/* MidWestAstro content theme — lightweight, brand-switched, mobile-first */
:root {
  --bg: #fbf6ee;
  --bg-alt: #f3e6d4;
  --bg-dark: #3b2418;
  --text: #2c1a12;
  --muted: #6b4f3e;
  --accent: #b33a2b;
  --accent-2: #d4a017;
  --header: #4a2418;
  --header-text: #fbf6ee;
  --card: #fffdf8;
  --border: rgba(59, 36, 24, 0.12);
  --shadow: 0 10px 30px rgba(59, 36, 24, 0.08);
  --radius: 18px;
  --wrap: 1180px;
  --header-h: 84px;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ad-in-h: 280px;
  --ad-side-h: 320px;
}
[data-brand="vintage"] {
  --bg: #f4efe6;
  --bg-alt: #e7ddd0;
  --bg-dark: #1f3d3a;
  --text: #241f1a;
  --muted: #5b5349;
  --accent: #2f5d56;
  --accent-2: #b45a3c;
  --header: #1b3330;
  --header-text: #f4efe6;
  --card: #fffaf3;
  --border: rgba(31, 61, 58, 0.14);
  --shadow: 0 10px 30px rgba(31, 61, 58, 0.08);
  --font-display: Palatino, "Palatino Linotype", "Book Antiqua", "Times New Roman", serif;
  --font-body: "Segoe UI", "Century Gothic", system-ui, sans-serif;
}
[data-brand="reefs"] {
  --bg: #f3f8fa;
  --bg-alt: #e4eef3;
  --bg-dark: #0b2a3a;
  --text: #102430;
  --muted: #4a6570;
  --accent: #0e6d7a;
  --accent-2: #e07a5f;
  --header: #08212e;
  --header-text: #eef7fa;
  --card: #ffffff;
  --border: rgba(11, 42, 58, 0.12);
  --shadow: 0 10px 30px rgba(11, 42, 58, 0.08);
  --font-display: "Trebuchet MS", "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c120e;
    --bg-alt: #261910;
    --text: #f4ece3;
    --muted: #cbb7a7;
    --card: #261910;
    --border: rgba(251, 246, 238, 0.1);
  }
  [data-brand="vintage"] {
    --bg: #141c1b;
    --bg-alt: #1b2625;
    --text: #f3eee6;
    --muted: #c4bbb0;
    --card: #1b2625;
    --border: rgba(244, 239, 230, 0.1);
  }
  [data-brand="reefs"] {
    --bg: #07141c;
    --bg-alt: #0c1e28;
    --text: #e8f3f6;
    --muted: #9cb3bd;
    --card: #0c1e28;
    --border: rgba(238, 247, 250, 0.1);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-2); }
.wrap { width: min(var(--wrap), calc(100% - 2rem)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--accent);
  color: #fff; padding: 0.5rem 0.8rem; z-index: 200;
}
.skip-link:focus { top: 0.5rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--header) 92%, transparent);
  color: var(--header-text);
  backdrop-filter: saturate(1.2) blur(12px);
  transition: min-height 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: var(--header-h);
  transition: min-height 0.25s ease;
}
.site-header.is-scrolled { --header-h: 64px; }
.wordmark { display: flex; align-items: center; gap: 0.7rem; color: inherit; text-decoration: none; min-width: 0; }
.wordmark-mark { width: 40px; height: 40px; color: var(--accent-2); flex: 0 0 auto; transition: transform 0.25s ease; }
.site-header.is-scrolled .wordmark-mark { transform: scale(0.86); }
.wordmark-text { display: flex; flex-direction: column; min-width: 0; }
.wordmark-name { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; font-weight: 700; }
.wordmark-tagline { font-size: 0.75rem; opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.nav-panel { position: relative; }
.nav-toggle {
  list-style: none; cursor: pointer; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 999px;
}
.nav-toggle::-webkit-details-marker, .nav-toggle::marker { display: none; content: ""; }
.nav-toggle span:not(.sr-only),
.nav-toggle span:not(.sr-only)::before,
.nav-toggle span:not(.sr-only)::after {
  content: ""; display: block; width: 20px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle span:not(.sr-only)::before { position: absolute; top: -6px; }
.nav-toggle span:not(.sr-only)::after { position: absolute; top: 6px; }
.site-nav {
  display: flex; flex-direction: column; gap: 0.2rem;
  position: absolute; right: 0; top: calc(100% + 0.4rem);
  background: var(--header); padding: 0.7rem; border-radius: 14px;
  min-width: 180px; box-shadow: var(--shadow);
}
.site-nav a {
  color: var(--header-text); text-decoration: none; padding: 0.45rem 0.7rem;
  border-radius: 10px; font-weight: 600;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: color-mix(in srgb, #fff 14%, transparent); }
.site-nav--desktop { display: none; }
@media (min-width: 860px) {
  .nav-panel { display: none; }
  .site-nav--desktop {
    display: flex; flex-direction: row; gap: 0.15rem;
    position: static; background: none; padding: 0; box-shadow: none; min-width: 0;
  }
}

/* Progress */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.progress-bar { display: block; height: 100%; width: 0; background: var(--accent-2); }

/* Heroes */
.hero { position: relative; isolation: isolate; color: #fff; overflow: hidden; }
.hero--home { min-height: min(86vh, 760px); display: grid; }
.hero--post { min-height: min(62vh, 560px); display: grid; }
.hero-visual, .hero-overlay { grid-area: 1 / 1; }
.hero-visual { overflow: hidden; }
.hero-picture, .hero-picture img {
  width: 100%; height: 100%; min-height: inherit;
}
.hero-picture { margin: 0; height: 100%; }
.hero-picture img {
  object-fit: cover; width: 100%; height: 115%;
  transform: translateY(var(--parallax, 0px));
  will-change: transform;
}
@media (max-width: 720px), (prefers-reduced-motion: reduce) {
  .hero-picture img { height: 100%; transform: none !important; will-change: auto; }
}
.hero-overlay {
  display: flex; align-items: flex-end;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 10%, rgba(0,0,0,0.72) 100%);
  padding: 4.5rem 0 2.4rem;
}
.hero-copy { max-width: 42rem; }
.hero-kicker {
  letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem;
  margin: 0 0 0.6rem; font-weight: 700; color: var(--accent-2);
}
.hero h1 {
  font-family: var(--font-display); font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.08; margin: 0 0 0.8rem; text-wrap: balance;
}
.hero-intro, .hero-intro p { font-size: 1.15rem; max-width: 40rem; margin: 0; }
.hero-intro a { color: #fff; }
.article-byline { margin: 0; opacity: 0.9; font-size: 0.95rem; }
.hero-credit {
  position: absolute; right: 1rem; bottom: 0.6rem; margin: 0;
  font-size: 0.72rem; color: rgba(255,255,255,0.85);
}
.hero-credit a { color: inherit; }
.hero-credit--inline { position: static; color: var(--muted); margin: 0 0 1.2rem; }

/* Cards / listing */
.band { padding: 3.2rem 0 1rem; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.band-head h2, .listing-title, .related h2, .faq h2, .toc-title {
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2rem); margin: 0;
}
.band-more { font-weight: 700; text-decoration: none; }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .card-grid, .card-grid--three { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,0.12); }
.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-media, .card-media img { margin: 0; width: 100%; }
.card-media img, .carousel-card .card-media img {
  aspect-ratio: 16 / 10; object-fit: cover; width: 100%; height: auto;
}
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-kicker { margin: 0 0 0.3rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.card h2, .card h3, .carousel-body h3 {
  font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; margin: 0 0 0.4rem;
}
.card-desc { margin: 0 0 0.5rem; color: var(--muted); }
.card-meta { margin: 0; color: var(--muted); font-size: 0.85rem; }

/* Carousel */
.carousel {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding: 0.2rem; padding: 0.2rem 0 1rem; -webkit-overflow-scrolling: touch;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.carousel-card {
  flex: 0 0 min(78vw, 340px); scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.carousel-card:hover { transform: translateY(-4px); }
.carousel-link { color: inherit; text-decoration: none; display: block; }
.carousel-body { padding: 1rem 1.1rem 1.2rem; }
.carousel-controls { display: flex; gap: 0.4rem; }
.carousel-btn {
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1.4rem; cursor: pointer;
}
.carousel-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Posts */
.post-layout { display: grid; gap: 2rem; padding: 2rem 0 4rem; }
@media (min-width: 980px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) 260px; align-items: start; }
  .post-sidebar { position: sticky; top: calc(var(--header-h) + 1rem); }
}
.direct-answer {
  background: var(--bg-alt); border-left: 4px solid var(--accent);
  padding: 1rem 1.15rem; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.08rem; margin: 0 0 1.4rem;
}
.prose { max-width: 68ch; }
.prose h2, .prose h3 {
  font-family: var(--font-display); line-height: 1.2; margin: 2rem 0 0.7rem;
}
.prose h2 { font-size: 1.55rem; }
.prose p, .prose li { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose figure { margin: 1.6rem 0; }
.page-main, .page-hero { padding-top: 2.2rem; }
.article-header h1 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; }

.toc { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1rem 0.6rem; margin-bottom: 1rem; }
.toc-title { font-size: 1.05rem; margin-bottom: 0.5rem; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0.6rem; }
.toc li { margin: 0 0 0.4rem; }
.toc a { color: inherit; text-decoration: none; font-size: 0.92rem; }
.toc a:hover { color: var(--accent); }

.faq details {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.2rem 1rem; margin: 0 0 0.6rem;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 0.7rem 0; }
.related { margin-top: 2.5rem; }
.related h2 { margin-bottom: 1rem; }

/* Ad slots — reserved so later units do not shift layout */
.ad-slot {
  border: 1px dashed color-mix(in srgb, var(--muted) 40%, transparent);
  background: repeating-linear-gradient(-45deg, transparent, transparent 8px, color-mix(in srgb, var(--muted) 6%, transparent) 8px, color-mix(in srgb, var(--muted) 6%, transparent) 16px);
  border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); margin: 1.6rem 0;
}
.ad-slot--in-content { min-height: var(--ad-in-h); }
.ad-slot--sidebar { min-height: var(--ad-side-h); margin-top: 0; }
.ad-slot-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 979px) { .ad-slot--sidebar { display: none; } }

/* Reveal */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.is-in { opacity: 1; transform: none; }
}

/* Footer */
.site-footer { background: var(--bg-dark); color: var(--header-text); margin-top: 3rem; padding: 2.4rem 0 2rem; }
.footer-inner { display: grid; gap: 1rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.footer-tag, .footer-copy { margin: 0; opacity: 0.8; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.8rem 1.1rem; }
.footer-nav a { color: inherit; }

.media-credit, .credit-alt { font-size: 0.82rem; color: var(--muted); }
.credit-list { padding-left: 1.1rem; }
.credit-list li { margin-bottom: 0.8rem; }
.credit-alt { display: block; margin-top: 0.2rem; }

.mark-hero {
  min-height: min(52vh, 460px); display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent-2) 28%, transparent), transparent 45%),
    var(--bg-dark);
  color: var(--header-text); text-align: center; padding: 3rem 1rem;
}
.mark-stamp {
  border: 4px double color-mix(in srgb, var(--header-text) 80%, transparent);
  border-radius: 50%; width: min(280px, 70vw); height: min(280px, 70vw);
  display: grid; place-items: center; padding: 1.5rem;
  font-family: var(--font-display); letter-spacing: 0.04em;
  box-shadow: inset 0 0 0 8px color-mix(in srgb, var(--accent-2) 50%, transparent);
}
.mark-stamp strong { display: block; font-size: 1.35rem; }

/* Contact form */
.contact-form {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.6rem;
  margin: 1.6rem 0 2.2rem;
  max-width: 36rem;
}
.contact-form .form-row { margin: 0 0 1rem; }
.contact-form .form-row:last-child { margin-bottom: 0; }
.contact-form label {
  display: block;
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}
.contact-form textarea { min-height: 10rem; resize: vertical; }
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.contact-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.contact-submit {
  appearance: none;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
}
.contact-submit:hover { background: color-mix(in srgb, var(--accent) 82%, #000); }
.contact-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.contact-submit:disabled { opacity: 0.7; cursor: wait; }
.contact-alert {
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.2rem;
}
.contact-alert--ok {
  background: var(--bg-alt);
  border-left: 4px solid var(--accent);
}
.contact-alert--err {
  background: var(--bg-alt);
  border-left: 4px solid #b33a2b;
}
