/* ═══════════════════════════════════════════════════════
   GT Narrative Report · v2 styles
   Confined-page layout, DM Serif Display + Inter + JetBrains Mono
   Designed to read as a document, not a webpage.
   All selectors prefixed .gt-report- to avoid course.css conflicts.
   ═══════════════════════════════════════════════════════ */

.gt-report-viewport {
  --report-cream: #f4f1e8;
  --report-paper: #ffffff;
  --report-ink: #1a1f24;
  --report-ink-soft: #3a424a;
  --report-ink-muted: #6b737c;
  --report-pine: #1a3629;
  --report-sage: #3e7361;
  --report-sage-pale: #e5efe9;
  --report-rose: #b56b7a;
  --report-line: #e8e3d4;
  --report-line-soft: #f0ebdd;

  background: var(--report-cream);
  min-height: 100vh;
  padding: 48px 24px 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--report-ink);
  -webkit-font-smoothing: antialiased;
}

.gt-report-page {
  width: 100%;
  max-width: 880px;
  min-height: 1100px;
  background: var(--report-paper);
  box-shadow: 0 1px 2px rgba(26,54,41,0.04), 0 8px 40px rgba(26,54,41,0.08), 0 24px 80px rgba(26,54,41,0.06);
  border-radius: 3px;
  padding: 72px 88px 64px;
  position: relative;
  overflow: hidden;
  color: var(--report-ink);
  text-align: left; /* override any centering inherited from parent (e.g. Moment .tm) */
}
/* Belt-and-suspenders: force left-align on every text container inside the report */
.gt-report-page h1, .gt-report-page h2, .gt-report-page h3, .gt-report-page h4,
.gt-report-page p, .gt-report-page div, .gt-report-page span, .gt-report-page aside,
.gt-report-page section, .gt-report-page header, .gt-report-page footer {
  text-align: left;
}
.gt-report-page .gt-cal-q-count,
.gt-report-page .gt-cal-q-label { text-align: left; }
.gt-report-page::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at top left, rgba(62,115,97,0.015), transparent 40%),
    radial-gradient(ellipse at bottom right, rgba(201,169,97,0.02), transparent 40%);
  pointer-events: none;
}
.gt-report-edge-mark {
  position: absolute;
  top: 32px; right: 32px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--report-ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
}

.gt-portrait-block {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--report-line);
  margin-bottom: 40px;
}
.gt-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--report-sage);
  margin-bottom: 12px;
}
.gt-portrait-word {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 84px;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--report-pine);
  font-style: italic;
  margin-bottom: 8px;
}
.gt-portrait-word::after {
  content: '.';
  color: var(--report-sage);
  font-style: normal;
}
.gt-portrait-context {
  font-size: 13px;
  color: var(--report-ink-muted);
  margin-top: 18px;
  font-feature-settings: 'tnum';
}
.gt-portrait-context strong { color: var(--report-ink); font-weight: 600; }

.gt-opening {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--report-ink);
  margin-bottom: 36px;
  max-width: 620px;
}
.gt-opening em { font-style: italic; color: var(--report-sage); }

.gt-arc {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
.gt-arc-beat { position: relative; }
.gt-arc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--report-sage);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gt-arc-label::before {
  content: '';
  width: 14px; height: 1px;
  background: var(--report-sage);
}
.gt-arc-beat h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--report-pine);
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}
.gt-arc-beat p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--report-ink-soft);
  margin: 0;
}
.gt-arc-beat p em { font-style: italic; color: var(--report-sage); }
.gt-evidence {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--report-ink-muted);
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.gt-cal-section { margin-bottom: 44px; }
.gt-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--report-line-soft);
}
.gt-section-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--report-pine);
  letter-spacing: -0.015em;
}
.gt-section-sub {
  font-size: 11px;
  color: var(--report-ink-muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
}

.gt-cal-map {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}
.gt-cal-y-axis {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--report-ink-muted);
}
.gt-cal-grid {
  position: relative;
  height: 260px;
  background: #f5f1e6; /* warmer cream, contrasts dots better than pale sage */
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(26,54,41,0.12);
}
.gt-cal-quadrant {
  border: 1px solid rgba(26,54,41,0.18);
  padding: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/* Stronger quadrant tinting — each block reads as a distinct column of meaning */
.gt-cal-quadrant[data-q="tl"] { background: rgba(62,115,97,0.10); }
.gt-cal-quadrant[data-q="tr"] { background: rgba(62,115,97,0.18); }
.gt-cal-quadrant[data-q="bl"] { background: rgba(181,107,122,0.14); }
.gt-cal-quadrant[data-q="br"] { background: rgba(201,169,97,0.14); }

.gt-cal-q-label {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--report-pine);
  letter-spacing: -0.01em;
  z-index: 2;
}
.gt-cal-q-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--report-ink-muted);
  margin-top: 2px;
  z-index: 2;
}
.cal-dot {
  position: absolute;
  width: 16px; height: 16px; /* 12 \u2192 16 for easier tap target on mobile */
  padding: 0;
  border-radius: 50%;
  background: #1a3629; /* pine — AAA contrast on any quadrant background */
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  border: 1.5px solid var(--report-paper);
  z-index: 3;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
  outline: none;
}
.cal-dot:hover, .cal-dot:focus-visible {
  transform: scale(1.4);
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
  z-index: 4;
}
.cal-dot.active {
  transform: scale(1.6);
  box-shadow: 0 0 0 3px rgba(168, 196, 180, 0.45), 0 4px 14px rgba(0,0,0,0.55);
  z-index: 5;
}
.cal-dot.wrong {
  background: #8c3a48; /* deeper rose for strong contrast on the wrong-row quadrants */
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

/* Popover shown when a dot is clicked/tapped — fixed to viewport so it's
   reliably visible regardless of where the calibration map sits. */
.cal-popover {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  max-width: 360px; width: calc(100vw - 48px);
  background: var(--report-paper, #f7f3e9);
  border: 1px solid rgba(26, 54, 41, 0.2);
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.36), 0 0 0 6px rgba(168, 196, 180, 0.14);
  padding: 20px 24px 18px;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  animation: cal-pop-in 0.18s ease-out;
}
@keyframes cal-pop-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.cal-pop-close {
  position: absolute; top: 6px; right: 10px;
  background: transparent; border: none;
  font-size: 24px; line-height: 1; color: var(--report-ink-muted);
  cursor: pointer; padding: 4px 8px;
  border-radius: 4px;
}
.cal-pop-close:hover { color: var(--report-ink); background: rgba(0,0,0,0.05); }
.cal-pop-head {
  font-size: 13px; font-weight: 600; color: var(--report-pine);
  margin-bottom: 6px; padding-right: 24px;
}
.cal-pop-meta {
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.cal-pop-mark { font-weight: 700; letter-spacing: 0.04em; }
.cal-pop-mark.correct { color: var(--report-sage); }
.cal-pop-mark.wrong { color: #8c3a48; }
.cal-pop-time { color: var(--report-ink-muted); letter-spacing: 0.04em; }
.cal-pop-q {
  font-size: 13px; line-height: 1.55;
  color: var(--report-ink); font-style: italic;
  margin-bottom: 8px;
}
.cal-pop-r {
  font-size: 12px; line-height: 1.5;
  color: var(--report-ink-muted);
}
.cal-pop-r em {
  font-style: italic; color: var(--report-ink); font-weight: 500;
}
.gt-cal-x-axis {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--report-ink-muted);
}
.gt-cal-citation {
  font-size: 11px;
  color: var(--report-ink-muted);
  font-style: italic;
  margin-top: 8px;
  max-width: 560px;
  line-height: 1.5;
}
.gt-cal-citation em { font-style: italic; color: var(--report-sage); }

/* Answer review — Confident Misses (miscalibration) + Genuine Gaps (known gaps) */
.gt-review-section {
  margin: -8px 0 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gt-review-block {
  padding: 14px 18px;
  border-radius: 0 5px 5px 0;
}
.gt-review-block-wasl {
  background: rgba(140, 58, 72, 0.04);
  border-left: 2px solid rgba(140, 58, 72, 0.45);
}
.gt-review-block-gaps {
  background: rgba(62, 115, 97, 0.04);
  border-left: 2px solid rgba(62, 115, 97, 0.35);
}
.gt-review-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 6px;
}
.gt-review-block-wasl .gt-review-title { color: #8c3a48; }
.gt-review-block-gaps .gt-review-title { color: var(--report-sage); }
.gt-review-title-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  opacity: 0.65;
  font-weight: 500;
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.gt-review-framing {
  font-size: 11px;
  line-height: 1.5;
  color: var(--report-ink-muted);
  margin: 0 0 10px;
  font-style: italic;
}
.gt-review-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gt-review-list li {
  padding: 8px 0;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}
.gt-review-list li:first-child { border-top: none; padding-top: 0; }
.gt-review-head {
  font-size: 12px;
  color: var(--report-ink);
  margin-bottom: 3px;
  font-weight: 500;
}
.gt-review-head strong { font-weight: 600; color: var(--report-pine); }
.gt-review-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--report-ink-muted);
  letter-spacing: 0.04em;
}
.gt-review-q {
  font-size: 12px;
  line-height: 1.5;
  color: var(--report-ink);
  margin-top: 3px;
  font-style: italic;
}
.gt-review-r {
  font-size: 11px;
  line-height: 1.45;
  color: var(--report-ink-muted);
  margin-top: 3px;
}
.gt-review-block-wasl .gt-review-r em {
  font-style: italic;
  color: #8c3a48;
  font-weight: 500;
}
.gt-review-block-gaps .gt-review-r em {
  font-style: italic;
  color: var(--report-sage);
  font-weight: 500;
}

.gt-takeaway {
  display: flex;
  gap: 16px;
  padding: 22px 26px;
  background: var(--report-sage-pale);
  border-left: 3px solid var(--report-sage);
  border-radius: 0 6px 6px 0;
  margin-bottom: 40px;
}
.gt-takeaway-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--report-sage);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: 'DM Serif Display', serif;
  font-weight: 400;
  font-size: 15px;
  font-style: italic;
}
.gt-takeaway-body { flex: 1; }
.gt-takeaway-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--report-sage);
  margin-bottom: 4px;
}
.gt-takeaway-text {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--report-pine);
  font-weight: 400;
}
.gt-takeaway-text em { font-style: italic; color: var(--report-sage); }

.gt-talpek-frame {
  border-top: 1px solid var(--report-line);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.gt-frame-text { flex: 1; max-width: 520px; }
.gt-frame-lead {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.5;
  color: var(--report-pine);
  margin-bottom: 4px;
}
.gt-frame-sub {
  font-size: 12px;
  color: var(--report-ink-muted);
  line-height: 1.5;
}
.gt-frame-mark {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--report-sage);
  text-align: right;
  line-height: 1.6;
}
.gt-frame-mark strong {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--report-pine);
  display: block;
  font-style: italic;
}

@media (max-width: 720px) {
  .gt-report-viewport { padding: 16px 12px 48px; }
  .gt-report-page { padding: 56px 28px 36px; min-height: unset; border-radius: 2px; }
  /* Hide the "Lead from Where You Are · Module 1" edge-mark on mobile:
     it overlaps the portrait kicker in narrow viewports. Desktop keeps it. */
  .gt-report-edge-mark { display: none; }
  .gt-portrait-word { font-size: 56px; }
  .gt-opening { font-size: 20px; }
  .gt-arc { grid-template-columns: 1fr; gap: 24px; }
  .gt-cal-grid { height: 220px; }
  .gt-talpek-frame { flex-direction: column; align-items: flex-start; gap: 16px; }
  .gt-frame-mark { text-align: left; }
}

/* Portrait phone: calibration map is a desktop analytical visualization —
   2×2 grid + hoverable dots don't translate to narrow touch surfaces.
   Narrative (portrait + opening + arc + Confident Misses + Genuine Gaps +
   takeaway) carries the story on its own. PDF + desktop keep the map. */
@media (orientation: portrait) and (max-width: 720px) {
  .gt-cal-section { display: none; }
}
