/* The Corner — Data guides (/data/guides/). Loads after data.css and blog.css.
   Adds the template's optional slots: video + transcript, the full-width component
   panel (checker, estimator, channel comparison, redaction demo), the FAQ, and
   the next-guide links. Built by tools/build_guides.py. */

/* ---------- video slot, under the stat strip ---------- */
.gvideo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin: clamp(48px, 6vw, 72px) 0 0; }
.gvideo figcaption { padding-top: 6px; }
.gvideo-k { margin: 0; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.gvideo h2 { margin: 10px 0 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 300; line-height: 1.15; letter-spacing: -.02em; }
.gvideo figcaption > p:not([class]) { margin: 12px 0 0; color: var(--fg-2); font-size: 15px; line-height: 1.6; }
.gvideo figcaption a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.transcript { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.transcript summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; font-size: 15px; color: var(--fg); }
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary:focus-visible { outline: 2px solid var(--fg-2); outline-offset: 4px; border-radius: 4px; }
.transcript .pm, .gfaq .pm { flex: none; width: 20px; height: 20px; position: relative; }
.transcript .pm::before, .transcript .pm::after { content: ""; position: absolute; left: 3px; right: 3px; top: 9px; height: 1.5px; background: var(--fg-2); transition: transform .25s var(--ease); }
.transcript .pm::after { transform: rotate(90deg); }
.transcript[open] .pm::after { transform: rotate(0); }
.transcript-in { max-height: 360px; overflow-y: auto; padding: 0 8px 18px 0; scrollbar-width: thin; }
.transcript-in p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
@media (max-width: 900px) { .gvideo { grid-template-columns: 1fr; } }

/* ---------- component slot: a full-width panel between sections ---------- */
.gslot { margin-top: clamp(56px, 7vw, 88px); padding: clamp(22px, 3vw, 34px); border: 1px solid var(--line-2); border-radius: 18px;
  background: radial-gradient(120% 70% at 0% 0%, rgba(139,124,246,.08), transparent 60%), linear-gradient(180deg, #19191c, #141416); }
.gslot-k { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.gslot h3 { margin: 10px 0 0; font-size: clamp(22px, 2.2vw, 28px); font-weight: 300; letter-spacing: -.02em; line-height: 1.2; }
.gslot-sub { margin: 8px 0 0; font-size: 15px; color: var(--fg-2); max-width: 60ch; }
.gslot .media { margin-top: 22px; }
.gslot .fine { margin-top: 16px; }

/* questions: a label and a row of choices (radio buttons styled as a segmented control) */
.gq { display: grid; gap: 0; margin-top: 22px; border-top: 1px solid var(--line); }
.gq fieldset { margin: 0; padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.gq legend { display: block; width: 100%; padding: 0; margin: 0 0 10px; font-size: 15px; color: var(--fg); }
/* Float the legend so it sits inside the padding like normal text; otherwise browsers pin it to the top line and push all the padding below it */
.gq legend { float: left; margin-bottom: 12px; }
.gq legend + * { clear: both; }
.gq legend small { display: inline; color: var(--fg-3); font-size: 13px; margin-left: 8px; }
.gopts { display: flex; flex-wrap: wrap; gap: 6px; }
.gopts label { position: relative; }
.gopts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.gopts span { display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2); font-size: 13px; color: var(--fg-2); transition: background-color .2s, color .2s, border-color .2s; white-space: nowrap; }
.gopts input:hover + span { color: var(--fg); border-color: var(--fg-3); }
.gopts input:checked + span { background: #ececec; border-color: #ececec; color: #111; }
.gopts input:focus-visible + span { outline: 2px solid var(--fg-2); outline-offset: 2px; }
@media (max-width: 640px) { .gq legend small { display: block; margin: 2px 0 0; } }

/* result box: written out in the HTML so crawlers read it; the script rewrites it */
.gresult { margin-top: 22px; padding: 22px 24px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg); }
.gresult .k { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.gresult .v { margin: 8px 0 0; font-size: clamp(26px, 3vw, 38px); font-weight: 300; letter-spacing: -.03em; line-height: 1.1; color: var(--fg); }
.gresult .why { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--fg-2); }
.gresult ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.gresult li { position: relative; padding-left: 22px; font-size: 14px; color: var(--fg-2); }
.gresult li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--fg-3); }
.gresult li.ok::before { background: #7fd1a5; }
.gresult li.near::before { background: #e7c46b; }
.gresult li.no::before { background: #e98a87; }
.gresult[data-tone="ok"] { border-color: rgba(127,209,165,.4); }
.gresult[data-tone="near"] { border-color: rgba(231,196,107,.4); }
.gresult[data-tone="no"] { border-color: rgba(233,138,135,.35); }
.gresult .btn { margin-top: 18px; }

/* tables in the reading column (criteria, examples, channel comparison) */
.gtable-wrap { margin-top: 32px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.gslot .gtable-wrap { margin-top: 20px; background: var(--bg); }
.gtable { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.gtable th, .gtable td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.gtable thead th { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); background: var(--bg-2); }
.gtable tbody th { font-weight: 500; color: var(--fg); min-width: 130px; }
.gtable td { color: var(--fg-2); }
.gtable tr:last-child > * { border-bottom: 0; }
.gtable small { display: block; color: var(--fg-3); font-size: 12px; margin-top: 2px; }
.gtable .num { white-space: nowrap; color: var(--fg); }

/* channel comparison: rows that don't fit the chosen company type fade back */
.gfilter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.gfilter button { font: inherit; font-size: 13px; height: 34px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-2); background: none; color: var(--fg-2); cursor: pointer; transition: background-color .2s, color .2s, border-color .2s; }
.gfilter button:hover { color: var(--fg); border-color: var(--fg-3); }
.gfilter button[aria-pressed="true"] { background: #ececec; border-color: #ececec; color: #111; }
/* one card per channel: the header row is kept for screen readers, each cell shows its own label */
.chan, .chan tbody { display: block; }
.chan thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.chan tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; padding: 20px 22px 22px; border-bottom: 1px solid var(--line); transition: opacity .3s; }
.chan tbody tr:last-child { border-bottom: 0; }
.chan tbody th, .chan tbody td { display: block; padding: 0; border: 0; }
.chan tbody th { grid-column: 1 / -1; font-size: 17px; font-weight: 400; margin-bottom: 4px; }
.chan tbody td { padding-top: 14px; font-size: 14px; }
.chan tbody td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.chan .fit { margin: 0 0 0 10px; vertical-align: 2px; }
@media (max-width: 560px) { .chan tbody tr { grid-template-columns: 1fr; } }
.chan tbody tr.dim { opacity: .32; }
.chan .fit { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #7fd1a5; display: none; }
.chan tr.best .fit { display: inline-block; }
.chan-note { margin: 14px 0 0; font-size: 15px; color: var(--fg-2); min-height: 1.6em; }

/* static before/after table under the redaction demo */
.swaps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 18px; }
.swaps div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--bg); }
.swaps s { color: #ff9e9b; text-decoration-color: rgba(255,158,155,.5); }
.swaps b { display: block; margin-top: 2px; font-weight: 400; font-family: var(--mono); color: #c6bdff; font-size: 12px; }

/* FAQ inside the article */
.gfaq .faq { margin-top: 28px; }
.gfaq .faq summary { font-size: 17px; }
.gfaq .faq .a { font-size: 16px; line-height: 1.65; }
.gfaq .faq .a a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.gfaq summary:focus-visible { outline: 2px solid var(--fg-2); outline-offset: 4px; border-radius: 4px; }

/* prose lists */
.prose .sec > ul:not([class]), .prose .sec > ol:not([class]) { margin: 20px 0 0; padding-left: 22px; font-size: 18px; line-height: 1.65; color: var(--fg-2); }
.prose .sec > ul:not([class]) li, .prose .sec > ol:not([class]) li { margin-top: 8px; padding-left: 4px; }
.prose .sec > ul:not([class]) li::marker, .prose .sec > ol:not([class]) li::marker { color: var(--fg-3); }
.prose .sec h3.sub { margin: 40px 0 0; font-size: 22px; font-weight: 400; letter-spacing: -.01em; color: var(--fg); }
.prose .sec h3.sub + p { margin-top: 10px; }
.prose .gtable a { color: var(--fg); }

/* rail: one primary button, a quiet referral link */
.toc-ref { font-size: 13px; color: var(--fg-3); padding-top: 4px; }
.toc-ref:hover { color: var(--fg); }

/* next guide */
.gnext { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; }
.gnext a { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; transition: border-color .3s; }
.gnext a:hover { border-color: var(--line-2); }
.gnext .k { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.gnext .t { font-size: 16px; color: var(--fg); }
@media (max-width: 640px) { .gnext { grid-template-columns: 1fr; } }

/* closing CTA: one path */
.paths1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
.gref { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--fg-3); }
.gref a { color: var(--fg-2); text-decoration: underline; text-underline-offset: 3px; }
.gref a:hover { color: var(--fg); }

@media (prefers-reduced-motion: reduce) { .chan tbody tr, .gopts span, .transcript .pm::after { transition: none; } }

/* ---------- diagrams (inline SVG with real text) ---------- */
.gfig { margin: 36px 0; }
.gfig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gfig svg { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); font-family: var(--sans); }
.gfig figcaption { margin-top: 14px; font-size: 15px; line-height: 1.5; color: var(--fg-2); }
@media (max-width: 720px) { .gfig-pair { grid-template-columns: 1fr; } }

/* ---------- two-up explainer cards ---------- */
.gcards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.gcards > div { padding: 22px 22px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.gcards .gk { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-3); }
.gcards h4 { margin: 8px 0 0; font-size: 18px; font-weight: 500; color: var(--fg); }
.gcards p { margin: 10px 0 0; font-size: 15px; line-height: 1.6; color: var(--fg-2); }
.gcards .gnote { color: var(--fg-3); font-size: 14px; }
@media (max-width: 720px) { .gcards { grid-template-columns: 1fr; } }

/* ---------- author page ---------- */
.author-top { display: flex; align-items: center; gap: clamp(20px, 3vw, 40px); margin-top: clamp(20px, 3vw, 36px); }
.author-top img { width: clamp(88px, 12vw, 160px); height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 1px solid var(--line-2); }
.author-top .bh1 { margin: 0; }

/* Readable small text: the site's --fg-3 (#6e6e6e) is 3.7:1 on #121212; WCAG AA wants 4.5:1.
   Guide pages use #8f8f8f instead (about 6:1). Diagrams set their own colours, so "hidden" steps stay dim. */
:root { --fg-3: #8f8f8f; }

/* Video series inside a guide's text column: the playlist sits under the main video */
.prose .vids-grid { grid-template-columns: 1fr; gap: 28px; }
.prose .vids-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.prose .vids-item { grid-template-columns: 120px 1fr; }
.prose .vids-item img { width: 120px; }
@media (max-width: 640px) { .prose .vids-list { grid-template-columns: 1fr; } }

/* Data value estimator: number boxes with sliders */
.gnums { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; border-bottom: 1px solid var(--line); }
.gnums .gnum { border-bottom: 0; }
.gnum { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.gnum label { font-size: 15px; color: var(--fg); }
.gnum input[type=number] { width: 100%; font: inherit; font-size: 22px; font-weight: 300; letter-spacing: -.01em; color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; padding: 4px 0 8px; -moz-appearance: textfield; }
.gnum input[type=number]::-webkit-inner-spin-button, .gnum input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gnum input[type=number]::placeholder { color: var(--fg-3); }
.gnum input[type=number]:focus-visible { outline: none; border-bottom-color: var(--fg-2); }
.gnum-hint { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
.gnum input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 6px 0 0; background: transparent; cursor: pointer; }
.gnum input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line-2); }
.gnum input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line-2); }
.gnum input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #ececec; border: 0; box-shadow: 0 0 0 4px rgba(236,236,236,.12); }
.gnum input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #ececec; border: 0; }
.gnum-ends { display: flex; justify-content: space-between; margin: -2px 0 0; font-family: var(--mono); font-size: 11px; color: var(--fg-3); }
.gresult .refresh { margin: 12px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg-2); }
.gresult .refresh b { display: block; font-size: clamp(20px, 2.2vw, 26px); font-weight: 300; letter-spacing: -.02em; color: var(--amber, #e7c46b); }
.gresult .refresh[hidden] { display: none; }
@media (max-width: 640px) { .gnums { grid-template-columns: 1fr; } .gnums .gnum + .gnum { border-top: 1px solid var(--line); } }

/* ---------- light theme (html[data-theme="light"]) ---------- */
html[data-theme="light"] .gslot { background: #fff; }
html[data-theme="light"] .gopts span { background: #fff; }
html[data-theme="light"] .gopts input:checked + span,
html[data-theme="light"] .gfilter button[aria-pressed="true"] { background: #111; border-color: #111; color: #fff; }
html[data-theme="light"] .gresult li.ok::before { background: #2e9e5e; }
html[data-theme="light"] .gresult li.near::before { background: #c08a00; }
html[data-theme="light"] .gresult li.no::before { background: #b42318; }
html[data-theme="light"] .gresult[data-tone="ok"] { border-color: rgba(26,127,67,.35); }
html[data-theme="light"] .gresult[data-tone="near"] { border-color: rgba(160,110,0,.38); }
html[data-theme="light"] .gresult[data-tone="no"] { border-color: rgba(180,35,24,.35); }
html[data-theme="light"] .gresult .refresh b { color: var(--amber); }
html[data-theme="light"] .chan .fit { color: #1a7f43; }
html[data-theme="light"] .swaps s { color: #b42318; text-decoration-color: rgba(180,35,24,.45); }
html[data-theme="light"] .swaps b { color: #5b46d6; }
html[data-theme="light"] .gnum input[type=range]::-webkit-slider-thumb { background: #111; box-shadow: 0 0 0 4px rgba(17,17,17,.1); }
html[data-theme="light"] .gnum input[type=range]::-moz-range-thumb { background: #111; }
/* diagrams: a white plate with the dark palette's attribute colours remapped (theme.css) */
html[data-theme="light"] .gfig svg { background: #fff; }
html[data-theme="light"] .gfig svg [fill="#ffffff"], html[data-theme="light"] .gfig svg [fill="#fff"] { fill: #fff; }
/* source pages: example records are <pre> blocks with dark inline colours */
html[data-theme="light"] pre[style*="background:#1c1c1e"] { background: #fff !important; border-color: rgba(17,17,17,.16) !important; color: #111 !important; }
