/* =====================================================================
   exalt.css — the inline exaltations animation (namespaced .ex-*)
   ---------------------------------------------------------------------
   Loaded by exaltations.html AFTER base.css / pages.css / de.css.
   Everything is scoped under .exalt-anim so it never collides with the
   shared site styles — this is what lets the animation live directly in
   the page (no iframe). Colours come from base.css tokens; the two
   accent colours (primary red / secondary blue) are set inline by the
   engine so they also work on SVG fills/strokes.
   ===================================================================== */

/* ---- single-column shell: animation on top, text below (more room
        for the wheel; identical to the former mobile layout) ---- */
.exalt-anim {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.4vw, 28px);
}

/* left: the wheel in a faintly-tinted box */
.ex-figure {
  background: var(--c-cloud);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: clamp(18px, 2.4vw, 30px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vh, 22px);
}
.ex-svgholder { width: 100%; max-width: 640px; margin: 0 auto; }
.ex-svg {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

/* right: the synced text in a white box */
.ex-text {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: clamp(22px, 2.8vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- static wheel ---- */
.ex-ring { fill: none; stroke: var(--c-powder); stroke-width: 1.4; }
.ex-ring--ghost { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 7; opacity: 0.8; }
.ex-cusp { stroke: var(--c-powder); stroke-width: 1; opacity: 0.7; }
.ex-cusp--ext { stroke: var(--c-haze); stroke-width: 0.8; stroke-dasharray: 1.5 6; opacity: 0.55; }
.ex-centre { fill: var(--c-stone); }
.ex-sign { color: var(--c-slate); }
.ex-sign use { color: inherit; }

/* ---- a transient step ---- */
.ex-step { opacity: 0; transition: opacity 0.5s ease; }
.ex-step--in { opacity: 1; }
.ex-step--out { opacity: 0; }

.ex-signhalo { fill: none; stroke-width: 2; opacity: 0.45; }
.ex-signlabel {
  font-family: 'Noto Sans', sans-serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.92;
}
.ex-line { fill: none; stroke-width: 3; opacity: 0.85; transition: stroke-dashoffset 0.85s ease; }
.ex-arrow { opacity: 0; transition: opacity 0.3s ease 0.7s; }
.ex-step--in .ex-arrow { opacity: 0.9; }

.ex-ghost { opacity: 0.3; }
.ex-ghost use { color: inherit; }

/* travelling token: a solid coloured disc carrying a white glyph, fully
   visible from the first frame; it glides via the CSS transform transition */
.ex-disc { opacity: 0.9; transition: opacity 0.4s ease; }
.ex-trav {
  transition: transform 1.15s cubic-bezier(.4,.05,.2,1);
}
.ex-trav-glyph { color: #ffffff; }
.ex-trav-glyph use { color: #ffffff; }
.ex-trav--land .ex-disc { opacity: 1; }

/* ---- final accumulated wheel ---- */
.ex-finallayer { opacity: 0; transition: opacity 0.7s ease; }
.ex-finallayer--in { opacity: 1; }
.ex-final-planet { color: inherit; }
.ex-final-planet use { color: inherit; }
.ex-final-halo { fill: #ffffff; opacity: 0.9; stroke-width: 1.4; }

/* ---- controls ---- */
.ex-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ex-btn {
  font-family: 'Noto Sans', sans-serif;
  border: 1px solid var(--c-powder);
  background: #fff;
  color: var(--c-harbor);
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.ex-btn:hover:not(:disabled) { border-color: var(--c-slate); color: var(--ink); }
.ex-btn:disabled { opacity: 0.4; cursor: default; }
.ex-btn--icon {
  width: 38px; height: 38px;
  font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.ex-btn--play {
  height: 38px;
  padding: 0 16px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.86rem; font-weight: 600;
  background: var(--c-indigo); color: #fff; border-color: var(--c-indigo);
}
.ex-btn--play:hover { background: var(--c-deep); border-color: var(--c-deep); color: #fff; }
.ex-play-icon { font-size: 0.72rem; }
.ex-progress {
  flex: 1;
  height: 4px;
  background: var(--c-mist);
  border-radius: 99px;
  overflow: hidden;
  min-width: 40px;
}
.ex-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--c-slate);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.ex-count {
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-mute);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex: none;
}

/* ---- synced text ---- */
.ex-text { transition: opacity 0.25s ease; }
.ex-text .ex-group {
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 0 0 1.1rem;
  line-height: 1.5;
}
.ex-text .ex-detail {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}
.ex-detail--idle { font-size: 1.05rem; color: var(--text-soft); margin-top: 0.8rem; }
.ex-sep { color: var(--c-stone); padding: 0 0.15em; font-style: normal; }
.ex-out { font-weight: 600; }
.ex-text--in { animation: ex-fade 0.4s ease; }
@keyframes ex-fade { from { opacity: 0.35; } to { opacity: 1; } }

/* ---- final table inside the text box ---- */
.ex-group--final {
  color: var(--ink);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  margin-bottom: 0.9rem;
}
.ex-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.78rem;
}
.ex-table thead th {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  text-align: left;
  padding: 0.3rem 0.5rem;
  border-bottom: 1.5px solid var(--ink);
}
.ex-table tbody th,
.ex-table tbody td {
  padding: 0.26rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
}
.ex-table tbody tr:last-child th,
.ex-table tbody tr:last-child td { border-bottom: none; }
.ex-cell { display: inline-flex; align-items: center; gap: 0.4em; }
.ex-cellglyph { width: 17px; height: 17px; flex: none; }
.ex-cell.primary .ex-cellname { color: var(--w-terra); font-weight: 600; }
.ex-cell.secondary .ex-cellname { color: var(--c-indigo); font-weight: 600; }
.ex-table tbody th .ex-cellname { color: var(--ink); font-weight: 600; }
.ex-table tbody th .ex-cellglyph { color: var(--c-slate); }

/* =====================================================================
   READING CONTENT — styles for the page panels (not the animation)
   ===================================================================== */

/* ---- traditional exaltations list ---- */
.trad-list {
  list-style: none;
  margin: 1.4rem 0 0.4rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem 1.6rem;
  max-width: 560px;
}
.trad-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.trad-list__p { font-family: 'Newsreader', Georgia, serif; font-size: 1.08rem; font-weight: 600; color: var(--ink); min-width: 5.5em; }
.trad-list__s { color: var(--c-stone); }
.trad-list__x { color: var(--text-soft); }

/* ---- citation box (Morpurgo) ---- */
.cite-box {
  margin: 1.5rem 0 0;
  padding: clamp(1.4rem, 3vw, 2rem) clamp(1.5rem, 3.5vw, 2.4rem);
  background: var(--w-cream);
  border: 1px solid var(--rule-warm);
  border-left: 3px solid var(--w-amber);
}
.cite-box p {
  font-family: 'Newsreader', Georgia, serif;
  font-style: italic;
  font-size: clamp(1.1rem, 1.9vw, 1.32rem);
  line-height: 1.6;
  color: var(--c-deep);
  margin: 0 0 1rem;
  text-wrap: pretty;
}
.cite-box p:last-child { margin-bottom: 0; }

/* ---- the primary / secondary scheme blocks ---- */
.exalt-scheme { margin: 1.5rem 0 0.4rem; display: flex; flex-direction: column; gap: 1.6rem; }
.exalt-scheme__group {
  background: var(--c-porcelain);
  border: 1px solid var(--rule-soft);
  border-radius: 8px;
  padding: clamp(1rem, 2.4vw, 1.5rem) clamp(1.1rem, 2.6vw, 1.6rem);
}
.exalt-scheme__lead {
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.9rem;
  line-height: 1.4;
}
.exalt-scheme__lead span {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-mute);
  margin-top: 0.2rem;
}
.exalt-scheme__rows { list-style: none; margin: 0; padding: 0; }
.exalt-scheme__rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-soft);
  padding: 0.32rem 0;
  border-bottom: 1px solid var(--rule);
}
.exalt-scheme__rows li:last-child { border-bottom: none; }
.exalt-scheme__rows b {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  min-width: 4.6em;
}
.exalt-scheme__rows i { color: var(--c-stone); font-style: normal; padding: 0 0.1em; }
.exalt-scheme__rows u { text-decoration: none; font-weight: 600; }
.exalt-scheme--primary .exalt-scheme__rows b,
.exalt-scheme--primary .exalt-scheme__rows u { color: var(--w-terra); }
.exalt-scheme--secondary .exalt-scheme__rows b,
.exalt-scheme--secondary .exalt-scheme__rows u { color: var(--c-indigo); }

/* ---- the grand 5-column table ---- */
.grand-table-wrap { overflow-x: auto; margin: 1.6rem 0 0.4rem; }
.grand-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.84rem;
  min-width: 560px;
}
.grand-table thead th {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 0.5rem 0.7rem;
  border-bottom: 1.5px solid var(--ink);
  text-align: left;
  white-space: nowrap;
}
.grand-table tbody th {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.grand-table tbody td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text-soft);
  text-align: left;
}
.grand-table tbody tr:hover th,
.grand-table tbody tr:hover td { background: var(--c-cloud); }
.grand-table tbody tr:last-child th,
.grand-table tbody tr:last-child td { border-bottom: none; }
.grand-table .ex-pri { color: var(--w-terra); font-weight: 600; }
.grand-table .ex-sec { color: var(--c-indigo); font-weight: 600; }
.grand-table caption {
  caption-side: bottom;
  text-align: left;
  font-family: 'Noto Sans', sans-serif;
  font-size: 0.76rem;
  color: var(--text-mute);
  margin-top: 0.9rem;
  line-height: 1.5;
}
