@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  --maroon:      #7a1a1a;
  --maroon-dark: #5c1111;
  --maroon-light:#a02020;
  --gold:        #c9a84c;
  --gold-light:  #e8c96a;
  --gold-pale:   #fdf3dc;
  --cream:       #faf7f2;
  --text:        #1a1a2e;
  --muted:       #6b7280;
  --border:      #e8e0d4;
  --bg:          #f2ede6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

/* ── PAGE HERO ── */
.page-hero {
  margin-top: 20px;
  background: linear-gradient(135deg, #1a0a0a 0%, #3d0f0f 60%, #1a0a0a 100%);
  padding: 110px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(201,168,76,0.12) 0%, transparent 60%);
}
.page-hero .eyebrow {
  display: inline-block;
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.35);
  color: var(--gold); font-size: 11px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  padding: 6px 20px; border-radius: 50px; margin-bottom: 18px;
}
.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.2rem); color: #fff; margin-bottom: 14px;
  position: relative;
}
.page-hero h1 span { color: var(--gold); }
.page-hero p { color: rgba(255,255,255,0.6); font-size: 15px; max-width: 480px; margin: 0 auto; line-height: 1.7; }

/* ── SUBMIT CTA ── */
.submit-cta { background: var(--maroon); text-align: center; padding: 18px 24px; }
.submit-cta a { color: rgba(255,255,255,0.85); font-size: 13.5px; text-decoration: none; }
.submit-cta a strong { color: var(--gold); }
.submit-cta a:hover strong { text-decoration: underline; }

/* ── BOARD WRAP ── */
.board-wrap { max-width: 1200px; margin: 0 auto; padding: 48px 24px 80px; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  background: #fff; border-radius: 14px; padding: 16px 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07); margin-bottom: 36px;
  border: 1px solid var(--border); width: 100%;
}
.filter-bar label {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.6px;
}
.filter-bar select {
  padding: 8px 32px 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; background: #fdfaf6;
  cursor: pointer; outline: none; appearance: none; max-width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.2s;
}
.filter-bar select:focus { border-color: var(--gold); }
.filter-bar button {
  padding: 9px 22px; background: var(--maroon); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background 0.2s;
}
.filter-bar button:hover { background: var(--maroon-dark); }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.filter-count strong { color: var(--text); }

/* ── POSTS GRID ── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ── POST CARD ── */
.post-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07); border: 1px solid var(--border);
  transition: transform 0.22s, box-shadow 0.22s;
  display: flex; flex-direction: column; cursor: pointer; min-width: 0;
}
.post-card:hover { transform: translateY(-5px); box-shadow: 0 14px 36px rgba(0,0,0,0.12); }
.post-card:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

.post-img {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, #f5ede0, #e8d8c0);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; overflow: hidden; position: relative;
}
.post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-img img { transform: scale(1.04); }
.post-img-placeholder { color: rgba(122,26,26,0.18); font-size: 3.5rem; }

.post-img-badge {
  position: absolute; top: 12px; left: 12px;
  padding: 4px 12px; border-radius: 50px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  backdrop-filter: blur(6px); background: rgba(255,255,255,0.88);
  color: var(--maroon); border: 1px solid rgba(122,26,26,0.15);
}

.post-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.post-tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }
.tag {
  padding: 3px 10px; border-radius: 50px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.tag-region   { background: #f0ebe3; color: var(--muted); }
.tag-pubmat   { background: #fef3c7; color: #92400e; }
.tag-announce { background: #dbeafe; color: #1e40af; }
.tag-officers { background: #f0fdf4; color: #166534; }

.post-title {
  font-family: 'Playfair Display', serif; font-size: 1.08rem; font-weight: 700;
  color: var(--text); margin-bottom: 8px; line-height: 1.35;
}
.post-desc { font-size: 13.5px; color: var(--muted); line-height: 1.65; flex: 1; margin-bottom: 16px; }
.post-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid #f2ece3; padding-top: 13px; margin-top: auto;
  flex-wrap: wrap; gap: 6px;
}

.btn-view-full {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 9px 18px;
  background: var(--maroon); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.2s; width: fit-content; align-self: flex-start;
}
.btn-view-full:hover { background: var(--maroon-dark); }
.btn-view-full svg { flex-shrink: 0; }

/* ══════════════════════════════════════════════
   ENHANCED MODAL — LUXURY EDITORIAL DESIGN
══════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 12000;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  /* rich dark scrim with subtle warmth */
  background: rgba(8, 2, 2, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }

/* ── MODAL SHELL ── */
.modal {
  background: #fff;
  width: 100%;
  max-width: 780px;
  max-height: 94vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* bottom sheet on mobile */
  border-radius: 24px 24px 0 0;
  animation: modalSlideUp 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  display: flex;
  flex-direction: column;
  /* custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  position: relative;
}
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

@keyframes modalSlideUp {
  from { transform: translateY(48px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* drag handle pill on mobile */
.modal::before {
  content: '';
  display: block;
  width: 40px; height: 4px;
  background: #e0d8d0;
  border-radius: 4px;
  margin: 14px auto 0;
  flex-shrink: 0;
}

/* ── DESKTOP: centered card ── */
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 32px; }
  .modal {
    border-radius: 20px;
    animation: modalFadeScale 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
    max-height: 88vh;
  }
  .modal::before { display: none; }

  @keyframes modalFadeScale {
    from { transform: scale(0.94) translateY(16px); opacity: 0; }
    to   { transform: scale(1)    translateY(0);    opacity: 1; }
  }
}

/* ── HERO IMAGE SECTION ── */
#modal-img-wrap {
  position: relative;
  flex-shrink: 0;
}

.modal-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
  /* sharp corners at top since modal has rounded top */
  border-radius: 0;
}

.modal-img-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #f5ede0 0%, #e8d8c0 50%, #f0e0c8 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; color: rgba(122,26,26,0.15);
}

/* Floating close button over image */
.modal-close-btn {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 20;
}
.modal-close-btn button {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #555;
  box-shadow: 0 4px 14px rgba(0,0,0,0.16);
  transition: background 0.18s, transform 0.18s;
  backdrop-filter: blur(4px);
}
.modal-close-btn button:hover {
  background: #fff;
  transform: scale(1.08);
  color: var(--maroon);
}

/* When no image: close button in top-right of body */
.modal-close-btn.no-image {
  position: sticky;
  top: 0; left: 0;
  display: flex; justify-content: flex-end;
  padding: 14px 16px 0;
  background: transparent;
  z-index: 20;
}
.modal-close-btn.no-image button {
  background: rgba(0,0,0,0.05);
  box-shadow: none;
  border: none;
}

/* ── GOLD ACCENT BAR below image ── */
.modal-accent-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--maroon) 0%, var(--gold) 50%, var(--maroon) 100%);
  flex-shrink: 0;
}

/* ── MODAL BODY ── */
.modal-body {
  padding: 28px 32px 8px;
  flex: 1;
}

/* Tags */
.modal-tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
}

/* Title */
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 3.5vw, 1.8rem);
  font-weight: 700; line-height: 1.25;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: -0.2px;
}

/* ── INFO GRID — styled like a luxury data card ── */
.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;  /* gap between cells = border lines */
  background: var(--border);  /* this becomes the grid lines */
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 24px;
}

.modal-info-item {
  background: #fff;
  padding: 14px 18px;
  transition: background 0.15s;
}
.modal-info-item:hover { background: var(--cream); }

.modal-info-item label {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--gold); margin-bottom: 5px;
}
/* small decorative dot before label */
.modal-info-item label::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  opacity: 0.7;
}

.modal-info-item span {
  font-size: 14px; font-weight: 600;
  color: var(--text); line-height: 1.4;
  display: block;
}

/* ── DIVIDER ── */
.modal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
  margin: 22px 0;
}

/* ── DESCRIPTION SECTION ── */
.modal-section-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gold); margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.modal-section-label::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

.modal-desc {
  font-size: 15px; line-height: 1.8;
  color: #374151; white-space: pre-wrap;
  word-wrap: break-word; overflow-wrap: break-word;
}

/* ── MODAL FOOTER ── */
.modal-footer {
  padding: 20px 32px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  /* subtle warm tint */
  background: #fdfaf6;
  border-radius: 0 0 20px 20px;
  flex-shrink: 0;
}

.modal-footer-meta {
  font-size: 12px; color: var(--muted); line-height: 1.7;
}
.modal-footer-meta strong { color: var(--text); font-weight: 600; }

.btn-modal-close {
  padding: 11px 28px;
  background: var(--maroon); color: #fff;
  border: none; border-radius: 50px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.4px;
  transition: background 0.2s, transform 0.18s;
  box-shadow: 0 4px 16px rgba(122,26,26,0.25);
}
.btn-modal-close:hover {
  background: var(--maroon-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(122,26,26,0.3);
}

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .e-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: .4; }
.empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; margin-bottom: 8px; color: var(--muted);
}
.empty-state p { font-size: 14px; color: var(--muted); }
.empty-state a {
  display: inline-block; margin-top: 18px; padding: 12px 28px;
  background: var(--maroon); color: #fff; border-radius: 50px;
  text-decoration: none; font-weight: 600; font-size: 14px;
}

/* ── PAGINATION ── */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.pg-btn {
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; border: 1.5px solid var(--border); color: var(--muted);
  transition: all 0.18s; background: #fff; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.pg-btn:hover { border-color: var(--maroon); color: var(--maroon); }
.pg-btn.active { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* ── SKELETON LOADER ── */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.skeleton-card {
  background: #fff; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}
.skeleton-img {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(90deg, #f0ebe3 25%, #faf7f2 50%, #f0ebe3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skeleton-body { padding: 18px 20px; }
.skeleton-line {
  height: 12px; border-radius: 6px; margin-bottom: 10px;
  background: linear-gradient(90deg, #f0ebe3 25%, #faf7f2 50%, #f0ebe3 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */

@media (max-width: 768px) {
  .page-hero { padding: 80px 18px 50px; }
  .page-hero p { font-size: 14px; padding: 0 10px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-count { margin-left: 0; text-align: left; }
  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .modal-info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .board-wrap { padding: 28px 16px 60px; }
  .posts-grid { grid-template-columns: 1fr; gap: 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .filter-bar label { margin-bottom: -4px; }
  .filter-count { margin-left: 0; }

  .modal-body { padding: 22px 20px 8px; }
  .modal-footer {
    padding: 16px 20px 24px;
    flex-direction: column;
    align-items: stretch;
  }
  .btn-modal-close { width: 100%; text-align: center; border-radius: 12px; }
  .modal-info-grid { grid-template-columns: 1fr; }
  .skeleton-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .filter-bar select, .filter-bar button { width: 100%; }

  .modal-body { padding: 18px 16px 8px; }
  .modal-info-item { padding: 12px 14px; }
  .modal-title { font-size: 1.25rem; }

  .post-body { padding: 14px; }
  .post-title { font-size: 1rem; }
  .post-desc { font-size: 13px; }
  .post-meta { flex-direction: column; align-items: flex-start; }
  .btn-view-full { width: 100%; justify-content: center; }
}

@media (max-width: 400px) {
  .post-card { border-radius: 12px; }
  .post-img { aspect-ratio: 4/3; }
  .modal-info-item span { font-size: 13.5px; }
  .modal-desc { font-size: 14px; }
}