/*
Pitch & Ledger v0.1
Reading-first palette:
- ink #202327
- brand navy #011127
- paper #FCFBF8
- surface #F4F1EB
- accent #FFA203 (micro-accent only)
*/

:root {
    --pl-ink: #202327;
    --pl-brand: #011127;
    --pl-paper: #fcfbf8;
    --pl-surface: #f4f1eb;
    --pl-muted: #686d73;
    --pl-rule: #dfddd7;
    --pl-accent: #ffa203;
    --pl-max: 1380px;
    --pl-reading: 680px;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--pl-ink);
    background: var(--pl-paper);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
::selection { background: rgba(255,162,3,.28); }

.pl-shell {
    width: min(calc(100% - 48px), var(--pl-max));
    margin-inline: auto;
}

/* Header */
.pl-header {
    background: var(--pl-paper);
    border-bottom: 1px solid var(--pl-rule);
}
.pl-header-top {
    min-height: 82px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.pl-search {
    width: max-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--pl-ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}
.pl-search svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}
.pl-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}
.pl-brand img {
    width: auto;
    max-width: 280px;
    height: 28px;
    object-fit: contain;
}
.pl-wordmark {
    color: var(--pl-brand);
    font-size: 28px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: -.025em;
}
.pl-tagline {
    margin-top: 6px;
    color: var(--pl-muted);
    font-size: 9px;
    line-height: 1;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.pl-subscribe-button {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 15px;
    border-radius: 2px;
    background: #242629;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    transition: background .18s ease, color .18s ease;
}
.pl-subscribe-button:hover {
    background: var(--pl-accent);
    color: var(--pl-ink);
}
.pl-nav-border { border-top: 1px solid var(--pl-rule); }
.pl-nav-scroll {
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
}
.pl-nav-scroll::-webkit-scrollbar { display: none; }
.pl-nav-scroll .nav {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    white-space: nowrap;
}
.pl-nav-scroll .nav a {
    position: relative;
    font-size: 13px;
    font-weight: 700;
}
.pl-nav-scroll .nav a:hover { color: var(--pl-muted); }

/* Shared */
.pl-main { padding: 30px 0 76px; }
.pl-kicker,
.pl-mini-kicker {
    color: #6e6a63;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}
.pl-mini-kicker { font-size: 10px; }
.pl-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pl-muted);
    font-size: 12px;
}
.pl-section-rule,
.pl-section-heading {
    border-top: 3px solid var(--pl-ink);
}
.pl-section-rule h2,
.pl-section-heading h2 {
    margin: 0;
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.pl-section-rule { padding-top: 11px; }
.pl-section-heading {
    padding-top: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}
.pl-section-heading a {
    color: var(--pl-muted);
    font-size: 12px;
}

/* Home */
.pl-home-lead {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(290px, .72fr);
    gap: 34px;
    align-items: start;
}
.pl-hero-image {
    display: block;
    overflow: hidden;
    background: #e7e3dc;
    aspect-ratio: 16 / 9;
}
.pl-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pl-hero-copy {
    max-width: 900px;
    padding-top: 17px;
}
.pl-hero h1 {
    margin: 8px 0 0;
    max-width: 940px;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(32px, 3.25vw, 44px);
    line-height: 1.055;
    font-weight: 600;
    letter-spacing: -.035em;
}
.pl-hero-dek {
    max-width: 800px;
    margin: 13px 0 15px;
    color: #44484d;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 19px;
    line-height: 1.5;
}
.pl-latest { min-width: 0; }
.pl-latest-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    padding: 18px 0;
    border-bottom: 1px solid var(--pl-rule);
}
.pl-latest-number {
    color: #9a968f;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 14px;
}
.pl-latest-item h3 {
    margin: 6px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 19px;
    line-height: 1.22;
    font-weight: 600;
    letter-spacing: -.018em;
}

.pl-analysis { margin-top: 56px; }
.pl-analysis-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
}
.pl-card {
    display: grid;
    grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--pl-rule);
}
.pl-card-image {
    background: #e7e3dc;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.pl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pl-card h3 {
    margin: 7px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 21px;
    line-height: 1.18;
    font-weight: 600;
    letter-spacing: -.018em;
}
.pl-card p {
    margin: 9px 0 12px;
    color: #51555b;
    font-size: 13.5px;
    line-height: 1.5;
}

.pl-newsletter {
    margin-top: 58px;
    border-top: 3px solid var(--pl-accent);
    border-bottom: 1px solid var(--pl-rule);
    background: var(--pl-surface);
}
.pl-newsletter-inner {
    min-height: 160px;
    padding-block: 36px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 36px;
}
.pl-newsletter h2 {
    max-width: 720px;
    margin: 8px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(26px, 2.7vw, 34px);
    line-height: 1.08;
    font-weight: 600;
    letter-spacing: -.025em;
}
.pl-newsletter p {
    max-width: 720px;
    margin: 10px 0 0;
    color: var(--pl-muted);
    font-size: 14px;
    line-height: 1.55;
}
.pl-newsletter-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    background: #242629;
    color: #fff;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 750;
}
.pl-newsletter-button:hover {
    background: var(--pl-accent);
    color: var(--pl-ink);
}

/* Archive / feeds */
.pl-archive { max-width: 1100px; }
.pl-archive-header {
    max-width: 760px;
    padding: 16px 0 32px;
    border-bottom: 1px solid var(--pl-rule);
}
.pl-archive-header h1,
.pl-page-header h1 {
    margin: 8px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.04;
    font-weight: 600;
    letter-spacing: -.035em;
}
.pl-archive-header p,
.pl-page-header p {
    color: var(--pl-muted);
    font-size: 17px;
    line-height: 1.55;
}
.pl-feed { margin-top: 12px; }
.pl-feed-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    padding: 24px 0;
    border-bottom: 1px solid var(--pl-rule);
}
.pl-feed-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e7e3dc;
}
.pl-feed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pl-feed-card h2 {
    margin: 6px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 24px;
    line-height: 1.16;
    font-weight: 600;
    letter-spacing: -.02em;
}
.pl-feed-card p {
    max-width: 680px;
    margin: 8px 0 12px;
    color: var(--pl-muted);
    font-size: 14px;
    line-height: 1.55;
}

/* Article */
.pl-article-header {
    max-width: 1180px;
    padding-top: 12px;
}
.pl-article-header > .pl-kicker {
    display: inline-block;
    margin-bottom: 12px;
}
.pl-article-header h1 {
    max-width: 1020px;
    margin: 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(40px, 5.2vw, 58px);
    line-height: 1.02;
    font-weight: 600;
    letter-spacing: -.04em;
}
.pl-article-dek {
    max-width: 850px;
    margin: 17px 0 0;
    color: #44484d;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(19px, 2vw, 22px);
    line-height: 1.5;
}
.pl-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
    color: var(--pl-muted);
    font-size: 12.5px;
}
.pl-feature-figure {
    margin: 32px 0 0;
}
.pl-feature-figure img {
    width: 100%;
    max-height: 720px;
    object-fit: cover;
}
.pl-feature-figure figcaption {
    max-width: 900px;
    margin-top: 8px;
    color: var(--pl-muted);
    font-size: 11px;
    line-height: 1.5;
}
.pl-content {
    width: min(calc(100% - 48px), var(--pl-reading));
    margin: 44px auto 0;
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: 19px;
    line-height: 1.68;
}
.pl-content > * { margin-top: 0; margin-bottom: 1.25em; }
.pl-content h2,
.pl-content h3,
.pl-content h4 {
    color: var(--pl-ink);
    font-family: "IBM Plex Serif", Georgia, serif;
    line-height: 1.16;
    letter-spacing: -.02em;
}
.pl-content h2 {
    margin-top: 2em;
    font-size: 30px;
    font-weight: 600;
}
.pl-content h3 {
    margin-top: 1.7em;
    font-size: 24px;
    font-weight: 600;
}
.pl-content a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.pl-content blockquote {
    margin-inline: 0;
    padding-left: 22px;
    border-left: 3px solid var(--pl-accent);
    color: #44484d;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 22px;
    line-height: 1.5;
}
.pl-content img { height: auto; }
.pl-content figcaption {
    color: var(--pl-muted);
    font-size: 11px;
    line-height: 1.5;
}

/* Ghost editor cards */
.pl-content .kg-width-wide {
    width: min(100vw - 48px, 980px);
    margin-left: 50%;
    transform: translateX(-50%);
}
.pl-content .kg-width-full {
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}
.pl-content .kg-callout-card {
    border-radius: 2px;
}

/* Saved HTML snippet styling: Key Numbers */
.pl-key-numbers {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 2px solid var(--pl-ink);
    border-bottom: 1px solid var(--pl-rule);
}
.pl-key-numbers-title {
    margin-bottom: 14px;
    color: var(--pl-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pl-key-numbers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.pl-key-number strong {
    display: block;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 28px;
    line-height: 1;
    font-weight: 600;
}
.pl-key-number span {
    display: block;
    margin-top: 6px;
    color: var(--pl-muted);
    font-size: 12px;
    line-height: 1.4;
}

/* Sources */
.pl-content .pl-sources {
    margin-top: 42px;
    padding-top: 18px;
    border-top: 2px solid var(--pl-ink);
}
.pl-content .pl-sources h2 {
    margin-top: 0;
    font-size: 22px;
}
.pl-content .pl-sources ol,
.pl-content .pl-sources ul {
    padding-left: 20px;
    color: var(--pl-muted);
    font-size: 13px;
    line-height: 1.55;
}

/* Article CTA + related */
.pl-article-end {
    width: min(calc(100% - 48px), var(--pl-reading));
    margin: 48px auto 0;
    padding: 28px;
    border-top: 3px solid var(--pl-accent);
    background: var(--pl-surface);
}
.pl-end-label {
    margin: 0;
    color: var(--pl-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pl-article-end h2 {
    margin: 8px 0 0;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 28px;
    font-weight: 600;
}
.pl-article-end p { color: var(--pl-muted); }
.pl-related { margin-top: 64px; }
.pl-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.pl-related-grid .pl-feed-card {
    display: block;
    padding: 0;
}
.pl-related-grid .pl-feed-image { margin-bottom: 14px; }
.pl-related-grid .pl-feed-card h2 { font-size: 20px; }
.pl-related-grid .pl-feed-card p { display: none; }

/* Pages / topics */
.pl-page,
.pl-topics-page {
    max-width: 900px;
}
.pl-page-header { margin-bottom: 36px; }
.pl-topic-group {
    padding: 26px 0;
    border-top: 1px solid var(--pl-rule);
}
.pl-topic-group h2 {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.pl-topic-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}
.pl-topic-links a {
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 22px;
    font-weight: 500;
}
.pl-topics-note {
    margin-top: 20px;
    color: var(--pl-muted);
    font-size: 13px;
}

/* Footer */
.pl-footer {
    border-top: 1px solid var(--pl-rule);
    background: var(--pl-paper);
}
.pl-footer-main {
    padding: 28px 0 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.pl-footer-brand {
    color: var(--pl-brand);
    font-size: 17px;
    font-weight: 750;
}
.pl-footer-main p {
    max-width: 560px;
    margin: 7px 0 0;
    color: var(--pl-muted);
    font-size: 12px;
}
.pl-footer-nav .nav {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pl-footer-nav .nav a {
    color: var(--pl-muted);
    font-size: 12px;
}
.pl-footer-bottom {
    padding: 15px 0 22px;
    border-top: 1px solid var(--pl-rule);
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: #85817a;
    font-size: 10px;
}

/* Error */
.pl-error {
    min-height: 50vh;
    padding-top: 80px;
    text-align: center;
}
.pl-error h1 {
    margin: 8px auto;
    max-width: 720px;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: 48px;
    font-weight: 600;
}
.pl-error p { color: var(--pl-muted); }

/* Ghost pagination */
.pagination {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--pl-muted);
    font-size: 12px;
}

@media (max-width: 980px) {
    .pl-header-top {
        min-height: 70px;
        grid-template-columns: 1fr auto;
    }
    .pl-search { display: none; }
    .pl-brand {
        align-items: flex-start;
        grid-column: 1;
    }
    .pl-brand img { height: 24px; max-width: 230px; }
    .pl-wordmark { font-size: 25px; }
    .pl-tagline { display: none; }
    .pl-subscribe-button { grid-column: 2; grid-row: 1; }
    .pl-nav-scroll { justify-content: flex-start; }
    .pl-nav-scroll .nav { gap: 24px; }

    .pl-home-lead { grid-template-columns: 1fr; }
    .pl-latest { margin-top: 6px; }
    .pl-analysis-grid { grid-template-columns: 1fr; }
    .pl-newsletter-inner { grid-template-columns: 1fr; }
    .pl-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .pl-shell { width: min(calc(100% - 26px), var(--pl-max)); }
    .pl-main { padding-top: 20px; }
    .pl-header-top { min-height: 64px; }
    .pl-brand img { height: 22px; max-width: 195px; }
    .pl-wordmark { font-size: 22px; }
    .pl-subscribe-button {
        min-height: 34px;
        padding-inline: 12px;
        font-size: 12px;
    }
    .pl-nav-scroll .nav { gap: 21px; }
    .pl-nav-scroll .nav a { font-size: 12px; }

    .pl-hero h1 { font-size: 36px; }
    .pl-hero-dek { font-size: 18px; }
    .pl-card {
        grid-template-columns: 126px minmax(0, 1fr);
        gap: 13px;
    }
    .pl-card h3 { font-size: 19px; }
    .pl-card p { display: none; }

    .pl-feed-card {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 14px;
    }
    .pl-feed-card h2 { font-size: 19px; }
    .pl-feed-card p { display: none; }

    .pl-article-header h1 { font-size: 39px; }
    .pl-content {
        width: min(calc(100% - 30px), var(--pl-reading));
        font-size: 18px;
        line-height: 1.68;
    }
    .pl-content h2 { font-size: 27px; }
    .pl-content h3 { font-size: 22px; }

    .pl-key-numbers-grid { grid-template-columns: 1fr; }
    .pl-article-end { width: min(calc(100% - 30px), var(--pl-reading)); }

    .pl-footer-main { grid-template-columns: 1fr; }
    .pl-footer-nav .nav { justify-content: flex-start; }
    .pl-footer-bottom { flex-direction: column; gap: 5px; }
}


/* Launch-state logic
   The site must look intentional with only 1–4 published stories.
   Modern browsers support :has(); it allows us to suppress empty modules
   without adding fragile template logic. */
.pl-latest:not(:has(.pl-latest-item)) {
    display: none;
}
.pl-home-lead:not(:has(.pl-latest-item)) {
    grid-template-columns: 1fr;
    max-width: 1120px;
}
.pl-home-lead:not(:has(.pl-latest-item)) .pl-hero-copy {
    max-width: 820px;
}
.pl-analysis:not(:has(.pl-card)) {
    display: none;
}
