/* ─── Editorial design system — NZZ / Le Temps inspired ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --font-serif: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --ink: #0d0d0d;
    --ink-soft: #2b2b2b;
    --ink-muted: #6b6b6b;
    --ink-faint: #999;
    --paper: #fafaf8;
    --paper-white: #ffffff;
    --rule: #e2e2de;
    --rule-dark: #c8c8c4;
    --accent: var(--color-accent, #da291c);
    --brand: var(--color-primary, #1a2a4a);
    --max: 1240px;
    --reading: 680px;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

html { font-size: 17px; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent); }

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

/* ─── Masthead ─── */
.masthead {
    background: var(--paper-white);
    border-bottom: 1px solid var(--ink);
}

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

.masthead-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 24px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.masthead-date { font-variant-numeric: tabular-nums; }

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-muted);
    padding: 2px 0;
    border-bottom: 2px solid transparent;
}

.lang-btn.is-active {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

.lang-sep { color: var(--rule-dark); font-weight: 300; }

.masthead-brand {
    padding: 28px 0 24px;
    text-align: center;
    border-bottom: 1px solid var(--rule);
}

.brand-link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--ink);
}

.brand-link:hover { color: var(--ink); opacity: 0.85; }

.brand-name {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-region {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.brand-logo { max-height: 52px; width: auto; }

.masthead-nav {
    padding: 10px 0;
}

.masthead-nav-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.nav-dot { color: var(--rule-dark); }

.site-main { min-height: 60vh; }

/* ─── Lead story (hero) ─── */
.lead-story {
    background: var(--paper-white);
    border-bottom: 1px solid var(--rule);
    padding: 40px 0;
}

.lead-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
    align-items: center;
}

.lead-media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--brand);
}

.lead-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--ease);
}

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

.lead-kicker {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 6px 12px;
}

.lead-headline-link:hover { color: var(--ink); }

.lead-headline {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.8vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--ink);
}

.lead-deck {
    font-size: 1.05rem;
    line-height: 1.65;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

.story-byline {
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
    margin-bottom: 24px;
}

.byline-sep { margin: 0 6px; }

.lead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn-outline,
.btn-accent {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 12px 24px;
    transition: all 0.2s var(--ease);
}

.btn-outline {
    border: 1.5px solid var(--ink);
    color: var(--ink);
}

.btn-outline:hover {
    background: var(--ink);
    color: #fff;
}

.btn-accent {
    background: var(--accent);
    color: #fff !important;
    border: 1.5px solid var(--accent);
}

.btn-accent:hover {
    background: #b82218;
    border-color: #b82218;
    color: #fff !important;
}

/* ─── News ticker ─── */
.news-ticker {
    background: var(--ink);
    color: #fff;
    border-bottom: 3px solid var(--accent);
}

.ticker-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 44px;
    overflow: hidden;
}

.ticker-badge {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--accent);
    color: #fff;
    padding: 5px 10px;
}

.ticker-viewport {
    flex: 1;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent);
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
    animation: ticker-scroll 80s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
    flex-shrink: 0;
    color: rgba(255,255,255,0.92) !important;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0 8px;
    transition: color 0.2s;
}

.ticker-item:hover { color: #fff !important; text-decoration: underline; }

.ticker-dot {
    flex-shrink: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ─── Horizontal news scroll ─── */
.news-scroll-section {
    padding: 36px 0 8px;
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}

.scroll-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.scroll-header h2 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
}

.scroll-controls {
    display: flex;
    gap: 8px;
}

.scroll-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--rule);
    background: #fff;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.scroll-btn:hover {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.news-scroll-viewport {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -24px;
    padding: 0 24px 20px;
}

.news-scroll-viewport::-webkit-scrollbar { display: none; }

.news-scroll-track {
    display: flex;
    gap: 16px;
    width: max-content;
}

.scroll-card {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--rule);
    color: inherit;
    transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}

.scroll-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.scroll-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}

.scroll-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.scroll-card:hover .scroll-card-img img { transform: scale(1.05); }

.scroll-card-body {
    padding: 14px 14px 16px;
}

.scroll-card-body h3 {
    font-family: var(--font-serif);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-fallback.sm {
    width: 100%;
    height: 100%;
    min-height: 80px;
    font-size: 1.5rem;
}

/* ─── Homepage layout ─── */
.page-body { padding: 48px 0 72px; }

.homepage-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

.section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--ink);
}

.section-title h2 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.news-count {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.section-title--sm {
    border-bottom-width: 1px;
    border-color: var(--rule);
    margin-bottom: 20px;
    padding-bottom: 12px;
}

.section-title--sm h2 {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.story-kicker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}

.story-kicker--accent { color: var(--accent); }

/* Featured story in feed */
.story-feature {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--rule);
}

.story-feature-link {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
    color: inherit;
}

.story-feature-link:hover h3 { color: var(--accent); }

.story-feature-media {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}

.story-feature-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.story-feature-link:hover .story-feature-media img { transform: scale(1.04); }

.story-feature-body h3 {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.story-feature-body p {
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-bottom: 12px;
}

.story-feature-body time {
    font-size: 0.78rem;
    color: var(--ink-faint);
}

/* Story grid */
.story-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-top: 1px solid var(--rule);
    border-left: 1px solid var(--rule);
}

.story-card {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.story-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    padding: 0;
    transition: background 0.2s;
}

.story-card-link:hover { background: var(--paper-white); }
.story-card-link:hover h3 { color: var(--accent); }

.story-card-media {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}

.story-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s var(--ease);
}

.story-card-link:hover .story-card-media img { transform: scale(1.05); }

.story-card-body {
    padding: 18px 16px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.story-card-body h3 {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: auto;
    padding-bottom: 12px;
}

.story-card-body time {
    font-size: 0.72rem;
    color: var(--ink-faint);
    margin-top: 8px;
}

.media-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand) 0%, #2a4070 100%);
    font-family: var(--font-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(255,255,255,0.35);
}

/* Sidebar rail */
.sidebar-rail {
    position: sticky;
    top: 24px;
}

.rail-block + .rail-block { margin-top: 40px; }

.ranked-list {
    list-style: none;
    counter-reset: rank;
}

.ranked-list li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}

.ranked-list li:first-child { padding-top: 0; }

.rank-num {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rule-dark);
    line-height: 1.2;
}

.ranked-list a:hover .rank-title { color: var(--accent); }

.rank-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    color: var(--ink);
}

.rank-meta {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.archive-links { list-style: none; }

.archive-links li { border-bottom: 1px solid var(--rule); }

.archive-links a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink-soft);
}

.archive-links a:hover { color: var(--accent); }

.archive-count {
    font-size: 0.75rem;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.empty-note, .empty-state {
    color: var(--ink-faint);
    font-size: 0.9rem;
    padding: 24px 0;
}

/* ─── Reading page (article / featured) ─── */
.reading-page {
    background: var(--paper-white);
    border-bottom: 1px solid var(--rule);
    padding: 48px 24px 80px;
}

.reading-wrap {
    max-width: var(--reading);
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 32px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rule);
}

.back-link:hover { color: var(--accent); border-color: var(--accent); }

.reading-header {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--rule);
}

.reading-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4.5vw, 2.65rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin: 8px 0 16px;
    color: var(--ink);
}

.reading-hero {
    margin-bottom: 36px;
}

.reading-hero img {
    width: 100%;
    height: auto;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.reading-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--ink-soft);
}

.reading-body p { margin-bottom: 1.35em; }

.reading-body p:first-of-type {
    font-size: 1.15rem;
    line-height: 1.75;
    color: var(--ink);
}

.reading-lead {
    font-size: 1.2rem !important;
    line-height: 1.7 !important;
    color: var(--ink) !important;
}

.featured-body h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 2em 0 0.75em;
    color: var(--ink);
}

.featured-body ol, .featured-body ul {
    margin: 0.75em 0 1.25em 1.5em;
}

.featured-body li { margin-bottom: 0.5em; }

.reading-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 2px solid var(--ink);
    font-size: 0.82rem;
    color: var(--ink-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.reading-footer a {
    font-weight: 700;
    color: var(--brand);
    border-bottom: 1px solid var(--rule);
}

.reading-footer a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.reading-cta { margin-top: 40px; }

/* Archive page */
.archive-page, .legal-page {
    padding: 48px 24px 80px;
    max-width: var(--max);
    margin: 0 auto;
}

.archive-page h1, .legal-page h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--ink);
}

.archive-articles {
    list-style: none;
    border-top: 1px solid var(--rule);
}

.archive-articles li { border-bottom: 1px solid var(--rule); }

.archive-articles a {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 20px;
    padding: 18px 0;
    align-items: baseline;
    color: inherit;
    transition: color 0.2s;
}

.archive-articles a:hover { color: var(--accent); }

.archive-date {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.archive-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.archive-source {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
}

.legal-body {
    max-width: var(--reading);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--ink-soft);
}

.legal-body p { margin-bottom: 1.25em; }

/* ─── Footer ─── */
.site-footer {
    background: var(--ink);
    color: rgba(255,255,255,0.75);
    padding: 56px 0 0;
}

.footer-brand {
    text-align: center;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 40px;
}

.footer-logo {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.footer-tagline {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
    max-width: 420px;
    margin: 0 auto;
    line-height: 1.5;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding-bottom: 40px;
}

.footer-col h4 {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 14px;
}

.footer-col p, .footer-col a {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    display: block;
    margin-bottom: 6px;
}

.footer-col a:hover { color: #fff; }

.social-row { display: flex; gap: 12px; }

.social-row a {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    transition: border-color 0.2s, background 0.2s;
}

.social-row a:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
}

/* ─── Load more ─── */
.load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--rule);
}

.btn-load-more {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 14px 40px;
    border: 1.5px solid var(--ink);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.btn-load-more:hover:not(:disabled) {
    background: var(--ink);
    color: #fff;
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: wait;
}

.load-more-status {
    font-size: 0.78rem;
    color: var(--ink-faint);
}

.card-excerpt {
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .homepage-layout { grid-template-columns: 1fr; }
    .sidebar-rail {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .story-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .lead-grid { grid-template-columns: 1fr; gap: 28px; }
    .lead-media { aspect-ratio: 16/9; }
    .story-feature-link { grid-template-columns: 1fr; }
    .story-grid { grid-template-columns: 1fr; }
    .sidebar-rail { grid-template-columns: 1fr; }
    .footer-links { grid-template-columns: 1fr; text-align: center; }
    .social-row { justify-content: center; }
    .masthead-nav-inner { flex-wrap: wrap; gap: 8px; }
    .ticker-badge { display: none; }
    .scroll-card { flex: 0 0 180px; }
    .section-title { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 480px) {
    html { font-size: 16px; }
    .container { padding: 0 16px; }
    .lead-actions { flex-direction: column; }
    .btn-outline, .btn-accent { text-align: center; }
    .archive-articles a { grid-template-columns: 56px 1fr; }
    .archive-source { display: none; }
}

/* ─── Subtle entrance ─── */
.story-card, .story-feature, .lead-story {
    animation: fadeUp 0.5s var(--ease) both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.story-card:nth-child(2) { animation-delay: 0.05s; }
.story-card:nth-child(3) { animation-delay: 0.1s; }
.story-card:nth-child(4) { animation-delay: 0.15s; }
.story-card:nth-child(5) { animation-delay: 0.2s; }
