/* Deep Dive shared styles — directive blocks (used in the admin editor preview
   AND the public reader page) plus the reader-page layout. The interactive viz
   "figure plate" archetypes bring their own .iqv-* styles (compiled into
   style.css by the interview-question Visualize feature); this file only styles
   the deep-dive wrappers (.dd-*). */

/* ── Directive blocks ── */
.dd-figure { margin: 1.75rem 0; text-align: center; }
.dd-figure img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid #D6D4CD; }
.dd-figure-caption { margin-top: .5rem; font-size: .85rem; color: #67665F; font-style: italic; }
.dd-figure-source { font-style: normal; color: inherit; text-decoration: underline; text-underline-offset: 2px; border-bottom: 0; }
.dd-figure-source::after { content: " \2197"; }
.dd-viz-figure { margin: 1.75rem 0; }

.dd-callout { margin: 1.5rem 0; padding: .85rem 1.1rem; border-radius: 9px; border: 1px solid #D6D4CD; border-left: 4px solid #C9C7C0; background: #F8F7F4; box-shadow: inset 0 2px 4px rgba(35,35,32,.06); }
.dd-callout-label { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem; color: #55544D; }
.dd-callout-body > :first-child { margin-top: 0; }
.dd-callout-body > :last-child { margin-bottom: 0; }
.dd-callout-tip { border-left-color: #2E9E6B; background: #E0EAE2; }
.dd-callout-tip .dd-callout-label { color: #256E4C; }
.dd-callout-warn { border-left-color: #D9A013; background: #F2E8CE; }
.dd-callout-warn .dd-callout-label { color: #7D5A0B; }
.dd-callout-note { border-left-color: #55544D; background: #DFDDD7; }
.dd-callout-note .dd-callout-label { color: #45443E; }

.dd-chapter { display: flex; align-items: center; gap: .65rem; margin: 2rem 0 .75rem; padding-top: 1rem; border-top: 1px solid #D6D4CD; scroll-margin-top: 90px; }
.dd-chapter-play { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; color: #FFFFFF; background: linear-gradient(180deg, #F06A24, #E55A12); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 1px 3px -1px rgba(194,74,11,.6); border: none; border-radius: 999px; padding: .25rem .7rem; cursor: pointer; white-space: nowrap; }
.dd-chapter-play:hover { background: #C24A0B; }
.dd-chapter-title { font-weight: 600; color: #45443E; }

.dd-reexplain { margin: 1.25rem 0; }
.dd-quiz { margin: 1.75rem 0; }

.dd-block-error { margin: 1rem 0; background: #F0E0DA; border: 1px solid #E0B4A8; color: #C4442E; padding: .6rem .85rem; border-radius: 8px; font-size: .85rem; }
.dd-block-error ul { margin: .35rem 0 0 1rem; list-style: disc; }

/* ── Reader page layout ── */
.dd-wrap { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }
.dd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2.5rem; align-items: start; }
@media (max-width: 980px) { .dd-grid { grid-template-columns: 1fr; } .dd-rail { position: static !important; } }

.dd-article { min-width: 0; }
.dd-hero-title { font-size: 2.25rem; line-height: 1.15; font-weight: 800; margin: 0 0 .5rem; }
.dd-hero-sub { font-size: 1.1rem; color: #55544D; margin: 0 0 1rem; }
.dd-hero-meta { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; font-size: .85rem; color: #67665F; margin-bottom: 1.5rem; }
.dd-hero-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.dd-meta-ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }

/* Mobile-only chapter list (the side rail falls below the article on narrow
   screens, which buried chapter navigation entirely). */
.dd-chapters-mobile { display: none; margin: -0.75rem 0 1.5rem; border: 1px solid #D6D4CD; border-radius: 10px; background: #F8F7F4; }
.dd-chapters-mobile summary { cursor: pointer; padding: .6rem .9rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #67665F; }
.dd-chapters-mobile ul { list-style: none; margin: 0; padding: 0 .5rem .5rem; }
.dd-chapters-mobile button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .45rem; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: .88rem; color: #45443E; }
.dd-chapters-mobile button:hover { background: #F8F7F4; }
.dd-chapters-mobile .dd-rail-t { color: #E55A12; font-variant-numeric: tabular-nums; font-size: .8rem; }
@media (max-width: 980px) {
   .dd-chapters-mobile { display: block; }
   .dd-rail-card--chapters { display: none; }
}

/* Video player (click-to-play, reuses the refresher pattern) */
.dd-player { position: relative; aspect-ratio: 16 / 9; background: #1B1B18; border-radius: 12px; overflow: hidden; margin-bottom: 1.75rem; }
.dd-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.dd-player-poster { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; background-size: cover; background-position: center; }
.dd-player-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 999px; background: rgba(229, 90, 18, .92); color: #F8F7F4; display: flex; align-items: center; justify-content: center; pointer-events: none; }
/* The gated poster's unlock CTA is an <a> with this class - it must stay
   clickable; pointer-events:none is only for the decorative play icon div. */
a.dd-player-play { pointer-events: auto; }
a.dd-player-play:hover { background: rgba(199, 74, 10, .95); }
.dd-player-play svg { width: 28px; height: 28px; margin-left: 4px; }

/* Prose */
.dd-prose { font-size: 1.05rem; line-height: 1.75; color: #232320; }
.dd-prose h2 { font-size: 1.6rem; font-weight: 700; margin: 2.25rem 0 .75rem; scroll-margin-top: 90px; }
.dd-prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 .5rem; scroll-margin-top: 90px; }
.dd-prose p { margin: 0 0 1rem; }
.dd-prose ul, .dd-prose ol { margin: 0 0 1rem 1.4rem; }
.dd-prose li { margin: .3rem 0; }
.dd-prose code { background: #DFDDD7; padding: .1rem .35rem; border-radius: 4px; font-size: .9em; }
.dd-prose pre { background: #232320; color: #D6D4CD; padding: 1rem; border-radius: 10px; overflow-x: auto; margin: 1.25rem 0; }
.dd-prose pre code { background: none; padding: 0; }
.dd-prose blockquote { border-left: 3px solid #E55A12; padding-left: 1rem; color: #55544D; margin: 1.25rem 0; }
.dd-prose a { color: #C24A0B; text-decoration: underline; }

/* Side rail (chapters / contents) */
.dd-rail { position: sticky; top: 84px; }
.dd-rail-card { background: #F8F7F4; border: 1px solid #D6D4CD; border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.dd-rail-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94938B; margin-bottom: .6rem; }
.dd-rail-chapters { list-style: none; margin: 0; padding: 0; }
.dd-rail-chapters li { margin: 0; }
.dd-rail-chapters button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .4rem; border: 0; background: none; border-radius: 6px; cursor: pointer; font-size: .88rem; color: #45443E; }
.dd-rail-chapters button:hover { background: #F8F7F4; }
.dd-rail-chapters .dd-rail-t { color: #E55A12; font-variant-numeric: tabular-nums; font-size: .8rem; }
.dd-rail-chapters .is-active button { background: #F3E2D2; color: #C24A0B; font-weight: 600; }

/* Quiz cards (server-hydrated) */
.dd-quiz-card { border: 1px solid #D6D4CD; border-radius: 12px; padding: 1rem 1.15rem; background: #F8F7F4; }
.dd-quiz-card .dd-quiz-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #E55A12; margin-bottom: .5rem; }
.dd-quiz-list { list-style: none; margin: 0; padding: 0; }
.dd-quiz-list li { padding: .4rem 0; border-top: 1px solid #DFDDD7; }
.dd-quiz-list li:first-child { border-top: 0; }
.dd-quiz-list a { color: #232320; font-weight: 500; text-decoration: none; }
.dd-quiz-list a:hover { color: #C24A0B; }

/* Paywall */
.dd-paywall { position: relative; margin-top: -140px; padding-top: 140px; background: linear-gradient(to bottom, rgba(255,255,255,0), #F8F7F4 130px); }
.dd-paywall-card { border: 1px solid #E5C4A4; background: #F7EFE6; border-radius: 14px; padding: 1.5rem; text-align: center; }

/* Re-explain widget (client-hydrated from :::reexplain mounts) */
.dd-rx { border: 1px solid #D6D4CD; border-radius: 12px; padding: .85rem 1rem; background: #F8F7F4; }
.dd-rx-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.dd-rx-label { font-size: .78rem; font-weight: 600; color: #67665F; }
.dd-rx-tabs { display: flex; gap: .35rem; }
.dd-rx-tab { font-size: .78rem; padding: .28rem .7rem; border: 1px solid #C9C7C0; border-radius: 999px; background: #F8F7F4; cursor: pointer; }
.dd-rx-tab:hover { background: #DFDDD7; }
.dd-rx-tab.is-active { border-color: #E55A12; color: #C24A0B; background: #F3E2D2; font-weight: 600; }
.dd-rx-tab:disabled { opacity: .5; cursor: default; }
.dd-rx-result { margin-top: .7rem; font-size: 1rem; line-height: 1.7; }
.dd-rx-result:empty { display: none; }
.dd-rx-foot { margin-top: .55rem; font-size: .75rem; color: #94938B; display: flex; gap: .75rem; align-items: center; }
.dd-rx-regen { color: #C24A0B; cursor: pointer; text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; }
.dd-rx-note { font-size: .85rem; color: #67665F; }
.dd-rx-note a { color: #C24A0B; text-decoration: underline; }

/* Recall checkpoint (baked :::check cards; answering wired by the host page) */
.dd-check { margin: 1.75rem 0; padding: 1rem 1.15rem 1.1rem; border: 1px solid #D6D4CD; border-radius: 10px; background: #F8F7F4; box-shadow: inset 0 2px 4px rgba(35,35,32,.06); }
.dd-check-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.dd-check-kicker { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #C24A0B; }
.dd-check-state { font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.dd-check.is-correct .dd-check-state { color: #256E4C; }
.dd-check.is-incorrect .dd-check-state { color: #A33B3B; }
.dd-check-q { margin: 0 0 .75rem; font-weight: 600; }
.dd-check-opts { display: flex; flex-direction: column; gap: 8px; }
.dd-check-opt { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: .55rem .75rem; border: 1px solid #D6D4CD; border-radius: 8px; background: #FFFFFF; cursor: pointer; font: inherit; color: inherit; transition: border-color .12s ease, background .12s ease; }
.dd-check-opt:hover:not(:disabled) { border-color: #E55A12; }
.dd-check-opt:disabled { cursor: default; }
.dd-check-key { flex: none; font-weight: 700; font-size: .72rem; color: #55544D; border: 1px solid #D6D4CD; border-radius: 5px; padding: 1px 6px; background: #F8F7F4; }
.dd-check-opt.is-answer { border-color: #2E9E6B; background: #E0EAE2; }
.dd-check-opt.is-answer .dd-check-key { border-color: #2E9E6B; color: #256E4C; }
.dd-check-opt.is-wrong { border-color: #C25454; background: #F1DFDF; }
.dd-check-opt.is-wrong .dd-check-key { border-color: #C25454; color: #A33B3B; }
.dd-check-why { margin-top: .8rem; padding-top: .7rem; border-top: 1px dashed #D6D4CD; font-size: .92em; color: #45443E; }

/* "In short": the opening summary box of a blog post (:::callout type="summary") */
.dd-callout-summary { border-left-color: #E55A12; background: #FBF1E8; }
.dd-callout-summary .dd-callout-label { color: #C24A0B; }
.dd-callout-summary .dd-callout-body ul { margin: 0; padding-left: 1.1rem; }
.dd-callout-summary .dd-callout-body li + li { margin-top: .35rem; }

/* Charts: baked :::chart figures (services/chartRenderer.js). Each chart holds a
   wide (720) and a compact (360) SVG; the container query shows one, so labels
   stay readable at phone width. Mark colours are the SVG's own attributes (the
   Instrument palette, checked with the dataviz validator); CSS adds only the
   hover/focus states, so a feed reader without this sheet still draws them. */
.dd-chart { container-type: inline-size; margin: 1.75rem 0; padding: 1rem 1.15rem .95rem; border: 1px solid #D6D4CD; border-radius: 10px; background: #F8F7F4; box-shadow: inset 0 2px 4px rgba(35,35,32,.06); }
.ddc-head { margin-bottom: .65rem; }
.ddc-title { margin: 0; font-weight: 650; font-size: 1rem; line-height: 1.35; color: #232320; }
.ddc-sub { margin: .2rem 0 0; font-size: .875rem; line-height: 1.45; color: #67665F; }
.ddc-legend { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin: 0 0 .7rem; font-size: .8125rem; color: #45443E; }
.ddc-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.ddc-key { flex: none; }
.ddc-plot { position: relative; border-radius: 6px; }
.ddc-plot:focus { outline: none; }
.ddc-plot:focus-visible { box-shadow: 0 0 0 2px #F8F7F4, 0 0 0 4px #E55A12; }
.ddc-svg { display: block; width: 100%; height: auto; max-width: 720px; overflow: visible; }
.ddc-svg--compact { max-width: 480px; }
/* An explicit rule: .ddc-svg's display:block would otherwise beat the browser's [hidden]. */
.ddc-svg[hidden] { display: none; }
.ddc-svg--waffle { width: auto; max-width: 100%; }
.dd-chart svg text { font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums; }
@container (max-width: 599px) {
   .ddc-svg--wide { display: none; }
   .ddc-svg--compact[hidden] { display: block; }
}
.ddc-hit { cursor: default; }
.ddc-mark.is-active .ddc-bar, .ddc-mark.is-active .ddc-dot, .ddc-mark.is-active .ddc-dot-to { stroke: #232320; stroke-width: 1.5px; }
.ddc-cell.is-active { stroke: #232320; stroke-width: 1.5px; }
.ddc-tip { position: absolute; z-index: 5; max-width: 280px; padding: .35rem .6rem; border-radius: 6px; background: #232320; color: #FFFDF8; font-size: .8125rem; line-height: 1.4; pointer-events: none; box-shadow: 0 6px 18px -8px rgba(35,35,32,.5); }
.ddc-tip[hidden] { display: none; }
.ddc-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Caption, note, source and tags wrap as items: one that starts a new line
   starts flush left (an inline margin would indent it). */
.ddc-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem; margin-top: .65rem; font-size: .8125rem; line-height: 1.5; color: #67665F; }
.ddc-date { white-space: nowrap; }
.ddc-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ddc-foot a:hover { color: #C24A0B; }
.ddc-caption { color: #45443E; }
.ddc-tag { display: inline-block; padding: 0 .4rem; border: 1px solid #D6D4CD; border-radius: 4px; background: #FFFDF8; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #55544D; vertical-align: 1px; }
.ddc-data { margin-top: .55rem; }
.ddc-data summary { cursor: pointer; width: max-content; font-size: .8125rem; font-weight: 600; color: #45443E; }
.ddc-data summary:hover { color: #C24A0B; }
.ddc-table { overflow-x: auto; margin-top: .5rem; }
.ddc-table table { width: 100%; border-collapse: collapse; font-size: .8125rem; line-height: 1.4; color: #45443E; background: #FFFDF8; }
.ddc-table th, .ddc-table td { padding: .35rem .55rem; border-bottom: 1px solid #E3E1DA; text-align: left; font-weight: 400; }
.ddc-table thead th { font-weight: 600; color: #232320; background: #F2F1EC; }
.ddc-table tbody th { color: #232320; }
.ddc-table .ddc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* stat tiles: headline numbers are text, not a chart */
.ddc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ddc-stat { padding: .75rem .9rem .8rem; border: 1px solid #D6D4CD; border-radius: 8px; background: #FFFDF8; }
.ddc-stat.is-hi { border-color: #E55A12; background: #FBF1E8; }
.ddc-stat-label { font-size: .8125rem; line-height: 1.35; color: #67665F; }
.ddc-stat-value { margin-top: .25rem; font-size: 1.75rem; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; color: #232320; }
.ddc-stat-caption { margin-top: .2rem; font-size: .8125rem; line-height: 1.4; color: #45443E; }
.ddc-equation { margin: .8rem 0 0; font-size: 1.375rem; font-weight: 650; text-align: center; color: #232320; }
