/* ═══ ARCANIST'S GUIDEBOOK — TEMPLE MODULE ═══════════════════════
   Examination hall + Journal. All colours/fonts via theme.css tokens.
════════════════════════════════════════════════════════════════ */

.temple-view { padding: 1.5rem clamp(1rem, 4vw, 3rem); max-width: 1060px; margin: 0 auto; }
/* .temple-welcome-banner retired — the art is now the arch's backdrop. */

/* ── The Hall ─────────────────────────────────────────────── */
.temple-hall { text-align: center; }

.temple-status-row {
  display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center;
  margin-bottom: 1.1rem;
}
.temple-plaque {
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--card-text);
  border-radius: 6px;
  padding: 0.55rem 0.95rem;
  min-width: 128px;
}
.temple-plaque-label {
  font-family: var(--font-ui);
  font-size: 0.56rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 3px;
}
.temple-plaque-value { font-family: var(--font-heading); font-size: 0.92rem; color: var(--card-text); }

/* ── Discipline selection ─────────────────────────────────── */
.temple-disciplines { max-width: 560px; margin: 0 auto 1.2rem; }
.temple-disciplines-label {
  font-family: var(--font-ui);
  font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent-dim);
  margin-bottom: 0.5rem;
}
.temple-discipline-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center; }
.discipline-chip {
  font-family: var(--font-heading);
  font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--content-text-muted);
  background: transparent;
  border: 1px solid var(--card-border); border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.discipline-chip:hover { border-color: var(--accent-border); }
.discipline-chip.active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: rgba(var(--accent-rgb), 0.08);
}
.discipline-chip.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.discipline-chip.locked:hover { border-color: var(--card-border); }
.temple-breadth-note {
  margin-top: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.6rem; letter-spacing: 0.14em;
  color: var(--content-text-muted);
}

/* ── Order progress ───────────────────────────────────────── */
.temple-progressbar-wrap { max-width: 460px; margin: 0 auto 1.6rem; }
.temple-progressbar {
  height: 7px; border-radius: 4px;
  border: 1px solid var(--accent-border);
  background: rgba(var(--accent-rgb), 0.07);
  overflow: hidden;
}
.temple-progressbar-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width 0.7s ease;
}
.temple-progressbar-caption {
  margin-top: 5px;
  font-family: var(--font-ui);
  font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--content-text-muted);
}

/* ── Begin ────────────────────────────────────────────────── */
.temple-begin-wrap { margin-bottom: 1rem; }
.temple-begin-btn {
  font-family: var(--font-heading);
  font-size: 1rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 0.85rem 2.2rem;
}
.temple-begin-note {
  margin-top: 0.55rem;
  font-family: var(--font-body); font-style: italic;
  color: var(--content-text-muted); font-size: 0.85rem;
}
.temple-loading, .temple-error {
  font-family: var(--font-body); font-style: italic;
  color: var(--content-text-muted); padding: 1rem;
}
.temple-error { color: var(--content-text); }

/* ── Examination chamber ──────────────────────────────────── */
.exam-chamber {
  max-width: 640px; margin: 0 auto;
  border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--card-text);
  border-radius: 8px;
  padding: 1.4rem 1.6rem 1.6rem;
}
.exam-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; }
.exam-title {
  font-family: var(--font-heading); letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 0.8rem; color: var(--content-heading);
}
.exam-progress { font-family: var(--font-ui); font-size: 0.68rem; color: var(--content-text-muted); letter-spacing: 0.1em; }
.exam-discipline-tag {
  display: inline-block;
  font-family: var(--font-ui); font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-border); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 0.9rem;
}
.exam-question {
  font-family: var(--font-body);
  font-size: 1.08rem; line-height: 1.5;
  margin-bottom: 1.1rem;
}
.exam-question .exam-flavor {
  display: block; margin-bottom: 0.45rem;
  font-style: italic; font-size: 0.9rem;
  color: var(--accent);
  opacity: 0.85;
}
.exam-question .exam-excerpt {
  display: block; margin-top: 0.6rem; padding: 0.7rem 0.9rem;
  border-left: 2px solid var(--accent-border);
  background: rgba(var(--accent-rgb), 0.05);
  font-style: italic; font-size: 0.95rem;
}
.exam-choices { display: grid; gap: 0.55rem; }
.exam-choice {
  text-align: left;
  font-family: var(--font-body); font-size: 0.97rem;
  color: var(--card-text);
  background: transparent;
  border: 1px solid var(--card-border); border-radius: 6px;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.exam-choice:hover:not([disabled]) { border-color: var(--accent-border); background: rgba(var(--accent-rgb), 0.06); }
.exam-choice[disabled] { cursor: default; }
.exam-choice.correct  { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }
.exam-choice.incorrect { opacity: 0.55; text-decoration: line-through; }
.exam-choice.revealed  { border-color: var(--accent-border); }
.exam-feedback {
  min-height: 1.4rem; margin-top: 0.9rem;
  font-family: var(--font-body); font-style: italic;
  color: var(--content-text-muted); font-size: 0.9rem;
}
.exam-actions { display: flex; gap: 0.7rem; margin-top: 0.9rem; justify-content: flex-end; }
.btn-quiet { opacity: 0.7; }

/* ── Results ──────────────────────────────────────────────── */
.exam-results {
  max-width: 560px; margin: 0 auto; text-align: center;
  border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--card-text);
  border-radius: 8px; padding: 1.8rem 1.6rem;
}
.exam-results-glyph { color: var(--accent); font-size: 1.6rem; margin-bottom: 0.3rem; }
.exam-results-title { font-family: var(--font-decorative); color: var(--content-heading); font-size: 1.35rem; margin: 0 0 0.6rem; }
.exam-results-score { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 0.7rem; }
.exam-results-breakdown { font-family: var(--font-body); font-size: 0.88rem; color: var(--content-text-muted); margin-bottom: 0.7rem; }
.exam-results-insight { font-family: var(--font-heading); letter-spacing: 0.1em; color: var(--accent); margin-bottom: 0.5rem; }
.exam-results-advance { font-family: var(--font-body); font-style: italic; font-size: 0.92rem; min-height: 1.2rem; margin-bottom: 0.8rem; }
.exam-results .exam-actions { justify-content: center; }

/* ── Journal ──────────────────────────────────────────────── */
.journal-page { max-width: 980px; margin: 0 auto; }
.journal-title {
  font-family: var(--font-decorative); color: var(--content-heading);
  text-align: center; letter-spacing: 0.12em;
  font-size: clamp(1.4rem, 4vw, 2rem); margin: 0 0 0.2rem;
}
.journal-sub {
  text-align: center; font-family: var(--font-body); font-style: italic;
  color: var(--content-text-muted); margin-bottom: 1.4rem;
}
.journal-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.journal-section {
  border: 1px solid var(--card-border);
  background: var(--card-bg); color: var(--card-text);
  border-radius: 8px; padding: 1.1rem 1.2rem;
}
.journal-section-wide { grid-column: 1 / -1; }
.journal-section-title {
  font-family: var(--font-heading); font-size: 0.82rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--content-heading);
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.45rem; margin: 0 0 0.8rem;
}
.journal-kv { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; }
.journal-kv .k {
  font-family: var(--font-ui); font-size: 0.6rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent-dim); align-self: center;
}
.journal-kv .v { font-family: var(--font-body); font-size: 0.92rem; }

/* Great Work stage track */
.journal-stage-track { display: flex; gap: 0.4rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.journal-stage {
  flex: 1; min-width: 92px; text-align: center;
  border: 1px solid var(--card-border); border-radius: 6px;
  padding: 0.45rem 0.3rem;
  font-family: var(--font-heading); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--content-text-muted);
}
.journal-stage.reached { border-color: var(--accent-border); color: var(--card-text); }
.journal-stage.current { border-color: var(--accent); color: var(--accent); }

/* Daily ritual */
.journal-ritual-list { display: grid; gap: 0.5rem; }
.journal-ritual-task {
  display: flex; align-items: baseline; gap: 0.6rem;
  font-family: var(--font-body); font-size: 0.92rem;
}
.journal-ritual-task .mark { font-family: var(--font-ui); color: var(--accent-dim); }
.journal-ritual-task.done .mark { color: var(--accent); }
.journal-ritual-task.done .label { text-decoration: line-through; opacity: 0.75; }
.journal-ritual-bonus {
  margin-top: 0.7rem; font-family: var(--font-body); font-style: italic;
  font-size: 0.85rem; color: var(--content-text-muted);
}

/* Temple construction SVG */
.temple-svg-wrap { display: flex; justify-content: center; padding: 0.4rem 0 0.6rem; }
.temple-svg { width: min(420px, 92%); height: auto; overflow: visible; }
.temple-svg .tstage rect,
.temple-svg .tstage path,
.temple-svg .tstage line,
.temple-svg .tstage circle {
  stroke: var(--accent);
  stroke-width: 1.6;
  fill: none;
}
.temple-svg .tstage rect[width] { fill: rgba(var(--accent-rgb), 0.04); }
.temple-svg .tstage { opacity: 0.06; transition: opacity 1.2s ease; }
.temple-svg .tstage.built { opacity: 1; }
.temple-svg-caption {
  text-align: center; font-family: var(--font-body); font-style: italic;
  font-size: 0.85rem; color: var(--content-text-muted);
}

/* Discoveries */
.journal-discovery-list { display: grid; gap: 0.5rem; max-height: 340px; overflow-y: auto; }
.journal-discovery {
  border: 1px solid var(--card-border); border-radius: 6px;
  padding: 0.55rem 0.8rem;
}
.journal-discovery.locked { opacity: 0.45; }
.journal-discovery .d-name { font-family: var(--font-heading); font-size: 0.82rem; letter-spacing: 0.08em; }
.journal-discovery.unlocked .d-name { color: var(--accent); }
.journal-discovery .d-desc { font-family: var(--font-body); font-size: 0.82rem; color: var(--content-text-muted); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 820px) {
  .journal-grid { grid-template-columns: 1fr; }
  .temple-status-row { gap: 0.5rem; }
  .temple-plaque { min-width: 42%; }
}

/* ── Journal: Examination Focus section ─────────────────────── */
.journal-focus-desc {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--content-text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
  font-style: italic;
}
#journalFocus .temple-discipline-chips {
  justify-content: flex-start;
}
#journalFocus .temple-breadth-note {
  margin-top: 0.65rem;
}

@media (prefers-reduced-motion: no-preference) {
  .temple-begin-btn { transition: box-shadow .2s, border-color .2s; }
}

/* ═══ THE HERO — the artwork IS the hall (Steel 1.15) ══════════════════
   Ender's direction: drop the arch, restore the art to full size, and put
   the title, standing and Begin control inside the image.

   Layout logic: the artwork is 2.21:1 with Bran standing at the LEFT
   gesturing rightward, and the room opening up on the right. So the content
   column sits on the RIGHT — he now gestures at the button — and the scrim
   is a horizontal gradient that darkens only that side, leaving Bran and the
   hall itself clearly visible. That was the failing of the previous pass:
   a full-frame scrim made the art "mostly not visible".
   ═════════════════════════════════════════════════════════════════════ */
.temple-hero {
  position: relative;
  max-width: 1060px;
  /* room to breathe before the disciplines block, so the banner doesn't
     crowd it — Ender */
  margin: 0 auto 2.2rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  isolation: isolate;
}
.temple-hero-art {
  display: block;
  width: 100%;
  height: auto;              /* full size — the image sets the hero's height */
  z-index: 0;
}
/* Right-side scrim only, so the left two-thirds of the painting reads clearly. */
.temple-hero.has-art::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to right,
    rgba(10,9,18,0) 0%,
    rgba(10,9,18,0) 34%,
    rgba(10,9,18,0.55) 52%,
    rgba(10,9,18,0.82) 68%,
    rgba(10,9,18,0.9) 100%);
  pointer-events: none;
}
.temple-hero-panel {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: min(52%, 30rem);
  padding: 1rem 1.6rem 1rem 0.6rem;
  text-align: center;
  color: #f3ecdc;
}
.temple-hero.has-art .temple-hall-title { color: #f0e2b8; margin-bottom: .25rem; }
.temple-hero.has-art .temple-hall-sub   { color: #d5c9ae; margin-bottom: .8rem; }

/* Plaques go translucent inside the art rather than opaque cards. */
.temple-hero .temple-status-row {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .45rem; margin-bottom: .9rem;
}
.temple-hero .temple-plaque {
  background: rgba(12,11,20,0.5);
  border: 1px solid rgba(201,168,76,0.32);
  border-radius: 7px;
  padding: .3rem .55rem;
  min-width: 0;
}
.temple-hero .temple-plaque-label { color: #b8ab8c; font-size: .55rem; }
.temple-hero .temple-plaque-value { color: #f0e2b8; font-size: .82rem; }
.temple-hero .temple-begin-wrap { margin: 0; }
.temple-hero .temple-begin-note { color: #cdc2a8; margin-top: .45rem; }

/* No artwork (onerror, or art removed): fall back to a plain readable panel. */
.temple-hero:not(.has-art) { border-radius: 10px; background: var(--card-bg); }
.temple-hero:not(.has-art) .temple-hero-panel {
  position: static; transform: none; width: auto;
  padding: 1.6rem 1.2rem; color: var(--card-text);
}

/* Narrow screens: the 2.21:1 art is far too short to hold this content, so
   the panel drops below the image instead of overlapping it. */
@media (max-width: 860px) {
  .temple-hero.has-art::after {
    background: linear-gradient(to bottom, rgba(10,9,18,0) 40%, rgba(10,9,18,0.55) 100%);
  }
  .temple-hero-panel {
    position: static;
    transform: none;
    width: auto;
    padding: 1rem 1rem 1.2rem;
    background: var(--card-bg);
    color: var(--card-text);
  }
  .temple-hero.has-art .temple-hall-title { color: var(--card-text); }
  .temple-hero.has-art .temple-hall-sub   { color: var(--card-text-muted, #8d8272); }
  .temple-hero .temple-plaque { background: var(--panel2); border-color: var(--border); }
  .temple-hero .temple-plaque-label { color: var(--text-muted); }
  .temple-hero .temple-plaque-value { color: var(--text); }
}

/* On phones the panel already sits beneath the art; dropping the standfirst
   there keeps the title, plaques and Begin control evenly balanced rather
   than pushing the button down. Retained on tablet and desktop. */
@media (max-width: 720px) {
  .temple-hero .temple-hall-sub { display: none; }
  .temple-hero { margin-bottom: 1.6rem; }
}
