:root {
  --brown-900: #3b2919;
  --brown-700: #583f2a;
  --brown-500: #6c4d33;
  --parchment: #faf5ee;
  --sand: #efd5c3;
  --line: #e4d8ca;
  --ink: #2e2620;
  --muted: #6b5d51;
  --link: #1a3665;
  --accent: #b5532a;
  --accent-dark: #8f3f1e;
  --radius: 10px;
  --heading: "Bitter", Georgia, serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
  font: 400 1.125rem/1.65 var(--body);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--heading); color: var(--brown-700); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); }
h2 { font-size: 1.55rem; margin-top: 1.4em; }
h3 { font-size: 1.25rem; margin-top: 1.4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.wrap { width: min(1160px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* Buttons */
.btn {
  display: inline-block; padding: .6rem 1.15rem; border-radius: 999px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--brown-700); }
.donate { margin: 0; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--brown-700); color: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; font: 600 1rem/1.2 var(--heading); flex: none; }
.brand:hover { color: #fff; }
.brand img { width: 48px; height: 48px; border-radius: 50%; background: #fff; }
.menu-toggle { display: none; background: none; border: 2px solid rgb(255 255 255 / .7); border-radius: 8px; color: #fff; font: 600 1rem var(--body); padding: .35rem .85rem; cursor: pointer; }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.nav-list, .menu { list-style: none; margin: 0; padding: 0; }
.nav-list { display: flex; align-items: center; gap: .15rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; cursor: pointer;
  color: #fff; font: 600 1.02rem/1 var(--body); text-decoration: none; padding: .65rem .6rem; border-radius: 6px;
}
.nav-link:hover, .has-menu.open > .nav-link { background: var(--brown-500); color: #fff; }
.nav-link[aria-current], .is-current > .nav-link { box-shadow: inset 0 -3px 0 var(--sand); }
.chev { width: 10px; height: 6px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.has-menu { position: relative; }
.menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 230px; padding: .5rem;
  background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: 0 12px 30px rgb(0 0 0 / .25);
}
.has-menu.open > .menu { display: block; }
@media (hover: hover) and (min-width: 1061px) { .has-menu:hover > .menu { display: block; } }
.menu a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.3; }
.menu a:hover { background: var(--parchment); color: var(--accent-dark); }
.menu a[aria-current] { font-weight: 600; color: var(--accent-dark); }
.menu-label { padding: .55rem .6rem .15rem; font: 600 .8rem/1.2 var(--body); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.menu-wide { display: none; columns: 2; column-gap: .5rem; min-width: 400px; }
.has-menu.open > .menu-wide { display: block; }
.menu-wide li { break-inside: avoid; }

@media (max-width: 1060px) {
  .menu-toggle { display: block; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch;
    background: var(--brown-700); padding: .5rem 1rem 1.25rem; max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .site-nav.open { display: flex; }
  .nav-list { flex-direction: column; align-items: stretch; }
  .nav-link { width: 100%; justify-content: space-between; padding: .8rem .6rem; }
  .menu, .menu-wide { position: static; min-width: 0; box-shadow: none; margin: 0 0 .5rem; }
  .menu-wide { columns: 1; }
}

/* Home hero: the 1860 scene, fading into the page at top and bottom */
.hero {
  --hero-img: 56.28vw;
  --hero-clear: 36vw;
  position: relative;
  color: var(--ink);
  text-align: center;
  background-color: var(--parchment);
  background-image:
    linear-gradient(to bottom,
      rgb(250 245 238 / 1) 0%, rgb(250 245 238 / 1) 3%, rgb(250 245 238 / .97) 22%, rgb(250 245 238 / .88) 32%,
      rgb(250 245 238 / .55) 39%, rgb(250 245 238 / .16) 45%, rgb(250 245 238 / 0) 50%,
      rgb(250 245 238 / 0) 86%, rgb(250 245 238 / .6) 93%, rgb(250 245 238 / 1) 98%),
    url(images/clarksville-1860.webp);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% calc(var(--hero-img) + 3px), 100% var(--hero-img);
}
.hero-inner { padding-top: clamp(1.75rem, 3.5vw, 3rem); padding-bottom: var(--hero-clear); }
.hero h1 { color: var(--brown-700); margin-bottom: .3em; font-size: clamp(2rem, 1.4rem + 2.2vw, 3.1rem); }
.hero p { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); max-width: 36em; margin: 0 auto 1.3rem; text-wrap: balance; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.hero .hero-actions { justify-content: center; }
.btn-outline { border-color: var(--brown-700); color: var(--brown-700); background: rgb(255 255 255 / .55); }
.btn-outline:hover { background: var(--brown-700); color: #fff; }
.hero-label { position: absolute; right: .75rem; bottom: .5rem; font-size: .82rem; line-height: 1.2; color: var(--muted); text-decoration: none; }
.hero-label:hover { color: var(--accent-dark); text-decoration: underline; }
@media (max-width: 767px) {
  .hero { --hero-img: 96vw; --hero-clear: 62vw; background-position: 38% bottom; background-size: 100% calc(var(--hero-img) + 3px), 170.6vw var(--hero-img); }
  .hero-label { left: 1rem; right: 1rem; text-align: center; font-size: .76rem; }
}

/* Page content */
main { padding-block: clamp(2rem, 5vw, 3.5rem); min-height: 50vh; }
.columns { display: flex; align-items: flex-start; gap: clamp(1.5rem, 4vw, 3.5rem); }
.columns > .col-sm-5 { flex: 3 1 0; min-width: 0; }
.columns > .col-sm-4 { flex: 2 1 0; min-width: 0; }
.single { max-width: 100%; }
.page-about .single, .page-bylaws .single { max-width: 46rem; }

.row { display: flex; flex-wrap: wrap; gap: 1rem; margin-block: 1rem; }
.row > [class*="col-"] { flex: 1 1 0; min-width: 0; }
.row > .col-xs-6.col-md-3 { flex: 0 0 calc(25% - .75rem); }
.row > .col-sm-6 { flex: 0 0 calc(50% - .5rem); }
.row > .col-sm-4 { flex: 0 0 calc(33.333% - .67rem); }
.row > .col-xs-12:not([class*="col-sm-"]) { flex: 0 0 100%; }
.row > .col-md-1 { flex: 0 0 calc(8.333% - 1rem); }
.row > .col-md-10 { flex: 1 1 0; }
.side-stack > div { margin-bottom: 1.5rem; }

.row a[data-lightbox] { display: block; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.row a[data-lightbox] img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .25s; }
.row a[data-lightbox]:hover img { transform: scale(1.04); }

.img-responsive { display: block; max-width: 100%; height: auto; }
.img-rounded { border-radius: var(--radius); }
.text-center { text-align: center; }
.pull-right { float: right; }
.pull-left { float: left; }
.pad-left-10px { padding-left: 1rem; }
.pad-btm-n-right { padding: 0 1rem .75rem 0; }
.col-sm-5 img, .col-sm-4 img { border-radius: var(--radius); }
.iframe-container { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; background: var(--line); }
.iframe-container iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.callout { clear: both; margin-top: 2.5rem; padding: 1.5rem 1.75rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.callout::after { content: ""; display: block; clear: both; }
.callout ul { margin-bottom: 0; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  max-width: 100%; padding: .5rem .6rem; border: 1px solid #bcae9f; border-radius: 6px; font: inherit;
}

/* Membership application */
.form-page { max-width: 46rem; margin-inline: auto; }
.app-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1.25rem 1.5rem 1.5rem; margin: 0 0 1.5rem; }
.app-form legend { font: 600 1.2rem var(--heading); color: var(--brown-700); padding: 0 .5rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .2rem; }
.field input { width: 100%; }
.field small { color: var(--muted); font-size: .92rem; }
.field-row { display: flex; gap: 1rem; }
.field-row .grow { flex: 1 1 0; min-width: 0; }
.field-row .small { flex: 0 0 7rem; }
.optional { font-weight: 400; color: var(--muted); }
.app-form input[type="date"], .app-form input[type="number"] { padding: .5rem .6rem; border: 1px solid #bcae9f; border-radius: 6px; font: inherit; max-width: 100%; }
.app-form input[type="date"] { width: 12rem; }
.app-form input.money { width: 9rem; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.5rem; margin-bottom: 1rem; }
.check-grid label { display: flex; align-items: baseline; gap: .5rem; }
.group-label { font-weight: 600; margin: 1rem 0 .4rem; }
.line { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.line label { display: contents; }
.line > span:first-of-type, .line label span { flex: 1; }
.qty { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.qty input { width: 4.5rem; }
.total-bar { display: flex; justify-content: space-between; align-items: center; background: var(--brown-700); color: #fff; border-radius: var(--radius); padding: .9rem 1.5rem; font: 600 1.25rem var(--heading); margin-bottom: 1rem; }
.pay-note, .form-hint { font-size: 1rem; color: var(--muted); }
.form-hint { margin-top: .6rem; }
.form-error { color: #a12a14; font-weight: 600; margin: .5rem 0 0; }
.form-status { font-weight: 600; color: var(--brown-700); margin-top: .75rem; }
.terms { margin-top: 3rem; }

/* Converted documents */
.doc { max-width: 44rem; margin-inline: auto; }
.doc p { margin: 0 0 1em; }
.doc figure { margin: 1.5rem 0; }
.doc figure img { display: block; margin-inline: auto; border-radius: var(--radius); }
.doc-meta { color: var(--muted); font-size: 1rem; }
.doc .caption { color: var(--muted); font-size: .98rem; line-height: 1.4; text-align: center; margin-top: -.75rem; margin-bottom: 1.5rem; }
.doc-image { max-width: 100%; }
.doc-image img { display: block; margin-inline: auto; border-radius: var(--radius); }

/* Footer */
.site-footer { background: var(--brown-900); color: #e9dfd3; margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding-block: 2.5rem; font-size: 1rem; }
.footer-inner strong { color: #fff; font-family: var(--heading); }
.footer-actions { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.legal { flex: 1 0 100%; margin: 0; padding-top: 1.25rem; border-top: 1px solid rgb(255 255 255 / .18); font-size: .9rem; color: #c9bbab; }

/* Photo viewer */
.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.viewer::backdrop { background: rgb(20 14 9 / .92); }
.viewer-stage { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 3.5rem 4.5rem 1.25rem; }
.viewer img { max-width: 100%; max-height: calc(100vh - 9rem); width: auto; height: auto; border-radius: 6px; }
.viewer-caption { color: #fff; text-align: center; max-width: 50rem; font-size: 1rem; line-height: 1.4; }
.viewer-count { color: #c9bbab; font-size: .9rem; }
.viewer button { position: absolute; background: rgb(255 255 255 / .14); border: 0; color: #fff; border-radius: 50%; width: 3rem; height: 3rem; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.viewer button:hover { background: rgb(255 255 255 / .3); }
.viewer-close { top: .75rem; right: .75rem; }
.viewer-prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.viewer-next { right: .75rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 767px) {
  body { font-size: 1.0625rem; }
  .columns { flex-direction: column; }
  .columns > .col-sm-5, .columns > .col-sm-4 { flex: none; width: 100%; }
  .row > .col-xs-6.col-md-3 { flex: 0 0 calc(50% - .5rem); }
  .row > .col-sm-6, .row > .col-sm-4 { flex: 0 0 100%; }
  .pull-right, .pull-left { float: none; display: block; margin-inline: auto; }
  .viewer-stage { padding: 3.75rem .75rem 1rem; }
  .viewer-prev, .viewer-next { top: auto; bottom: .75rem; transform: none; }
  .viewer-stage { padding-bottom: 4.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.doc, .doc h1, .doc h2 { overflow-wrap: anywhere; }

/* Meetings */
.meetings { max-width: 58rem; margin-inline: auto; }
.coming { background: var(--brown-700); color: #fff; border-radius: var(--radius); padding: clamp(1.75rem, 4vw, 3rem); margin-bottom: 2.5rem; }
.coming h2 { color: #fff; margin: 0 0 .5em; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem); }
.coming p { max-width: 38em; margin: 0 0 1.4rem; }
.coming .eyebrow { color: var(--sand); font-weight: 600; font-size: .95rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .5rem; }
.expect { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.expect > div { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.expect h3 { margin-top: 0; }
.expect p { margin: 0; }
.past-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.past-grid figure { margin: 0; }
.past-grid img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; border-radius: var(--radius); }
.past-grid figcaption { font-size: .98rem; line-height: 1.35; color: var(--muted); margin-top: .4rem; }
.archive-note { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1.1rem; }
@media (max-width: 767px) { .expect, .past-grid { grid-template-columns: 1fr; } }

/* Home */
.home-section { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.home-section > h2:first-child { margin-top: 0; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; transition: box-shadow .15s, transform .15s; }
.card:hover { color: var(--ink); box-shadow: 0 8px 22px rgb(59 41 25 / .16); transform: translateY(-2px); }
.card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card-title { font: 600 1.15rem/1.25 var(--heading); color: var(--brown-700); padding: .85rem 1rem .2rem; }
.card-text { font-size: 1rem; line-height: 1.4; color: var(--muted); padding: 0 1rem 1rem; }
.expect > div > p + p { margin-top: .6rem; }
.involve { background: var(--brown-700); color: #fff; border-radius: var(--radius); padding: clamp(1.75rem, 4vw, 3rem); margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.involve h2 { color: #fff; margin-top: 0; }
.involve p { max-width: 46em; }
.involve .hero-actions { align-items: center; margin-top: 1.5rem; }
.book { display: flex; gap: clamp(1.25rem, 4vw, 2.5rem); align-items: flex-start; }
.book img { display: block; border-radius: 6px; box-shadow: 0 6px 18px rgb(59 41 25 / .25); }
.book h2 { margin-top: 0; }
.supporters { list-style: none; padding: 0; margin: 1rem 0; columns: 3; column-gap: 2rem; font-weight: 600; }
.supporters li { break-inside: avoid; padding: .2rem 0; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .book { flex-direction: column; } .supporters { columns: 1; } }
.book > a { flex: 0 0 auto; }

/* Pony Express era */
.era { max-width: 62rem; margin-inline: auto; }
.era-lead { font-size: 1.2rem; max-width: 46rem; }
.era-figure { margin: 1.5rem 0 2rem; }
.era-figure a { display: block; }
.era-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 8px 26px rgb(59 41 25 / .28); }
.era-figure figcaption { color: var(--muted); font-size: .98rem; margin-top: .6rem; text-align: center; }
.era-key { columns: 2; column-gap: 2.5rem; padding-left: 1.4rem; }
.era-key li { break-inside: avoid; margin-bottom: .8rem; }
@media (max-width: 767px) { .era-key { columns: 1; } }
.era-stage { position: relative; }
.era-pin { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; display: grid; place-items: center; border-radius: 50%; background: #f7efdf; border: 2px solid var(--brown-900); color: var(--brown-900); font: 700 .9rem/1 var(--heading); pointer-events: none; box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.era-badge { position: absolute; right: .6rem; bottom: .6rem; background: rgb(247 239 223 / .93); color: var(--brown-900); font-size: .85rem; line-height: 1.2; padding: .3rem .6rem; border-radius: 6px; pointer-events: none; }
@media (max-width: 767px) { .era-pin { width: 19px; height: 19px; margin: -9.5px 0 0 -9.5px; font-size: .68rem; border-width: 1.5px; } .era-badge { font-size: .68rem; right: .3rem; bottom: .3rem; padding: .18rem .4rem; } }

/* Cemetery list */
.page-doc-clarksville-cemetery-grave-list .doc { max-width: 66rem; }
.grave-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 1rem 0 1.25rem; }
.grave-tools label { font-weight: 600; }
.grave-tools input { flex: 1 1 16rem; max-width: 26rem; padding: .55rem .75rem; border: 1px solid #bcae9f; border-radius: 8px; font: inherit; background: #fff; }
.grave-tools p { margin: 0; color: var(--muted); font-size: 1rem; }
.grave-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.5rem; }
.grave-table { width: 100%; border-collapse: collapse; font-size: 1.02rem; line-height: 1.4; }
.grave-table thead th { text-align: left; background: var(--brown-700); color: #fff; padding: .65rem .9rem; font-weight: 600; }
.grave-table tbody th, .grave-table td { padding: .65rem .9rem; border-top: 1px solid var(--line); vertical-align: top; text-align: left; }
.grave-table tbody th { font-weight: 600; color: var(--brown-700); width: 28%; }
.grave-table td[data-label] { white-space: nowrap; width: 12%; }
.grave-table tbody tr:nth-child(even) { background: #fdfaf5; }
.grave-status { display: inline-block; margin-left: .5rem; padding: .05rem .5rem; border-radius: 999px; background: var(--sand); color: var(--brown-900); font-size: .82rem; white-space: nowrap; }
@media (max-width: 767px) {
  .grave-table thead { position: absolute; left: -9999px; }
  .grave-table, .grave-table tbody, .grave-table tr, .grave-table th, .grave-table td { display: block; width: auto !important; }
  .grave-table tr { padding: .75rem .9rem; border-top: 1px solid var(--line); }
  .grave-table tbody tr:first-child { border-top: 0; }
  .grave-table tbody th, .grave-table td { padding: 0; border: 0; white-space: normal !important; }
  .grave-table td[data-label] { display: inline-block; margin-right: 1rem; font-size: .98rem; }
  .grave-table td[data-label]:empty { display: none; }
  .grave-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .grave-notes { margin-top: .2rem; }
  .grave-notes:empty { display: none; }
  .grave-status { margin-left: 0; }
}
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; background: var(--parchment); }
