/**
 * single-news.css
 *
 * Scoped stylesheet for the single-psp_news.php template.
 * Enqueued conditionally via inc/enqueue.php — only on psp_news single posts.
 * Depends on main.css for: design tokens (--black, --silver, etc.),
 * .container, and global reset. Do not duplicate those here.
 *
 * Sections:
 *   1. Breadcrumb
 *   2. Article hero (Option A: title overlaid on full-bleed image)
 *   3. Meta bar
 *   4. Article body + prose
 *   5. Editorial components (pull quote, figure, stats)
 *   6. Article footer (tags + share)
 *   7. Sidebar (TOC + related articles)
 *   8. Prev/next article nav
 *   9. Responsive overrides (1100px, 900px, 540px)
 *
 * @package psi-sigma-phi
 */


/* ─────────────────────────────────────────────
   1. BREADCRUMB
───────────────────────────────────────────── */

.breadcrumb {
    background: #1e1e1e;
    border-bottom: 1px solid rgba(184, 184, 184, 0.12);
}

.breadcrumb-inner {
    display: flex;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
    height: 48px;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-inner::-webkit-scrollbar {
    display: none;
}

.breadcrumb-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    background: rgba(184, 184, 184, 0.1);
    border: 1px solid rgba(184, 184, 184, 0.15);
    border-radius: 50%;
    margin-right: 12px;
    transition: background 0.2s;
    text-decoration: none;
}

.breadcrumb-home:hover {
    background: rgba(184, 184, 184, 0.2);
}

.breadcrumb-home svg {
    color: var(--silver);
}

.breadcrumb-sep {
    color: rgba(184, 184, 184, 0.3);
    margin: 0 10px;
    user-select: none;
}

.breadcrumb-inner a {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.breadcrumb-inner a:hover {
    color: var(--silver-light);
    text-decoration: underline;
}

.breadcrumb-current {
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}


/* ─────────────────────────────────────────────
   2. ARTICLE HERO
   Option A: title overlaid on full-bleed image.
   Multi-stop gradient guarantees title legibility
   regardless of image brightness or content.
───────────────────────────────────────────── */

.article-hero {
    position: relative;
    width: 100%;
    height: clamp(520px, 40vh, 780px);
    overflow: hidden;
    background: var(--black-2);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid rgba(184, 184, 184, 0.08);
}

/* Featured image — set by the_post_thumbnail() */
.article-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: grayscale(100%) contrast(1.05);
    display: block;
}

/* No-image fallback: Ψ watermark centred on dark field.
   PHP only renders this div when !has_post_thumbnail(). */
.article-hero-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.article-hero-fallback-glyph {
    font-family: var(--serif);
    font-size: clamp(280px, 36vw, 480px);
    font-weight: 900;
    color: var(--white);
    opacity: 0.04;
    line-height: 1;
    user-select: none;
    letter-spacing: -0.04em;
}

/* Gradient overlay — always present.
   Light veil at top preserves photographic impact.
   Opaque at bottom so title is always readable. */
.article-hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 10, 10, 0.22)  0%,
        rgba(10, 10, 10, 0.05) 20%,
        rgba(10, 10, 10, 0.10) 40%,
        rgba(10, 10, 10, 0.62) 62%,
        rgba(10, 10, 10, 0.88) 78%,
        rgba(10, 10, 10, 0.97) 100%
    );
    pointer-events: none;
}

/* Read time — absolute top-right */
.article-hero-readtime {
    position: absolute;
    top: 36px;
    right: 40px;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(245, 245, 245, 0.7);
    display: flex;
    align-items: center;
    gap: 7px;
    z-index: 2;
}

.article-hero-readtime svg {
    opacity: 0.6;
    flex-shrink: 0;
}

/* Hero content container — holds badge, title, meta, bottom bar */
.article-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 40px 48px;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

/* Category badge — white pill, black text */
.article-category-badge {
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--black);
    background: var(--white);
    padding: 6px 14px;
    display: inline-block;
    line-height: 1;
    align-self: flex-start;
    margin-bottom: 18px;
}

/* H1 — article title
   text-shadow lifts letterforms off light-toned images */
.article-title {
    font-family: var(--serif);
    font-size: clamp(30px, 4vw, 56px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.02em;
    color: var(--white);
    margin-bottom: 20px;
    max-width: 860px;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55), 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Date + chapter chips row */
.article-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.article-date {
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(200, 200, 200, 0.75);
    font-weight: 600;
}

.meta-sep {
    width: 3px;
    height: 3px;
    background: rgba(184, 184, 184, 0.35);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Chapter relationship chips — ghost style on dark background */
.chapter-chip {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: rgba(200, 200, 200, 0.7);
    border: 1px solid rgba(184, 184, 184, 0.3);
    padding: 4px 10px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.chapter-chip:hover {
    border-color: rgba(245, 245, 245, 0.7);
    color: var(--white);
}

/* Bottom bar: byline left, share right */
.article-hero-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(184, 184, 184, 0.15);
    flex-wrap: wrap;
}

/* Byline */
.article-byline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.byline-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(184, 184, 184, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 13px;
    font-weight: 700;
    color: rgba(200, 200, 200, 0.85);
    flex-shrink: 0;
}

.byline-text .byline-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--silver-light);
}

.byline-text .byline-role {
    font-size: 11px;
    color: rgba(184, 184, 184, 0.55);
    margin-top: 2px;
}

/* Share buttons */
.share-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-label {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(184, 184, 184, 0.5);
    font-weight: 700;
    margin-right: 4px;
}

.share-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(184, 184, 184, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(184, 184, 184, 0.6);
    text-decoration: none;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.share-btn:hover {
    border-color: rgba(245, 245, 245, 0.5);
    color: var(--white);
}

/* Copy-link confirmed state: brief flash of white border */
.share-btn.js-copied {
    border-color: var(--silver);
    color: var(--white);
}


/* ─────────────────────────────────────────────
   3. META BAR
   Conditional — only rendered by PHP when
   news_image_caption or news_source_url is set.
───────────────────────────────────────────── */

.article-meta-bar {
    background: var(--black-2);
    border-bottom: 1px solid rgba(184, 184, 184, 0.08);
    padding: 14px 0;
}

.article-meta-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/* Photo credit / caption */
.article-image-caption-bar {
    font-size: 11px;
    color: var(--silver-dark);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 7px;
    line-height: 1.5;
}

.article-image-caption-bar svg {
    flex-shrink: 0;
    opacity: 0.45;
}

/* External source attribution */
.source-note {
    font-size: 11px;
    color: var(--silver-dark);
    letter-spacing: 0.06em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.source-note a {
    color: var(--silver);
    text-underline-offset: 2px;
    text-decoration: underline;
    transition: color 0.2s;
}

.source-note a:hover {
    color: var(--white);
}

.source-note svg {
    flex-shrink: 0;
    opacity: 0.5;
}


/* ─────────────────────────────────────────────
   4. ARTICLE BODY + PROSE
───────────────────────────────────────────── */

.article-body {
    padding: 72px 0 96px;
}

/* Two-column: prose + sidebar.
   Grid collapses to single column at 1100px. */
.article-body .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 80px;
    align-items: start;
}

/* Prose column */
.article-prose {
    max-width: 680px;
    min-width: 0; /* prevents grid blowout on long words */
}

.article-prose p {
    font-size: 17px;
    color: var(--silver-light);
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 28px;
}

.article-prose p:last-child {
    margin-bottom: 0;
}

.article-prose h2 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin: 52px 0 20px;
    padding-top: 4px;
    /* Scroll offset for TOC anchor links — accounts for sticky header */
    scroll-margin-top: calc(96px + 24px);
}

.article-prose h3 {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    margin: 40px 0 16px;
    scroll-margin-top: calc(96px + 24px);
}

.article-prose strong {
    color: var(--white);
    font-weight: 600;
}

.article-prose a {
    color: var(--silver);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.article-prose a:hover {
    color: var(--white);
}

.article-prose ul,
.article-prose ol {
    color: var(--silver-light);
    font-size: 17px;
    font-weight: 300;
    line-height: 1.8;
    padding-left: 24px;
    margin-bottom: 28px;
}

.article-prose li {
    margin-bottom: 8px;
}


/* ─────────────────────────────────────────────
   5. EDITORIAL COMPONENTS
   Pull quote, inline figure, stats callout.
   All live inside .article-prose via the_content().
───────────────────────────────────────────── */

/* Pull quote */
.pull-quote {
    margin: 52px 0;
    padding: 36px 40px;
    border-left: 3px solid var(--silver);
    background: var(--black-2);
}

.pull-quote blockquote {
    font-family: var(--serif);
    font-size: 22px;
    font-style: italic;
    font-weight: 500;
    color: var(--white);
    line-height: 1.45;
}

.pull-quote cite {
    display: block;
    margin-top: 18px;
    font-size: 11px;
    font-style: normal;
    color: var(--silver-dark);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}

/* Inline figure */
.article-figure {
    margin: 48px 0;
}

.article-figure-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--black-2);
    border: 1px solid rgba(184, 184, 184, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.article-figure-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.05);
}

.article-figure figcaption {
    font-size: 12px;
    color: var(--silver-dark);
    margin-top: 10px;
    line-height: 1.5;
}

/* Stats callout — 3-column grid of metric cells */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(184, 184, 184, 0.08);
    border: 1px solid rgba(184, 184, 184, 0.1);
    margin: 48px 0;
}

.stat-cell {
    background: var(--black-2);
    padding: 28px 24px;
}

.stat-value {
    font-family: var(--serif);
    font-size: 36px;
    font-weight: 800;
    background: var(--silver-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 11px;
    color: var(--silver-dark);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1.4;
}


/* ─────────────────────────────────────────────
   6. ARTICLE FOOTER — tags + share
───────────────────────────────────────────── */

.article-footer {
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid rgba(184, 184, 184, 0.1);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
}

/* Tags group */
.article-tags-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-tags-label {
    font-size: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 700;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.article-tag {
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--silver-dark);
    border: 1px solid rgba(184, 184, 184, 0.18);
    padding: 5px 12px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.article-tag:hover {
    border-color: var(--silver);
    color: var(--silver);
}

/* Footer share — mirrors hero share row */
.article-footer-share {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.article-footer-share .share-label {
    text-align: right;
}


/* ─────────────────────────────────────────────
   7. SIDEBAR
   Sticky at desktop. TOC + related articles.
   Entire sidebar is omitted from the DOM by PHP
   when news_toc = false — no CSS toggling needed.
───────────────────────────────────────────── */

.article-sidebar {
    position: sticky;
    top: calc(96px + 24px); /* sticky header height + breathing room */
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Sidebar block wrapper */
.sidebar-block {
    background: var(--black-2);
    border: 1px solid rgba(184, 184, 184, 0.1);
    padding: 28px 24px;
}

.sidebar-block + .sidebar-block {
    margin-top: 1px;
}

/* Block heading row */
.sidebar-block-label {
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 700;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-block-label::before {
    content: "";
    width: 16px;
    height: 1px;
    background: var(--silver-dark);
    flex-shrink: 0;
}

/* TOC list — populated by news-toc.js */
.toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.toc-list a {
    display: block;
    padding: 10px 14px;
    background: var(--black-3);
    font-size: 12px;
    color: var(--silver-dark);
    text-decoration: none;
    line-height: 1.4;
    transition: background 0.2s, color 0.2s, padding-left 0.15s;
}

.toc-list a:hover {
    background: #1e1e1e;
    color: var(--white);
    padding-left: 18px;
}

/* h3 sub-items — indented, smaller, dimmer */
.toc-list a.toc-sub {
    padding-left: 22px;
    font-size: 11px;
    color: rgba(184, 184, 184, 0.5);
}

/* Active section — set by news-toc.js on scroll */
.toc-list a.is-active {
    background: #1e1e1e;
    color: var(--white);
    border-left: 2px solid var(--silver);
    padding-left: 12px; /* compensate for 2px border */
}

.toc-list a.toc-sub.is-active {
    padding-left: 20px;
}

/* TOC block hidden until JS has built the list.
   Prevents a flash of the empty block on page load. */
.js-toc-block {
    display: none;
}

.js-toc-block.is-ready {
    display: block;
}

/* Related articles */
.related-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.related-item a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--black-3);
    text-decoration: none;
    transition: background 0.2s;
}

.related-item a:hover {
    background: #1e1e1e;
}

.related-category {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 700;
}

.related-title {
    font-size: 13px;
    color: var(--silver);
    line-height: 1.4;
    font-weight: 400;
}

.related-item a:hover .related-title {
    color: var(--white);
}

.related-date {
    font-size: 10px;
    color: var(--silver-dark);
}


/* ─────────────────────────────────────────────
   8. PREV / NEXT ARTICLE NAV
───────────────────────────────────────────── */

.page-nav {
    background: var(--black-2);
    border-top: 1px solid rgba(184, 184, 184, 0.1);
}

.page-nav-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1280px;
    margin: 0 auto;
}

.page-nav-item {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    border-right: 1px solid rgba(184, 184, 184, 0.1);
}

/* Empty placeholder when no prev/next post exists */
.page-nav-item--empty {
    pointer-events: none;
}

.page-nav-item:last-child {
    border-right: none;
    text-align: right;
    align-items: flex-end;
}

.page-nav-item:hover:not(.page-nav-item--empty) {
    background: var(--black-3);
}

.page-nav-direction {
    font-size: 10px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-nav-item:last-child .page-nav-direction {
    flex-direction: row-reverse;
}

.page-nav-meta {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--silver-dark);
    font-weight: 600;
    margin-top: 4px;
}

.page-nav-title {
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.25;
}


/* ─────────────────────────────────────────────
   9. RESPONSIVE OVERRIDES
───────────────────────────────────────────── */

/* ── 1100px: two-column body collapses to single column ── */
@media (max-width: 1100px) {

    .article-body .container {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .article-sidebar {
        position: static;
    }

    .article-prose {
        max-width: 100%;
    }

}

/* ── 900px: mobile nav, hero adjustments ── */
@media (max-width: 900px) {

    .breadcrumb-inner {
        padding: 0 20px;
    }

    /* Hero shrinks but stays tall enough to breathe */
    .article-hero {
        height: clamp(400px, 72vw, 580px);
    }

    .article-hero-content {
        padding: 0 20px 36px;
    }

    .article-hero-readtime {
        top: 20px;
        right: 20px;
    }

    .article-hero-bottom {
        gap: 16px;
    }

    /* Meta bar stacks vertically */
    .article-meta-bar .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Article footer stacks with internal padding */
    .article-footer {
        flex-direction: column;
        padding: 24px 20px 0;
    }

    .article-footer-share {
        align-items: flex-start;
    }

    /* Editorial components */
    .stats-row {
        grid-template-columns: 1fr;
    }

    .pull-quote {
        padding: 24px 28px;
    }

    .pull-quote blockquote {
        font-size: 19px;
    }

    /* Prev/next stacks vertically */
    .page-nav-inner {
        grid-template-columns: 1fr;
    }

    .page-nav-item {
        border-right: none;
        border-bottom: 1px solid rgba(184, 184, 184, 0.1);
    }

    .page-nav-item:last-child {
        text-align: left;
        align-items: flex-start;
    }

    .page-nav-item:last-child .page-nav-direction {
        flex-direction: row;
    }

}

/* ── 540px: small phones ── */
@media (max-width: 540px) {

    /* Hero: extra height so title isn't squeezed on portrait phones */
    .article-hero {
        height: clamp(460px, 100vw, 580px);
    }

    .article-hero-content {
        padding: 0 16px 28px;
    }

    .article-title {
        letter-spacing: -0.015em;
    }

    /* Share row wraps below byline on very narrow screens */
    .article-hero-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    /* Stats: 2-up on small phones rather than fully stacked */
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .article-body {
        padding: 48px 0 72px;
    }

    .article-prose p {
        font-size: 16px;
    }

}