/* News page — scoped to .news-page and .news-* classes. */

body { background: var(--bg, #0c0c0e); }
html.light body { background: #ffffff; }

.news-page {
    padding-top: 88px;
    background: var(--bg, #0c0c0e);
    color: var(--text, #fff);
    min-height: 100vh;
}
html.light .news-page {
    background: #ffffff;
    color: #18181b;
}
html.light .news-hero-sub { color: #4a4a4a; }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.news-hero {
    padding: 80px 32px 48px;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
html.light .news-hero { border-bottom-color: rgba(196, 23, 23, 0.4); }
.news-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(800px 320px at 50% 50%, rgba(196, 23, 23, 0.18), transparent 65%);
    pointer-events: none;
}
.news-hero-inner {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}
.news-hero-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red, #c41717);
    margin-bottom: 16px;
}
.news-hero-title {
    font-size: clamp(34px, 5.4vw, 60px);
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -0.025em;
    margin: 0 0 18px;
}
.news-hero-sub {
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.6;
    color: var(--text-mid, #a1a1aa);
    max-width: 640px;
    margin: 0 auto;
}

/* ── Body container ───────────────────────────────────────────────────── */

.news-body {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 24px 96px;
}
.news-loading,
.news-empty {
    text-align: center;
    color: var(--text-mid, #a1a1aa);
    padding: 60px 20px;
    font-size: 14px;
}

/* ── List view (cards) ────────────────────────────────────────────────── */

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
@media (max-width: 720px) {
    .news-list { grid-template-columns: 1fr; }
}

.news-card {
    background: var(--surface, #18181b);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
html.light .news-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}
.news-card:hover {
    border-color: rgba(196, 23, 23, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}
html.light .news-card:hover {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
}
.news-card-thumb {
    aspect-ratio: 16 / 9;
    background-color: rgba(255, 255, 255, 0.04);
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
html.light .news-card-thumb {
    background-color: rgba(0, 0, 0, 0.04);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}
.news-card-thumb.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim, #71717a);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.news-card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.news-card-meta {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red, #c41717);
}
.news-card-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0;
}
.news-card-excerpt {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-mid, #a1a1aa);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card-foot {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim, #71717a);
}
.news-card-readmore {
    color: var(--red, #c41717);
    font-weight: 600;
}
.news-card-author { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-card-stats {
    display: inline-flex; align-items: center; gap: 12px;
    flex-shrink: 0;
}
.news-card-stat {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-dim, #71717a);
    font-variant-numeric: tabular-nums;
}
.news-stat-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Stat strip under the title on the single-post view */
.news-single-stats {
    display: flex; align-items: center; gap: 14px;
    margin: 18px 0 28px;
    font-size: 13px;
    color: var(--text-dim, #71717a);
    font-variant-numeric: tabular-nums;
}
.news-single-stats .news-stat {
    display: inline-flex; align-items: center; gap: 6px;
}
.news-single-stats .news-stat-icon { width: 16px; height: 16px; }
.news-like-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    color: var(--text-dim, #a1a1aa);
    font: inherit; font-size: 13px; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.news-like-btn:hover {
    background: rgba(196, 23, 23, 0.12);
    color: var(--red, #c41717);
    border-color: rgba(196, 23, 23, 0.35);
}
.news-like-btn:active { transform: scale(0.96); }
.news-like-btn.is-liked {
    color: var(--red, #c41717);
    background: rgba(196, 23, 23, 0.14);
    border-color: rgba(196, 23, 23, 0.45);
}
.news-like-btn .news-stat-icon { width: 15px; height: 15px; }
html.light .news-like-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #4a4a4a;
}
html.light .news-like-btn:hover {
    background: rgba(196, 23, 23, 0.08);
    color: var(--red, #c41717);
    border-color: rgba(196, 23, 23, 0.4);
}
html.light .news-like-btn.is-liked {
    color: var(--red, #c41717);
    background: rgba(196, 23, 23, 0.1);
    border-color: rgba(196, 23, 23, 0.45);
}

/* ── Single post view ─────────────────────────────────────────────────── */

.news-single {
    max-width: 760px;
    margin: 0 auto;
}
.news-single-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mid, #a1a1aa);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 24px;
    transition: color 0.15s;
}
.news-single-back:hover { color: var(--red, #c41717); }
.news-single-meta {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--red, #c41717);
    margin-bottom: 14px;
}
.news-single-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 14px;
}
.news-single-byline {
    font-size: 13px;
    color: var(--text-mid, #a1a1aa);
    margin-bottom: 28px;
}
.news-single-byline strong { color: var(--text, #fff); font-weight: 600; }
html.light .news-single-byline strong { color: #18181b; }
.news-single-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: rgba(255, 255, 255, 0.04);
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    margin-bottom: 32px;
}
html.light .news-single-hero { background-color: rgba(0, 0, 0, 0.04); }

/* Rendered Markdown body — content comes from marked + DOMPurify. */
.news-single-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text, #fff);
}
html.light .news-single-content { color: #18181b; }
.news-single-content h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin: 36px 0 14px;
}
.news-single-content h3 {
    font-size: 19px;
    font-weight: 700;
    margin: 28px 0 10px;
}
.news-single-content p { margin: 0 0 18px; }
.news-single-content a {
    color: var(--red, #c41717);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.news-single-content a:hover { text-decoration: none; }
.news-single-content ul,
.news-single-content ol {
    margin: 0 0 18px;
    padding-left: 26px;
}
.news-single-content li { margin-bottom: 6px; }
.news-single-content blockquote {
    margin: 0 0 18px;
    padding: 12px 18px;
    border-left: 3px solid var(--red, #c41717);
    background: rgba(196, 23, 23, 0.06);
    color: var(--text-mid, #a1a1aa);
    border-radius: 0 8px 8px 0;
}
.news-single-content code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.92em;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
}
html.light .news-single-content code { background: rgba(0, 0, 0, 0.06); }
.news-single-content pre {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 0 0 18px;
}
html.light .news-single-content pre {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
.news-single-content pre code {
    background: transparent;
    padding: 0;
    font-size: 13px;
}
.news-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.news-single-content hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 36px 0;
}
html.light .news-single-content hr { border-top-color: rgba(0, 0, 0, 0.1); }

/* ── Gallery (multi-image + video viewer) ───────────────────────────── */
.news-gallery {
    margin-bottom: 32px;
}
.news-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    /* Smooth fade + tiny scale on media switch (see wireGallery in news.js). */
    opacity: 1;
    transform: scale(1);
    transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}
.news-gallery-main.is-switching {
    opacity: 0;
    transform: scale(0.985);
}
html.light .news-gallery-main { background: #f0f0f2; }
.news-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.news-gallery-main iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.news-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}
.news-gallery-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.05);
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: border-color 0.15s, transform 0.12s;
}
html.light .news-gallery-thumb { background-color: rgba(0, 0, 0, 0.05); }
.news-gallery-thumb:hover { transform: translateY(-1px); }
.news-gallery-thumb.is-active {
    border-color: var(--red, #c41717);
}
.news-gallery-thumb.is-video::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
}
.news-gallery-thumb-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    z-index: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* Video embed (YouTube / Vimeo / approved iframe sources). Responsive 16:9
   wrapper so the iframe always fills the article width without overflowing. */
.news-embed {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 24px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
}
html.light .news-embed { background: #f0f0f2; }
.news-embed iframe,
.news-single-content iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 720px) {
    .news-hero { padding: 56px 22px 40px; }
    .news-body { padding: 40px 18px 60px; }
    .news-single-title { font-size: 28px; }
}
