/* ============================================================ */
/* kd-article.css · Article page styles                         */
/* Extends kd-page.css. Used by news/*.html article pages.      */
/* ============================================================ */

.kd-article {
    background: var(--kd-bg);
    color: var(--kd-fg);
    font-family: var(--kd-font-sans);
}

/* Top bar — minimal, links back to homepage */
.kd-article__topbar {
    border-bottom: 1px solid var(--kd-border);
    padding: 14px 0;
    background: var(--kd-bg);
    position: sticky;
    top: 0;
    z-index: 10;
}
.kd-article__topbar .kd-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.kd-article__topbar .kd-article__brand {
    margin-inline-end: auto;
    margin-inline-start: 24px;
}
.kd-langpill--article {
    flex-shrink: 0;
}
.kd-article__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--kd-font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kd-fg-muted);
    text-decoration: none;
    transition: color var(--kd-dur) var(--kd-ease);
}
.kd-article__back:hover { color: var(--kd-fg); }
.kd-article__back::before {
    content: "←";
    font-size: 14px;
    line-height: 1;
}
.kd-article__brand {
    font-family: var(--kd-font-sans);
    font-weight: var(--kd-w-semibold);
    font-size: 14px;
    letter-spacing: -0.01em;
    color: var(--kd-fg);
    text-decoration: none;
}

/* ---------- Masthead — header overlaid on hero image ---------- */
.kd-article__masthead {
    position: relative;
    isolation: isolate;
    border-bottom: 1px solid var(--kd-border);
    overflow: hidden;
    min-height: clamp(420px, 64vh, 640px);
    display: flex;
    align-items: flex-end;
    color: #fff; /* default tone: light text on image */
}
.kd-article__masthead-img {
    position: absolute;
    inset: 0;
    z-index: -2;
}
.kd-article__masthead-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
/* Gradient overlay — default tone=light: image fades to dark at bottom.
   Heavy enough to keep meta + title legible against any image. */
.kd-article__masthead::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.55) 30%,
        rgba(0, 0, 0, 0.80) 70%,
        rgba(0, 0, 0, 0.92) 100%
    );
    pointer-events: none;
}
/* Tone override: dark text on a light gradient (use for very dark images
   or when the brand prefers light treatment) */
.kd-article__masthead[data-hero-tone="dark"] {
    color: #0a0c10;
}
.kd-article__masthead[data-hero-tone="dark"]::before {
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.55) 30%,
        rgba(255, 255, 255, 0.85) 70%,
        rgba(255, 255, 255, 0.96) 100%
    );
}
/* Container for the masthead content */
.kd-article__masthead .kd-container {
    width: 100%;
    padding-block: clamp(48px, 6vw, 88px);
}

/* Header — meta, title, lede.
   Used inside .kd-article__masthead (overlay) — colors inherit from
   the masthead's tone, so meta/lede/title all read against the image. */
.kd-article__header {
    /* No background, no border — sits over the masthead gradient */
}
.kd-article__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    font-family: var(--kd-font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: inherit;
    opacity: 0.85;
}
.kd-article__meta .kd-badge {
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.92);
    color: #0a0c10;
    border-color: transparent;
}
.kd-article__masthead[data-hero-tone="dark"] .kd-article__meta .kd-badge {
    background: rgba(10, 12, 16, 0.92);
    color: #fff;
}
.kd-article__meta-sep {
    width: 4px; height: 4px;
    background: currentColor;
    opacity: 0.5;
    border-radius: 50%;
    flex: 0 0 auto;
}
.kd-article__title {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: var(--kd-w-semibold);
    line-height: 1.02;
    letter-spacing: -0.025em;
    margin: 0 0 24px;
    max-width: 22ch;
    text-wrap: balance;
    color: inherit;
}
.kd-article__lede {
    font-size: clamp(18px, 1.5vw, 22px);
    line-height: 1.5;
    color: inherit;
    opacity: 0.9;
    max-width: 60ch;
    margin: 0;
    text-wrap: pretty;
}

/* Body, prose, sidebar, foot moved to kd-article-body.css. */
