/* ============================================================
   Marion County, Tennessee — History & Heritage
   Site-wide stylesheet
   Warm parchment aesthetic · system fonts · zero external requests
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* palette — warm parchment (matched to timeline) */
  --paper:       #f4ece0;
  --paper-2:     #ebe1d1;
  --ink:         #1f1a14;
  --ink-soft:    #4a4036;
  --ink-faded:   #7a6d5d;
  --rule:        #cdbfa8;
  --accent:      #8a2a1c;
  --accent-hover:#6d2016;
  --card:        #fbf6ec;
  --card-shadow: 0 1px 2px rgba(40,30,15,0.06), 0 8px 24px rgba(40,30,15,0.08);

  /* type — system stack */
  --font-serif: ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;

  /* spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;

  /* layout */
  --max-width: 820px;
  --max-width-wide: 1040px;
  --nav-height: 52px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1.5rem);
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: radial-gradient(ellipse at top, #faf3e6 0%, var(--paper) 45%, var(--paper-2) 100%);
  background-attachment: fixed;
  line-height: 1.65;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(138,42,28,0.3);
  transition: border-color 0.15s;
}
a:hover { border-bottom-color: var(--accent); color: var(--accent-hover); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
}
h1 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
}
h2 {
  font-size: clamp(22px, 3vw, 30px);
  margin-top: 2.5em;
  margin-bottom: 0.6em;
  position: relative;
}
h3 {
  font-size: clamp(17px, 2vw, 22px);
  margin-top: 1.8em;
  margin-bottom: 0.4em;
}
h4 {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1.5em;
  margin-bottom: 0.4em;
}

p  { margin-bottom: 1em; color: var(--ink-soft); font-size: 15.5px; line-height: 1.7; }
ul, ol { margin-bottom: 1em; padding-left: 1.4rem; color: var(--ink-soft); font-size: 15px; }
li { margin-bottom: 0.35rem; line-height: 1.6; }

/* prose paragraphs — for long-form reading (history, about) */
.prose p {
  font-size: 16.5px;
  line-height: 1.78;
  max-width: 65ch;
  color: var(--ink-soft);
  margin-bottom: 1.2em;
}
.prose p:first-of-type::first-line {
  color: var(--ink);
}

/* ---------- Layout ---------- */
.container     { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(31,26,20,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--accent);
}

.site-nav .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--paper);
  border: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.nav-brand:hover { color: #fff; border: none; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
}
.nav-links li { margin: 0; }
.nav-links a {
  color: rgba(244,236,224,0.75);
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover {
  color: var(--paper);
  background: rgba(255,255,255,0.1);
  border: none;
}
.nav-links a[aria-current="page"] {
  color: var(--paper);
  background: rgba(138,42,28,0.5);
}

/* hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--paper);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
  border-radius: 1px;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(31,26,20,0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 24px 16px;
    border-bottom: 2px solid var(--accent);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 8px; font-size: 15px; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- Page Header ---------- */
.page-header {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 60px 24px 36px;
  text-align: center;
}
.page-header .eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--ink-faded);
  margin-bottom: 16px;
}
.page-header h1 {
  color: var(--ink);
  margin-bottom: 12px;
}
.page-header .subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 580px;
  margin: 0 auto;
}
.page-header .header-rule {
  width: 80px;
  height: 1px;
  background: var(--rule);
  margin: 24px auto 0;
}

/* ---------- Hero (image-backed, for select pages) ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 80px 24px 48px;
  overflow: hidden;
}
.hero--image {
  background-size: cover;
  background-position: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero--image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(31,26,20,0.55) 0%,
    rgba(31,26,20,0.7) 100%
  );
}
.hero--image > * { position: relative; z-index: 1; }
.hero--image h1 { color: var(--paper); text-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.hero--image .subtitle {
  color: rgba(244,236,224,0.85);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 560px;
}
.hero--image .header-rule {
  width: 60px;
  height: 1px;
  background: rgba(244,236,224,0.4);
  margin: 20px auto 0;
}

/* ---------- Page content ---------- */
.page-content {
  padding: var(--space-lg) 0 var(--space-xl);
}
.last-updated {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: var(--space-lg);
}

/* ---------- Section dividers ---------- */
.section-rule {
  width: 60px;
  height: 1px;
  background: var(--rule);
  margin: 3rem auto;
}
h2 + .section-subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--ink-faded);
  font-size: 15px;
  margin-top: -0.4em;
  margin-bottom: 1.2em;
}

/* ---------- Cards (landing pages) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: var(--space-md);
}

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 3px rgba(40,30,15,0.08), 0 14px 30px rgba(40,30,15,0.10);
}

.card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-bottom: 1px solid var(--rule);
}

.card-body { padding: 14px 16px 16px; }
.card-body h3 {
  font-size: 16px;
  margin: 0 0 6px;
  line-height: 1.3;
}
.card-body h3 a {
  color: var(--ink);
  border: none;
}
.card-body h3 a:hover { color: var(--accent); border: none; }
.card-body p {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

/* card without image */
.card--text-only { border-left: 3px solid var(--accent); }

/* full-card link (whole card is clickable) */
a.card--link {
  display: block;
  color: inherit;
  border-bottom: none;
  text-decoration: none;
}
a.card--link:hover,
a.card--link:focus { border-bottom: none; color: inherit; }
a.card--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a.card--link .card-body h3 { color: var(--ink); transition: color 0.15s; }
a.card--link:hover .card-body h3 { color: var(--accent); }

/* ---------- Inline figures ---------- */
figure {
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--paper-2);
}
figure img {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: cover;
}
figcaption {
  font-size: 12px;
  color: var(--ink-faded);
  padding: 8px 12px;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  line-height: 1.45;
  font-style: italic;
}

/* float figures for prose pages */
.figure-right {
  float: right;
  max-width: 320px;
  margin: 0.5em 0 1em 1.5em;
}
.figure-left {
  float: left;
  max-width: 320px;
  margin: 0.5em 1.5em 1em 0;
}
@media (max-width: 600px) {
  .figure-right, .figure-left {
    float: none;
    max-width: 100%;
    margin: 1.5em 0;
  }
}

/* ---------- Highlight box ---------- */
.highlight-box {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  border-radius: 0 6px 6px 0;
  margin: 2em 0;
  box-shadow: var(--card-shadow);
}
.highlight-box h3 {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}
.highlight-box p {
  font-size: 14.5px;
  margin: 0;
  color: var(--ink-soft);
}

/* ---------- Table of contents ---------- */
.toc {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 22px;
  margin-bottom: 2.5em;
  display: inline-block;
  box-shadow: var(--card-shadow);
}
.toc h2 {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin: 0 0 10px;
  font-weight: 600;
}
.toc ul { margin: 0; padding-left: 0; list-style: none; }
.toc li {
  margin-bottom: 4px;
  font-size: 14px;
  padding-left: 14px;
  position: relative;
}
.toc li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 1px;
  background: var(--rule);
}
.toc a { font-family: var(--font-serif); }

/* ---------- People profiles ---------- */
.profile {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 2em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--rule);
}
.profile:last-child { border-bottom: none; }
.profile-img {
  width: 100px;
  height: 120px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  flex-shrink: 0;
}
.profile-text h3 { margin-top: 0; font-size: 18px; }
.profile-text p { font-size: 14.5px; }
@media (max-width: 500px) {
  .profile { flex-direction: column; }
  .profile-img { width: 80px; height: 96px; }
}

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.gallery-grid figure {
  margin: 0;
  transition: transform 0.15s ease;
}
.gallery-grid figure:hover { transform: translateY(-2px); }
.gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

/* ---------- Section groups (landing pages) ---------- */
.section-group {
  margin-top: 2.5em;
}
.section-group h2 {
  font-size: 13px;
  font-family: var(--font-serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faded);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  margin-top: 0;
  margin-bottom: 1em;
}

/* ---------- Sources ---------- */
.page-sources {
  margin-top: 3em;
  padding-top: 1.5em;
  border-top: 1px solid var(--rule);
}
.page-sources h2 {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin: 0 0 12px;
}
.page-sources ul { list-style: none; padding: 0; }
.page-sources li {
  font-size: 13.5px;
  padding: 4px 0;
  color: var(--ink-soft);
}
.page-sources li + li { border-top: 1px solid rgba(205,191,168,0.4); }

/* ---------- Footer ---------- */
.site-footer {
  background: rgba(31,26,20,0.95);
  color: rgba(244,236,224,0.6);
  padding: 2.5em 24px;
  margin-top: var(--space-xl);
  font-size: 13px;
  text-align: center;
  letter-spacing: 0.02em;
}
.site-footer p { color: rgba(244,236,224,0.6); margin-bottom: 4px; font-size: 13px; }
.site-footer a {
  color: rgba(244,236,224,0.8);
  border-bottom-color: rgba(244,236,224,0.3);
}
.site-footer a:hover { color: var(--paper); }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .page-header { padding: 44px 20px 28px; }
  .hero { padding: 56px 20px 36px; }
  .card-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---------- Subpage back link ---------- */
.back-link {
  font-size: 13px;
  letter-spacing: 0.03em;
  color: var(--ink-faded);
  margin-bottom: 1em;
}
.back-link a {
  color: var(--ink-soft);
  border-bottom: none;
}
.back-link a:hover { color: var(--accent); }

/* ---------- Fact list (key-value block at top of subpages) ---------- */
.fact-list {
  list-style: none;
  padding: 14px 18px;
  margin: 0 0 1.8em;
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 20px;
  box-shadow: var(--card-shadow);
}
.fact-list li {
  font-size: 13.5px;
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}
.fact-list li strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  margin-right: 4px;
}

/* ---------- Clearfix ---------- */
.clearfix::after { content: ""; display: table; clear: both; }
