﻿/* ============================================================
   Editorial system v2 - typographic, high-contrast, singular accent
   Design read: editorial tech publication for AI enthusiasts,
   Swiss-grid language, one accent (signal red), mono metadata.
   ============================================================ */

:root {
    --font-sans: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
    --font-display: 'Instrument Sans', 'Segoe UI', sans-serif;

    --rule-weight: 1px;
    --grid-gap: clamp(1.25rem, 2vw, 2rem);

    /* light */
    --page-bg: #fbfbf9;
    --surface-bg: #ffffff;
    --surface-sunk: #f2f2ee;
    --header-bg: rgba(251, 251, 249, 0.92);
    --text-primary: #101110;
    --text-secondary: #3d4140;
    --text-muted: #74797a;
    --border-color: #d9dbd6;
    --border-strong: #101110;
    --accent-color: #e2401c;
    --accent-soft: rgba(226, 64, 28, 0.08);
    --shadow-rgb: 16, 17, 16;
    --shadow-color: rgba(16, 17, 16, 0.08);
    --radius: 2px;
    --radius-pill: 999px;

    /* legacy aliases used across older partials */
    --dark-bg: var(--page-bg);
    --dark-card: var(--surface-bg);
    --dark-hover: var(--surface-sunk);
    --card-bg: var(--surface-bg);
    --bg-primary: var(--page-bg);
    --accent-purple: var(--accent-color);
    --accent-pink: var(--accent-color);
    --primary-color: var(--accent-color);
    --gradient-primary: none;
    --gradient-secondary: none;
    --gradient-accent: none;
}

html[data-theme='dark'] {
    --page-bg: #0d0e0d;
    --surface-bg: #141615;
    --surface-sunk: #1b1e1c;
    --header-bg: rgba(13, 14, 13, 0.92);
    --text-primary: #f3f3ee;
    --text-secondary: #c3c6c1;
    --text-muted: #8b908c;
    --border-color: #2a2d2b;
    --border-strong: #f3f3ee;
    --accent-color: #ff5a36;
    --accent-soft: rgba(255, 90, 54, 0.14);
    --shadow-rgb: 0, 0, 0;
    --shadow-color: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
}

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

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

body {
    background: var(--page-bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-feature-settings: 'ss01' 1, 'cv05' 1;
    letter-spacing: -0.006em;
    line-height: 1.62;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image: linear-gradient(90deg, rgba(var(--shadow-rgb), 0.035) 1px, transparent 1px);
    background-size: calc(100% / 12) 100%;
}

h1, h2, h3, h4,
.hero-main-heading,
.article-headline,
.article-title,
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.028em;
    line-height: 1.04;
    text-wrap: balance;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent-color);
    color: #fff;
}

/* Masthead ------------------------------------------------- */
.site-header {
    background: var(--header-bg);
    border-bottom: var(--rule-weight) solid var(--border-strong);
    box-shadow: none;
    padding: 0.85rem 0;
    backdrop-filter: saturate(140%) blur(8px);
}

.site-header .container {
    max-width: 1360px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo a {
    display: inline-flex;
    align-items: center;
}

.logo img {
    height: 30px !important;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 1.6rem;
    margin-right: auto;
}

.main-nav a {
    position: relative;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.35rem 0;
    transition: color 0.15s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--accent-color);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.main-nav a:hover,
.main-nav a[aria-current='page'] {
    color: var(--text-primary);
}

.main-nav a:hover::after,
.main-nav a[aria-current='page']::after {
    transform: scaleX(1);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.header-meta-link {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
}

.header-meta-link:hover {
    color: var(--accent-color);
}

.theme-toggle {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-pill);
    border: var(--rule-weight) solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, color 0.15s ease, transform 0.25s ease;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: rotate(-18deg);
}

.theme-toggle-icon::before {
    content: '\25D0';
    font-size: 0.85rem;
}

html[data-theme='dark'] .theme-toggle-icon::before {
    content: '\25D1';
}

/* Section headers ----------------------------------------- */
.section-header,
.homepage-section-shell > .container > .section-header {
    border-top: var(--rule-weight) solid var(--border-strong);
    padding-top: 0.7rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    margin: 0;
}

.section-subtitle,
.article-excerpt,
.article-perex {
    color: var(--text-secondary);
    font-size: 0.98rem;
    max-width: 62ch;
}

/* Cards ---------------------------------------------------- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--grid-gap);
    margin-top: 1.5rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    border: 0;
    border-top: var(--rule-weight) solid var(--border-strong);
    border-radius: 0;
    box-shadow: none;
    padding-top: 0.85rem;
    transition: none;
}

.article-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--accent-color);
}

.article-image {
    aspect-ratio: 16 / 10;
    height: auto;
    overflow: hidden;
    background: var(--surface-sunk);
}

.article-card:hover .article-image img {
    transform: none;
    filter: saturate(1.06);
}

.article-image img {
    transition: filter 0.3s ease;
}

.article-body,
.article-content {
    padding: 0.9rem 0 0;
}

.article-meta,
.article-meta-small {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.article-title {
    font-size: 1.24rem;
    margin-bottom: 0.5rem;
}

.article-title a {
    text-decoration: none;
    background-image: linear-gradient(var(--accent-color), var(--accent-color));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .article-title a {
    background-size: 100% 2px;
}

.article-excerpt {
    font-size: 0.92rem;
    line-height: 1.55;
}

.read-more {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    text-decoration: none;
}

/* Category / section blocks -------------------------------- */
.category-section,
.homepage-section-shell,
.editor-brief {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.editor-brief {
    border-top: var(--rule-weight) solid var(--border-strong);
    padding-top: 1rem;
}

.editor-brief-kicker {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-color);
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.editor-brief-link {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border-bottom: 2px solid var(--border-strong);
    padding-bottom: 2px;
}

.editor-brief-link-primary {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* Hero ----------------------------------------------------- */
.hero-badge,
.hero-meta-pill,
.tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--accent-color);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.28rem 0.5rem;
}

.hero-description {
    color: rgba(255, 255, 255, 0.86);
}

.hero-main-heading {
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.breaking-news-ticker {
    border-top: var(--rule-weight) solid var(--border-strong);
    border-bottom: var(--rule-weight) solid var(--border-color);
    background: transparent;
}

/* Article page --------------------------------------------- */
.article-page {
    background: var(--page-bg);
}

.article-shell {
    border-top: var(--rule-weight) solid var(--border-strong);
}

.article-hero-panel,
.article-rail-card,
.article-module,
.article-note-card,
.comments-section,
.comment-form-wrapper {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.article-rail-card {
    border-top: var(--rule-weight) solid var(--border-strong);
    padding-top: 0.75rem;
}

.article-rail-card h2,
.article-rail-card h3,
.rail-meta-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.article-kicker-row .article-category-pill {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: var(--accent-color);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.26rem 0.5rem;
}

.article-headline {
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    letter-spacing: -0.035em;
}

.article-deck {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 58ch;
}

.article-meta-row {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-top: var(--rule-weight) solid var(--border-color);
    padding-top: 0.6rem;
}

.article-prose {
    font-size: 1.08rem;
    line-height: 1.72;
    max-width: 68ch;
}

.article-prose h2 {
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    margin-top: 2.4em;
    padding-top: 0.6em;
    border-top: var(--rule-weight) solid var(--border-color);
}

.article-prose .quick-summary,
.article-hook {
    border-left: 3px solid var(--accent-color);
    background: transparent;
    padding: 0.2rem 0 0.2rem 1rem;
}

.article-prose a {
    color: var(--text-primary);
    text-decoration-color: var(--accent-color);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.article-prose a:hover {
    color: var(--accent-color);
}

.article-embed-image {
    margin: 2.25rem 0;
}

.article-embed-image img {
    width: 100%;
    border-radius: var(--radius);
}

.article-embed-image figcaption {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Buttons -------------------------------------------------- */
button,
.btn,
.hero-cta-btn,
.editor-brief-link-primary {
    border-radius: var(--radius);
}

.hero-cta-btn,
.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border: 0;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.7rem 1.1rem;
}

.hero-cta-btn:hover,
.btn-primary:hover {
    background: var(--text-primary);
    color: var(--page-bg);
    transform: none;
}

/* Footer --------------------------------------------------- */
.footer-content,
.footer-section,
.footer-bottom {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

footer,
.site-footer {
    border-top: 3px solid var(--border-strong);
    background: transparent;
}

/* Dark-mode surface fixes ---------------------------------- */
html[data-theme='dark'] .article-image,
html[data-theme='dark'] .article-hero-media,
html[data-theme='dark'] .hero-lead-image,
html[data-theme='dark'] .hero-side-image {
    background: var(--surface-sunk);
}

html[data-theme='dark'] img {
    filter: brightness(0.94) contrast(1.02);
}

html[data-theme='dark'] .site-header {
    border-bottom-color: var(--border-strong);
}

/* Motion: entry reveal, reduced-motion safe ---------------- */
@media (prefers-reduced-motion: no-preference) {
    .article-card,
    .article-module,
    .editor-brief {
        animation: rise-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

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

@keyframes rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
    .site-header .container {
        padding: 0 1rem;
    }

    .main-nav {
        gap: 1rem;
    }

    .article-headline {
        letter-spacing: -0.025em;
    }

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

    body::before {
        display: none;
    }
}

/* Article layout: flat prose column, upright serif-free headings ---- */
.article-prose h1,
.article-prose h2,
.article-prose h3,
.article-prose h4 {
    font-family: var(--font-display);
}

.article-layout {
    gap: 2.75rem;
}

.article-rail {
    border-left: 1px solid var(--border-color);
    padding-left: 1.5rem;
}

@media (max-width: 1024px) {
    .article-rail {
        border-left: 0;
        padding-left: 0;
    }
}

/* Cookie banner inherits the system fonts and accent -------------- */
.cookie-banner,
.cookie-banner-text h3,
.cookie-banner h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.cookie-banner {
    background: var(--surface-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px var(--shadow-color);
}

.cookie-banner .accept-btn,
.cookie-banner .btn-primary,
.cookie-banner .cookie-accept {
    background: var(--accent-color) !important;
    color: #fff !important;
    border-radius: var(--radius) !important;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

#ot-sdk-btn-floating,
#onetrust-banner-sdk {
    font-family: var(--font-sans) !important;
}

/* Hero headline: keep it to two lines at desktop ------------------- */
.hero-main-heading {
    font-size: clamp(1.9rem, 3.1vw, 3rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    max-width: 22ch;
}

@media (max-width: 900px) {
    .hero-main-heading {
        font-size: clamp(1.6rem, 6vw, 2.4rem);
        max-width: none;
    }
}

/* Home hero panel: tighter type so the lead story fits the first screen */
.hero-main-heading {
    --hero-heading-max: 2.9rem !important;
    --hero-heading-min: 1.85rem !important;
    --hero-heading-mobile-max: 2.1rem !important;
    --hero-heading-mobile-min: 1.6rem !important;
    --hero-heading-measure: 20ch !important;
    letter-spacing: -0.035em;
}

.hero-lead-content {
    padding: clamp(1rem, 2.2vw, 2rem);
}

.hero-description {
    max-width: 46ch;
    font-size: 0.96rem;
    line-height: 1.5;
}

/* Hero headline: no pill background, editorial scrim only ---------- */
.hero-main-heading span {
    display: inline;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-decoration-break: initial;
    -webkit-box-decoration-break: initial;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

/* Header: swap the wordmark artwork per theme ------------------------ */

/* Paint a readable page before any stylesheet arrives: this protects against
   a blank/black first frame on slow CDN or cold cache. */
html {
    background: var(--page-bg);
    color: var(--text-primary);
}

#bg-canvas {
    display: none;
}

.logo .logo-dark { display: none; }
html[data-theme='dark'] .logo .logo-light { display: none; }
html[data-theme='dark'] .logo .logo-dark { display: inline-block; }
.logo img { height: 34px; width: auto; }

/* Hard-coded legacy colours that ignore the token palette ----------- */
.ticker-item,
.ticker-label,
.ticker-sep,
.ticker-content a,
.mobile-menu-kicker,
.menu-item,
.menu-item-secondary,
.view-all-link,
.trending-week-category,
.article-meta,
.article-meta-small,
.category-section-description {
    color: var(--text-secondary);
}

.ticker-label {
    background: var(--accent-color);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0 0.75rem;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.ticker-item:hover,
.view-all-link:hover,
.menu-item:hover {
    color: var(--accent-color);
}

.ticker-dot { display: none; }

.breaking-news-ticker {
    background: var(--surface-bg);
    border-image: none;
    border-top: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    height: 34px;
    margin: 2rem 0 0;
    animation: none;
}

.mobile-menu {
    background: var(--page-bg);
}

.mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.4);
}

.mobile-menu-semicircle,
.menu-items-container {
    background: var(--page-bg);
    border-color: var(--border-strong);
    border-radius: 0;
}

.mobile-menu-kicker {
    background: transparent;
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0;
    border-radius: 0;
}

.mobile-menu .menu-item,
.mobile-menu .menu-item-secondary {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    box-shadow: none;
    padding: 0.85rem 0;
    transform: none;
}

.mobile-menu .menu-item:hover,
.mobile-menu .menu-item-secondary:hover {
    color: var(--accent-color);
    background: transparent;
    transform: none;
}

.mobile-menu .menu-item-secondary {
    border-bottom-color: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    padding: 0.6rem 0;
}

/* Dark-mode readability fixes for legacy blocks --------------------- */
html[data-theme='dark'] .trending-week-section {
    color: var(--text-primary);
    background: transparent;
}

html[data-theme='dark'] .trending-week-card {
    background: var(--surface-bg);
    border: 0;
    border-top: 1px solid var(--border-strong);
    box-shadow: none;
}

html[data-theme='dark'] .trending-week-card:hover {
    transform: none;
    border-color: var(--accent-color);
}

html[data-theme='dark'] .ticker-item,
html[data-theme='dark'] .ticker-label,
html[data-theme='dark'] .ticker-sep,
html[data-theme='dark'] .ticker-content div,
html[data-theme='dark'] .ticker-wrapper {
    color: var(--text-secondary);
}

html[data-theme='dark'] .ticker-label {
    color: #fff;
}

html[data-theme='dark'] .footer-content {
    background: transparent;
    border: 0;
    box-shadow: none;
}

html[data-theme='dark'] .article-image,
html[data-theme='dark'] .article-card .article-body {
    color: var(--text-primary);
}

/* Section pin + Most read leaderboard ------------------------------- */
.section-pin {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 1.1rem 0 1.6rem;
    border-bottom: 1px solid var(--border-color);
}

.section-pin-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-sunk);
}

.section-pin-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-pin-body {
    display: grid;
    gap: 0.6rem;
    align-content: center;
}

.section-pin-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.section-pin-title {
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    letter-spacing: -0.03em;
    margin: 0;
}

.section-pin:hover .section-pin-title {
    color: var(--accent-color);
}

.section-pin-deck {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 48ch;
    margin: 0;
}

.section-pin-meta {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .section-pin {
        grid-template-columns: 1fr;
    }
}

.leaderboard-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.leaderboard-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-top: var(--rule-weight) solid var(--border-strong);
    padding-top: 0.7rem;
    margin-bottom: 1.75rem;
}

.leaderboard-title {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin: 0;
}

.leaderboard-switch {
    display: inline-flex;
    gap: 1.1rem;
}

.leaderboard-switch a {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

.leaderboard-switch a.is-active,
.leaderboard-switch a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--accent-color);
}

.leaderboard-top {
    display: grid;
    gap: 0;
    border-top: 1px solid var(--border-strong);
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 2.2rem 96px minmax(0, 1fr);
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
}

.leaderboard-rank {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-color);
    letter-spacing: 0.08em;
}

.leaderboard-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-sunk);
}

.leaderboard-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leaderboard-copy {
    display: grid;
    gap: 0.25rem;
}

.leaderboard-title-row {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.leaderboard-row:hover .leaderboard-title-row {
    color: var(--accent-color);
}

.leaderboard-meta {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.leaderboard-list {
    list-style: none;
    margin: 1.5rem 0 0;
    padding: 0;
    border-top: 1px solid var(--border-strong);
}

.leaderboard-list li {
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    text-decoration: none;
    color: inherit;
}

.leaderboard-list-title {
    font-size: 0.98rem;
}

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

.leaderboard-list-meta {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.leaderboard-pagination {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.75rem;
}

.leaderboard-pagination a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    min-width: 2rem;
    text-align: center;
    padding: 0.35rem 0.4rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-secondary);
}

.leaderboard-pagination a.is-active {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.leaderboard-empty {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}
/* ---- 4. Overflow hardening ----------------------------------------- */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

.main-content,
.container,
.homepage-section-shell,
.article-page,
.category-container,
.leaderboard-page {
    max-width: 100%;
    min-width: 0;
}

.adsbygoogle,
.adsbygoogle iframe,
ins.adsbygoogle {
    max-width: 100% !important;
    overflow: hidden;
}

@media (max-width: 767px) {
    .leaderboard-row {
        grid-template-columns: 1.6rem 72px minmax(0, 1fr);
        gap: 0.75rem;
    }

    .leaderboard-title-row {
        font-size: 1rem;
    }

    .leaderboard-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}

/* Mobile drawer must be invisible AND unhittable when closed */
.mobile-menu:not(.active) {
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu:not(.active) .mobile-menu-semicircle {
    transform: translateX(100%);
    pointer-events: none;
}

.mobile-menu.active {
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-semicircle,
.menu-items-container {
    background: var(--page-bg);
    border-radius: 0;
    border-left: 1px solid var(--border-strong);
    box-shadow: none;
}

.mobile-menu .menu-item {
    min-height: 0;
}

/* Mobile masthead: one row, nav moves into the drawer -------------- */
@media (max-width: 899px) {
    .site-header .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    .main-nav {
        display: none;
    }

    .header-tools {
        margin-left: auto;
    }

    .logo img {
        height: 26px;
    }
}
/* ---- Redesign: AI Radar strip and Most read ---------------------- */
.breaking-news-ticker {
    background: var(--surface-bg);
    background-image: none;
    border-image: none;
    border-top: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    height: 34px;
    margin: 2rem 0 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.ticker-label {
    background: var(--accent-color);
    background-image: none;
    color: #fff;
    border-radius: 0;
    padding: 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-dot { display: none; }

.ticker-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ticker-content {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    white-space: nowrap;
    padding-left: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.01em;
}

.ticker-item {
    color: var(--text-secondary);
    text-decoration: none;
}

.ticker-item:hover { color: var(--accent-color); }

.ticker-sep {
    color: var(--border-strong);
    opacity: 0.6;
}

.trending-week-section {
    background: transparent;
    background-image: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 3rem 0 2rem;
    margin: 2.5rem 0 0;
    border-top: 1px solid var(--border-strong);
}

.trending-week-section > .container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 2rem;
}

.trending-week-title {
    text-align: left;
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.028em;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
    display: block;
}

.trending-week-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1.25rem;
    border-top: 1px solid var(--border-strong);
    padding-top: 1rem;
}

.trending-week-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
    text-decoration: none;
    color: inherit;
    transition: none;
}

.trending-week-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.trending-week-card:hover .trending-week-article-title {
    color: var(--accent-color);
}

.trending-week-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--surface-sunk);
}

.trending-week-content {
    padding: 0.7rem 0 0;
}

.trending-week-article-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.015em;
    margin: 0 0 0.35rem;
    color: var(--text-primary);
}

.trending-week-category {
    font-family: var(--font-mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.trending-week-metric {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

@media (max-width: 1100px) {
    .trending-week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .trending-week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .trending-week-section > .container { padding: 0 1rem; }
}

/* ============================================
   RAIL SPACING UNDER THE HEADER + SQUARE MEDIA
   ============================================ */

/* Breathing room between the fixed masthead and the lead story. */
.hero-fullwidth-section {
    padding-top: 1.75rem;
    margin-top: 0;
}

body:not(.home-heroless) .hero-content-wrapper {
    padding-top: 0;
}

/* Editorial rule: photography is square-cornered. Only pills stay round. */
.hero-lead-card,
.hero-lead-image,
.hero-side-card,
.hero-side-image,
.photo-grid img,
.article-card img,
.card img,
.article-hero img,
.article-hero-image,
.article-featured-image,
.article-body img,
.article-content img,
.trending-week-card,
.trending-week-image,
.trending-week-image img,
.homepage-category-block img,
.pinned-card img,
.pinned-image,
.category-pinned img,
.most-read img,
.mr-card img,
figure,
figure img {
    border-radius: 0 !important;
}

.hero-lead-card,
.hero-side-card {
    box-shadow: none;
}

@media (max-width: 900px) {
    .hero-fullwidth-section {
        padding-top: 1rem;
    }
}

/* The four hero side images sit in a grid whose own container still had a 24-28px
   radius, which rounded the grid corners even though each card was square. */
.photo-grid,
.hero-right,
.hero-right > * {
    border-radius: 0 !important;
}
