/* ==========================================================================
   ICM History & Timeline — stylesheet
   A project of Murfreesboro Muslim Youth (MMY)
   Design language: a civic archive / ledger. Dates live in the margin like
   marginalia; three chapters of the real story (stability, conflict,
   healing) are color-coded to MMY's own brand palette rather than to
   generic decoration.
   ========================================================================== */

:root {
  /* ---- Brand-derived palette ---- */
  --ink: #16233a;              /* primary text, warm near-navy, not pure black */
  --ink-soft: #3c4a63;
  --paper: #ffffff;            /* base canvas, light mode */
  --paper-warm: #f7f2e7;       /* secondary panel tint (marginalia / pull quotes) */
  --paper-sunken: #f3f5f9;     /* subtle section alternation */
  --line: #dfe3ea;             /* hairline borders */

  --blue: #285090;             /* Roots era + primary links/buttons */
  --blue-deep: #173e73;
  --blue-tint: #c9dff2;

  --gold: #c97a00;             /* accessible gold for text/icons on light bg */
  --gold-bright: #f8a000;      /* brand gold, used on dark surfaces */

  --red: #a00008;              /* Reckoning era (land, backlash, the fight to build) */
  --red-tint: #ffd2cc;

  --green: #1f6b2e;            /* Campus era (service, growth, healing) */
  --green-tint: #ddebdd;

  --radius: 3px;
  --max: 68rem;
  --measure: 38rem;

  --font-display: "Lora", "Iowan Old Style", "Georgia", serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(22, 35, 58, 0.06);

  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e9edf5;
  --ink-soft: #b7c1d6;
  --paper: #0f2038;
  --paper-warm: #182c4a;
  --paper-sunken: #13253f;
  --line: #2a3c5c;

  --blue: #7fb0e8;
  --blue-deep: #a9cbf0;
  --blue-tint: #1c3357;

  --gold: #f8a000;
  --gold-bright: #ffbf4d;

  --red: #ff6b63;
  --red-tint: #3a1c22;

  --green: #6fcf85;
  --green-tint: #17301d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #e9edf5;
    --ink-soft: #b7c1d6;
    --paper: #0f2038;
    --paper-warm: #182c4a;
    --paper-sunken: #13253f;
    --line: #2a3c5c;
    --blue: #7fb0e8;
    --blue-deep: #a9cbf0;
    --blue-tint: #1c3357;
    --gold: #f8a000;
    --gold-bright: #ffbf4d;
    --red: #ff6b63;
    --red-tint: #3a1c22;
    --green: #6fcf85;
    --green-tint: #17301d;
  }
}

/* ---- Reset-lite ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-deep); }
a:not(.btn):not(.card-link) { text-underline-offset: 0.15em; }
main { display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.5em;
}
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.25em; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--paper);
  padding: .6rem 1rem; border-radius: var(--radius); z-index: 200;
  transition: top .15s ease;
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 780px) { .wrap { padding-inline: 2.5rem; } }

/* ============================== Header ============================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.25rem; gap: 1rem;
}
.wordmark {
  display: flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  white-space: nowrap;
}
.wordmark svg { width: 30px; height: 30px; flex: none; }
.wordmark .sub { display: block; font-family: var(--font-body); font-weight: 400; font-size: .68rem; letter-spacing: .02em; color: var(--ink-soft); }

.main-nav { display: none; }
@media (min-width: 900px) {
  .main-nav { display: flex; align-items: center; gap: 1.6rem; }
}
.main-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: .96rem; font-weight: 600;
  padding: .4rem .1rem; border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--gold); }
.nav-drop { position: relative; }
.nav-drop > a { display: inline-flex; align-items: center; }
.nav-drop > button {
  background: none; border: none; font: inherit; cursor: pointer;
  color: var(--ink-soft); font-weight: 600; font-size: .96rem;
  display: flex; align-items: center; gap: .3rem; padding: .4rem .1rem;
}
.nav-drop > button:hover { color: var(--ink); }
.nav-drop .chev { display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-left: .3rem; margin-top: -3px; }
.nav-drop-panel {
  position: absolute; top: 100%; left: -1rem; margin-top: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(15, 32, 56, .16);
  min-width: 15.5rem; padding: .85rem .5rem .5rem;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s linear;
  pointer-events: none;
}
.nav-drop:hover .nav-drop-panel,
.nav-drop:focus-within .nav-drop-panel {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .nav-drop-panel { transition: opacity .16s ease, visibility .16s linear; transform: none; }
}
.nav-drop-panel a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .5rem .6rem; border-radius: 2px; font-size: .92rem; font-weight: 500;
  color: var(--ink); text-decoration: none; border-bottom: none;
}
.nav-drop-panel a:hover { background: var(--paper-sunken); }
.nav-drop-panel .era-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: .4em; }
.nav-drop-panel small { color: var(--ink-soft); font-weight: 400; }

.header-tools { display: flex; align-items: center; gap: .5rem; }
.theme-toggle {
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper-sunken);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.menu-toggle {
  width: 2.4rem; height: 2.4rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--paper-sunken); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
@media (min-width: 900px) { .menu-toggle { display: none; } }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { display: none; }
.menu-toggle svg { width: 18px; height: 18px; }

.mobile-nav {
  display: none; border-bottom: 1px solid var(--line); background: var(--paper);
}
.mobile-nav.is-open { display: block; }
@media (min-width: 900px) { .mobile-nav { display: none !important; } }
.mobile-nav .wrap { padding-block: 1rem; display: flex; flex-direction: column; gap: .15rem; }
.mobile-nav a { padding: .6rem .2rem; color: var(--ink); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--paper-sunken); }
.mobile-nav .mnav-group-label { font-size: .78rem; text-transform: none; color: var(--ink-soft); padding: .8rem .2rem .2rem; font-weight: 600; }
.mobile-nav .mnav-sub { padding-left: 1rem; font-weight: 500; font-size: .94rem; }

/* ============================== Footer ============================== */
.site-footer { border-top: 1px solid var(--line); margin-top: 5rem; padding-block: 2.6rem 3rem; }
.site-footer .wrap { display: grid; gap: 2rem; }
@media (min-width: 780px) { .site-footer .wrap { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer .footer-heading { font-size: .95rem; font-family: var(--font-body); font-weight: 700; margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer a { color: var(--ink-soft); text-decoration: none; font-size: .93rem; display: inline-block; padding-block: .3rem; }
.site-footer a:hover { color: var(--blue-deep); }
.disclaimer {
  font-size: .88rem; color: var(--ink-soft); max-width: 34rem; line-height: 1.55;
}
.disclaimer strong { color: var(--ink); }
.disclaimer a { text-decoration: underline; text-underline-offset: 0.15em; }
.footer-base {
  border-top: 1px solid var(--line); margin-top: 2.2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: space-between;
  font-size: .82rem; color: var(--ink-soft);
}
.footer-base a { color: var(--ink-soft); }

/* ============================== Buttons / links ============================== */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: var(--radius);
  font-weight: 700; font-size: .96rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  overflow-wrap: anywhere; max-width: 100%;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-soft); }
:root[data-theme="dark"] .btn-primary { color: #0f2038; }

.card-link { text-decoration: none; }
.link-arrow { font-weight: 700; text-decoration: none; white-space: nowrap; }

/* ============================== Hero (home) ============================== */
.hero { padding-block: 3rem 3.5rem; }
@media (min-width: 900px) { .hero { padding-block: 4.5rem 4rem; } }
.hero .wrap { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr 0.85fr; padding-top: .4rem; } }
.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.15rem);
  letter-spacing: -0.01em;
  max-width: 16ch;
}
.hero .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 34rem; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.hero-kicker { font-family: var(--font-display); font-style: italic; color: var(--blue); font-size: 1rem; margin-bottom: .6rem; display: block; }

.thread-graphic { width: 100%; height: auto; }
.thread-graphic .tg-year { font-family: var(--font-body); font-size: 11px; fill: var(--ink-soft); }

.hero-photo { margin: 0; border-top: 4px solid var(--gold); }
.hero-photo img { width: 100%; height: auto; display: block; }
.hero-photo figcaption { font-size: .8rem; color: var(--ink-soft); padding-top: .6rem; }
.hero-photo figcaption a { color: var(--ink-soft); text-decoration: underline; }

.article-photo { margin: 1.6rem 0 2rem; border-top: 3px solid var(--band-color, var(--blue)); }
.article-photo img { width: 100%; height: auto; display: block; border-radius: 0 0 var(--radius) var(--radius); }
.article-photo figcaption { font-size: .82rem; color: var(--ink-soft); padding-top: .55rem; }
.article-photo figcaption a { color: var(--ink-soft); text-decoration: underline; }
.photo-row { display: grid; gap: 1.4rem; }
@media (min-width: 700px) { .photo-row { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.photo-row .article-photo { margin: 0; }

/* ============================== Stats ============================== */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 2.2rem; background: var(--paper-sunken); }
.stats .wrap { display: grid; gap: 1.6rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stats .wrap { grid-template-columns: repeat(4, 1fr); } }
.stat b { display: block; font-family: var(--font-display); font-size: 2.1rem; color: var(--blue-deep); line-height: 1; margin-bottom: .35rem; }
.stat span { color: var(--ink-soft); font-size: .92rem; }

/* ============================== Era cards ============================== */
.section { padding-block: 3.4rem; }
.section-head { max-width: 40rem; margin-bottom: 2.2rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.eyebrow { font-family: var(--font-display); font-style: italic; color: var(--ink-soft); font-size: 1.02rem; }

.era-grid { display: grid; gap: 1.4rem; }
@media (min-width: 780px) { .era-grid { grid-template-columns: repeat(3, 1fr); } }
.era-card {
  border: 1px solid var(--line); border-left: 5px solid var(--card-color, var(--blue));
  border-radius: var(--radius); padding: 1.6rem 1.5rem;
  background: var(--paper); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: .7rem;
}
.era-card .era-range { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.era-card h3 { font-size: 1.25rem; margin-bottom: 0; }
.era-card p { color: var(--ink-soft); font-size: .96rem; margin-bottom: .2rem; }
.era-card .link-arrow { color: var(--card-color, var(--blue)); }

/* ============================== About blurb (home) ============================== */
.about-split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .about-split { grid-template-columns: 1.2fr 0.8fr; } }
blockquote.pull {
  margin: 0; background: var(--paper-warm); border-radius: var(--radius);
  padding: 1.6rem 1.7rem; font-family: var(--font-display); font-size: 1.15rem;
  color: var(--ink); border-left: 4px solid var(--gold);
}
blockquote.pull footer { margin-top: .8rem; font-family: var(--font-body); font-size: .82rem; color: var(--ink-soft); font-weight: 600; }

/* ============================== Timeline page ============================== */
.era-band { padding-block: 2.2rem 1.8rem; border-top: 1px solid var(--line); }
.era-band:first-of-type { border-top: none; }
.era-band .era-tag {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  color: var(--band-color); padding: .25rem .65rem; border: 1px solid var(--band-color);
  border-radius: 999px; margin-bottom: .9rem;
}
.era-band h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
.era-band .era-sub { color: var(--ink-soft); font-weight: 600; margin-bottom: 1rem; font-size: .95rem; }
.era-band .era-intro { max-width: var(--measure); color: var(--ink-soft); }

.ledger { position: relative; margin-top: 1rem; }
.ledger::before {
  content: ""; position: absolute; left: 6.2rem; top: .4rem; bottom: .4rem;
  width: 2px; background: var(--band-color); opacity: .35;
  transform: scaleY(0); transform-origin: top; transition: transform 1.1s ease;
}
.ledger.is-visible::before { transform: scaleY(1); }
@media (max-width: 620px) { .ledger::before { display: none; } }

.ledger-row {
  display: grid; grid-template-columns: 1fr; gap: .4rem;
  padding-block: 1.5rem; border-top: 1px solid var(--line);
}
.ledger-row:first-child { border-top: none; }
@media (min-width: 620px) {
  .ledger-row { grid-template-columns: 6rem 1fr; gap: 1.6rem; }
}
.ledger-year {
  position: relative; font-family: var(--font-display); font-weight: 700;
  font-size: 1.6rem; color: var(--band-color); line-height: 1;
}
.ledger-year .dot { display: none; }
@media (min-width: 620px) {
  .ledger-year .dot {
    display: block; position: absolute;
    width: 10px; height: 10px; border-radius: 50%; background: var(--band-color);
    top: .35rem; left: 5.75rem;
  }
}
.ledger-body h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.ledger-body p { color: var(--ink-soft); margin-bottom: .7rem; }
.ledger-body .link-arrow { font-size: .92rem; color: var(--band-color); }

/* ============================== Year page ============================== */
.breadcrumb { font-size: .85rem; color: var(--ink-soft); padding-block: 1.4rem .6rem; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue-deep); }
.breadcrumb .sep { margin-inline: .5rem; opacity: .6; }

.year-hero { padding-block: 1rem 2.4rem; }
.year-badge {
  display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 700;
  color: var(--band-color); border: 1px solid var(--band-color); padding: .3rem .7rem;
  border-radius: 999px; margin-bottom: 1.1rem;
}
.year-hero .big-year { font-family: var(--font-display); font-size: clamp(3rem, 9vw, 5rem); line-height: .95; color: var(--band-color); margin-bottom: .1rem; }
.year-hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .7rem; }
.year-hero .lede { color: var(--ink-soft); max-width: var(--measure); font-size: 1.05rem; }

.events { max-width: 46rem; }
.event { display: grid; grid-template-columns: 1fr; gap: .3rem; padding-block: 1.7rem; border-top: 1px solid var(--line); }
.event:first-child { border-top: none; padding-top: 0; }
@media (min-width: 620px) { .event { grid-template-columns: 5.5rem 1fr; gap: 1.4rem; } }
.event .when {
  font-family: var(--font-display); font-style: italic; color: var(--band-color);
  font-size: .98rem; padding-top: .15rem;
}
.event h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.event p { margin-bottom: .9rem; }
.event p:last-child { margin-bottom: 0; }
.event a.watch { font-weight: 700; font-size: .92rem; }

.year-pager {
  display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.6rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.year-pager a { text-decoration: none; color: var(--ink); font-weight: 700; max-width: 46%; }
.year-pager small { display: block; color: var(--ink-soft); font-weight: 500; font-size: .8rem; margin-bottom: .2rem; }
.year-pager .next { text-align: right; margin-left: auto; }

/* ============================== Generic content page ============================== */
.page-hero { padding-block: 1rem 2rem; }
.page-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); max-width: 20ch; }
.page-hero .lede { color: var(--ink-soft); font-size: 1.08rem; max-width: var(--measure); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2rem; font-size: 1.4rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); }

.faq { display: grid; gap: 0; margin-top: 1rem; }
.faq details { border-top: 1px solid var(--line); padding-block: 1.1rem; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-family: var(--font-display); font-size: 1.06rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--blue); font-size: 1.2rem; }
.faq details[open] summary::after { content: "\2212"; }
.faq p { margin-top: .8rem; color: var(--ink-soft); }

.panel {
  background: var(--paper-warm); border-radius: var(--radius); padding: 1.6rem 1.7rem; margin-block: 1.6rem;
}
.panel h2, .panel h3 { margin-top: 0; }
.panel a, .prose a { overflow-wrap: anywhere; }

.contact-split { display: grid; gap: 1.6rem; margin-top: 1.8rem; }
@media (min-width: 780px) { .contact-split { grid-template-columns: 1fr 1fr; } }
.icm-contact-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.icm-contact-list li { font-size: .96rem; }
.icm-contact-list strong { color: var(--ink); }
.icm-contact-list a { color: var(--ink-soft); }

.gallery-embed {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem;
  background: var(--paper-sunken); text-align: center;
}
.gallery-embed h2 { margin-top: 0; }

.media-feature { margin-top: 1.5rem; }
.media-feature h2 { margin-bottom: .3rem; font-size: 1.5rem; }
.media-byline { font-size: .84rem; color: var(--ink-soft); font-weight: 600; margin-bottom: .6rem; }
.media-group { margin-top: 2.4rem; }
.media-group h3 { font-size: 1.1rem; margin-bottom: .2rem; }
.media-list { list-style: none; margin: 0; padding: 0; }
.media-item {
  border-top: 1px solid var(--line); padding-block: 1.1rem;
}
.media-item:last-child { padding-bottom: 0; }
.media-item > a {
  font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.02rem;
  display: inline-block; margin-bottom: .25rem;
}
.media-item > a:hover { color: var(--blue-deep); text-decoration: underline; }
.media-item .media-byline { margin-bottom: .5rem; display: block; }
.media-item p:not(.media-byline) { color: var(--ink-soft); margin-bottom: 0; font-size: .96rem; }

/* ============================== Utility ============================== */
.era-swatch { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; }
.mt-0 { margin-top: 0; }
.center { text-align: center; }
.error-page { text-align: center; padding-block: 5rem; }
.error-page .big { font-family: var(--font-display); font-size: clamp(3.5rem, 12vw, 6rem); color: var(--blue-tint); line-height: 1; margin-bottom: .5rem; }
