/* The Greater Order: parchment editorial mode (light) and midnight navy (dark).
   Palette and type: Wiki work/brands/thegreaterorder/STYLE_GUIDE.md. Mobile first. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --navy: #172B40;
  --parchment: #F3F0E8;
  --gold: #D0B477;
  --green: #526B62;
  --terracotta: #9C5145;
  --charcoal: #343A40;

  --bg: var(--parchment);
  --surface: #FBF9F4;
  --ink: var(--charcoal);
  --ink-soft: #5A6168;
  --heading: var(--navy);
  --link: var(--navy);
  --rule: rgba(208, 180, 119, 0.7);
  --button-bg: var(--navy);
  --button-ink: var(--parchment);
  --focus: var(--navy);
  --notice-bg: #EFE8D6;

  --font-title: "Cormorant Garamond", "Libre Baskerville", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --radius: 4px;
  --max: 1120px;
  --measure: 68ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--navy);
    --surface: #1D3550;
    --ink: var(--parchment);
    --ink-soft: #C9C4B8;
    --heading: var(--parchment);
    --link: var(--gold);
    --rule: rgba(208, 180, 119, 0.4);
    --button-bg: var(--gold);
    --button-ink: var(--navy);
    --focus: var(--gold);
    --notice-bg: #20384F;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

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

a { color: var(--link); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--heading);
  line-height: 1.15;
  margin: 1.6em 0 0.5em;
}
h1 { font-size: clamp(2rem, 7vw, 3.25rem); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.3em; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2rem); letter-spacing: 0.02em; }
h3 { font-size: 1.3rem; margin-top: 0.4em; }
p, ul, ol { margin: 0 0 1em; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

main { padding-top: 1.5rem; padding-bottom: 3rem; }

.skip-link {
  position: absolute; left: 8px; top: -100px;
  background: var(--button-bg); color: var(--button-ink);
  padding: 10px 14px; z-index: 10;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Header and navigation: links wrap into a 3-column grid on phones, one row on desktop. No JS. */
.site-header { border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.header-inner { display: flex; flex-direction: column; gap: 0.5rem; padding-top: 0.75rem; padding-bottom: 0.5rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--heading); min-height: 48px; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.site-nav a {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 6px;
  font-size: 0.92rem; text-align: center; text-decoration: none; color: var(--ink);
  border-bottom: 2px solid transparent;
}
.site-nav a[aria-current="page"] { border-bottom-color: var(--gold); color: var(--heading); font-weight: 600; }
.site-nav a:hover { color: var(--heading); border-bottom-color: var(--rule); }

@media (min-width: 860px) {
  .header-inner { flex-direction: row; align-items: center; justify-content: space-between; }
  .site-nav { display: flex; gap: 0.25rem; }
  .site-nav a { padding: 0 12px; font-size: 0.95rem; }
}

/* Buttons: 48px tall touch targets. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--button-bg); color: var(--button-ink);
  border: 2px solid var(--button-bg); border-radius: var(--radius);
  font: 600 0.95rem/1 var(--font-body); letter-spacing: 0.03em;
  text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button-quiet { background: transparent; color: var(--link); border-color: var(--rule); }
.button[hidden] { display: none; }
.button .icon {
  width: 18px;
  height: 18px;
  margin-right: 0.45rem;
  flex-shrink: 0;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
}
.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-row .button { padding: 0 16px; font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* Page parts */
.eyebrow { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.eyebrow a { color: inherit; }
.lede { font-size: 1.2rem; color: var(--ink); max-width: var(--measure); }
.meta { font-size: 0.9rem; color: var(--ink-soft); }
.page-head { margin-bottom: 1.5rem; }
.prose { max-width: var(--measure); }
.small-head { font-family: var(--font-body); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); margin: 1.5em 0 0.5em; }

.hero { display: grid; gap: 1.25rem; align-items: center; padding: 1rem 0 2rem; border-bottom: 1px solid var(--rule); }
.hero-crest { width: 160px; height: 160px; border-radius: 50%; justify-self: center; }
.hero h1 { margin-top: 0.2em; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 240px 1fr; gap: 2.5rem; padding: 2rem 0 3rem; }
  .hero-crest { width: 220px; height: 220px; }
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } .grid-wide { grid-template-columns: repeat(2, 1fr); } }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 1rem 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.card-body > :last-child { margin-bottom: 0; }
.card-title { margin: 0.2em 0; font-size: 1.4rem; }
.card-title a { color: var(--heading); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.video-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.game-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.game-card .button { align-self: flex-start; margin-top: auto; }

/* Books grid and cards */
.book-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 2rem; }
.book-jump-link { display: inline-block; padding: 0.35rem 0.8rem; border: 1px solid var(--rule); border-radius: 999px; font-size: 0.85rem; text-decoration: none; color: var(--link); background: var(--surface); transition: border-color 0.15s ease; }
.book-jump-link:hover { border-color: var(--gold); text-decoration: none; }
.book-count { color: var(--ink-soft); font-weight: 400; font-size: 0.85em; }

.grid-books { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-books { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid-books { grid-template-columns: repeat(3, 1fr); } }
.book-card { display: flex; flex-direction: column; transition: border-color 0.15s ease; }
.book-card:hover { border-color: var(--gold); }
.book-cover-wrap { padding: 0.75rem 0.75rem 0.25rem; display: flex; justify-content: center; }
.book-cover { width: 100%; max-width: 230px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--rule); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); }
.book-card .card-body { padding: 0.75rem 1rem 1rem; }
.book-card .card-title { font-size: 1.2rem; margin: 0.1em 0; }
.book-author { font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); margin: 0.05rem 0 0.35rem; }
.book-footer { margin-top: auto; padding-top: 0.35rem; display: flex; flex-direction: column; gap: 0.5rem; }
.button-amazon { align-self: flex-start; }
.badge-topic { background: var(--navy); color: var(--parchment); }
.affiliate-notice { margin: 1.25rem 0 1.5rem; }
.affiliate-notice .notice-title { margin-top: 0; font-size: 1.15rem; }
.book-section { margin: 2.25rem 0; }
.book-section-title { font-size: 1.45rem; margin: 0 0 1.1rem; padding-bottom: 0.4rem; border-bottom: 2px solid var(--rule); color: var(--heading); }
.book-desc { font-size: 0.93rem; margin-bottom: 0.5rem; line-height: 1.45; }
.book-free-links { display: flex; flex-wrap: nowrap; gap: 0.35rem; align-items: center; margin: 0; font-size: 0.8rem; white-space: nowrap; }
.free-link { display: inline-block; padding: 2px 6px; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; font-size: 0.78rem; color: var(--link); white-space: nowrap; }
.free-link:hover { border-color: var(--gold); }
.tagline { font-family: var(--font-title); font-size: 1.2rem; font-weight: 600; margin: 0; }

.badge { display: inline-block; align-self: flex-start; margin: 0; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--parchment); }
.badge-released { background: var(--green); }
.badge-dev { background: var(--terracotta); }

.upcoming { list-style: none; padding: 0; display: grid; gap: 0.75rem; }
.upcoming li { border-left: 3px solid var(--gold); padding: 0.25rem 0 0.25rem 1rem; }
.upcoming h3 { margin: 0 0 0.2em; }
.upcoming p { margin: 0; }

.steps { list-style: none; padding: 0; display: grid; gap: 1rem; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.steps li { counter-increment: step; border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.steps h3::before { content: counter(step, upper-roman) ". "; color: var(--gold); }
.steps p { margin: 0; }

.pillars { padding-left: 1.4rem; }
.pillars li::marker { font-family: var(--font-title); font-weight: 700; color: var(--gold); }
.pillars h3 { margin-bottom: 0.2em; }
.checklist li { margin-bottom: 0.4em; }

.callout, .notice { background: var(--notice-bg); border: 1px solid var(--rule); border-left: 4px solid var(--gold); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 2rem 0; }
.callout h2, .notice h2 { margin-top: 0; font-size: 1.5rem; }
.notice > :last-child, .callout > :last-child { margin-bottom: 0; }
.notice-quiet { color: var(--ink-soft); font-style: italic; }

.alert { border-left: 4px solid var(--terracotta); background: var(--notice-bg); padding: 0.9rem 1.1rem; border-radius: var(--radius); max-width: var(--measure); }
.alert:empty, .validation-summary-valid { display: none; }

/* Video page: the 9:16 player sits beside the text on desktop, above it on phones. */
.video-page { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .video-page { grid-template-columns: minmax(280px, 380px) 1fr; gap: 2.5rem; align-items: start; } }
.player { position: relative; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe, .player-poster, .player-poster img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-poster img { object-fit: cover; }
.play-button { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: rgba(23, 43, 64, 0.85); border: 2px solid var(--gold); }
.play-button::after { content: ""; position: absolute; left: 30px; top: 22px; border-style: solid; border-width: 16px 0 16px 26px; border-color: transparent transparent transparent var(--gold); }
.player-empty { display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); }
.video-info h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.link-row { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Idea form */
.idea-form { max-width: 880px; margin-top: 1.5rem; }
.idea-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.idea-form fieldset:disabled { opacity: 0.55; }
.field { display: flex; flex-direction: column; margin-bottom: 1.25rem; }
.field label { font-weight: 600; color: var(--heading); margin-bottom: 0.25rem; }
.hint { font-size: 0.9rem; color: var(--ink-soft); margin: 0 0 0.4rem; }
.field-pair { display: grid; gap: 0 1.25rem; }
@media (min-width: 760px) { .field-pair { grid-template-columns: 1fr 1fr; } }
input[type="email"], input[type="text"], textarea {
  width: 100%; min-height: 48px; padding: 12px 14px;
  font: inherit; font-size: 1rem; /* 16px stops iOS zooming on focus */
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--ink-soft); border-radius: var(--radius);
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { border-color: var(--focus); }
.input-validation-error { border-color: var(--terracotta) !important; }
.field-error { color: var(--terracotta); font-size: 0.9rem; margin-top: 0.3rem; }
@media (prefers-color-scheme: dark) { .field-error { color: #E2A497; } }
.field-check { flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 0.75rem; }
.field-check input { width: 24px; height: 24px; margin: 2px 0 0; flex: none; accent-color: var(--button-bg); }
.field-check label { flex: 1; font-weight: 500; color: var(--ink); }
.field-check .field-error { flex-basis: 100%; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 calc(2rem + env(safe-area-inset-bottom)); text-align: center; }
.divider { display: flex; justify-content: center; margin-bottom: 1rem; }
.divider span { width: 10px; height: 10px; background: var(--gold); transform: rotate(45deg); box-shadow: -40px 40px 0 -4px transparent; }
.footer-tagline { font-family: var(--font-title); font-weight: 700; font-size: 1.4rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--heading); }
.footer-promise, .footer-small { font-size: 0.88rem; color: var(--ink-soft); }
.social-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 1rem 0; }
.page-head .social-links { justify-content: flex-start; }

@media (prefers-reduced-motion: no-preference) {
  .button, .site-nav a { transition: border-color 0.15s ease, filter 0.15s ease; }
}

/* Feed and post pages */
.feed { container-type: inline-size; }

/* Feed Tabs */
.feed-tabs-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2px solid var(--rule);
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.tab-list {
  display: flex;
  gap: 1.5rem;
  margin-bottom: -2px;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.25rem;
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover {
  color: var(--heading);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.tab-btn.active, .tab-btn[aria-selected="true"] {
  color: var(--heading);
  border-bottom-color: var(--gold);
}
.tab-count {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
}
.feed-meta {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}
.feed-meta .rss-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.feed-meta .rss-link:hover {
  color: var(--heading);
  border-color: var(--gold);
}
.tab-panel[hidden] {
  display: none;
}
.empty-feed {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 1.05rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  margin: 1rem 0;
}

/* Mosaic: a video tile is 1 column x 2 rows at 9:16, an article tile is 1 row; dense flow fills the holes. */
.grid-feed {
  --cols: 1;
  --gap: 1.25rem;
  --col: calc((100cqi - (var(--cols) - 1) * var(--gap)) / var(--cols));
  gap: var(--gap);
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: calc((var(--col) * 16 / 9 - var(--gap)) / 2);
  grid-auto-flow: dense;
}
@media (min-width: 600px) { .grid-feed { --cols: 2; } }
@media (min-width: 960px) { .grid-feed { --cols: 3; } }

/* Research grid for long-form blogs */
.grid-research {
  --cols: 1;
  --gap: 1.75rem;
  gap: var(--gap);
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
  grid-auto-flow: row;
  align-items: stretch;
}
@media (min-width: 760px) {
  .grid-research {
    --cols: 2;
    grid-template-columns: repeat(2, 1fr);
  }
}
.post-article {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.post-article:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.post-article .post-thumb {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
}
.post-article .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.post-article .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.75rem 1.75rem;
  gap: 0.6rem;
}
.post-article .meta {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.1rem;
}
.post-article .meta .kind {
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.post-article .card-title {
  font-family: var(--font-title);
  font-size: 1.85rem;
  line-height: 1.25;
  margin: 0.15rem 0 0.4rem;
}
.post-article .card-title a {
  color: var(--heading);
  text-decoration: none;
}
.post-article .card-title a:hover {
  color: var(--link);
  text-decoration: underline;
}
.post-article .card-body > p:not(.meta) {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.post-thumb { position: relative; display: block; }
.post-thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post-thumb-placeholder { width: 100%; aspect-ratio: 16 / 10; background: var(--surface); display: flex; align-items: center; justify-content: center; }

.post-video { grid-row: span 2; position: relative; }
.post-video .post-thumb, .post-video .post-thumb img, .post-video .post-thumb video { height: 100%; aspect-ratio: auto; }
.post-video .card-body { position: absolute; left: 0; right: 0; bottom: 0; padding-top: 3rem; background: linear-gradient(transparent, rgba(23, 43, 64, 0.92)); color: var(--parchment); pointer-events: none; }
.post-video .card-body a { pointer-events: auto; color: var(--parchment); }
.post-video .meta { color: var(--gold); }
.post-video .card-body > p:not(.meta) { display: none; }
.play-badge { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: rgba(23, 43, 64, 0.85); border: 2px solid var(--gold); }
.play-badge::after { content: ""; position: absolute; left: 23px; top: 17px; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent var(--gold); }
.grid-videos {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  grid-auto-rows: auto;
  grid-auto-flow: row;
  align-items: stretch;
}
.yt-card {
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.yt-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.yt-player {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 520px;
  width: 100%;
  background: #111F2E;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.yt-player img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.yt-play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(23, 43, 64, 0.88);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s, background 0.15s;
}
.yt-play-btn:hover { transform: scale(1.08); background: var(--navy); }
.yt-card .card-body { padding: 1.125rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex: 1; gap: 0.55rem; }
.yt-card .card-title { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.yt-summary { font-size: 0.92rem; line-height: 1.5; margin: 0; }
.yt-actions { margin-top: auto; padding-top: 0.5rem; }
.yt-watch-link { font-size: 0.9rem; font-weight: 700; }
@media (max-width: 768px) {
  .grid-videos { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .yt-player { max-height: 460px; }
}
@media (max-width: 576px) {
  .grid-videos { grid-template-columns: 1fr; }
}
.kind { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem; }

.post-page { display: grid; gap: 1.5rem; }
.post-page-video { grid-template-columns: 1fr; }
.post-page-slideshow { grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .post-page-video, .post-page-slideshow { grid-template-columns: minmax(280px, 400px) 1fr; gap: 0 2.5rem; align-items: start; }
  .post-page-video .post-body, .post-page-video .post-foot,
  .post-page-slideshow .post-body, .post-page-slideshow .post-foot { grid-column: 2; }
}
.post-page video.player { display: block; position: static; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }

/* Slideshow Component */
.slideshow-col { width: 100%; max-width: 420px; margin: 0 auto; }
.slideshow-player {
  position: relative; width: 100%; background: #111F2E; border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.slide-viewport { position: relative; width: 100%; aspect-ratio: 9 / 16; background: #000; overflow: hidden; }
.slide-item {
  position: absolute; inset: 0; display: none; flex-direction: column; justify-content: space-between;
  align-items: center; padding: 1rem; background: #000; color: #fff; opacity: 0; transition: opacity 0.2s ease-in-out;
}
.slide-item.active { display: flex; opacity: 1; }
.slide-image-wrapper { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.slide-image-wrapper img { width: 100%; height: 100%; object-fit: contain; }
.slide-caption {
  position: relative; z-index: 2; width: 100%; padding: 0.65rem 0.9rem; text-align: center;
  font-weight: 700; font-size: 0.95rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(17, 31, 46, 0.9); border: 1px solid var(--rule); border-radius: 4px;
  color: var(--gold); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.slide-caption-top { margin-top: 0.5rem; }
.slide-caption-bottom { margin-bottom: 0.5rem; }
.slide-role-badge {
  position: absolute; top: 0.6rem; right: 0.6rem; z-index: 3; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; padding: 0.15rem 0.5rem; background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--gold); color: var(--gold); border-radius: 3px;
}
.slideshow-controls {
  display: flex; align-items: center; justify-content: space-between; padding: 0.65rem 1rem;
  background: var(--surface); border-top: 1px solid var(--rule);
}
.slide-nav-btn {
  background: var(--surface-dark, #172B40); color: var(--parchment, #F3F0E8); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 0.35rem 0.85rem; font-size: 0.88rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
}
.slide-nav-btn:hover { border-color: var(--gold); color: var(--gold); }
.slide-indicator { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); }
.slide-dots {
  display: flex; justify-content: center; gap: 0.4rem; padding: 0.4rem 1rem 0.65rem; background: var(--surface);
}
.slide-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--rule); border: none; cursor: pointer; padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}
.slide-dot.active { background: var(--gold); transform: scale(1.3); }

/* Feed card for slideshow */
.post-slideshow { grid-row: span 2; position: relative; }
.post-slideshow .post-thumb, .post-slideshow .post-thumb img { height: 100%; aspect-ratio: auto; }
.post-slideshow .card-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding-top: 3rem;
  background: linear-gradient(transparent, rgba(23, 43, 64, 0.92)); color: var(--parchment); pointer-events: none;
}
.post-slideshow .card-body a { pointer-events: auto; color: var(--parchment); }
.post-slideshow .meta { color: var(--gold); }
.post-slideshow .card-body > p:not(.meta) { display: none; }
.slideshow-badge {
  position: absolute; top: 10px; right: 10px; padding: 0.2rem 0.6rem; border-radius: var(--radius);
  background: rgba(23, 43, 64, 0.85); border: 1px solid var(--gold); color: var(--gold);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.post-info h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); }
.post-page-article .post-info, .post-page-article .post-body { max-width: var(--measure); }

.post-body { font-size: 1.07rem; }
.post-body h2 { font-size: 1.7rem; }
.post-body h3 { font-size: 1.35rem; margin-top: 1.4em; }
.post-body img { margin: 1.5rem 0; border-radius: var(--radius); }
.post-body blockquote { margin: 1.5rem 0; padding: 0.25rem 0 0.25rem 1.1rem; border-left: 3px solid var(--gold); color: var(--ink-soft); font-style: italic; }
.post-body pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.9rem 1rem; font-size: 0.9rem; }
.post-body code { font-size: 0.92em; }
.post-body table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.5rem 0; }
.post-body th, .post-body td { border: 1px solid var(--rule); padding: 0.45rem 0.7rem; text-align: left; }
.post-body hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* Admin */
.admin-block { max-width: 880px; margin-bottom: 2.5rem; }
.admin-form input[type="password"], .admin-form input[type="url"], .admin-form input[type="file"] {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 1rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--ink-soft); border-radius: var(--radius);
}
.admin-form fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0 0 1.25rem; }
.admin-form legend { font-weight: 600; color: var(--heading); padding: 0 0.3rem; }
.kind-pick label { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; margin-right: 1.1rem; }
.kind-pick input { width: 20px; height: 20px; accent-color: var(--button-bg); }
.admin-form progress { width: 100%; height: 12px; margin-bottom: 1rem; accent-color: var(--gold); }
.admin-post { margin-bottom: 1rem; }
.admin-post details { border-top: 1px solid var(--rule); padding: 0.5rem 0; }
.admin-post summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--heading); }

/* Content page */
.table-scroll { overflow-x: auto; }
.content-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.content-table th, .content-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.content-table th { color: var(--heading); font-weight: 600; }

/* Inbox page */
.inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.inbox-tabs, .inbox-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.inbox-select {
  min-height: 48px;
  padding: 0 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
}
.inbox-table td:nth-child(6) {
  min-width: 240px;
  white-space: pre-wrap;
  word-break: break-word;
}
.action-button {
  min-height: 44px;
  padding: 0 16px;
  font-size: 0.9rem;
}

/* Manage page (/manage): phone first, one column of cards. */
.manage-head { margin-bottom: 0.5rem; }
.button-small { min-height: 44px; padding: 0 14px; font-size: 0.88rem; }
.manage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.manage-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 2px solid var(--rule); margin-bottom: 16px; }
.manage-tab {
  min-height: 48px; background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  font: 600 1rem/1 var(--font-body); color: var(--ink-soft); cursor: pointer;
}
.manage-tab[aria-selected="true"] { color: var(--heading); border-bottom-color: var(--gold); }
.tab-count { display: inline-block; min-width: 1.5em; padding: 2px 6px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 0.8rem; }
.tab-count[hidden] { display: none; }
.manage-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.manage-toolbar .inbox-select { flex: 1 1 180px; }
.manage-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.manage-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.manage-card-head {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center;
  padding: 14px 16px; background: transparent; border: 0; text-align: left; cursor: pointer; color: var(--ink); font: inherit;
}
.manage-card-title { font-weight: 600; font-size: 1.12rem; line-height: 1.35; overflow-wrap: anywhere; color: var(--heading); }
.manage-card-body { padding: 14px 16px 16px; border-top: 1px solid var(--rule); font-size: 1rem; line-height: 1.5; }
.manage-card-body textarea { width: 100%; font-size: 16px; }
/* Scaled player: 42.5vh tall (50% of original 85vh) */
.manage-player { position: relative; width: min(100%, calc(42.5vh * 9 / 16)); aspect-ratio: 9 / 16; margin: 12px auto; background: #000; border-radius: var(--radius); overflow: hidden; }
.manage-player iframe, .manage-player video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; border: 1px solid var(--rule); }
.pill-new { background: var(--gold); color: var(--navy); border-color: var(--gold); margin-left: 6px; }
.pill-pending, .pill-waiting { background: var(--notice-bg); color: var(--ink); }
.pill-approved, .pill-posted { background: var(--green); color: #fff; border-color: var(--green); }
.pill-rejected { background: transparent; color: var(--ink-soft); }
.manage-failures { color: var(--terracotta); margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; }
.manage-failures li { margin: 0.2rem 0; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.comment-new { border-left: 4px solid var(--gold); padding-left: 10px; }
.comment-meta { margin: 0 0 4px; font-size: 0.9rem; }
.comment-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.comment-actions li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.manage-card-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.9rem; }
.brand-chip { display: inline-block; padding: 1px 8px; border-radius: var(--radius); border: 1px solid var(--gold); color: var(--heading); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; }
.pill-queued { background: var(--navy); color: var(--parchment); border-color: var(--navy); }
@media (prefers-color-scheme: dark) { .pill-queued { background: var(--gold); color: var(--navy); border-color: var(--gold); } }
.manage-status { font-weight: 600; }
.manage-section { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 4px; }
.manage-section .small-head { margin-top: 0.75em; }
/* Phone: filters two per row, search on its own row. Wider: one row. */
.manage-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.filter { display: flex; flex-direction: column; min-width: 0; }
.filter label { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.filter-wide { grid-column: 1 / -1; }
.filter input, .filter select { width: 100%; min-height: 44px; font-size: 16px; }
.note-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.note { border-left: 3px solid var(--gold); padding: 4px 0 4px 10px; }
.note-done { border-left-color: var(--rule); opacity: 0.7; }
.note-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.platforms { border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 10px 10px; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.platforms legend { font-weight: 600; color: var(--heading); padding: 0 4px; }
.platform-check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.platform-check input { width: 22px; height: 22px; accent-color: var(--button-bg); }
.manage-queue { display: grid; grid-template-columns: repeat(4, 1fr); }
.manage-queue .button { width: 100%; padding: 0 6px; font-size: 0.8rem; }
.manage-decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.manage-decisions .button { width: 100%; }
.button-approve { background: var(--green); border-color: var(--green); color: var(--parchment); }
.button-approve:hover { filter: brightness(1.12); }
.button-return { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.button-return:hover { filter: brightness(1.08); }
.button-reject { background: transparent; border-color: var(--terracotta); color: var(--terracotta); }
.button-reject:hover { background: rgba(156, 81, 69, 0.1); }
.manage-details { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 6px; }
.manage-details summary { font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer; padding: 6px 0; }
.manage-details summary:hover { color: var(--heading); }
.manage-details[open] summary { margin-bottom: 8px; }
.platform-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.platform-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--rule);
  color: var(--heading); text-decoration: none; font-size: 0.9rem; font-weight: 600;
}
.platform-link:hover { border-color: var(--gold); filter: brightness(1.05); }
@media (min-width: 720px) {
  .manage-card-head { grid-template-columns: 1fr auto; }
  .manage-filters { grid-template-columns: 2fr 1fr 1fr; }
  .filter-wide { grid-column: auto; }
  .manage-decisions { display: flex; }
  .manage-decisions .button { width: auto; }
}
.run-list { font-size: 0.9rem; color: var(--ink-soft); padding-left: 1.1rem; }

/* Compass: one SVG chart per version. Green and terracotta tint the two sides; gold draws the rules. */
.compass-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.compass-tabs a {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 48px; padding: 0.4rem 0.9rem;
  border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 600; line-height: 1.25;
}
.compass-tabs a[aria-current="page"] { border-color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); color: var(--heading); }
.tab-kind { font-size: 0.75rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

.compass-layout { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 960px) { .compass-layout { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 2rem; } }
.compass-figure { margin: 0; }
.compass-board { position: relative; }
.compass-svg { display: block; width: 100%; height: auto; aspect-ratio: 1; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); touch-action: manipulation; }
.compass-svg .side-low { fill: var(--terracotta); fill-opacity: 0.08; }
.compass-svg .side-high { fill: var(--green); fill-opacity: 0.1; }
.compass-svg .grid { stroke: var(--rule); stroke-width: 1; stroke-opacity: 0.5; }
.compass-svg .mid { stroke: var(--gold); stroke-width: 3; }
.compass-svg .quadrant { fill: var(--ink-soft); fill-opacity: 0.75; font: 600 22px var(--font-body); letter-spacing: 0.04em; }
.compass-svg .tick { fill: var(--ink-soft); font: 500 20px var(--font-body); }
.compass-svg .dot circle { fill: var(--heading); stroke: var(--gold); stroke-width: 3; }
.compass-svg .dot text, .compass-svg .custom-points text { fill: var(--ink); font: 600 24px var(--font-body); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.compass-svg .dot:hover circle, .compass-svg .dot:focus-visible circle, .compass-svg .dot.is-selected circle { fill: var(--gold); stroke: var(--heading); stroke-width: 5; }
.compass-svg .dot:focus-visible { outline: none; }
.compass-svg .dot.is-dim { opacity: 0.15; }
.compass-svg.no-codes .dot text { display: none; }
.compass-svg.no-codes .dot:hover text, .compass-svg.no-codes .dot.is-selected text { display: inline; }
.compass-svg .custom-points circle { fill: none; stroke: var(--gold); stroke-width: 4; stroke-dasharray: 6 4; }
.compass-readout { position: absolute; left: 0.5rem; bottom: 0.5rem; margin: 0; padding: 0.15rem 0.5rem; font-size: 0.8rem; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); pointer-events: none; }
.compass-readout[hidden] { display: none; }

.axis-label { margin: 0.35rem 0; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--heading); }
.axis-top, .axis-bottom { text-align: center; }
.axis-x { display: flex; justify-content: space-between; gap: 1rem; }
.axis-x .axis-label:last-child { text-align: right; }
.compass-figure figcaption { margin-top: 0.5rem; }

.compass-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.compass-tools[hidden], .custom-form[hidden] { display: none; }
.compass-tools input { flex: 1 1 10rem; }
.compass-tools select, .custom-form input[type="range"] { min-height: 48px; font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-soft); border-radius: var(--radius); padding: 0 0.6rem; }
.custom-form input[type="range"] { padding: 0; accent-color: var(--gold); border: 0; background: transparent; }

.compass-list { list-style: none; padding: 0; margin: 0 0 1rem; border-top: 1px solid var(--rule); }
@media (min-width: 960px) { .compass-list { max-height: 34rem; overflow-y: auto; } }
.compass-list li { border-bottom: 1px solid var(--rule); }
.compass-list li.is-selected { background: var(--notice-bg); box-shadow: inset 3px 0 0 var(--gold); }
.compass-list li[hidden] { display: none; }
.compass-list summary { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 0.5rem; align-items: center; min-height: 48px; padding: 0 0.6rem; cursor: pointer; }
.compass-list .code { font-weight: 600; letter-spacing: 0.06em; color: var(--ink-soft); }
.compass-list .name { font-weight: 600; color: var(--heading); }
.compass-list .xy { font-size: 0.85rem; color: var(--ink-soft); white-space: nowrap; }
.point-body { padding: 0 0.75rem 0.75rem; }
.point-body p { margin: 0 0 0.5em; font-size: 0.95rem; }
.custom-form { margin-top: 1.5rem; padding-top: 0.5rem; border-top: 1px solid var(--rule); }
.compass-method { margin-top: 2.5rem; }
/* Phones draw the 1000-unit chart at about 350 px, so chart text needs bigger units to stay readable. */
@media (max-width: 600px) {
  .compass-svg .dot text, .compass-svg .custom-points text { font-size: 40px; stroke-width: 8px; }
  .compass-svg .quadrants { display: none; }
  .compass-svg .tick { font-size: 32px; }
  .compass-svg .dot circle { stroke-width: 5; }
}
