/*
Theme Name: CRPF Warm Editorial
Theme URI: https://responsiblepublicfinance.org
Author: Centre for Responsible Public Finance
Author URI: https://responsiblepublicfinance.org
Description: Custom editorial theme for the Centre for Responsible Public Finance
Version: 1.5.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: crpf
Domain Path: /languages
*/

/* ══════════════════════════════════════════════════════
   CRPF Warm Editorial — Design System
   Centre for Responsible Public Finance
   ══════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --ink: #1a1c1c;
    --paper: #f9f9f9;
    --warm-white: #f3f3f3;
    --terracotta: #002147;
    --terracotta-light: #e8eef1;
    --copper: #e9c176;
    --copper-light: #fdf6e8;
    --green: #2d6a3f;
    --green-light: #ecf4ef;
    --mid: #74777f;
    --light: #c4c6cf;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Source Sans 3', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --max-w: 1320px;
    --pad: 2rem;
}

html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.65; -webkit-font-smoothing: antialiased; }

a { color: inherit; text-decoration: none; transition: color 0.2s; }

/* ── Nav ── */
.topbar { position: sticky; top: 0; z-index: 100; background: var(--paper); border-bottom: 1px solid var(--light); backdrop-filter: blur(12px); }
.topbar-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad); height: 60px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--ink); letter-spacing: -0.02em; text-decoration: none; }
.logo:hover { color: var(--ink); text-decoration: none; }
.logo span { color: var(--terracotta); }

/* WordPress nav-menu integration */
.nav-menu { display: flex; gap: 2rem; align-items: center; list-style: none; }
.nav-menu li { list-style: none; position: relative; }
.nav-menu > li > a { font-size: 0.82rem; font-weight: 600; color: var(--mid); text-decoration: none; transition: color 0.2s; }
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a { color: var(--ink); text-decoration: none; }

/* Sub-menus */
.nav-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--paper); border: 1px solid var(--light); list-style: none; min-width: 200px; z-index: 101; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-radius: 8px; padding: 0.5rem 0; }
.nav-menu li:hover > .sub-menu { display: block; }
.nav-menu .sub-menu li a { display: block; padding: 0.5rem 1.2rem; font-size: 0.8rem; color: var(--ink); }
.nav-menu .sub-menu li a:hover { background: var(--terracotta-light); color: var(--terracotta); }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; color: var(--ink); }

.btn-nav { font-size: 0.78rem; font-weight: 700; padding: 0.5rem 1.2rem; background: var(--terracotta); color: white; border: none; border-radius: 6px; cursor: pointer; font-family: var(--sans); text-decoration: none; display: inline-block; }
.btn-nav:hover { opacity: 0.9; color: white; text-decoration: none; }

/* ── Buttons ── */
.btn-primary { padding: 0.85rem 2rem; background: var(--ink); color: var(--paper); border: none; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: var(--sans); transition: all 0.2s; text-decoration: none; display: inline-block; }
.btn-primary:hover { background: #0d1117; transform: translateY(-1px); color: var(--paper); text-decoration: none; }
.btn-outline { padding: 0.85rem 2rem; background: transparent; color: var(--ink); border: 1.5px solid var(--light); border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: var(--sans); text-decoration: none; display: inline-block; }
.btn-outline:hover { border-color: var(--ink); text-decoration: none; }
.btn-terracotta { padding: 0.85rem 2rem; background: var(--terracotta); color: white; border: none; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; font-family: var(--sans); text-decoration: none; display: inline-block; }
.btn-terracotta:hover { opacity: 0.9; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.section { max-width: var(--max-w); margin: 0 auto; padding: 4.5rem var(--pad); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2.5rem; }
.section-head h2 { font-family: var(--serif); font-size: 2rem; font-weight: 400; margin: 0; line-height: 1.2; }
.section-head p { font-size: 0.92rem; color: var(--mid); margin: 0; }
.section-head .more { font-size: 0.82rem; font-weight: 700; color: var(--terracotta); text-decoration: none; }
.section-head .more:hover { text-decoration: underline; }
.divider { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad); }
.divider hr { border: none; border-top: 1px solid var(--light); }

/* ── Overline ── */
.overline { font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 0.4rem; }

/* ── Hero: Inverted full-width masthead ── */
.hero-wrapper {
    background: var(--terracotta);
    position: relative;
    overflow: hidden;
}

/* Background texture — pinstripe + radial glows */
.hero-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.018) 0px,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px,
            transparent 18px
        ),
        radial-gradient(
            ellipse 55% 45% at 82% 18%,
            rgba(233, 193, 118, 0.08) 0%,
            transparent 70%
        ),
        radial-gradient(
            ellipse 45% 55% at 12% 85%,
            rgba(255, 255, 255, 0.035) 0%,
            transparent 60%
        );
    pointer-events: none;
    z-index: 0;
}

/* Large background £ symbol */
.hero-wrapper::after {
    content: '\00a3';
    position: absolute;
    top: -8%;
    right: -2%;
    font-family: var(--serif);
    font-size: 28rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.03);
    line-height: 1;
    pointer-events: none;
    z-index: 0;
}

/* Scattered £ symbols */
.hero-pounds {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.hero-pounds span {
    position: absolute;
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}
.hero-pounds .p1 { top: 12%; left: -4%; font-size: 18rem; color: rgba(233, 193, 118, 0.04); transform: rotate(-12deg); }
.hero-pounds .p2 { bottom: -15%; right: 22%; font-size: 14rem; color: rgba(255, 255, 255, 0.025); transform: rotate(8deg); }
.hero-pounds .p3 { top: 55%; left: 38%; font-size: 8rem; color: rgba(233, 193, 118, 0.03); transform: rotate(-5deg); }
.hero-pounds .p4 { top: -5%; left: 52%; font-size: 11rem; color: rgba(255, 255, 255, 0.02); transform: rotate(15deg); }
.hero-pounds .p5 { bottom: 5%; left: 8%; font-size: 6rem; color: rgba(233, 193, 118, 0.035); transform: rotate(-20deg); }

.hero {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 5rem var(--pad) 0;
    position: relative;
    z-index: 1;
}
.hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 400;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    color: #ffffff;
}
.hero h1 em { font-style: italic; color: var(--copper); }
.hero h1 .mobile-br { display: none; }

.hero-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2.5rem;
    align-items: start;
    padding-bottom: 4rem;
}
.hero-intro { max-width: 420px; }
.hero-intro p { font-size: 1.05rem; line-height: 1.75; color: rgba(255, 255, 255, 0.75); margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.8rem; }

/* Hero buttons — gold primary, white-outline secondary */
.hero .btn-primary { background: var(--copper); color: var(--terracotta); }
.hero .btn-primary:hover { opacity: 0.9; background: var(--copper); color: var(--terracotta); }
.hero .btn-outline { color: #ffffff; border-color: rgba(255, 255, 255, 0.3); }
.hero .btn-outline:hover { border-color: #ffffff; color: #ffffff; }

.hero-sep { width: 1px; background: rgba(255, 255, 255, 0.2); align-self: stretch; }

/* Lead stories — on dark background */
.lead-stories {}
.lead-story { padding-bottom: 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.lead-story:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.lead-story .overline {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: 0.35rem;
}
.lead-story h3 {
    font-family: var(--serif);
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1.25;
    margin: 0 0 0.35rem 0;
}
.lead-story h3 a { color: #ffffff; text-decoration: none; transition: color 0.2s; }
.lead-story h3 a:hover { color: var(--copper); }
.lead-story p { font-size: 0.78rem; color: rgba(255, 255, 255, 0.6); line-height: 1.55; margin: 0; }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 2rem; list-style: none; }
.breadcrumb a, .breadcrumb span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--mid); }
.breadcrumb a:hover { color: var(--terracotta); }
.breadcrumb .sep { color: var(--light); }
.breadcrumb .current { color: var(--terracotta); }

/* ── Article header (single post pages) ── */
.article-header { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem var(--pad) 0; }
.article-header h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4.5vw, 3.5rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.025em;
    max-width: 820px;
    margin: 0 0 1.25rem 0;
}
.article-header .standfirst { font-size: 1.15rem; line-height: 1.7; color: var(--mid); max-width: 700px; margin-bottom: 2rem; }

/* ── Article meta bar ── */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    margin-bottom: 0;
}
.author-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--copper-light);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--copper);
    flex-shrink: 0;
}
.author-info .author-name { font-weight: 700; font-size: 0.88rem; }
.author-info .author-role { font-size: 0.75rem; color: var(--mid); }
.meta-right {
    margin-left: auto;
    display: flex;
    gap: 1.75rem;
    align-items: center;
}
.meta-item { font-size: 0.72rem; color: var(--mid); font-weight: 500; }
.meta-item strong { font-weight: 700; color: var(--ink); }
.share-links { display: flex; gap: 0.5rem; }
.share-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 1px solid var(--light);
    background: transparent;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--mid);
    cursor: pointer;
    font-family: var(--sans);
    transition: all 0.2s;
    text-decoration: none;
    padding: 0;
    line-height: 1;
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ── Page header (for generic pages) ── */
.page-header { max-width: var(--max-w); margin: 0 auto; padding: 3.5rem var(--pad) 0; }
.page-header h1 { font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3.5rem); font-weight: 400; line-height: 1.12; letter-spacing: -0.025em; max-width: 820px; margin: 0 0 1.25rem 0; }
.page-header .standfirst { font-size: 1.15rem; line-height: 1.7; color: var(--mid); max-width: 700px; margin-bottom: 2rem; }

/* ── Policy grid ── */
.policy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--light); border: 1px solid var(--light); border-radius: 12px; overflow: hidden; }
.policy-card { background: var(--paper); padding: 1.75rem; display: flex; flex-direction: column; min-height: 240px; cursor: pointer; text-decoration: none; color: var(--ink); transition: background 0.3s; }
.policy-card:hover { background: var(--terracotta-light); }
.policy-card .num { font-family: var(--mono); font-size: 0.65rem; color: var(--mid); margin-bottom: auto; }
.policy-card h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 400; line-height: 1.25; margin: 0 0 0.6rem 0; }
.policy-card p { font-size: 0.8rem; color: var(--mid); line-height: 1.55; margin: 0; }
.policy-card .tag { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--terracotta); margin-top: 0.9rem; }

/* ── Articles ── */
.articles { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.article { text-decoration: none; color: var(--ink); display: block; }
.article .date { font-size: 0.7rem; font-weight: 600; color: var(--copper); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.article h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; line-height: 1.25; margin: 0 0 0.6rem 0; transition: color 0.2s; }
.article:hover h3 { color: var(--terracotta); }
.article p { font-size: 0.82rem; color: var(--mid); line-height: 1.65; margin: 0; }
.article .time { font-size: 0.68rem; font-weight: 700; color: var(--mid); margin-top: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* WP article cards (for template-parts/content.php) */
.articles-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; }
.article-card { text-decoration: none; color: var(--ink); display: block; }
.article-card .date { font-size: 0.7rem; font-weight: 600; color: var(--copper); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.article-card h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; line-height: 1.25; margin: 0 0 0.6rem 0; transition: color 0.2s; }
.article-card:hover h3 { color: var(--terracotta); }
.article-card p { font-size: 0.82rem; color: var(--mid); line-height: 1.65; margin: 0; }
.article-card .time { font-size: 0.68rem; font-weight: 700; color: var(--mid); margin-top: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* ── Tag chips ── */
.tag-chip { font-size: 0.7rem; font-weight: 600; padding: 0.35rem 0.85rem; border: 1px solid var(--light); border-radius: 20px; color: var(--mid); text-decoration: none; transition: all 0.2s; display: inline-block; }
.tag-chip:hover { border-color: var(--terracotta); color: var(--terracotta); }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0; }

/* ── Opinion section ── */
.opinion-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
}
.opinion-featured { text-decoration: none; color: var(--ink); display: block; }
.opinion-featured .overline {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: 0.6rem;
}
.opinion-featured h3 {
    font-family: var(--serif);
    font-size: 1.75rem;
    font-weight: 400;
    line-height: 1.2;
    margin: 0 0 0.75rem 0;
    transition: color 0.2s;
}
.opinion-featured:hover h3 { color: var(--terracotta); }
.opinion-featured .meta {
    font-size: 0.75rem;
    color: var(--mid);
    margin-bottom: 0.75rem;
}
.opinion-featured .excerpt {
    font-size: 0.92rem;
    color: var(--mid);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.opinion-featured .read-more {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--terracotta);
}
.opinion-list {}
.opinion-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--light);
    text-decoration: none;
    color: var(--ink);
    display: block;
}
.opinion-item:last-child { border-bottom: none; }
.opinion-item h4 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 0 0 0.25rem 0;
    transition: color 0.2s;
}
.opinion-item:hover h4 { color: var(--terracotta); }
.opinion-item .meta {
    font-size: 0.7rem;
    color: var(--mid);
}

/* ── Stat cards (sidebar) ── */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin: 2rem 0; }
.stat-card { background: var(--warm-white); border: 1px solid var(--light); border-radius: 12px; padding: 1.75rem; text-align: center; }
.stat-card .number { font-family: var(--mono); font-size: 2.4rem; font-weight: 500; color: var(--terracotta); line-height: 1; margin-bottom: 0.4rem; }
.stat-card .label { font-size: 0.82rem; color: var(--mid); line-height: 1.45; }
.stat-card-value { font-family: var(--mono); font-size: 1.75rem; font-weight: 700; display: block; margin-bottom: 0.5rem; color: var(--terracotta); }
.stat-card-label { font-size: 0.82rem; color: var(--mid); }

/* ── Pull stat (inline) ── */
.pull-stat { background: var(--warm-white); border: 1px solid var(--light); border-radius: 12px; padding: 2rem; margin: 2.5rem 0; text-align: center; }
.pull-stat .number { font-family: var(--mono); font-size: 2.8rem; font-weight: 500; color: var(--terracotta); line-height: 1; margin-bottom: 0.4rem; }
.pull-stat .label { font-size: 0.82rem; color: var(--mid); line-height: 1.5; }
.pull-stat-value { font-family: var(--mono); font-size: 2rem; font-weight: 700; color: var(--terracotta); display: block; margin-bottom: 0.5rem; }
.pull-stat-label { font-size: 0.95rem; color: var(--ink); }

/* ── Newsletter ── */
.newsletter { background: var(--ink); color: var(--paper); padding: 4.5rem var(--pad); }
.newsletter-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.newsletter h2 { font-family: var(--serif); font-size: 2.2rem; font-weight: 400; line-height: 1.15; margin: 0 0 0.75rem 0; color: var(--paper); }
.newsletter p { font-size: 0.9rem; opacity: 0.55; line-height: 1.7; margin: 0; }
.nl-form { display: flex; gap: 0.7rem; }
.nl-form input { flex: 1; padding: 0.85rem 1.1rem; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: white; font-size: 0.88rem; font-family: var(--sans); outline: none; }
.nl-form input::placeholder { color: rgba(255,255,255,0.3); }
.nl-form input:focus { border-color: var(--terracotta); }
.nl-form button { padding: 0.85rem 1.6rem; background: var(--terracotta); color: white; border: none; border-radius: 8px; font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: var(--sans); white-space: nowrap; }
/* Also support .newsletter-form class from WP templates */
.newsletter-form { display: flex; gap: 0.7rem; }
.newsletter-form input[type="email"] { flex: 1; padding: 0.85rem 1.1rem; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; color: white; font-size: 0.88rem; font-family: var(--sans); outline: none; }
.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.3); }
.newsletter-form input[type="email"]:focus { border-color: var(--terracotta); }
.newsletter-form button { padding: 0.85rem 1.6rem; background: var(--terracotta); color: white; border: none; border-radius: 8px; font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: var(--sans); white-space: nowrap; }

/* ── Footer ── */
footer { background: var(--paper); border-top: 1px solid var(--light); padding: 3.5rem var(--pad) 2.5rem; }
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-brand { }
.footer-brand .logo { font-size: 1.2rem; }
.footer-brand p { font-size: 0.8rem; color: var(--mid); line-height: 1.7; margin-top: 0.75rem; max-width: 280px; }
.footer-col { }
.footer-col h4 { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); margin: 0 0 0.75rem 0; }
.footer-col a { display: block; font-size: 0.82rem; color: var(--ink); text-decoration: none; margin-bottom: 0.4rem; }
.footer-col a:hover { color: var(--terracotta); }
/* WP footer menu integration */
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col li a { display: block; font-size: 0.82rem; color: var(--ink); text-decoration: none; }
.footer-col li a:hover { color: var(--terracotta); }
.footer-bottom { max-width: var(--max-w); margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--light); display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--mid); }
.footer-bottom p { margin: 0; }

/* ── Article layout (body + sidebar) ── */
.article-layout {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 4rem;
    align-items: start;
    padding-top: 3rem;
}
.article-body { max-width: 720px; }
.article-body p { font-size: 1.05rem; line-height: 1.82; margin-bottom: 1.5rem; color: var(--ink); }
.article-body p.lead-para { font-size: 1.18rem; line-height: 1.78; }
.article-body h2 { font-family: var(--serif); font-size: 1.65rem; font-weight: 400; margin: 2.5rem 0 1rem 0; line-height: 1.2; }
.article-body h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin: 2rem 0 0.75rem 0; line-height: 1.3; }
.article-body blockquote { border-left: 4px solid var(--terracotta); padding: 1.5rem 0 1.5rem 1.5rem; margin: 2rem 0; font-size: 1.25rem; font-style: italic; color: var(--mid); }
.article-body blockquote p { margin-bottom: 0; }
.article-body figure { margin: 2rem 0; }
.article-body figcaption { font-size: 0.9rem; color: var(--mid); margin-top: 0.5rem; }
.article-body table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.95rem; }
.article-body table th, .article-body table td { border-bottom: 1px solid var(--light); padding: 0.75rem; text-align: left; }
.article-body table th { background: var(--warm-white); font-weight: 700; }
.article-body table tbody tr:hover { background: var(--terracotta-light); }

/* ── Article meta bar (legacy fallback) ── */
.article-meta a { color: var(--terracotta); }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 0; }
.sidebar-section { margin-bottom: 2.5rem; }
.sidebar-section h4 {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mid);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--light);
}

/* TOC list */
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin-bottom: 0.5rem; }
.toc-list a {
    font-size: 0.82rem;
    color: var(--mid);
    text-decoration: none;
    line-height: 1.45;
    display: block;
    padding-left: 0.75rem;
    border-left: 2px solid transparent;
    transition: all 0.2s;
}
.toc-list a:hover, .toc-list a.active { color: var(--ink); border-left-color: var(--terracotta); }

/* Legacy .toc class */
.toc { background: var(--warm-white); padding: 1.5rem; border-radius: 8px; }
.toc h4 { font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); margin: 0 0 1rem 0; padding-bottom: 0.5rem; border-bottom: 1px solid var(--light); }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.5rem; }
.toc a { color: var(--mid); text-decoration: none; font-size: 0.82rem; display: block; padding-left: 0.75rem; border-left: 2px solid transparent; transition: all 0.2s; }
.toc a:hover, .toc a.active { color: var(--ink); border-left-color: var(--terracotta); }

/* Sidebar key stat cards */
.sidebar-stat {
    background: var(--warm-white);
    border: 1px solid var(--light);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 0.75rem;
}
.sidebar-stat .number {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--terracotta);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.sidebar-stat .label { font-size: 0.72rem; color: var(--mid); line-height: 1.4; }

/* Sidebar related items */
.related-item {
    display: block;
    text-decoration: none;
    color: var(--ink);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light);
}
.related-item:last-child { border-bottom: none; }
.related-item .overline {
    font-family: var(--mono);
    font-size: 0.58rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--copper);
    margin-bottom: 0.25rem;
}
.related-item h5 {
    font-family: var(--serif);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
    transition: color 0.2s;
}
.related-item:hover h5 { color: var(--terracotta); }

/* Legacy .related-items class */
.related-items { background: var(--warm-white); padding: 1.5rem; border-radius: 8px; }
.related-items h4 { font-family: var(--mono); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mid); margin: 0 0 1rem 0; }
.related-items ul { list-style: none; padding: 0; margin: 0; }
.related-items li { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--light); }
.related-items li:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.related-items a { font-weight: 500; color: var(--ink); display: block; margin-bottom: 0.25rem; text-decoration: none; }
.related-items a:hover { color: var(--terracotta); }
.related-items .date { font-size: 0.82rem; color: var(--mid); }

/* ── Article tags ── */
.article-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 3rem 0 2rem; padding-top: 2rem; border-top: 1px solid var(--light); }

/* ── Article table ── */
.article-table { width: 100%; border-collapse: collapse; margin: 2rem 0; font-size: 0.88rem; }
.article-table thead th { text-align: left; font-family: var(--mono); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mid); padding: 0.75rem 1rem; border-bottom: 2px solid var(--ink); }
.article-table tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--light); }
.article-table tbody td:first-child { font-weight: 600; }
.article-table tbody td.num, .article-table thead th.num { font-family: var(--mono); font-size: 0.82rem; text-align: right; }
.article-table caption { text-align: left; font-size: 0.72rem; color: var(--mid); padding: 0.5rem 0; caption-side: bottom; }

/* ── Author bio ── */
.author-bio {
    max-width: 720px;
    background: var(--warm-white);
    border: 1px solid var(--light);
    border-radius: 14px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.author-bio-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--copper-light);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--copper);
    flex-shrink: 0;
}
.author-bio img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.author-bio h4 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.2rem 0; }
.author-bio .role { font-size: 0.78rem; color: var(--terracotta); font-weight: 600; margin-bottom: 0.5rem; }
.author-bio p { font-size: 0.82rem; color: var(--mid); line-height: 1.65; margin: 0; }
.author-bio-content h4 { font-family: var(--serif); margin: 0 0 0.25rem 0; font-size: 1.1rem; }
.author-bio-title { font-size: 0.82rem; color: var(--terracotta); margin-bottom: 0.75rem; display: block; }
.author-bio-content p { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--mid); }

/* ── Related section (bottom of article) ── */
.related-section { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad) 4rem; }
.related-section h3 { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; margin: 0 0 2rem 0; padding-bottom: 1rem; border-bottom: 1px solid var(--light); }
.related-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2.5rem; }
.related-card { text-decoration: none; color: var(--ink); display: block; }
.related-card .overline { font-family: var(--mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terracotta); margin-bottom: 0.4rem; }
.related-card h4 { font-family: var(--serif); font-size: 1.2rem; font-weight: 400; line-height: 1.25; margin: 0 0 0.5rem 0; transition: color 0.2s; }
.related-card:hover h4 { color: var(--terracotta); }
.related-card p { font-size: 0.78rem; color: var(--mid); line-height: 1.6; margin: 0; }

/* ── Share buttons ── */
.share-buttons { display: flex; gap: 0.5rem; }
.share-buttons a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--warm-white); color: var(--mid); text-decoration: none; transition: all 0.2s; font-size: 0.82rem; }
.share-buttons a:hover { background: var(--terracotta); color: white; }

/* ── Pagination ── */
.pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 3rem 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; font-size: 0.88rem; transition: all 0.2s; }
.pagination a { background: var(--warm-white); color: var(--ink); border: 1px solid var(--light); text-decoration: none; }
.pagination a:hover { background: var(--terracotta); color: white; border-color: var(--terracotta); }
.pagination .current { background: var(--terracotta); color: white; font-weight: 700; }

/* ── WordPress Blocks ── */
.alignwide { max-width: 100%; margin-left: auto; margin-right: auto; }
.alignfull { max-width: none; width: 100vw; position: relative; left: calc(-1 * ((100vw - 100%) / 2)); margin: 1.5rem 0; }
.wp-block-image { margin-bottom: 1.5rem; }
.wp-block-image img { max-width: 100%; height: auto; border-radius: 4px; }
.wp-block-quote { border-left: 4px solid var(--terracotta); padding: 1.5rem 0 1.5rem 1.5rem; margin: 2rem 0; font-size: 1.25rem; font-style: italic; color: var(--mid); }
.wp-block-table { width: 100%; border-collapse: collapse; margin: 2rem 0; }
.wp-block-table table { width: 100%; }
.wp-block-table table td, .wp-block-table table th { padding: 0.75rem; border: 1px solid var(--light); }
.wp-block-table table th { background: var(--warm-white); font-weight: 700; }

/* ── Comments ── */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--light); }
.comment-list { list-style: none; padding: 0; }
.comment { margin-bottom: 2rem; padding: 1.5rem; background: var(--warm-white); border-radius: 8px; }
.comment-author { font-weight: 600; margin-bottom: 0.5rem; }
.comment-metadata { font-size: 0.82rem; color: var(--mid); margin-bottom: 1rem; }
.comment-reply-link { font-size: 0.82rem; color: var(--terracotta); text-decoration: none; }
.comment-reply-link:hover { text-decoration: underline; }
.children { list-style: none; padding: 0; margin-left: 1rem; margin-top: 1rem; }

/* ── WordPress menu item classes ── */
.menu-item { list-style: none; }
.menu-item.current-menu-item > a { color: var(--ink); font-weight: 700; }

/* ── Page content (no results / search) ── */
.page-content { max-width: 720px; margin: 2rem 0; }
.page-content p { font-size: 1.05rem; line-height: 1.82; margin-bottom: 1.5rem; color: var(--mid); }
.page-content .search-form { display: flex; gap: 0.7rem; max-width: 480px; }
.page-content .search-form .search-field { flex: 1; padding: 0.85rem 1.1rem; border: 1px solid var(--light); border-radius: 8px; font-size: 0.88rem; font-family: var(--sans); background: var(--warm-white); }
.page-content .search-form .search-submit { padding: 0.85rem 1.6rem; background: var(--terracotta); color: white; border: none; border-radius: 8px; font-size: 0.82rem; font-weight: 700; cursor: pointer; font-family: var(--sans); }

/* ── WP Pagination ── */
.nav-links { display: flex; justify-content: center; gap: 0.5rem; margin: 3rem 0; }
.nav-links a, .nav-links span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 0.75rem; border-radius: 8px; font-size: 0.88rem; transition: all 0.2s; }
.nav-links a { background: var(--warm-white); color: var(--ink); border: 1px solid var(--light); text-decoration: none; }
.nav-links a:hover { background: var(--terracotta); color: white; border-color: var(--terracotta); }
.nav-links .current { background: var(--terracotta); color: white; font-weight: 700; }

/* ── Screen reader text ── */
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .hero-row { grid-template-columns: 1fr; }
    .hero-sep { display: none; }
    .policy-grid { grid-template-columns: 1fr 1fr; }
    .data-feature { grid-template-columns: 1fr; }
    .articles { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
    .opinion-grid { grid-template-columns: 1fr; }
    .newsletter-inner { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--light); }
    .related-grid { grid-template-columns: 1fr 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .nav-menu { gap: 1rem; }
}

@media (max-width: 640px) {
    :root { --pad: 1.25rem; }
    .hero h1 .mobile-br { display: inline; }
    .hero h1 { font-size: 2rem; }
    .article-header h1 { font-size: 1.8rem; }
    .article-meta { flex-wrap: wrap; gap: 1rem; }
    .meta-right { margin-left: 0; width: 100%; justify-content: space-between; }
    .sidebar { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .policy-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 0.5rem; }
    .author-bio { flex-direction: column; }
    .nl-form { flex-direction: column; }
    .newsletter-form { flex-direction: column; }
    .hero-actions { flex-direction: column; }

    /* Mobile nav */
    .nav-menu { display: none; position: fixed; top: 60px; left: 0; right: 0; background: var(--paper); flex-direction: column; gap: 0; border-bottom: 1px solid var(--light); z-index: 99; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
    .nav-menu.active { display: flex; }
    .nav-menu > li > a { display: block; padding: 1rem var(--pad); border-bottom: 1px solid var(--light); }
    .menu-toggle { display: block; }
    .btn-nav { display: none; }
}
