/* =========================================================
   VabaMaa — stylesheet
   Serious, readable, center-right Estonian publication.
   Serif headlines (Merriweather) + sans body (Inter).
   Navy brand + restrained gold accent.
   ========================================================= */

:root {
    --navy: #0B2447;
    --navy-dark: #071733;
    --gold: #B8860B;
    --gold-soft: #E6C26F;
    --red: #C8102E;
    --red-dark: #A00D24;
    --ink: #1A1A1A;
    --text: #2A2A2A;
    --muted: #666666;
    --divider: #E5E5E5;
    --bg: #FFFFFF;
    --bg-soft: #F8F7F4;
    --shadow-sm: 0 1px 2px rgba(11, 36, 71, 0.08);
    --shadow-md: 0 4px 12px rgba(11, 36, 71, 0.1);

    --serif: "Merriweather", Georgia, "Times New Roman", serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --max-wide: 1280px;
    --max-narrow: 720px;
}

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

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

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--navy);
}

h1, h2, h3, h4 {
    font-family: var(--serif);
    color: var(--ink);
    line-height: 1.25;
    margin: 0 0 0.5em;
}

p {
    margin: 0 0 1em;
}

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

.container-narrow {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Utility bar ---------- */
.utility-bar {
    background: #F4F3EF;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
}

.utility-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 36px;
}

.utility-date {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.utility-nav {
    display: flex;
    gap: 20px;
}

.utility-nav a {
    color: var(--muted);
    transition: color 0.15s;
}

.utility-nav a:hover {
    color: var(--navy);
}

/* ---------- Header (Economist-style: red logo box + category strip) ---------- */
.site-header {
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--divider);
}

.masthead {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 24px;
}

/* Red box wrapping the white logo */
.brand-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--red);
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    padding: 12px;
    transition: background-color 0.15s;
}

.brand-box:hover {
    background: var(--red-dark);
}

.brand-logo-white {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Tagline meta beside the box */
.masthead-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.masthead-est {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--red);
}

.masthead-tagline {
    font-family: var(--serif);
    font-size: 16px;
    font-weight: 400;
    font-style: italic;
    color: var(--muted);
    line-height: 1.3;
}

/* Category navigation strip below masthead */
.category-nav {
    background: var(--bg);
    border-top: 1px solid var(--divider);
    border-bottom: 2px solid var(--navy);
}

.category-nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0 24px;
}

.category-link {
    display: inline-block;
    padding: 14px 16px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: 0.01em;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -2px; /* sit on top of category-nav border */
}

.category-link:first-child {
    padding-left: 0;
}

.category-link:hover {
    color: var(--red);
    border-bottom-color: var(--red);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s;
}

/* ---------- Category chip ---------- */
.category-chip {
    display: inline-block;
    background: var(--navy);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 2px;
}

.category-chip-large {
    font-size: 12px;
    padding: 6px 12px;
    margin-bottom: 20px;
}

/* ---------- Hero section ---------- */
.hero-section {
    padding: 48px 0 32px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
}

.hero-card {
    border-bottom: 1px solid var(--divider);
    padding-bottom: 24px;
}

.hero-link {
    display: block;
}

.hero-image {
    position: relative;
    width: 100%;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    aspect-ratio: 16 / 10;
    margin-bottom: 20px;
    overflow: hidden;
}

.hero-primary .hero-image {
    aspect-ratio: 16 / 10;
}

.hero-secondary .hero-image {
    aspect-ratio: 16 / 10;
}

.hero-image .category-chip {
    position: absolute;
    top: 16px;
    left: 16px;
}

.hero-headline {
    font-size: 34px;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.hero-secondary .hero-headline {
    font-size: 26px;
}

.hero-link:hover .hero-headline {
    color: var(--navy);
}

.hero-kicker {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.meta-row {
    font-size: 13px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.meta-row .sep {
    margin: 0 6px;
    color: var(--divider);
}

/* ---------- Section header ---------- */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-top: 32px;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    letter-spacing: -0.01em;
    text-transform: none;
    font-family: var(--serif);
    flex-shrink: 0;
}

.section-rule {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--gold) 0%, var(--divider) 100%);
    display: block;
}

/* ---------- Grid section ---------- */
.grid-section {
    padding: 16px 0 48px;
    background: var(--bg);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.card-grid-wide {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.grid-card {
    transition: transform 0.15s;
}

.grid-card a {
    display: block;
}

.grid-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #ddd;
    background-size: cover;
    background-position: center;
    margin-bottom: 14px;
}

.grid-image .category-chip {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    padding: 4px 8px;
}

.grid-headline {
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
    line-height: 1.3;
}

.grid-card:hover .grid-headline {
    color: var(--navy);
}

.grid-summary {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Ticker ---------- */
.ticker-section {
    background: var(--bg-soft);
    padding: 16px 0 48px;
    border-top: 1px solid var(--divider);
}

.ticker-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 40px;
}

.ticker-list li {
    border-bottom: 1px dashed var(--divider);
}

.ticker-list a {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    font-size: 15px;
    transition: color 0.15s;
}

.ticker-list a:hover {
    color: var(--navy);
}

.ticker-cat {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
}

.ticker-title {
    font-weight: 500;
    color: var(--ink);
}

.ticker-list time {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Single article ---------- */
.single-article {
    padding: 48px 0 64px;
}

.breadcrumbs {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px;
}

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

.breadcrumbs a:hover {
    color: var(--navy);
}

.breadcrumbs span {
    margin: 0 8px;
    color: var(--divider);
}

.article-header {
    margin-bottom: 32px;
}

.article-title {
    font-size: 44px;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.article-kicker {
    font-size: 20px;
    color: var(--muted);
    line-height: 1.45;
    font-weight: 300;
    margin-bottom: 24px;
    font-family: var(--serif);
    font-style: italic;
}

.article-meta {
    font-size: 14px;
    color: var(--muted);
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    padding: 14px 0;
    font-variant-numeric: tabular-nums;
}

.byline {
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.article-hero {
    margin: 32px 0 40px;
}

.article-hero img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
}

.article-hero figcaption {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
    font-style: italic;
}

.article-body {
    font-size: 18px;
    line-height: 1.75;
    color: var(--text);
}

.article-body p {
    margin: 0 0 1.2em;
}

.article-body p:first-of-type::first-letter {
    font-family: var(--serif);
    font-size: 3.2em;
    font-weight: 900;
    float: left;
    line-height: 0.9;
    margin: 0.1em 0.1em -0.05em 0;
    color: var(--navy);
}

.article-body h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 0.5em;
    color: var(--ink);
}

.article-body h3 {
    font-size: 22px;
    font-weight: 700;
    margin-top: 1.8em;
    margin-bottom: 0.4em;
    color: var(--ink);
}

.article-body blockquote {
    border-left: 3px solid var(--gold);
    padding: 4px 0 4px 24px;
    margin: 32px 0;
    font-family: var(--serif);
    font-style: italic;
    font-size: 22px;
    color: var(--ink);
    line-height: 1.5;
}

.article-body a {
    color: var(--navy);
    border-bottom: 1px solid var(--gold-soft);
    transition: background 0.15s;
}

.article-body a:hover {
    background: var(--gold-soft);
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.2em 1.2em;
    padding: 0;
}

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

.article-body strong {
    color: var(--ink);
    font-weight: 700;
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--divider);
    margin: 40px 0;
}

.article-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

.tag {
    display: inline-block;
    font-size: 12px;
    color: var(--muted);
    margin-right: 12px;
    font-weight: 500;
}

.article-foot {
    margin-top: 48px;
    padding: 24px;
    background: var(--bg-soft);
    border-left: 3px solid var(--gold);
}

.masthead-note {
    font-size: 15px;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.masthead-note strong {
    color: var(--navy);
    font-family: var(--serif);
    font-weight: 900;
}

/* ---------- Related ---------- */
.related-section {
    background: var(--bg-soft);
    padding: 32px 0 64px;
    border-top: 1px solid var(--divider);
}

/* ---------- Category page ---------- */
.category-section {
    padding: 48px 0 64px;
}

.category-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--navy);
}

.category-title {
    font-size: 48px;
    font-weight: 900;
    color: var(--navy);
    margin-bottom: 8px;
}

.category-lede {
    font-size: 17px;
    color: var(--muted);
    margin: 0;
}

.empty-state {
    padding: 40px;
    text-align: center;
    background: var(--bg-soft);
    color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--navy);
    color: #CFD8E3;
    margin-top: 64px;
    padding: 56px 0 0;
    font-size: 14px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 2fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-mark {
    font-family: var(--serif);
    font-weight: 900;
    font-size: 28px;
    color: white;
    margin-bottom: 12px;
}

.footer-brand p {
    color: #8FA5BE;
    line-height: 1.6;
    max-width: 380px;
}

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

.footer-links h4 {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gold);
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: #CFD8E3;
    padding: 4px 0;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 0;
    background: var(--navy-dark);
    font-size: 13px;
    color: #8FA5BE;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-secondary .hero-headline {
        font-size: 28px;
    }

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

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

    .ticker-list {
        grid-template-columns: 1fr;
    }
}

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

    .masthead {
        gap: 14px;
        padding: 14px 16px;
    }

    .brand-box {
        width: 64px;
        height: 64px;
        padding: 8px;
    }

    .masthead-est {
        font-size: 10px;
        letter-spacing: 0.16em;
    }

    .masthead-tagline {
        font-size: 13px;
    }

    .category-nav-inner {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: 0 16px;
    }

    .category-link {
        padding: 12px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nav-toggle {
        display: none;  /* mobile uses horizontal-scroll category nav, no hamburger needed */
    }

    .utility-nav {
        gap: 14px;
    }

    .hero-section {
        padding: 24px 0 16px;
    }

    .hero-headline {
        font-size: 26px;
    }

    .hero-secondary .hero-headline {
        font-size: 22px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .card-grid-wide {
        grid-template-columns: 1fr;
    }

    .article-title {
        font-size: 32px;
    }

    .article-kicker {
        font-size: 17px;
    }

    .article-body {
        font-size: 17px;
    }

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

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

    .footer-bottom .container {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 420px) {
    .footer-links {
        grid-template-columns: 1fr;
    }

    .ticker-list a {
        grid-template-columns: 1fr auto;
    }

    .ticker-cat {
        display: none;
    }
}


/* ---------- Ad slots / sponsor placements ---------- */
/*
   Three sizes: billboard (970x250 area), banner (728x90 area), inline.
   While in editorial-message mode, slot still occupies real banner space
   so the layout looks like a "real" media site from day 1. When real
   sponsors come on, the same slot renders the sponsor; when programmatic
   ads come on, the macro renders ad code. CSS stays the same.
*/

.ad-slot {
    margin: 32px 0;
    background: var(--bg-soft);
    border-top: 3px solid var(--gold);
    border-bottom: 1px solid var(--divider);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.ad-slot-billboard {
    min-height: 200px;
    padding: 32px 24px;
}

.ad-slot-banner {
    min-height: 110px;
    padding: 20px 24px;
}

.ad-slot-content {
    max-width: var(--max-narrow);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.ad-slot-billboard .ad-slot-content {
    max-width: 920px;
    text-align: center;
    align-items: center;
}

.ad-slot-tag {
    display: inline-block;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 4px;
}

.ad-slot-headline {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
}

.ad-slot-billboard .ad-slot-headline {
    font-size: 28px;
}

.ad-slot-body {
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    max-width: 600px;
}

.ad-slot-billboard .ad-slot-body {
    font-size: 16px;
}

.ad-slot-cta {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 2px;
    transition: color 0.15s, border-color 0.15s;
}

.ad-slot-cta:hover {
    color: var(--gold);
    border-color: var(--navy);
}

.ad-slot-sponsor-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-decoration: none;
}

.ad-slot-logo {
    height: 32px;
    max-width: 200px;
    object-fit: contain;
}

.ad-slot-billboard .ad-slot-logo {
    height: 48px;
    max-width: 280px;
}

/* Programmatic ad code container — keeps layout stable when iframe loads */
.ad-slot-programmatic {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
}

.ad-slot-billboard .ad-slot-programmatic {
    min-height: 250px;
}

@media (max-width: 720px) {
    .ad-slot {
        margin: 24px -16px;
        border-radius: 0;
    }
    .ad-slot-billboard {
        min-height: 160px;
        padding: 24px 16px;
    }
    .ad-slot-banner {
        min-height: 100px;
        padding: 16px;
    }
    .ad-slot-billboard .ad-slot-headline {
        font-size: 22px;
    }
    .ad-slot-headline {
        font-size: 18px;
    }
    .ad-slot-billboard .ad-slot-body {
        font-size: 14px;
    }
    .ad-slot-body {
        font-size: 14px;
    }
}

/* ---------- Footer lineage / heritage line ---------- */
.footer-tagline {
    margin: 8px 0;
}

.footer-lineage {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px solid rgba(184, 134, 11, 0.3);
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    font-family: var(--serif);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}

.footer-lineage span {
    white-space: nowrap;
}

.footer-lineage strong {
    color: var(--gold-soft);
    font-weight: 700;
    letter-spacing: 0.04em;
}

@media (max-width: 720px) {
    .footer-lineage {
        flex-direction: column;
        gap: 6px;
        font-size: 12px;
    }
}
