/* ------------------------------------------------------------------
   RedTop Daily - public theme
   ------------------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--step-0);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--red);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
}

p {
    margin: 0 0 var(--space-4);
}

.container {
    width: min(100% - 2rem, var(--container));
    margin-inline: auto;
}

.visually-hidden,
.skip-link:not(:focus) {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 100;
    padding: var(--space-2) var(--space-4);
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-pill);
}

.muted {
    color: var(--muted);
}

/* ---------------- Reading progress ---------------- */
.reading-progress {
    position: fixed;
    inset: 0 auto auto 0;
    z-index: 90;
    width: 100%;
    height: 3px;
    background: transparent;
}

.reading-progress span {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--red);
    transition: width 80ms linear;
}

/* ---------------- Breaking ticker ---------------- */
.ticker {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #0a0a0c;
    color: #f4f2ec;
    font-size: var(--step--1);
    overflow: hidden;
}

.ticker__label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    /* Fixed brand red: stays identical in light and dark themes */
    background: var(--red-brand);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.ticker__label::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: rtd-pulse 1.6s infinite;
}

@keyframes rtd-pulse {
    50% {
        opacity: 0.25;
    }
}

.ticker__viewport {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.ticker__track {
    display: flex;
    gap: var(--space-6);
    padding-left: 1rem;
    white-space: nowrap;
    animation: rtd-ticker 42s linear infinite;
}

.ticker:hover .ticker__track {
    animation-play-state: paused;
}

.ticker__item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #f4f2ec;
}

.ticker__item::before {
    content: "◆";
    color: var(--red);
    font-size: 0.6rem;
}

@keyframes rtd-ticker {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ---------------- Masthead ---------------- */
/* The masthead stays dark in both themes by design. */
.masthead {
    background: #101014;
    color: #f4f2ec;
    border-bottom: 3px solid var(--red);
}

.masthead__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) 0;
}

.masthead__meta {
    font-size: var(--step--1);
    color: #a19e96;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    line-height: 1.5;
}

.masthead__meta span {
    display: block;
    text-transform: none;
    letter-spacing: 0;
    color: #d9d6ce;
}

.masthead__logo {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1;
    /* Fixed brand red: matches the footer wordmark and stays identical in dark mode */
    color: var(--red-brand);
}

.masthead__logo:hover {
    color: #ff6d80;
}

.masthead__logo-sub {
    color: #f4f2ec;
    font-size: 0.42em;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    font-weight: 700;
}

.masthead__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Controls inside the dark masthead keep light-on-dark styling in both themes. */
.masthead .search-form {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.masthead .search-field {
    color: #f4f2ec;
}

.masthead .search-field::placeholder {
    color: rgba(244, 242, 236, 0.55);
}

.masthead .search-btn {
    background: #f4f2ec;
    color: #101014;
}

.masthead .search-btn:hover {
    background: var(--red);
    color: #fff;
}

.masthead .icon-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f4f2ec;
}

.masthead .icon-btn:hover {
    border-color: #ff3b52;
    color: #ff6d80;
}

.masthead .search-suggest {
    background: #191920;
    border-color: #2c2c35;
    color: #f4f2ec;
}

.masthead .search-suggest a {
    border-color: #2c2c35;
    color: #f4f2ec;
}

.masthead .search-suggest a:hover {
    background: #23232c;
    color: #fff;
}

.masthead .search-suggest p {
    color: #a19e96;
}

/* ---------------- Search ---------------- */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.2rem 0.2rem 0.9rem;
    min-width: 210px;
}

.search-field {
    border: 0;
    background: transparent;
    padding: 0.45rem 0.4rem;
    min-width: 0;
    width: 100%;
    outline: none;
}

.search-btn {
    border: 0;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-pill);
    padding: 0.45rem 0.9rem;
    font-size: var(--step--1);
    font-weight: 700;
    cursor: pointer;
}

.search-btn:hover {
    background: var(--red);
}

.search-suggest {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    right: 0;
    z-index: 40;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

.search-suggest a,
.search-suggest p {
    display: block;
    padding: 0.6rem 0.9rem;
    margin: 0;
    font-size: var(--step--1);
    border-bottom: 1px solid var(--border);
}

.search-suggest a:last-child {
    border-bottom: 0;
}

.search-suggest a:hover {
    background: var(--surface-alt);
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    cursor: pointer;
    font-size: 1rem;
}

.icon-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

[data-theme="light"] .icon-btn__moon,
[data-theme="dark"] .icon-btn__sun {
    display: none;
}

/* ---------------- Nav ---------------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

.nav__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 52px;
}

.nav__toggle {
    display: none;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav__links::-webkit-scrollbar {
    display: none;
}

.nav__link {
    position: relative;
    flex: 0 0 auto;
    padding: 0.9rem 0.75rem;
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
}

.nav__link::after {
    content: "";
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0;
    height: 3px;
    background: var(--cat, var(--red));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--ink);
}

.nav__link:hover::after,
.nav__link.is-active::after {
    transform: scaleX(1);
}

.nav__live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--step--1);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--red);
}

.nav__live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    animation: rtd-pulse 1.6s infinite;
}

/* ---------------- Flash + main ---------------- */
.site-main {
    padding-bottom: var(--space-8);
}

.flash-wrap {
    padding-top: var(--space-4);
}

.flash {
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: var(--step--1);
    margin-bottom: var(--space-3);
}

.flash--error {
    border-color: var(--danger);
    background: var(--red-soft);
    color: var(--danger);
}

.flash--success {
    border-color: var(--success);
    color: var(--success);
}

/* ---------------- Layout ---------------- */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: var(--space-6);
    padding-top: var(--space-6);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    margin: var(--space-7) 0 var(--space-4);
    border-bottom: 1px solid var(--border);
    padding-bottom: var(--space-3);
}

.section-head__title {
    font-size: var(--step-2);
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
}

.section-head__title::before {
    content: "";
    width: 8px;
    height: 26px;
    background: var(--red);
    border-radius: 2px;
}

.section-head__link {
    font-size: var(--step--1);
    font-weight: 700;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ---------------- Hero ---------------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--space-5);
    align-items: stretch;
    padding-top: var(--space-6);
}

.hero__side {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: var(--space-5);
}

/* ---------------- Cards ---------------- */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-2);
    border-color: var(--border-strong);
}

.card__media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--surface-alt);
    overflow: hidden;
}

.card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms var(--ease);
}

.card:hover .card__media img {
    transform: scale(1.04);
}

.card__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cat, var(--red));
}

.kicker::before {
    content: "";
    width: 14px;
    height: 3px;
    background: currentColor;
}

.card__title {
    font-size: var(--step-1);
    line-height: 1.16;
}

.card__excerpt {
    margin: 0;
    color: var(--muted);
    font-family: var(--font-body);
    font-size: var(--step--1);
}

.card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.card__meta span + span::before {
    content: "·";
    margin-right: 0.6rem;
}

.card--lead .card__title {
    font-size: var(--step-3);
}

.card--lead .card__excerpt {
    font-size: var(--step-0);
}

.card--lead .card__media {
    aspect-ratio: 16 / 8;
}

.card--side {
    flex-direction: row;
    align-items: stretch;
}

.card--side .card__media {
    flex: 0 0 38%;
    aspect-ratio: auto;
    min-height: 110px;
}

.card--side .card__body {
    padding: var(--space-3) var(--space-4);
    justify-content: center;
}

.card--side .card__title {
    font-size: var(--step-0);
}

.card--row {
    flex-direction: row;
}

.card--row .card__media {
    flex: 0 0 200px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: var(--space-5);
}

/* ---------------- Sidebar ---------------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    align-self: start;
    position: sticky;
    top: calc(var(--header-height) + 0.5rem);
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
}

.widget__title {
    font-size: var(--step-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--ink);
}

.widget__title::before {
    content: "";
    width: 10px;
    height: 10px;
    background: var(--red);
    border-radius: 50%;
}

.trend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: trend;
}

.trend-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px dashed var(--border);
}

.trend-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.trend__rank {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--border-strong);
    line-height: 1;
}

.trend-item a {
    font-weight: 700;
    font-size: var(--step--1);
    line-height: 1.35;
}

.trend__meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.widget--cta {
    background: linear-gradient(150deg, var(--ink), #2a2a33);
    color: #fff;
    border-color: transparent;
}

.widget--cta p {
    color: rgba(255, 255, 255, 0.72);
    font-size: var(--step--1);
}

.widget--cta .btn {
    width: 100%;
    justify-content: center;
}

/* Dark theme: --ink flips to a light tone, so this card becomes a light surface.
   Its copy needs dark ink instead of the light-on-dark treatment used above. */
[data-theme="dark"] .widget--cta {
    background: linear-gradient(150deg, var(--ink), var(--ink-soft));
    color: var(--ink-fixed);
}

[data-theme="dark"] .widget--cta p {
    color: rgba(31, 31, 37, 0.75);
}

[data-theme="dark"] .widget--cta .widget__title {
    border-bottom-color: var(--ink-fixed);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.tag-pill:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---------------- Buttons + forms ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 700;
    font-size: var(--step--1);
    cursor: pointer;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.btn:hover {
    border-color: var(--ink);
}

.btn--primary {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn--primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}

.btn--dark {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-msg {
    margin: var(--space-2) 0 0;
    font-size: var(--step--1);
    min-height: 1.2em;
}

.form-msg.is-error {
    color: var(--danger);
}

.form-msg.is-success {
    color: var(--success);
}

/* ---------------- Newsletter band ---------------- */
/* Intentionally always dark, regardless of the active color theme.
   Literal colors on purpose: the band must not inherit any theme token. */
.newsletter-band {
    background-color: #111114;
    color: #ffffff;
    color-scheme: dark;
    margin-top: var(--space-8);
    padding: var(--space-7) 0;
}

/* Still dark, just lifted enough to separate from the dark page background */
[data-theme="dark"] .newsletter-band {
    background-color: #1f1f25;
}

.newsletter-band__inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: var(--space-6);
}

.newsletter-band h2 {
    color: #ffffff;
    font-size: var(--step-3);
    margin-bottom: var(--space-2);
}

.newsletter-band p {
    color: rgba(255, 255, 255, 0.72);
    margin: 0;
}

.newsletter-form {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.newsletter-form input[type="email"] {
    flex: 1 1 220px;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.newsletter-form .form-msg {
    flex-basis: 100%;
}

.newsletter-form .form-msg.is-success {
    color: #7ff0bd;
}

.newsletter-form .form-msg.is-error {
    color: #ff9aa8;
}

/* Fixed CTA red shared by every primary button sitting on a dark surface.
   Literal colours on purpose: the theme tokens --red / --red-dark shift in
   dark mode, which used to make the sidebar "Join the list" button a different
   shade from the band's "Subscribe" button. */
.newsletter-band .btn--primary,
.widget--cta .btn--primary {
    background: #c8102e;
    border-color: #c8102e;
    color: #ffffff;
}

.newsletter-band .btn--primary:hover,
.widget--cta .btn--primary:hover {
    background: #9c0c23;
    border-color: #9c0c23;
    color: #ffffff;
}

/* ---------------- Footer ---------------- */
.footer {
    background: var(--paper);
    padding-top: var(--space-7);
    border-top: 1px solid var(--border);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: var(--space-6);
    padding-bottom: var(--space-6);
}

.footer__brand p {
    font-family: var(--font-body);
    color: var(--muted);
    font-size: var(--step--1);
}

.footer__logo {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    /* Fixed brand red: stays identical in light and dark themes */
    color: var(--red-brand);
    display: inline-block;
    margin-bottom: var(--space-2);
}

.footer__col h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-bottom: var(--space-3);
}

.footer__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
    font-size: var(--step--1);
}

.footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2);
    padding: var(--space-4) 0;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.socials {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.socials a {
    display: inline-grid;
    place-items: center;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.socials a:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---------------- Back to top ---------------- */
.to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--red);
    border-radius: 50%;
    background: var(--red);
    color: #ffffff;
    box-shadow: var(--shadow-2);
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
        background var(--dur) var(--ease), border-color var(--dur) var(--ease),
        visibility 0s linear var(--dur);
}

.to-top.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    transition-delay: 0s;
}

.to-top:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
}

.to-top:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}

.to-top__icon {
    display: block;
}

/* ---------------- Article page ---------------- */
.article-head {
    /* Match the featured banner width */
    max-width: 100%;
    margin: 0 auto;
    padding-top: var(--space-6);
}

.article-head__title {
    font-size: var(--step-4);
    margin: var(--space-3) 0;
}

.article-head__deck {
    font-family: var(--font-body);
    font-size: var(--step-1);
    color: var(--ink-soft);
    margin-bottom: var(--space-4);
}

.article-head__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    font-size: var(--step--1);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: var(--space-5);
    border-bottom: 2px solid var(--ink);
}

.article-figure {
    margin: var(--space-5) 0;
}

.article-figure img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.article-figure figcaption {
    margin-top: var(--space-2);
    font-size: 0.75rem;
    color: var(--muted);
}

.article-body {
    /* Match the featured banner width */
    max-width: 100%;
    margin: 0 auto;
    font-family: var(--font-body);
    font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
    line-height: 1.75;
}

.article-body > p:first-of-type::first-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 3.4em;
    font-weight: 900;
    line-height: 0.82;
    padding: 0.6rem 0.55rem 0 0;
    color: var(--red);
}

.article-body h2 {
    font-size: var(--step-2);
    margin: var(--space-6) 0 var(--space-3);
}

.article-body h3 {
    font-size: var(--step-1);
    margin: var(--space-5) 0 var(--space-2);
}

.article-body a {
    color: var(--red);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-body blockquote {
    margin: var(--space-5) 0;
    padding: var(--space-3) var(--space-5);
    border-left: 5px solid var(--red);
    background: var(--surface-alt);
    font-style: italic;
}

.article-body ul,
.article-body ol {
    padding-left: 1.4rem;
    margin-bottom: var(--space-4);
}

.article-body img {
    border-radius: var(--radius);
    margin: var(--space-4) 0;
}

.article-body figure {
    margin: var(--space-5) 0;
}

.article-body figcaption {
    font-family: var(--font-ui);
    font-size: 0.78rem;
    color: var(--muted);
}

.article-body iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: var(--radius);
    margin: var(--space-4) 0;
}

.article-foot {
    /* Match the featured banner width */
    max-width: 100%;
    margin: var(--space-6) auto 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
}

.share-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.share-bar a,
.share-bar button {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-size: inherit;
    font-weight: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

.share-bar a:hover,
.share-bar button:hover {
    border-color: var(--red);
    color: var(--red);
}

.article-side {
    /* Match the featured banner width */
    max-width: 100%;
    margin: var(--space-6) auto 0;
}

/* ---------------- Comments ---------------- */
.comments {
    /* Match the featured banner width */
    max-width: 100%;
    margin: var(--space-7) auto 0;
}

.comments h2 {
    font-size: var(--step-2);
    margin-bottom: var(--space-4);
}

.comment {
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
}

.comment__meta {
    display: flex;
    gap: var(--space-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: var(--space-2);
}

.comment__body {
    font-family: var(--font-body);
    margin: 0;
}

.comment-form {
    margin-top: var(--space-5);
    display: grid;
    gap: var(--space-3);
}

.comment-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* ---------------- Listings + pagination ---------------- */
.page-head {
    padding: var(--space-6) 0 var(--space-4);
    border-bottom: 1px solid var(--border);
}

.page-head__title {
    font-size: var(--step-3);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-head__title::before {
    content: "";
    width: 10px;
    height: 34px;
    background: var(--accent, var(--red));
    border-radius: 2px;
}

.page-head__desc {
    color: var(--muted);
    margin: var(--space-2) 0 0;
    max-width: 60ch;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: var(--space-6) 0;
}

.pagination__link,
.pagination__current {
    display: inline-grid;
    place-items: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: var(--step--1);
    font-weight: 700;
}

.pagination__current {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.load-more {
    display: grid;
    place-items: center;
    padding: var(--space-5) 0;
}

.empty-state {
    padding: var(--space-7) var(--space-4);
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.prose {
    max-width: var(--container-narrow);
    margin: var(--space-6) auto;
}

.prose h2 {
    font-size: var(--step-2);
    margin: var(--space-5) 0 var(--space-2);
}

.prose p,
.prose li {
    font-family: var(--font-body);
    font-size: 1.08rem;
}

/* ---------------- Advertisements ---------------- */
.ad-slot {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: var(--space-3);
    background: var(--surface);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    overflow: hidden;
}

.ad-slot__label {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    text-align: center;
}

.ad-slot .adsbygoogle {
    width: 100%;
    margin: 0 auto;
}

.ad-band {
    margin-top: var(--space-5);
}

.ad-slot--horizontal {
    min-height: 100px;
}

.ad-slot--rectangle {
    min-height: 220px;
}

.ad-slot--hero,
.ad-slot--tile {
    justify-content: center;
    min-height: 240px;
}

.ad-slot--widget {
    min-height: 200px;
}

/* Inside an existing widget (Trending now) the ad keeps the card chrome of its
   parent instead of drawing a second box. */
.ad-slot--in-widget {
    margin-top: var(--space-3);
    padding: var(--space-3) 0 0;
    border: 0;
    border-top: 1px dashed var(--border);
    border-radius: 0;
    background: transparent;
    min-height: 180px;
}

/* Floating rails: fixed 160 x 600 units pinned beside the content column.
   Hidden by default so narrow screens and tablets never lose content width. */
.ad-slot--rail {
    display: none;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    width: 160px;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

@media (min-width: 1620px) {
    .ad-slot--rail {
        display: block;
    }

    .ad-rail--left {
        left: calc((100vw - var(--container)) / 2 - 184px);
    }

    .ad-rail--right {
        right: calc((100vw - var(--container)) / 2 - 184px);
    }
}

/* Pop-up modal */
.ad-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: var(--space-4);
}

.ad-modal[hidden] {
    display: none;
}

.ad-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 12, 0.72);
}

.ad-modal__dialog {
    position: relative;
    display: grid;
    gap: 0.5rem;
    width: min(100%, 420px);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
}

.ad-modal__close {
    position: absolute;
    top: 0.35rem;
    right: 0.4rem;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--ink);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.ad-modal__close:hover,
.ad-modal__close:focus-visible {
    border-color: var(--red);
    color: var(--red);
}

.has-ad-modal {
    overflow: hidden;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
    .layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .masthead__inner {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo actions"
            "meta meta";
        row-gap: var(--space-3);
    }

    .masthead__logo {
        grid-area: logo;
    }

    .masthead__actions {
        grid-area: actions;
    }

    .masthead__meta {
        grid-area: meta;
    }

    .layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hero__side {
        grid-template-rows: none;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .newsletter-band__inner {
        grid-template-columns: 1fr;
    }

    .nav__toggle {
        display: inline-block;
    }

    .nav__links {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-2);
        padding: var(--space-2);
    }

    .nav__links.is-open {
        display: flex;
    }

    .nav__link {
        padding: 0.8rem;
        border-radius: var(--radius-sm);
    }

    .nav__link::after {
        display: none;
    }

    .nav__link:hover,
    .nav__link.is-active {
        background: var(--surface-alt);
    }

    .nav__inner {
        position: relative;
    }
}

@media (max-width: 640px) {
    .masthead__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "actions"
            "meta";
    }

    .masthead__actions {
        justify-content: space-between;
    }

    .search-form {
        flex: 1;
        min-width: 0;
    }

    .hero__side {
        grid-template-columns: 1fr;
    }

    .card--side {
        flex-direction: row;
    }

    .grid-cards {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .card__body {
        padding: var(--space-3);
    }

    .card__excerpt {
        display: none;
    }

    .card--lead .card__excerpt {
        display: block;
    }

    .comment-form__row {
        grid-template-columns: 1fr;
    }

    .footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .article-body > p:first-of-type::first-letter {
        font-size: 2.6em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ticker__track {
        animation: none;
    }

    .card:hover {
        transform: none;
    }

    .to-top {
        transition: none;
    }
}
