/* The Fourth Pillar — public site */

:root {
    --paper: #fbfaf7;
    --ink: #16161a;
    --ink-soft: #4a4a52;
    --muted: #74747c;
    --rule: #e3e0d8;
    --rule-strong: #16161a;
    --accent: #b3121b;
    --accent-ink: #ffffff;
    --chip: #f0ede6;
    --serif: "Noto Serif", "Noto Serif Devanagari", Georgia, serif;
    --sans: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
    --wrap: 1180px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #121214;
        --ink: #ecebe7;
        --ink-soft: #c4c3be;
        --muted: #9a9993;
        --rule: #2a2a2e;
        --rule-strong: #ecebe7;
        --accent: #ef4b52;
        --chip: #1d1d21;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 17px/1.6 var(--sans);
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 16px;
    top: 8px;
    background: var(--ink);
    color: var(--paper);
    padding: 6px 10px;
    z-index: 10;
}

.muted {
    color: var(--muted);
}

/* Header */

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 13px;
    color: var(--muted);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-left a {
    font-weight: 600;
    color: var(--ink-soft);
}

.topbar-left a.active {
    color: var(--accent);
}

.page .story-body p:first-child {
    font-family: var(--serif);
    font-size: 22px;
    line-height: 1.5;
}

.lang-switch {
    display: flex;
    gap: 6px;
}

.lang-switch .current,
.lang-switch a {
    padding: 2px 10px;
    border: 1px solid var(--rule);
    border-radius: 999px;
}

.lang-switch .current {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
}

.masthead {
    text-align: center;
    padding-top: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--rule);
}

.brand {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(32px, 6vw, 56px);
    letter-spacing: -0.01em;
    line-height: 1.1;
    display: inline-block;
}

.brand:hover {
    text-decoration: none;
}

.brand.small {
    font-size: 22px;
    margin: 0 0 8px;
}

.brand picture {
    display: block;
}

.logo {
    display: block;
    width: auto;
    height: clamp(64px, 10vw, 104px);
    margin: 0 auto;
}

.logo--small {
    height: 52px;
    margin: 0;
}

.tagline {
    margin: 6px 0 0;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.sections {
    border-bottom: 3px double var(--rule-strong);
}

.sections ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 0 auto;
    padding-top: 6px;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sections a {
    display: block;
    padding: 6px 12px;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    border-radius: 4px;
}

.sections a.active {
    color: var(--accent);
}

.breaking {
    border-bottom: 1px solid var(--rule);
}

.breaking-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 15px;
}

.breaking-label,
.badge {
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

.breaking ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.breaking li {
    white-space: nowrap;
}

.breaking li + li::before {
    content: "•";
    color: var(--accent);
    margin-right: 24px;
}

/* Cards */

main {
    padding-top: 28px;
    padding-bottom: 48px;
    min-height: 50vh;
}

.card {
    padding: 16px 0;
    border-bottom: 1px solid var(--rule);
}

.kicker {
    display: inline-block;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-right: 8px;
}

.card .badge {
    vertical-align: 2px;
}

.headline {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.25;
    margin: 6px 0 8px;
    font-size: 21px;
}

.card--lead .headline {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.15;
    margin-top: 10px;
}

.card--compact .headline {
    font-size: 18px;
}

.excerpt {
    margin: 0 0 10px;
    color: var(--ink-soft);
}

.card--lead .excerpt {
    font-size: 19px;
}

.meta {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.meta a {
    font-weight: 600;
    color: var(--ink-soft);
}

/* Card images */

.card-media {
    display: block;
    margin-bottom: 10px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--chip);
    aspect-ratio: 16 / 9;
}

.card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card-media:hover img {
    transform: scale(1.03);
}

.card--compact.has-image {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 14px;
    align-items: start;
}

.card-thumb {
    display: block;
    width: 96px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 2px;
    background: var(--chip);
    margin-top: 4px;
}

.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Front page */

.front {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 32px;
    padding-bottom: 12px;
}

.front-lead .card {
    border-bottom: 0;
    padding-top: 0;
}

.front-side {
    border-left: 1px solid var(--rule);
    padding-left: 24px;
}

.front-side .card:last-child {
    border-bottom: 0;
}

.block {
    margin-top: 32px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 3px solid var(--rule-strong);
    padding-top: 10px;
    margin-bottom: 4px;
}

.section-title {
    font-family: var(--serif);
    font-size: 20px;
    margin: 0;
}

.grid.grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lead-more {
    border-top: 1px solid var(--rule);
}

.more {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    padding-left: 12px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 28px;
}

.grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Listing pages */

.page-head {
    padding-bottom: 18px;
    border-bottom: 3px solid var(--rule-strong);
    margin-bottom: 8px;
}

.page-head h1,
.story-head h1,
.not-found h1 {
    font-family: var(--serif);
    font-weight: 700;
    line-height: 1.15;
    margin: 4px 0 10px;
    font-size: clamp(30px, 5vw, 46px);
}

.lede {
    font-size: 19px;
    color: var(--ink-soft);
    margin: 0 0 12px;
    max-width: 760px;
}

.chips {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips a {
    display: block;
    padding: 4px 12px;
    background: var(--chip);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
}

.stack {
    max-width: 820px;
}

.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 820px;
    margin-top: 24px;
    font-size: 15px;
    font-weight: 600;
}

.pager .disabled {
    color: var(--muted);
    font-weight: 400;
}

.empty {
    color: var(--muted);
    padding: 48px 0;
    text-align: center;
}

/* Article */

.story {
    max-width: 760px;
    margin: 0 auto;
}

.story-kicker {
    margin: 0;
}

.byline {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 10px 0;
    margin: 16px 0;
    font-size: 15px;
}

.byline p {
    margin: 0;
}

.byline a {
    font-weight: 600;
}

.read-in {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
}

.story-image {
    margin: 0 0 28px;
}

.story-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    background: var(--chip);
}

.story-image figcaption,
.story-body figcaption {
    font-size: 14px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.5;
}

.credit {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.story-body {
    font-size: 19px;
    line-height: 1.75;
}

.story-body video {
    display: block;
    width: 100%;
    max-height: 80vh;
    background: #000;
    border-radius: 2px;
}

.story-body iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 2px;
    background: #000;
}

.story-body h2,
.story-body h3,
.story-body h4 {
    font-family: var(--serif);
    line-height: 1.3;
    margin: 1.6em 0 0.5em;
}

.story-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.story-body blockquote {
    margin: 1.5em 0;
    padding: 4px 0 4px 20px;
    border-left: 4px solid var(--accent);
    font-family: var(--serif);
    font-size: 21px;
    color: var(--ink-soft);
}

.story-body img {
    max-width: 100%;
    height: auto;
}

.story-body figure {
    margin: 1.5em 0;
}


.story-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    display: block;
    overflow-x: auto;
}

.story-body th,
.story-body td {
    border: 1px solid var(--rule);
    padding: 6px 10px;
    text-align: left;
}

.story-body pre {
    overflow-x: auto;
    background: var(--chip);
    padding: 12px;
    font-size: 15px;
}

.share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 14px;
}

.share span {
    font-weight: 600;
    margin-right: 4px;
}

.share a,
.share button,
.button {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.share a:hover,
.share button:hover,
.button:hover {
    border-color: var(--ink);
    text-decoration: none;
}

/* Footer */

.site-footer {
    border-top: 3px double var(--rule-strong);
    padding: 28px 0 40px;
    font-size: 14px;
    color: var(--muted);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.footer-inner p {
    margin: 0;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    justify-content: flex-end;
}

.footer-links a {
    color: var(--ink-soft);
    font-weight: 500;
}

.copyright {
    grid-column: 1 / -1;
}

/* Social links */

.follow {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
}

.follow-label {
    font-weight: 600;
    color: var(--ink-soft);
}

.social {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink-soft);
}

.social a:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

.social--large a {
    height: 44px;
    padding: 0 16px 0 12px;
    font-weight: 600;
    color: var(--ink);
}

.about-follow {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}

.about-follow h2 {
    font-family: var(--serif);
    font-size: 20px;
    margin: 0 0 12px;
}

.not-found {
    text-align: center;
    padding-top: 80px;
}

.not-found .lede {
    margin: 0 auto 24px;
}

/* Responsive */

@media (max-width: 960px) {
    .grid,
    .grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    .grid.grid--2 {
        grid-template-columns: 1fr;
    }

    .front {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .front-side {
        border-left: 0;
        padding-left: 0;
    }

    .grid,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .sections ul {
        justify-content: flex-start;
    }

    .story-body {
        font-size: 18px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
    }

    .footer-links {
        justify-content: flex-start;
    }
}
