/* =========================================================
   Save KVEC — "public record" theme
   Serious / official tone: muted navy + off-white, serif
   masthead, restrained red used only for warnings/admin marks.
   ========================================================= */

:root {
  --navy: #1b2a3d;
  --navy-dark: #101a26;
  --paper: #f6f4ee;
  --card: #ffffff;
  --ink: #21262c;
  --muted: #5b6470;
  --rule: #d9d3c4;
  --accent: #7a1f2b;
  --accent-soft: #f4e7e7;
  --approve: #2f6b3a;
  --approve-soft: #e7efe8;
  --pending: #8a6a1f;
  --pending-soft: #f5efdf;
  --focus: #2b4a6f;
}

* { box-sizing: border-box; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body, html {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Merriweather', Georgia, 'Times New Roman', serif;
  color: var(--navy);
  margin: 0 0 0.5em;
}

a { color: var(--focus); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--focus); }

/* ---------- Masthead ---------- */
.masthead {
  background: var(--navy);
  color: #fff;
  text-align: center;
  padding: 2.75rem 1rem 2.25rem;
  border-bottom: 6px solid var(--navy-dark);
}

.masthead-logo {
  display: block;
  max-width: 300px;
  width: 70%;
  height: auto;
  margin: 0 auto 0.85rem;
  /* Source mark is solid red; overlay it to white so it reads cleanly
     against the dark navy masthead instead of clashing with it. */
  filter: brightness(0) invert(1);
  opacity: 0.96;
}

.masthead .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  color: #b9c3d1;
  margin-bottom: 0.6rem;
}

.masthead h1 {
  color: #fff;
  font-size: 2.75rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.35rem;
}

.masthead .dateline {
  color: #9fb0c4;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.2);
  display: inline-block;
  padding: 0.4rem 0;
  margin-top: 0.75rem;
}

/* ---------- Site nav (public pages) ---------- */
.site-nav {
  background: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 0.7rem 1rem;
  position: relative;
}
/* The links live inside a .nav-links wrapper (added for the mobile
   hamburger toggle). Without an explicit flex rule here, that wrapper
   collapses to a single flex item and the <a> tags fall back to default
   inline spacing — which is what made the desktop menu look like one
   long link. Restoring flex + gap here is the actual fix; the divider
   and hover treatment are the redesign on top of it. */
.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0;
}

.site-nav a {
  color: #cdd7e3;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.4rem 1.5rem;
  border-left: 1px solid rgba(255,255,255,0.14);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-bottom-color 0.15s ease;
}
.site-nav .nav-links a:first-child { border-left: none; }
.site-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.4); }
.site-nav a.active { color: #fff; border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
}
.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: #cdd7e3;
  margin: 5px 0;
  border-radius: 1px;
}

@media (max-width: 680px) {
  .site-nav {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .nav-toggle { display: block; }
  .site-nav .nav-links {
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    gap: 0;
    text-align: center;
  }
  .site-nav.nav-open .nav-links {
    display: flex;
  }
  .site-nav .nav-links a {
    padding: 0.75rem 0;
    border-left: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    width: 100%;
  }
}

/* ---------- Page shell ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.article p {
  font-size: 1.06rem;
  margin: 0 0 1.15rem;
}

.article .source-link {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--navy);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
}

.article .source-link a { font-weight: 600; }

/* ---------- Dedicated article page ---------- */
.breadcrumb { margin-bottom: 1.5rem; font-size: 0.92rem; }

.notice-box {
  background: var(--accent-soft);
  border: 1px solid #e2b9bd;
  border-left: 4px solid var(--accent);
  color: var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.article-full {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 2rem 2.25rem;
}

.article-headline {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.article-byline {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.article-full p {
  font-size: 1.06rem;
  margin: 0 0 1.15rem;
}

.article-full h2 {
  font-size: 1.3rem;
  margin-top: 1.75rem;
  border-top: 1px solid var(--rule);
  padding-top: 1.5rem;
}

.article-page .source-link {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--navy);
  padding: 0.9rem 1.1rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
  font-weight: 600;
}

hr.rule {
  border: none;
  border-top: 2px solid var(--navy);
  margin: 2.5rem 0 2rem;
}

/* ---------- Flash messages ---------- */
.flash {
  padding: 0.9rem 1.1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
.flash.success { background: var(--approve-soft); color: var(--approve); border-color: #bcd6c0; }
.flash.pending { background: var(--pending-soft); color: var(--pending); border-color: #e2d3a4; }
.flash.error { background: var(--accent-soft); color: var(--accent); border-color: #e2b9bd; }

/* ---------- Comment form ---------- */
.comment-form {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
}

.comment-form h2 { font-size: 1.3rem; margin-bottom: 1rem; }

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid #c7c2b5;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

.field textarea { min-height: 110px; resize: vertical; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(43, 74, 111, 0.15);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--paper);
  border: 1px dashed var(--rule);
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.captcha-row label { font-size: 0.9rem; font-weight: 600; margin: 0; white-space: nowrap; }
.captcha-row input { width: 80px; flex: none; }
.captcha-refresh { font-size: 0.8rem; color: var(--muted); margin-left: auto; }

.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--navy-dark); }
.btn.small { padding: 0.35rem 0.8rem; font-size: 0.82rem; }
.btn.outline { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.btn.outline:hover { background: var(--navy); color: #fff; }
.btn.danger { background: var(--accent); }
.btn.danger:hover { background: #5c1620; }
.btn.approve { background: var(--approve); }
.btn.approve:hover { background: #234f2b; }

/* ---------- Comments list ---------- */
.comments h2 { font-size: 1.3rem; margin-bottom: 1.25rem; }

.comments-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.comments-heading h2 { margin-bottom: 0; }

.sds-info-link {
  background: none;
  border: 1px solid var(--rule);
  border-radius: 20px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  margin-bottom: 1.25rem;
}
.sds-info-link:hover { color: var(--focus); border-color: var(--focus); }

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 38, 0.6);
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 100;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--card);
  border-radius: 8px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.modal-box h2 { font-size: 1.35rem; margin-bottom: 0.9rem; }
.modal-box p { margin: 0 0 1rem; font-size: 0.98rem; }
.modal-box ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.modal-box li { margin-bottom: 0.5rem; font-size: 0.98rem; }

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--accent); }

.comment-thread { border-top: 1px solid var(--rule); }

.comment {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin: 1rem 0;
}

.comment.admin-reply {
  border-left-color: var(--accent);
  background: #fffaf9;
}

.comment .comment-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.comment .name { font-weight: 700; color: var(--navy); font-size: 0.98rem; }
.comment.admin-reply .name { color: var(--accent); }

.badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent);
  color: #fff;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.comment .timestamp { color: var(--muted); font-size: 0.78rem; }

.comment .message { margin: 0 0 0.6rem; color: var(--ink); }

.comment .comment-actions {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.comment .comment-actions button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
}
.comment .comment-actions button:hover { color: var(--accent); }

/* Nesting depth is capped at level-4 so deep reply chains stop narrowing
   the comment column into unreadable slivers — everything past depth 4
   indents by the same fixed amount instead of compounding further. */
.replies {
  margin-left: 1.6rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule);
}
.replies.level-2 { margin-left: 1.3rem; padding-left: 0.9rem; }
.replies.level-3 { margin-left: 1rem; padding-left: 0.8rem; border-left-color: var(--muted); }
.replies.level-4 { margin-left: 0.75rem; padding-left: 0.7rem; border-left-color: var(--muted); border-left-style: dashed; }

.reply-form, .report-form {
  display: none;
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--rule);
}

.empty-state {
  color: var(--muted);
  font-style: italic;
  padding: 1rem 0;
}

/* ---------- Archived comments: content-warning overlay ---------- */
.archive-disclaimer {
  background: #fff8e6;
  border: 1px solid #f0dfa6;
  color: #6b4f0c;
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.92rem;
}
.archive-disclaimer i { margin-top: 0.15rem; color: #8a6a1f; }
.archive-link-row {
  margin: 0.6rem 0 0;
}
.archive-link-row a {
  color: var(--accent);
  font-weight: 600;
}

.archived-warning {
  position: relative;
}
.archived-warning .comment-warning-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: #241417;
  color: #f2dede;
  border: 1px dashed #7a1f2b;
  border-radius: 4px;
  padding: 1.4rem 1rem;
}
.archived-warning .comment-warning-overlay i {
  font-size: 1.3rem;
  color: #e2a1a8;
}
.archived-warning .comment-warning-overlay p {
  margin: 0;
  font-size: 0.85rem;
  color: #e2c6c9;
}
.archived-warning .comment-warning-overlay button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.archived-warning .comment-warning-overlay button:hover { background: #5c1620; }

.archived-warning .comment-revealed-content { display: none; }
.archived-warning .comment-hide-btn {
  margin-top: 0.6rem;
  background: none;
  border: 1px solid var(--rule);
  color: var(--muted);
  border-radius: 4px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}
.archived-warning .comment-hide-btn:hover { color: var(--accent); border-color: var(--accent); }

.archived-warning.revealed .comment-warning-overlay { display: none; }
.archived-warning.revealed .comment-revealed-content { display: block; }

.status-pill.outline {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--muted);
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 1.5rem;
  background: var(--navy);
  color: #9fb0c4;
  font-size: 0.85rem;
}
footer a { color: #cddaf0; }
.footer-icons {
    display: flex;
    justify-content: center;
    gap: 1.1rem;
    margin-bottom: 0.7rem;
}
.footer-icons a {
    color: #cddaf0;
    font-size: 1.15rem;
    transition: color 0.2s ease, transform 0.2s ease;
}
.footer-icons a:hover { color: #fff; transform: translateY(-2px); }
.contact-method .social-links {
    display: flex;
    gap: 0.9rem;
    margin-top: 0.5rem;
}
.contact-method .social-links a {
    font-size: 1.3rem;
    color: var(--accent);
    transition: color 0.2s ease, transform 0.2s ease;
}
.contact-method .social-links a:hover { color: var(--navy); transform: translateY(-2px); }

/* ---------- Admin ---------- */
.admin-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Grouped admin nav: each labeled section (Overview / Moderation /
   Community / Content / Administration) is its own row, so ~18
   destinations stay scannable instead of one long wrapping list. */
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 0;
}

.admin-nav-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.admin-nav-group:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.admin-nav-group-label {
  flex: 0 0 auto;
  min-width: 88px;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding-right: 0.6rem;
  border-right: 1px solid var(--rule);
  margin-right: 0.1rem;
}

.admin-nav a {
  padding: 0.3rem 0.65rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
}

.admin-nav a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.admin-nav a:hover:not(.active) { border-color: var(--navy); }

/* ---------- Dashboard: "needs attention" / "at a glance" cards ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
  margin: 0 0 1.4rem;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--muted);
  border-radius: 5px;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
}
.dashboard-card:hover {
  border-left-color: var(--focus);
  box-shadow: 0 2px 8px rgba(27, 42, 61, 0.08);
}

.dashboard-card.alert { border-left-color: var(--accent); }
.dashboard-card.alert:hover { border-left-color: var(--accent); }
.dashboard-card.info { border-left-color: var(--approve); }

.dashboard-card-count {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  font-size: 1.3rem;
  color: var(--navy);
  line-height: 1;
  flex-shrink: 0;
}
.dashboard-card.alert .dashboard-card-count { color: var(--accent); }

.dashboard-card-label {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.25;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--rule);
  font-size: 0.92rem;
}

.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.admin-table th {
  background: var(--paper);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.status-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-weight: 700;
}
.status-pill.approved { background: var(--approve-soft); color: var(--approve); }
.status-pill.pending { background: var(--pending-soft); color: var(--pending); }
.status-pill.rejected { background: var(--accent-soft); color: var(--accent); }

.action-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.ua-cell { max-width: 260px; word-break: break-word; }

.sds-flagged-card { border-left-color: var(--accent); }
.sds-reason {
  font-size: 0.82rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0.5rem 0.7rem;
  margin: 0 0 0.6rem;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 1.5rem;
}

.login-card {
  background: var(--card);
  padding: 2.25rem;
  border-radius: 6px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.login-logo {
  display: block;
  max-width: 200px;
  width: 80%;
  height: auto;
  margin: 0 auto 1.1rem;
}

.login-card h2 { text-align: center; }
.login-card .field { margin-bottom: 0.9rem; }

.field-icon {
  position: relative;
}
.field-icon i {
  position: absolute;
  left: 0.75rem;
  top: 2.45rem;
  color: var(--muted);
  font-size: 0.9rem;
  pointer-events: none;
}
.field-icon input {
  padding-left: 2.3rem !important;
}

.field-checkbox label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
}
.field-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.login-card .btn i { margin-right: 0.4rem; }

.setup-note {
  background: var(--pending-soft);
  color: var(--pending);
  border: 1px solid #e2d3a4;
  padding: 0.8rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .masthead h1 { font-size: 2rem; }
  .replies, .replies.level-2, .replies.level-3, .replies.level-4 {
    margin-left: 0.6rem;
    padding-left: 0.5rem;
  }
}

/* ---------- Live stats counter ---------- */
.stats-counter {
  display: flex;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 2rem;
}
.stats-counter-item {
  flex: 1;
  background: var(--card);
  text-align: center;
  padding: 1rem 0.5rem;
}
.stats-num {
  display: block;
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--navy);
  line-height: 1.1;
}
.stats-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- Homepage hero banner ---------- */
.hero-banner {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.hero-banner .hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: #b9c3d1;
  margin-bottom: 0.75rem;
}
.hero-banner h2 {
  color: #fff;
  font-size: 2.15rem;
  max-width: 780px;
  margin: 0 auto 0.9rem;
  line-height: 1.28;
}
.hero-banner .hero-sub {
  color: #cdd7e3;
  max-width: 620px;
  margin: 0 auto 1.75rem;
  font-size: 1.05rem;
}
.hero-banner .stats-counter { max-width: 480px; margin: 0 auto; }

.cta-row {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-banner .cta-row { margin-bottom: 2rem; }
.cta-row .btn { padding: 0.75rem 1.6rem; font-size: 0.95rem; }
.hero-banner .btn.outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.hero-banner .btn.outline:hover { background: rgba(255,255,255,0.14); color: #fff; }

.stats-counter.on-dark { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.2); }
.stats-counter.on-dark .stats-counter-item { background: rgba(255,255,255,0.04); }
.stats-counter.on-dark .stats-num { color: #fff; }
.stats-counter.on-dark .stats-label { color: #b9c3d1; }

/* ---------- Homepage "Read the Story" banner ---------- */
.story-hero {
  position: relative;
  background-image: linear-gradient(rgba(16,26,38,0.86), rgba(16,26,38,0.86)), url('../story-hero-bg.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 3.5rem 1.5rem;
  text-align: center;
}
.story-hero .hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: #cdd7e3;
  margin-bottom: 0.75rem;
}
.story-hero h2 {
  color: #fff;
  font-size: 1.9rem;
  max-width: 700px;
  margin: 0 auto 0.9rem;
  line-height: 1.3;
}
.story-hero p {
  color: #d7dee7;
  max-width: 600px;
  margin: 0 auto 1.6rem;
  font-size: 1.02rem;
}
.story-hero .btn.accent { background: var(--accent); }
.story-hero .btn.accent:hover { background: #5c1620; }
.story-hero .btn i { margin-right: 0.4rem; }

@media (max-width: 680px) {
  .story-hero { padding: 2.5rem 1.25rem; }
  .story-hero h2 { font-size: 1.5rem; }
}

/* ---------- Homepage "Explore the Record" grid ---------- */
.explore-section {
  padding: 2.75rem 1.5rem 0.5rem;
  max-width: 1080px;
  margin: 0 auto;
}
.explore-section h2 { text-align: center; margin-bottom: 0.4rem; }
.explore-section .explore-sub {
  text-align: center;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 2rem;
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-bottom: 2.5rem;
}
.explore-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--navy);
  border-radius: 6px;
  padding: 1.4rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.explore-card:hover { box-shadow: 0 8px 24px rgba(27,42,61,0.14); transform: translateY(-2px); }
.explore-card.on-track { border-top-color: var(--approve); }
.explore-card .explore-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}
.explore-card.on-track .explore-icon { background: var(--approve-soft); color: var(--approve); }
.explore-card h3 { font-size: 1.08rem; margin-bottom: 0; }
.explore-card p { color: var(--muted); font-size: 0.9rem; margin: 0; flex-grow: 1; }
.explore-card .explore-meta { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.explore-card .btn { align-self: flex-start; margin-top: 0.3rem; }

/* ---------- Comment gate (prominent login/signup prompt) ---------- */
.comment-gate {
  background: var(--accent-soft);
  border: 1px solid #e2b9bd;
  border-radius: 8px;
  padding: 1.85rem 1.5rem;
  text-align: center;
}
.comment-gate .comment-gate-icon { font-size: 1.9rem; color: var(--accent); margin-bottom: 0.6rem; }
.comment-gate p { font-size: 1.08rem; color: var(--ink); max-width: 520px; margin: 0 auto 1.3rem; }

@media (max-width: 680px) {
  .hero-banner h2 { font-size: 1.65rem; }
  .hero-banner { padding: 2.25rem 1rem 1.75rem; }
  .explore-section { padding: 2rem 1rem 0.5rem; }
}

/* ---------- Account pages (register/login/verify) ---------- */
.account-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.account-page h1 { margin-bottom: 0.4rem; }
.account-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.75rem;
}
.posting-as {
  font-size: 0.9rem;
  color: var(--muted);
  margin: -0.25rem 0 1rem;
}
.field-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}
.field select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
}

/* ---------- Legal info box (whistleblower page) ---------- */
.legal-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--focus);
  padding: 1.1rem 1.3rem;
  border-radius: 4px;
  font-size: 0.93rem;
  margin-bottom: 2rem;
}
.legal-box h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}
.legal-box p {
  margin: 0 0 0.75rem;
}
.legal-box p:last-child { margin-bottom: 0; }
.legal-box .fine-print {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Press / media page ---------- */
.press-pitch p { font-size: 1.02rem; margin: 0 0 1.1rem; }
.press-facts {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
}
.press-facts h3 { margin-top: 0; font-size: 1.05rem; }
.press-facts ul { margin: 0; padding-left: 1.2rem; }
.press-facts li { margin-bottom: 0.5rem; font-size: 0.98rem; }

/* ---------- Staff / roles page ---------- */
.role-card { margin: 1rem 0; }
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  margin-top: 0.4rem;
}
.permission-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
  padding: 0.35rem 0;
}
.permission-check input { margin-top: 0.2rem; flex-shrink: 0; }

/* ---------- Admin: mobile-responsive tables ----------
   Below the breakpoint every <tr> becomes a card and each <td> stacks
   its column header (from data-label) above its value, instead of
   forcing the whole table to scroll sideways. */
@media (max-width: 760px) {
  .admin-wrap { padding: 1.25rem 0.85rem 3rem; }

  .admin-header { gap: 0.6rem; }
  .admin-header > div { font-size: 0.85rem; line-height: 1.6; }

  .admin-nav { gap: 0.35rem; padding: 0.6rem 0.7rem; }
  .admin-nav-group { gap: 0.3rem; flex-wrap: wrap; }
  .admin-nav-group-label {
    flex-basis: 100%;
    border-right: none;
    padding-right: 0;
    margin-bottom: 0.1rem;
  }
  .admin-nav a { padding: 0.3rem 0.6rem; font-size: 0.76rem; }

  .dashboard-grid { grid-template-columns: 1fr; }

  .admin-table { border: none; background: none; font-size: 0.9rem; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    background: var(--card);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--navy);
    border-radius: 6px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.9rem;
  }
  .admin-table td {
    border: none;
    padding: 0.4rem 0;
    text-align: left;
    word-break: break-word;
  }
  .admin-table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 0.2rem;
  }
  .admin-table td.action-row {
    display: block;
  }
  .admin-table td.action-row > * {
    margin: 0 0.4rem 0.4rem 0;
  }
  .admin-table td.ua-cell { max-width: none; }

  .permission-grid { grid-template-columns: 1fr; }
}

/* ---------- Nav search box (site-wide) ---------- */
.site-search {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.14);
}
.site-search input[type="search"] {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px 0 0 4px;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
  width: 120px;
}
.site-search input[type="search"]::placeholder { color: #9fb0c4; }
.site-search input[type="search"]:focus { outline: none; border-color: var(--accent); }
.site-search button {
  background: var(--accent);
  color: #fff;
  /* Matches the input's 1px border with a transparent one of its own
     (rather than "border: none") so both elements add up to the same
     total height — otherwise the button sits 2px shorter than the
     input next to it. */
  border: 1px solid transparent;
  border-radius: 0 4px 4px 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}
.site-search button:hover { background: #5c1620; }

@media (max-width: 680px) {
  .site-search {
    flex-basis: 100%;
    justify-content: center;
    margin: 0.6rem 0 0.3rem;
    padding: 0.75rem 1rem 0 0;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
  }
  .site-search input[type="search"] { flex: 1; width: auto; }
}

/* ---------- News ticker banner ---------- */
.news-ticker {
  background: linear-gradient(90deg, var(--accent), #9c2c3a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  border-bottom: 2px solid var(--navy-dark);
}
.news-ticker-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  max-width: 900px;
}
.news-ticker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  animation: news-ticker-pulse 2.2s ease-in-out infinite;
}
@keyframes news-ticker-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.15); opacity: 1; }
}
.news-ticker-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
  opacity: 0.85;
  padding-right: 0.65rem;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}
.news-ticker-track {
  position: relative;
  flex: 1;
  min-height: 1.4em;
  overflow: hidden;
  text-align: center;
}
.news-ticker-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  border-bottom: none;
  opacity: 0;
  transform: translateY(6px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.6s ease, transform 0.6s ease;
  pointer-events: none;
}
.news-ticker-item.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.news-ticker-item:hover { text-decoration: underline; }
.news-ticker-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.news-ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transition: background 0.3s ease;
}
.news-ticker-dot.active { background: #fff; }

@media (max-width: 640px) {
  .news-ticker { padding: 0.5rem 0.85rem; font-size: 0.78rem; }
  .news-ticker-label { display: none; }
  .news-ticker-dots { display: none; }
}

/* ---------- Blog list / post ---------- */
.blog-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.rss-link {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.rss-link:hover { color: var(--accent); }
.blog-category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.blog-category-filter a {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
}
.blog-category-filter a.active,
.blog-category-filter a:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.blog-list { border-top: 1px solid var(--rule); }
.blog-list-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.blog-list-item h2 { font-size: 1.25rem; margin: 0.3rem 0 0.5rem; }
.blog-list-item .message { margin-bottom: 0.75rem; }

.pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.pagination a {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.pagination a.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination a:hover:not(.active) { border-color: var(--navy); color: var(--navy); }

/* ---------- Social share buttons ---------- */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}
.share-buttons-label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.85rem;
  margin-right: 0.25rem;
}
.share-buttons .btn i { margin-right: 0.35rem; }

/* ---------- Comment/reply image attachments + lightbox ---------- */
.comment-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.comment-image-thumb {
  max-width: 96px;
  max-height: 96px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.comment-image-thumb:hover { opacity: 0.85; }

.comment-image-item {
  position: relative;
  display: inline-flex;
}
.comment-image-delete-form {
  position: absolute;
  top: -8px;
  right: -8px;
  margin: 0;
}
.btn.tiny {
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-box {
  background: var(--navy-dark);
  border-radius: 10px;
  padding: 1.25rem;
  max-width: 95vw;
  position: relative;
  text-align: center;
}
.lightbox-image-wrap {
  max-width: 95vw;
  max-height: 85vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  display: block;
  transition: transform 0.2s ease;
  transform-origin: center center;
}
.lightbox-zoom-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.lightbox-zoom-controls button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.lightbox-zoom-controls button:hover { background: rgba(255,255,255,0.2); }
.lightbox-caption {
  margin-top: 1rem;
  text-align: left;
  color: #e7ebf1;
  font-size: 0.88rem;
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}
.lightbox-caption summary {
  cursor: pointer;
  color: #fff;
  font-size: 0.9rem;
}
.lightbox-summary-hint {
  color: #9fb0c4;
  font-weight: 400;
  font-size: 0.82rem;
}
.lightbox-caption p {
  margin: 0.5rem 0 0;
  white-space: pre-wrap;
}

/* ---------- Admin: comment image thumbnails ---------- */
.admin-wrap .comment-images .comment-image-thumb {
  max-width: 84px;
  max-height: 84px;
  cursor: default;
}

/* Admin/staff "you're logged in" bar on public pages (includes/admin_bar.php) */
.admin-mode-bar {
  background: #1f2933;
  color: #fff;
  text-align: center;
  font-size: 0.82rem;
  padding: 0.45rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-mode-bar strong {
  font-weight: 700;
}
.admin-mode-bar a {
  color: #9fd3ff;
  text-decoration: underline;
}
.admin-mode-bar a:hover {
  color: #fff;
}

/* Note shown on a reply whose parent comment was hidden by SDS (see
   fetch_approved_comment_tree()'s parent_hidden re-parenting logic) */
.parent-hidden-note {
  font-size: 0.8rem;
  color: #8a6d1a;
  background: #fff8e6;
  border: 1px solid #f0dfa6;
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  margin: 0.3rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Investigations: public case-file file lists and timeline (used on
   investigation.php; the admin equivalents reuse .comment/.role-card). */
.file-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1.5rem;
}
.file-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.file-list li a {
  font-weight: 600;
}
.file-list .file-desc {
  color: var(--muted);
  font-weight: 400;
}
.investigation-timeline {
  border-left: 3px solid var(--rule);
  margin: 0.5rem 0 1.5rem;
  padding-left: 0;
}
.timeline-entry {
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}
.timeline-entry .name {
  font-weight: 700;
}

/* Progress bar — used by petitions (signature goal) and investigations
   (case progress_percent), same visual treatment for both. */
.progress-track {
  background: var(--rule);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin: 0.6rem 0 0.9rem;
}
.progress-fill {
  background: var(--approve, #3f8f5f);
  height: 100%;
  border-radius: 999px;
}
.source-link-inline {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}
.source-link-inline a {
  font-weight: 600;
}

/* ---------- Unified nav bar: search (left) / links (center) / login+signup (right), all in one row ---------- */
.site-nav.mega-nav {
    justify-content: flex-start;
}
.nav-search-group {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 0;
}
.mega-nav-links {
    flex: 0 0 auto;
}
.utility-search-toggle {
    background: none;
    border: none;
    color: #cdd7e3;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.2rem 0.3rem;
    transition: color 0.2s ease, transform 0.45s cubic-bezier(0.4,0,0.2,1);
}
.utility-search-toggle:hover { color: #fff; }
.nav-search-group .utility-search {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.45s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
}
.nav-search-group.search-expanded .utility-search {
    max-width: 240px;
    opacity: 1;
    margin-right: 0.6rem;
}
.nav-search-group.search-expanded .utility-search-toggle {
    color: #fff;
    transform: translateX(0.15rem);
}
.nav-search-group .utility-search input[type="search"] {
    width: 100%;
    min-width: 190px;
    flex: 1;
    background: transparent;
    border: none;
    border-bottom: 1px solid transparent;
    color: #fff;
    font-size: 0.85rem;
    padding: 0.3rem 0.1rem;
    transition: border-color 0.3s ease;
}
.nav-search-group.search-expanded .utility-search input[type="search"] {
    border-bottom-color: rgba(255,255,255,0.35);
}
.nav-search-group .utility-search input[type="search"]::placeholder { color: #8fa0b8; }
.nav-search-group .utility-search input[type="search"]:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
.nav-search-group .utility-search button[type="submit"] {
    background: none;
    border: none;
    color: #8fa0b8;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    display: none;
}
.nav-search-group .utility-search input[type="search"] { width: 100%; flex: 1; }
.utility-account-links {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex: 1 1 0;
    justify-content: flex-end;
}
.utility-account-links a {
    color: #cdd7e3;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.utility-account-links a:hover { color: #fff; }
.utility-account-links a i { margin-right: 0.3rem; }
.utility-account-links .utility-signup {
    padding: 0.32rem 0.9rem;
    font-size: 0.78rem;
}

.nav-social {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
    margin-left: 0.4rem;
}
.nav-social a {
    color: #b9c6da;
    font-size: 1.05rem;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}
.nav-social a:hover { color: #fff; transform: translateY(-1px); }

/* ---------- Mega nav ---------- */
.mega-nav { position: relative; }
.mega-nav .mega-nav-links { position: relative; }

.mega-item { position: relative; border-left: 1px solid rgba(255,255,255,0.14); }
.mega-item:first-child { border-left: none; }

.mega-trigger {
    background: none;
    border: none;
    color: #cdd7e3;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.4rem 1.5rem;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.15s ease, border-bottom-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.mega-trigger i { font-size: 0.65rem; transition: transform 0.15s ease; }
.mega-trigger:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.4); }
.mega-trigger.active { color: #fff; border-bottom-color: var(--accent); }
.mega-item.mega-open .mega-trigger { color: #fff; }
.mega-item.mega-open .mega-trigger i { transform: rotate(180deg); }

.mega-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 320px;
    background: #fff;
    border: 1px solid var(--rule);
    border-top: 3px solid var(--accent);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 14px 32px rgba(16,26,38,0.22);
    padding: 0.6rem;
    z-index: 50;
}
.mega-item.mega-open .mega-panel { display: block; }
@media (hover: hover) and (pointer: fine) {
    .mega-item:hover .mega-panel { display: block; }
}

.mega-panel a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.7rem;
    border-radius: 5px;
    border: none;
    color: var(--ink);
}
.mega-panel a:hover { background: var(--paper); border: none; }
.mega-panel a i {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.mega-panel-intro {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 0.35rem 0.7rem 0.55rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 0.35rem;
}
.mega-panel.mega-panel-grid {
    min-width: 460px;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 0.5rem;
}
.mega-item.mega-open .mega-panel.mega-panel-grid { display: grid; }
@media (hover: hover) and (pointer: fine) {
    .mega-item:hover .mega-panel.mega-panel-grid { display: grid; }
}
.mega-panel.mega-panel-grid .mega-panel-intro { grid-column: 1 / -1; }
.mega-panel a {
    opacity: 0;
    transform: translateY(4px);
    animation: megaItemIn 0.3s ease forwards;
}
.mega-panel a:nth-of-type(1) { animation-delay: 0.02s; }
.mega-panel a:nth-of-type(2) { animation-delay: 0.05s; }
.mega-panel a:nth-of-type(3) { animation-delay: 0.08s; }
.mega-panel a:nth-of-type(4) { animation-delay: 0.11s; }
.mega-panel a:nth-of-type(5) { animation-delay: 0.14s; }
.mega-panel a:nth-of-type(6) { animation-delay: 0.17s; }
@keyframes megaItemIn {
    to { opacity: 1; transform: translateY(0); }
}
.mega-panel a span { display: flex; flex-direction: column; gap: 0.1rem; }
.mega-panel a strong { font-size: 0.92rem; color: var(--navy); }
.mega-panel a small { font-size: 0.78rem; color: var(--muted); font-weight: 400; }

@media (max-width: 680px) {
    .site-nav.mega-nav { justify-content: flex-start; }
    .site-nav.mega-nav .nav-toggle { margin-left: 0; order: 1; }
    .nav-search-group { order: 2; flex: 0 0 auto; }
    .nav-search-group .utility-search { position: static; border-radius: 4px; margin-top: 0.5rem; flex-basis: 100%; }
    .utility-account-links { order: 3; flex: 0 0 auto; margin-left: auto; gap: 0.6rem; }
    .utility-account-links a i, .utility-account-links button i { margin-right: 0; }
    .nav-link-text { display: none; }
    .nav-social { display: none; }

    .site-nav.mega-nav .mega-nav-links { order: 4; text-align: left; }
    .site-nav.mega-nav .mega-nav-links > a { text-align: left; }

    .mega-item { border-left: none; width: 100%; }
    .site-nav.mega-nav .mega-trigger { width: 100%; justify-content: flex-start; gap: 0.6rem; padding: 0.75rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .site-nav.mega-nav .mega-trigger i { margin-left: auto; }
    .mega-panel {
        display: none;
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: rgba(0,0,0,0.15);
        width: 100%;
        margin-bottom: 0.4rem;
    }
    .mega-panel.mega-panel-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }
    .mega-panel a {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .mega-item.mega-open .mega-panel { display: block; }
    .mega-item.mega-open .mega-panel { display: block; }
    .mega-panel a strong { color: #fff; }
    .mega-panel a small { color: #b9c3d1; }
    .mega-panel a:hover { background: rgba(255,255,255,0.08); }
    .mega-panel a i { background: rgba(255,255,255,0.12); color: #fff; }
}

/* ---------- Contact page ---------- */
.contact-intro { font-size: 1.02rem; margin: 0 0 1.5rem; }
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.contact-method {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 1.1rem 1.2rem;
}
.contact-method i { color: var(--accent); margin-right: 0.4rem; }
.contact-method h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.contact-method p { font-size: 0.9rem; color: var(--muted); margin: 0; }
.contact-method a { font-weight: 600; }


/* ---------- Lottie accents ---------- */
.hero-pulse-lottie {
    width: 100%;
    max-width: 320px;
    height: 40px;
    margin: 0.75rem auto 0;
    opacity: 0.85;
}
.stats-reveal-lottie {
    width: 56px;
    height: 40px;
    margin: 0 auto 0.5rem;
}
.cta-nudge-wrap {
    position: relative;
    display: inline-block;
}
.cta-nudge {
    position: absolute;
    top: -7px;
    right: -7px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}
.explore-icon.explore-icon-lottie {
    width: 64px;
    height: 64px;
    background: none;
}
.explore-icon.explore-icon-lottie > div {
    width: 64px;
    height: 64px;
}

/* ---------- Auth modal (Log In / Register) ---------- */
.auth-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11,20,32,0.72);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}
.auth-modal-overlay.open { display: flex; }
body.modal-open { overflow: hidden; }
.auth-modal {
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    max-width: 380px;
}
.auth-modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--muted);
    cursor: pointer;
    padding: 0.25rem;
}
.auth-modal-close:hover { color: var(--ink); }
.auth-modal-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    border-bottom: 1px solid var(--rule);
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.6rem 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.auth-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.auth-modal-flash { margin-bottom: 0.9rem; }
.auth-modal-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--rule);
}
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Mobile masthead: minimize header real-estate ---------- */
@media (max-width: 680px) {
    .masthead {
        padding: 0.85rem 1rem 0.7rem;
    }
    .masthead-logo {
        max-width: 150px;
        width: 52%;
        margin: 0 auto 0.35rem;
    }
    .masthead .eyebrow {
        font-size: 0.6rem;
        letter-spacing: 0.12em;
        margin-bottom: 0.35rem;
    }
    .masthead .dateline {
        font-size: 0.72rem;
        padding: 0.25rem 0;
        margin-top: 0.4rem;
    }
    .hero-pulse-lottie {
        margin-top: 0.5rem;
        max-width: 220px;
        height: 28px;
    }
}