/*
Stylesheet: Seriously Scientific - Series Guide
Version:    2.0.0
Template:   page-series-guide.php

WHAT CHANGED IN 2.0.0, AND WHY
  v1 borrowed .news-layout, .news-sidebar-card and .news-content from
  news.css. Nothing enqueues news.css on a guide, so on the live page
  the two-column grid, the card backgrounds and the body width all
  vanished: the sidebar dropped underneath the article at full width
  and the content column collapsed to a narrow strip.

  This file now owns every rule the template needs and depends on no
  other stylesheet. The palette is re-declared on the page wrapper, the
  same way voyager.css and eclipse.css do it, so the page is
  self-sufficient even if load order changes.

THREE THINGS THAT ARE LOAD-BEARING
  1. Section 3, the .entry-content float guard. Without it, floated
     captions still LOOK right but stop taking clicks. See
     theme-architecture-notes.md.
  2. Section 2, the Space Grotesk declarations. A custom template
     inherits none of the site's automatic Grotesk rule, because that
     rule is scoped to .page-template-default.
  3. --site-w. The guide must be the same width as every other page on
     the site, and it reads that from the same variable style.css uses.
*/

/* ═══════════════════════════════════════════════════════════
   1. PAGE WRAPPER AND PALETTE
   Values mirror style.css v3.2 Cosmic Rust Supernova. Declared here
   so the page renders correctly whatever else does or does not load.
   ═══════════════════════════════════════════════════════════ */
.ss-guide-page {
    --deep-space: #1A0C08;
    --lunar-rock: #3D2318;
    --martian-soil: #795548;
    --supernova-orange: #CD5A24;
    --supernova-orange-hover: #A85420;
    --supernova-orange-light: #D4742E;
    --nebula-turquoise: #4A9FD4;
    --amber: #E29000;
    --highlight-yellow: #fadb67;
    --starlight: #F7FAFC;
    --starlight-muted: #E2E8F0;

    --deep-space-rgb: 26, 12, 8;
    --lunar-rock-rgb: 61, 35, 24;
    --supernova-orange-rgb: 205, 90, 36;
    --nebula-turquoise-rgb: 74, 159, 212;
    --amber-rgb: 226, 144, 0;

    /* Card surfaces. Translucent rather than solid, so the page's own
       background shows through and the cards sit on the page instead
       of on top of it. */
    --sg-card-bg: rgba(var(--lunar-rock-rgb), 0.55);
    --sg-card-bg-hover: rgba(var(--lunar-rock-rgb), 0.78);
    --sg-card-line: rgba(255, 255, 255, 0.09);
    --sg-card-line-hover: rgba(var(--supernova-orange-rgb), 0.55);
    --sg-radius: 12px;
    --sg-dim: #B8A99E;          /* readable muted text, AA on deep space */

    max-width: var(--site-w, 1320px);
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    box-sizing: border-box;
    color: var(--starlight);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ss-guide-page *,
.ss-guide-page *::before,
.ss-guide-page *::after {
    box-sizing: border-box;
}

/* Safety net. No anchor on this page may fall back to the browser's
   default blue; anything without its own colour inherits the text
   around it. Three links in the episode strip were doing exactly that
   on the live page. Every rule below overrides this deliberately. */
.ss-guide-page a { color: inherit; }

/* ═══════════════════════════════════════════════════════════
   2. TYPOGRAPHY: Space Grotesk 700
   Prominent headings, stat figures, dossier titles and kickers only.
   Everything else stays on Inter.
   ═══════════════════════════════════════════════════════════ */
.ss-guide-page .sg-title,
.ss-guide-page .sg-section-title,
.ss-guide-page .sg-dossier-title,
.ss-guide-page .sg-dossier-kicker,
.ss-guide-page .sg-stat-num,
.ss-guide-page .sg-sibling-num,
.ss-guide-page .sg-rail-n,
.ss-guide-page .sg-ou-band-title,
.ss-guide-page .sg-concept-title,
.ss-guide-page .sg-content h2,
.ss-guide-page .sg-content h3 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   3. THE .entry-content FLOAT GUARD
   style.css section 8 puts every direct child of .entry-content on
   position:relative; z-index:2, so paragraphs paint over an earlier
   floated caption and steal its clicks.

   flow-root contains the float so the figure has real height.
   z-index 3 lifts captions above the paragraphs that follow.

   Both figcaption AND .wp-caption-text are named, because the classic
   [caption] shortcode emits the second, never the first.
   ═══════════════════════════════════════════════════════════ */
.sg-content figure,
.sg-content .wp-caption,
.sg-content .sg-figure {
    display: flow-root;
}

.sg-content > figure,
.sg-content > .wp-caption,
.sg-content > .sg-figure,
.sg-content .wp-caption {
    position: relative;
    z-index: 3;
}

/* ═══════════════════════════════════════════════════════════
   4. PROGRESS BAR AND BREADCRUMB
   ═══════════════════════════════════════════════════════════ */
.sg-progress-track {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.25);
    z-index: 9999;
}

.sg-progress-bar {
    height: 100%;
    width: 0;
    background: var(--supernova-orange);
    box-shadow: 0 0 10px var(--supernova-orange);
    transition: width 0.1s linear;
}

.sg-crumb {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sg-dim);
    padding: 1.5rem 0 0;
    margin-bottom: 1.5rem;
}

.sg-crumb a {
    color: var(--sg-dim);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sg-crumb a:hover {
    color: var(--supernova-orange);
}

.sg-crumb-sep {
    margin: 0 0.5rem;
    opacity: 0.45;
}

/* ═══════════════════════════════════════════════════════════
   5. HEADER BITS
   ═══════════════════════════════════════════════════════════ */
.sg-kicker {
    margin: 0 0 0.55rem;
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--amber);
    margin-bottom: 0.7rem;
}

/* On the hero, over the scrim. */
.ss-guide-page .sg-title {
    font-size: clamp(1.8rem, 3.6vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    color: #fff;
    margin: 0;
    max-width: 20ch;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}

.sg-hero--plain .sg-title { text-shadow: none; color: var(--starlight); }

.sg-standfirst {
    font-size: clamp(1.02rem, 1.4vw, 1.22rem);
    line-height: 1.65;
    color: var(--starlight-muted);
    border-left: 4px solid var(--supernova-orange);
    background: linear-gradient(90deg, rgba(var(--supernova-orange-rgb), 0.12), transparent 75%);
    padding: 1rem 1.3rem;
    border-radius: 0 8px 8px 0;
    margin: 0 0 1.75rem;
    max-width: 70ch;
}

.sg-dossier .sg-byline {
    flex: 1 1 100%;
    padding-top: 0.9rem;
    margin-top: 0.2rem;
    border-top: 1px solid var(--sg-card-line);
}

.sg-byline {
    font-size: 0.75rem;
    color: var(--sg-dim);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.sg-readtime {
    background: rgba(var(--nebula-turquoise-rgb), 0.16);
    color: var(--nebula-turquoise);
    padding: 3px 9px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.65rem;
}

.sg-nohost-badge {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sg-dim);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.13);
    padding: 3px 9px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   6. DOSSIER STAT STRIP
   Full content width, matching the hero beneath it.
   ═══════════════════════════════════════════════════════════ */
.sg-dossier {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    margin: 0 0 2rem;
    padding: 1.15rem 1.5rem;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-card-line);
    border-left: 3px solid var(--amber);
    background:
        linear-gradient(135deg, rgba(var(--lunar-rock-rgb), 0.7), rgba(var(--lunar-rock-rgb), 0.35));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sg-dossier-head {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-width: 0;
}

.sg-dossier-kicker {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--amber);
}

.sg-dossier-title {
    font-size: 1.4rem;
    line-height: 1.2;
    color: var(--starlight);
}

.sg-dossier-sub {
    font-size: 0.74rem;
    color: var(--sg-dim);
}

.sg-stat-row {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.sg-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sg-stat-num {
    font-size: 1.9rem;
    line-height: 1;
    color: var(--supernova-orange);
    font-variant-numeric: tabular-nums;
}

.sg-stat-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    color: var(--sg-dim);
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   7. HERO
   Image first, title on the image. Capped by viewport height so the
   whole banner plus the start of the article is visible on a 1366x768
   laptop, which is the screen this theme keeps tripping over.
   ═══════════════════════════════════════════════════════════ */
.sg-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    /* width must be definite. Without it, min-height plus aspect-ratio
       makes the browser derive WIDTH from HEIGHT, and the hero forced
       itself to 747px on a 390px phone. */
    width: 100%;
    min-height: 320px;
    margin: 0 0 0.75rem;
    border-radius: var(--sg-radius);
    overflow: hidden;
    border: 1px solid var(--sg-card-line);
    background: rgba(var(--lunar-rock-rgb), 0.5);
}

.sg-hero-media {
    position: absolute;
    inset: 0;
}

.sg-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* The scrim. Dark enough at the bottom for white type to pass contrast,
   clear at the top so the photograph is still the photograph. */
.sg-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(var(--deep-space-rgb), 0.94) 0%,
        rgba(var(--deep-space-rgb), 0.78) 26%,
        rgba(var(--deep-space-rgb), 0.28) 55%,
        rgba(var(--deep-space-rgb), 0.05) 100%
    );
    pointer-events: none;
}

.sg-hero--image { aspect-ratio: 21 / 9; max-height: 62vh; }
.sg-hero--plain { aspect-ratio: auto; min-height: 0; padding-top: 1rem; }

.sg-hero-body {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 2rem 2.25rem 1.9rem;
}

.sg-hero-caption {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--sg-dim);
    font-style: italic;
    margin: 0 0 1.5rem;
    padding: 0 0.25rem;
}

.sg-hero-caption a {
    color: var(--amber);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   8. TWO-COLUMN LAYOUT
   This is the rule whose absence broke the live page.
   ═══════════════════════════════════════════════════════════ */
.sg-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 3rem;
    align-items: start;
}

.sg-main {
    min-width: 0;
}

.sg-railcol {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 8.5rem;         /* clears the 7rem sticky site header */
}

/* ═══════════════════════════════════════════════════════════
   9. ARTICLE BODY
   ═══════════════════════════════════════════════════════════ */
.ss-guide-page .sg-content {
    font-size: 1.06rem;
    line-height: 1.85;
    color: rgba(247, 250, 252, 0.9);
}

.ss-guide-page .sg-content p {
    margin: 0 0 1.5rem;
}

.ss-guide-page .sg-content h2 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: clamp(1.6rem, 2.1vw, 1.95rem);
    line-height: 1.2;
    color: var(--supernova-orange);
    margin: 3rem 0 1.1rem;
}

.ss-guide-page .sg-content h2::after {
    content: '';
    flex: 1;
    height: 1px;
    min-width: 40px;
    background: linear-gradient(90deg, rgba(var(--supernova-orange-rgb), 0.5), transparent);
}

.ss-guide-page .sg-content h3 {
    font-size: clamp(1.25rem, 1.5vw, 1.45rem);
    line-height: 1.32;
    color: var(--starlight);
    margin: 2.4rem 0 0.8rem;
}

.ss-guide-page .sg-content a {
    color: var(--amber);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ss-guide-page .sg-content a:hover {
    color: var(--supernova-orange);
}

.ss-guide-page .sg-content strong {
    color: var(--starlight);
    font-weight: 700;
}

.ss-guide-page .sg-content ul,
.ss-guide-page .sg-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    padding: 0;
}

.ss-guide-page .sg-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

.ss-guide-page .sg-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.sg-content .alignleft  { float: left;  margin: 8px 28px 18px 0; }
.ss-guide-page .sg-content .alignright { float: right; margin: 8px 0 18px 28px; }
.sg-content .aligncenter{ display: block; margin: 25px auto; }

.ss-guide-page .sg-content figcaption,
.ss-guide-page .sg-content .wp-caption-text {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--sg-dim);
    margin-top: 0.55rem;
    font-style: italic;
    text-align: center;
}

.ss-guide-page .sg-content figcaption a,
.ss-guide-page .sg-content .wp-caption-text a {
    color: var(--amber);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ss-guide-page .sg-content blockquote {
    border-left: 4px solid var(--amber);
    background: rgba(var(--amber-rgb), 0.06);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--starlight-muted);
}

/* ═══════════════════════════════════════════════════════════
   10. IN-BODY COMPONENTS
   Class names appear in the pasted HTML of each guide.
   ═══════════════════════════════════════════════════════════ */
.sg-content .sg-lead {
    font-size: 1.18rem;
    line-height: 1.75;
    color: var(--starlight);
}

/* Concept bento cards, with the hover treatment the rest of the site
   uses on its bento cards: lift, brighten, warm the border. */
.sg-content .sg-concepts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.1rem;
    margin: 1.75rem 0 2.25rem;
}

.sg-content .sg-concept {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.2rem;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-card-line);
    border-top: 3px solid var(--nebula-turquoise);
    background: var(--sg-card-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: transform 0.22s ease, border-color 0.22s ease,
                background 0.22s ease, box-shadow 0.22s ease;
}

.sg-content .sg-concept:hover {
    transform: translateY(-4px);
    background: var(--sg-card-bg-hover);
    border-color: var(--sg-card-line-hover);
    border-top-color: var(--supernova-orange);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.sg-content .sg-concept-label {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--nebula-turquoise);
    transition: color 0.22s ease;
}

.sg-content .sg-concept:hover .sg-concept-label {
    color: var(--supernova-orange);
}

.sg-content .sg-concept-title {
    font-size: 1.04rem;
    line-height: 1.25;
    color: var(--starlight);
}

.sg-content .sg-concept-desc {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--starlight-muted);
}

/* Quick facts */
.sg-content .sg-facts {
    margin: 1.75rem 0 2.25rem;
    padding: 1.3rem 1.5rem;
    border-radius: 0 var(--sg-radius) var(--sg-radius) 0;
    border: 1px solid rgba(var(--supernova-orange-rgb), 0.22);
    border-left: 4px solid var(--supernova-orange);
    background: linear-gradient(135deg, rgba(var(--supernova-orange-rgb), 0.1), rgba(var(--lunar-rock-rgb), 0.3));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sg-content .sg-facts-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--supernova-orange);
    margin-bottom: 0.85rem;
}

.sg-content .sg-facts ul {
    margin: 0 0 0 1.1rem;
}

.sg-content .sg-facts li {
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 0.55rem;
}

.sg-content .sg-facts li:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════
   11. SECTION HEADINGS below the article
   ═══════════════════════════════════════════════════════════ */
.sg-section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.35rem;
    color: var(--supernova-orange);
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin: 3rem 0 0.4rem;
}

.sg-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    min-width: 40px;
    background: linear-gradient(90deg, rgba(var(--amber-rgb), 0.6), transparent);
}

.sg-section-kicker {
    font-size: 0.82rem;
    color: var(--sg-dim);
    margin: 0 0 1.2rem;
}

/* ═══════════════════════════════════════════════════════════
   12. OPEN UNIVERSITY BAND
   ═══════════════════════════════════════════════════════════ */
.sg-ou-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 3rem 0 0;
    padding: 1.5rem 1.75rem;
    border-radius: var(--sg-radius);
    border: 1px solid rgba(var(--amber-rgb), 0.3);
    border-left: 4px solid var(--amber);
    background: linear-gradient(135deg, rgba(var(--amber-rgb), 0.13), rgba(var(--lunar-rock-rgb), 0.3));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.sg-ou-band-body {
    flex: 1 1 340px;
    min-width: 0;
}

.sg-ou-band-kicker {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--amber);
    margin-bottom: 0.4rem;
}

.ss-guide-page .sg-ou-band-title {
    font-size: 1.35rem;
    line-height: 1.2;
    color: var(--starlight);
    margin: 0 0 0.55rem;
    display: block;
    text-transform: none;
}

.sg-ou-band-title::after { content: none; }

.sg-ou-band-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--starlight-muted);
    margin: 0;
    max-width: 62ch;
}

.sg-ou-band-btn {
    flex: 0 0 auto;
    display: inline-block;
    background: var(--amber);
    color: var(--deep-space) !important;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none !important;
    transition: filter 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sg-ou-band-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(var(--amber-rgb), 0.28);
}

/* ═══════════════════════════════════════════════════════════
   13. SIBLING EPISODES
   ═══════════════════════════════════════════════════════════ */
.sg-sibling-list {
    list-style: none;
    margin: 1.2rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.sg-sibling-list li { margin: 0; }

.sg-sibling-list a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--sg-card-line);
    background: var(--sg-card-bg);
    color: var(--starlight);
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sg-sibling-list a:hover {
    transform: translateX(4px);
    border-color: var(--sg-card-line-hover);
    background: var(--sg-card-bg-hover);
}

.sg-sibling-num {
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--supernova-orange-rgb), 0.16);
    color: var(--supernova-orange);
    font-size: 0.88rem;
}

.sg-sibling-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sg-sibling-place {
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--starlight);
}

.sg-sibling-title {
    font-size: 0.74rem;
    color: var(--sg-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   14. VIDEO STRIP
   ═══════════════════════════════════════════════════════════ */
.sg-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
}

.sg-video-card {
    display: block;
    text-decoration: none;
    color: var(--starlight);
    border-radius: 10px;
    transition: transform 0.22s ease;
}

.sg-video-card:hover { transform: translateY(-4px); }

.sg-video-thumb {
    position: relative;
    display: block;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--sg-card-line);
    aspect-ratio: 16 / 9;
    background: rgba(var(--lunar-rock-rgb), 0.5);
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

.sg-video-card:hover .sg-video-thumb {
    border-color: var(--sg-card-line-hover);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
}

.sg-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.35s ease;
}

.sg-video-card:hover .sg-video-thumb img { transform: scale(1.05); }

.sg-video-noimg {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(var(--supernova-orange-rgb), 0.2), rgba(var(--nebula-turquoise-rgb), 0.12));
}

.sg-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.22s ease, background 0.22s ease;
}

.sg-video-card:hover .sg-video-play {
    transform: translate(-50%, -50%) scale(1.12);
    background: rgba(var(--supernova-orange-rgb), 0.85);
}

.sg-video-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 0.65rem;
    transition: color 0.2s ease;
}

.sg-video-card:hover .sg-video-title { color: var(--supernova-orange); }

/* ═══════════════════════════════════════════════════════════
   15. PUZZLES
   ═══════════════════════════════════════════════════════════ */
.sg-puzzle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.9rem;
    margin-top: 1.2rem;
}

.sg-puzzle-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-align: center;
    padding: 1.2rem 0.85rem;
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-card-line);
    background: var(--sg-card-bg);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-decoration: none;
    transition: transform 0.22s ease, border-color 0.22s ease,
                background 0.22s ease, box-shadow 0.22s ease;
}

.sg-puzzle-card:hover {
    transform: translateY(-4px);
    border-color: var(--sg-card-line-hover);
    background: var(--sg-card-bg-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Square icon box. aspect-ratio stops it collapsing when the icon SVG
   has no intrinsic ratio, which is what happened on the biographies. */
.sg-puzzle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    aspect-ratio: 1 / 1;
    color: var(--amber);
    transition: transform 0.22s ease, color 0.22s ease;
}

.sg-puzzle-card:hover .sg-puzzle-icon {
    transform: scale(1.1);
    color: var(--supernova-orange);
}

.sg-puzzle-icon svg { width: 100%; height: 100%; }

.sg-puzzle-title {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--starlight-muted);
}

/* ═══════════════════════════════════════════════════════════
   16. SHARE
   ═══════════════════════════════════════════════════════════ */
.sg-share {
    text-align: center;
    margin: 3rem 0 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sg-card-line);
    position: relative;
    z-index: 5;
}

.sg-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    background: transparent;
    color: var(--supernova-orange);
    border: 1px solid rgba(var(--supernova-orange-rgb), 0.5);
    border-radius: 8px;
    padding: 0.7rem 1.6rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sg-share-btn:hover {
    background: rgba(var(--supernova-orange-rgb), 0.14);
    border-color: var(--supernova-orange);
    transform: translateY(-2px);
}

.sg-share-btn:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

.sg-share h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--supernova-orange);
    margin: 0 0 1.1rem;
    font-size: 1.2rem;
}

/* ═══════════════════════════════════════════════════════════
   17. COMMENTS, PARKED
   ═══════════════════════════════════════════════════════════ */
.sg-comments[data-sg-comments="parked"] { display: none; }

.sg-comments[data-sg-comments="on"] {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sg-card-line);
}

/* ═══════════════════════════════════════════════════════════
   18. SIDEBAR CARDS
   ═══════════════════════════════════════════════════════════ */
.sg-card {
    border-radius: var(--sg-radius);
    border: 1px solid var(--sg-card-line);
    background: var(--sg-card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.3rem;
    transition: border-color 0.22s ease, background 0.22s ease;
}

.sg-card:hover {
    background: var(--sg-card-bg-hover);
    border-color: rgba(255, 255, 255, 0.16);
}

.sg-ou-card      { border-left: 3px solid var(--amber); }
.sg-watch-card   { border-left: 3px solid var(--supernova-orange); }
.sg-rail-card    { border-left: 3px solid var(--amber); }
.sg-educator-card{ border-left: 3px solid var(--supernova-orange); }

.sg-card-title {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 1rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--sg-card-line);
}

.sg-card-title--orange { color: var(--supernova-orange); }
.sg-card-title--blue   { color: var(--amber); }

.sg-watch-body,
.sg-ou-body {
    font-size: 0.83rem;
    line-height: 1.6;
    color: var(--starlight-muted);
    margin: 0 0 0.9rem;
}

.sg-watch-note {
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--sg-dim);
    margin: 0.65rem 0 0;
}

/* Open University gets the solid button: it is the link that works for
   every reader wherever they are. */
.sg-ou-btn {
    display: block;
    text-align: center;
    background: var(--amber);
    color: var(--deep-space) !important;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.35;
    text-decoration: none !important;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.sg-ou-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* iPlayer is one rung down, and carries the restriction on the button
   rather than only in the note underneath. */
.sg-watch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    text-align: center;
    background: transparent;
    color: var(--supernova-orange) !important;
    border: 1px solid rgba(var(--supernova-orange-rgb), 0.5);
    padding: 0.65rem 1rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sg-watch-btn:hover {
    background: rgba(var(--supernova-orange-rgb), 0.14);
    border-color: var(--supernova-orange);
}

.sg-watch-uk {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--sg-dim);
}

.sg-hub-btn {
    display: block;
    text-align: center;
    background: var(--supernova-orange);
    color: #fff !important;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sg-hub-btn:hover {
    background: var(--supernova-orange-hover);
    transform: translateY(-2px);
}

.sg-bio-link {
    display: block;
    text-align: center;
    margin-top: 0.65rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(var(--supernova-orange-rgb), 0.3);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--supernova-orange) !important;
    text-decoration: none !important;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sg-bio-link:hover {
    background: rgba(var(--supernova-orange-rgb), 0.1);
    border-color: var(--supernova-orange);
}

.sg-educator-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--starlight);
    margin: 0 0 0.9rem;
}

/* Episode rail */
.sg-rail {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sg-rail li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sg-rail li:last-child { border-bottom: none; }

.sg-rail a,
.sg-rail > li > span {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.35rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--starlight-muted);
    text-decoration: none !important;
    transition: color 0.2s ease, background 0.2s ease, padding-left 0.2s ease;
}

.sg-rail a:hover {
    color: var(--supernova-orange);
    background: rgba(var(--supernova-orange-rgb), 0.09);
    padding-left: 0.7rem;
}

.sg-rail-n {
    flex: 0 0 auto;
    width: 1.4rem;
    font-size: 0.7rem;
    color: var(--sg-dim);
}

.sg-rail-here > span {
    color: var(--supernova-orange);
    font-weight: 700;
    background: rgba(var(--supernova-orange-rgb), 0.1);
}

.sg-rail-here .sg-rail-n { color: var(--supernova-orange); }

.sg-rail-soon { opacity: 0.38; cursor: default; }

/* ═══════════════════════════════════════════════════════════
   19. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1180px) {
    .sg-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; }
    .sg-dossier { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .sg-stat-row { gap: 1.75rem; }
}

@media (max-width: 900px) {
    .ss-guide-page { padding: 0 1.25rem 3rem; }
    .sg-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .sg-railcol {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    /* The watch card carries the copyright message, so it spans rather
       than being squeezed into a half column. */
    .sg-watch-card, .sg-ou-card { grid-column: 1 / -1; }
    .sg-video-grid { grid-template-columns: 1fr 1fr; }
    .sg-ou-band { flex-direction: column; align-items: stretch; padding: 1.25rem; }
    .sg-ou-band-btn { text-align: center; }
    .sg-section-title { font-size: 1.15rem; }
    .sg-stat-num { font-size: 1.6rem; }
}

@media (max-width: 700px) {
    /* A 21/9 banner is a letterbox slot on a phone. Squarer, and the
       min-height goes with it so nothing drives width from height. */
    .sg-hero--image { aspect-ratio: 4 / 3; max-height: 52vh; }
    .sg-hero { min-height: 220px; }
    .sg-hero-body { padding: 1.4rem 1.25rem 1.3rem; }
}

@media (max-width: 560px) {
    .sg-railcol { grid-template-columns: 1fr; }
    .sg-video-grid { grid-template-columns: 1fr; }
    .sg-content .sg-lead { font-size: 1.03rem; }
    .sg-sibling-title { display: none; }
    .sg-content .alignleft,
    .sg-content .alignright { float: none; display: block; margin: 1.5rem auto; }
}

@media (prefers-reduced-motion: reduce) {
    .ss-guide-page * { transition: none !important; }
    .ss-guide-page *:hover { transform: none !important; }
}