/* ─────────────────────────────────────────────────────────────
   Themes — section styles on top of styles.css.
   Two views:
     ☆ Index  — the 7 themes as cards
     ☆ Primer — single theme: hero, voices, essay, teachings,
                dispatches, sister themes
   The active accent palette tints the themes (unlike tradition
   pages which tint by their own color).
   ───────────────────────────────────────────────────────────── */

html, body { min-height: 100%; }
body.theme-body {
  background: var(--bg);
  overflow-x: hidden;
}

/* ───────── header (sibling of traditions/dispatches) ───────── */
.thm-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 36px; min-height: 60px;
  background: color-mix(in srgb, var(--bg), transparent 10%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 50%);
}
.thm-brand {
  font-family: "Cinzel", serif;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  display: inline-flex; align-items: baseline; gap: 10px;
}
.thm-brand .sep { color: var(--muted); }
.thm-brand .sub { color: var(--text3); }
.thm-brand { white-space: nowrap; flex-shrink: 0; }
.thm-nav { display: flex; gap: 16px 18px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1100px) {
  .thm-brand .sep, .thm-brand .sub { display: none; }
  .thm-nav { gap: 18px; }
}
.thm-nav a {
  font-family: "Jost", sans-serif;
  font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  transition: color .2s;
  position: relative; padding: 4px 0;
}
.thm-nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--accent); transition: right 300ms ease;
}
.thm-nav a:hover, .thm-nav a.active { color: var(--accent-hi); }
.thm-nav a:hover::after, .thm-nav a.active::after { right: 0; }

/* ═══════════════════════════════════════════════════════════════
   INDEX
   ═══════════════════════════════════════════════════════════════ */

.tm-hero {
  text-align: center;
  padding: 88px 24px 36px;
  max-width: 900px;
  margin: 0 auto;
}
.tm-eyebrow {
  font-family: "Cinzel", serif;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
  display: inline-flex; align-items: center; gap: 14px;
}
.tm-eyebrow::before, .tm-eyebrow::after {
  content: ""; width: 36px; height: 1px; background: var(--border2);
}
.tm-title {
  font-family: "Cinzel", serif;
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1.05;
  color: var(--cream);
  margin-bottom: 22px;
  text-shadow: 0 0 80px color-mix(in srgb, var(--glow), transparent 50%);
}
.tm-title em { color: var(--accent); font-style: normal; }
.tm-lede {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(17px, 2vw, 21px);
  font-weight: 300;
  color: var(--text3);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 600px;
  text-wrap: pretty;
}

.tm-grid {
  max-width: 1200px;
  margin: 56px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tm-card {
  display: block;
  background: var(--bg);
  padding: 40px 32px 32px;
  text-decoration: none; color: inherit;
  cursor: pointer;
  position: relative;
  transition: background .25s;
  min-height: 280px;
}
.tm-card:hover { background: var(--bg2); }
.tm-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 30%, color-mix(in srgb, var(--accent-lo) 14%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.tm-card:hover::before { opacity: 1; }
.tm-card-glyph {
  display: flex; justify-content: center;
  margin-bottom: 22px;
  position: relative; z-index: 1;
  color: var(--accent);
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent), transparent 60%));
  transition: transform .4s cubic-bezier(.2,.7,.2,1), filter .35s;
}
.tm-card:hover .tm-card-glyph {
  transform: scale(1.08);
  filter: drop-shadow(0 0 22px color-mix(in srgb, var(--accent), transparent 40%));
}
.tm-card-name {
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
  position: relative; z-index: 1;
}
.tm-card-essence {
  text-align: center;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 17px;
  font-weight: 300;
  color: var(--text2);
  line-height: 1.45;
  margin-bottom: 18px;
  position: relative; z-index: 1;
  text-wrap: pretty;
}
.tm-card-stats {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: "Jost", sans-serif;
  font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
}
.tm-card-stats .num { color: var(--accent); font-family: "Cinzel", serif; }

.tm-explainer {
  max-width: 880px;
  margin: 96px auto 0;
  padding: 56px 32px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, color-mix(in srgb, var(--accent-lo) 12%, transparent), transparent 60%),
    var(--bg2);
  text-align: center;
}
.tm-explainer .eye {
  font-family: "Cinzel", serif;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.tm-explainer p {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(17px, 1.9vw, 21px);
  font-style: italic;
  font-weight: 300;
  color: var(--text2);
  line-height: 1.7;
  max-width: 60ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.tm-explainer em { color: var(--accent); font-style: italic; }

.tm-foot {
  max-width: 1100px;
  margin: 96px auto 0;
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 18px;
}
.tm-foot .brand {
  font-family: "Cinzel", serif;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.tm-foot .links {
  display: flex; gap: 18px;
  font-family: "Jost", sans-serif;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}
.tm-foot .links a { color: var(--text3); }
.tm-foot .links a:hover { color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   PRIMER DETAIL
   ═══════════════════════════════════════════════════════════════ */

.tp-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Jost", sans-serif;
  font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
  margin: 24px auto 0;
  max-width: 1100px;
  padding: 0 24px;
  transition: color .15s;
}
.tp-back:hover { color: var(--accent); }

/* hero */
.tp-hero {
  position: relative;
  text-align: center;
  padding: 56px 24px 72px;
  max-width: 880px;
  margin: 0 auto;
  overflow: visible;
}
.tp-hero-glow {
  position: absolute;
  top: -40px; left: 50%;
  transform: translateX(-50%);
  width: 900px; max-width: 100vw;
  height: 500px;
  background: radial-gradient(ellipse 50% 60% at 50% 40%, color-mix(in srgb, var(--accent-lo) 22%, transparent), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.tp-hero-glyph {
  position: relative; z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 160px; height: 160px;
  color: var(--accent);
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--accent), transparent 50%));
  margin: 0 auto 22px;
}
.tp-hero-eye {
  position: relative; z-index: 1;
  font-family: "Jost", sans-serif;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: inline-flex; align-items: center; gap: 14px;
}
.tp-hero-eye::before, .tp-hero-eye::after {
  content: ""; width: 28px; height: 1px; background: var(--accent-lo);
}
.tp-hero-name {
  position: relative; z-index: 1;
  font-family: "Cinzel", serif;
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--cream);
  margin-bottom: 20px;
}
.tp-hero-essence {
  position: relative; z-index: 1;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 300;
  color: var(--accent);
  line-height: 1.4;
  margin-bottom: 22px;
  text-wrap: balance;
  max-width: 30ch;
  margin-left: auto; margin-right: auto;
}
.tp-hero-dek {
  position: relative; z-index: 1;
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 300;
  color: var(--text3);
  line-height: 1.65;
  max-width: 48ch;
  margin: 0 auto;
  text-wrap: pretty;
}

/* follow chip in the theme hero */
.tp-hero-follow {
  position: relative; z-index: 1;
  margin-top: 28px;
  display: inline-flex;
  justify-content: center;
}

/* not-found state */
.tp-not-found {
  max-width: 560px;
  margin: 120px auto;
  padding: 56px 32px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
}
.tp-nf-glyph {
  font-family: "Cinzel", serif;
  font-size: 36px;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 18px;
}
.tp-not-found h2 {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--cream);
  margin-bottom: 12px;
}
.tp-not-found p {
  font-family: "Cormorant Garamond", serif;
  font-size: 17px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 32px;
}
.tp-nf-back {
  font-family: "Cinzel", serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

/* voices section — 4 cross-tradition quotes side by side */
.tp-voices {
  max-width: 1100px;
  margin: 56px auto 0;
  padding: 0 24px;
}
.tp-section-eye {
  font-family: "Cinzel", serif;
  font-size: 10px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 16px;
}
.tp-section-eye::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.tp-section-eye .count {
  color: var(--accent);
  font-family: "Cinzel", serif;
  letter-spacing: 0.1em;
}
.tp-voices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.tp-voice {
  display: block;
  background: var(--bg2);
  text-decoration: none; color: inherit;
  padding: 28px 26px 24px;
  transition: background .2s;
  position: relative;
}
.tp-voice:hover {
  background: var(--bg3);
}
.tp-voice .v-trad {
  font-family: "Jost", sans-serif;
  font-size: 9px; letter-spacing: 0.26em; text-transform: uppercase;
  margin-bottom: 14px;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--v-color, var(--text3));
}
.tp-voice .v-trad .swatch {
  width: 8px; height: 8px; border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 4px currentColor;
  flex-shrink: 0;
}
.tp-voice .v-source {
  position: relative; z-index: 1;
}
.tp-voice .v-quote {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 20px;
  font-weight: 300;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 16px;
  text-wrap: pretty;
}
.tp-voice .v-source {
  font-family: "Jost", sans-serif;
  font-size: 10px; letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: none;
}
.tp-voice:hover .v-quote { color: var(--v-color); }
.tp-voice .v-arrow {
  position: absolute;
  top: 24px; right: 24px;
  color: var(--v-color, var(--accent));
  opacity: 0; transform: translateX(-4px);
  transition: all .2s;
  font-size: 14px;
}
.tp-voice:hover .v-arrow { opacity: 1; transform: none; }

/* body essay */
.tp-essay {
  max-width: 720px;
  margin: 80px auto 0;
  padding: 0 24px;
}
.tp-essay p {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(19px, 2.3vw, 23px);
  font-weight: 300;
  line-height: 1.78;
  color: var(--text2);
  margin-bottom: 28px;
  text-wrap: pretty;
}
.tp-essay p:first-child {
  font-size: clamp(21px, 2.5vw, 25px);
  color: var(--text);
}
.tp-essay p strong { color: var(--cream); font-weight: 500; }
.tp-essay p em { color: var(--accent); font-style: italic; }
.tp-essay-glyph {
  display: flex; align-items: center; justify-content: center;
  margin: 32px 0 36px;
  color: var(--accent-lo);
  font-family: "Cinzel", serif;
  font-size: 14px;
}
.tp-essay-glyph::before, .tp-essay-glyph::after {
  content: ""; width: 60px; height: 1px;
  background: linear-gradient(to right, transparent, var(--border2), transparent);
  margin: 0 16px;
}

/* teachings list (cross-tradition) */
.tp-teachings-wrap {
  max-width: 1100px;
  margin: 96px auto 0;
  padding: 0 24px;
}
.tp-teachings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.tp-tcard {
  display: block;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
  background: var(--bg2);
  position: relative;
  transition: all .2s;
}
.tp-tcard:hover {
  border-color: var(--c, var(--accent-lo));
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--c, var(--accent-lo)) 5%, var(--bg2));
}
.tp-tcard .tc-trad {
  font-family: "Jost", sans-serif;
  font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase;
  margin-bottom: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--c);
}
.tp-tcard .tc-trad .swatch {
  width: 7px; height: 7px; border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.tp-tcard .tc-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 22px;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 6px;
  text-wrap: balance;
}
.tp-tcard .tc-source {
  font-family: "Jost", sans-serif;
  font-size: 10px; letter-spacing: 0.06em;
  color: var(--muted);
}
.tp-tcard:hover .tc-title { color: var(--c); }

/* dispatches list */
.tp-dispatches-wrap {
  max-width: 1100px;
  margin: 64px auto 0;
  padding: 0 24px;
}
.tp-dispatches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.tp-dcard {
  display: block;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 22px 24px;
  background: var(--bg2);
  transition: all .2s;
}
.tp-dcard:hover {
  border-color: var(--accent-lo);
  transform: translateY(-2px);
}
.tp-dcard .dc-meta {
  font-family: "Jost", sans-serif;
  font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.tp-dcard .dc-meta .kind { color: var(--accent); }
.tp-dcard .dc-title {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 22px;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 8px;
  text-wrap: balance;
}
.tp-dcard:hover .dc-title { color: var(--accent-hi); }
.tp-dcard .dc-sub {
  font-family: "Cormorant Garamond", serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text3);
  line-height: 1.5;
}

/* sister themes section */
.tp-sisters-wrap {
  max-width: 1100px;
  margin: 64px auto 0;
  padding: 0 24px;
}
.tp-sisters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.tp-sister {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: center;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
  text-decoration: none; color: inherit;
  transition: all .2s;
}
.tp-sister:hover {
  border-color: var(--accent-lo);
  background: var(--bg3);
}
.tp-sister-glyph {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  color: var(--accent);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent), transparent 60%));
}
.tp-sister-name {
  font-family: "Cinzel", serif;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.tp-sister-essence {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 15px;
  color: var(--text2);
  line-height: 1.4;
}

/* prev / next theme nav */
.tp-nav {
  max-width: 1100px;
  margin: 80px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .tp-nav { grid-template-columns: 1fr; }
}
.tp-nav a {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 4px;
  text-decoration: none; color: inherit;
  transition: all .2s;
}
.tp-nav a:last-child { flex-direction: row-reverse; text-align: right; }
.tp-nav a:hover { border-color: var(--accent-lo); background: var(--bg3); }
.tp-nav-glyph {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent), transparent 60%));
}
.tp-nav-body { flex: 1; }
.tp-nav-label {
  font-family: "Jost", sans-serif;
  font-size: 9px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.tp-nav-name {
  font-family: "Cinzel", serif;
  font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
}

.tp-foot {
  max-width: 1100px;
  margin: 96px auto 0;
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 18px;
}
.tp-foot-brand {
  font-family: "Cinzel", serif;
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.tp-foot .links {
  display: flex; gap: 18px;
}
.tp-foot .links a {
  font-family: "Jost", sans-serif;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text3);
}
.tp-foot .links a:hover { color: var(--accent); }

/* empty states */
.tp-empty {
  padding: 32px 24px;
  border: 1px dashed var(--border);
  border-radius: 4px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 17px;
  color: var(--text3);
  text-align: center;
  line-height: 1.5;
  background: color-mix(in srgb, var(--bg2), transparent 60%);
}

@media (max-width: 720px) {
  .thm-head { padding: 0 16px; }
  .thm-nav { gap: 14px; }
  .tm-hero { padding: 56px 20px 24px; }
  .tp-hero { padding: 40px 20px 56px; }
  .tp-hero-glyph { width: 120px; height: 120px; }
}


/* ───────── mobile nav scroll fix ─────────
   Force the nav to be a scrollable horizontal strip so all links remain
   reachable when there's not enough room. Without min-width:0 + flex:1,
   flex layout lets the nav overflow the viewport (which body clips). */
@media (max-width: 800px) {
  .thm-head { gap: 12px; }
  .thm-brand .sep, .thm-brand .sub { display: none; }
  .thm-nav {
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-end;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .thm-nav::-webkit-scrollbar { display: none; }
  .thm-nav a {
    white-space: nowrap;
    flex-shrink: 0;
  }
}
