/* News — matches streamers / site glass theme */

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

html {
    overflow-x: clip;
}

html.news-page-doc,
html.news-page-doc body {
    background-color: #050505;
}

body.news-page-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #050505;
    color: #f5f5f5;
    padding: 0;
    min-height: 100vh;
    overflow-x: clip;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Top glow (same as status / streamers / achievements via header-menu). */
body.news-page-body::before {
    content: '';
    position: fixed;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    width: min(140vw, 1600px);
    height: 320px;
    background: radial-gradient(
        ellipse 78% 92% at 50% 0%,
        rgba(99, 102, 241, 0.26) 0%,
        rgba(99, 102, 241, 0.1) 38%,
        transparent 72%
    );
    pointer-events: none;
    z-index: 0 !important;
}

body.news-page-body .news-page button {
    font: inherit;
}

body.news-page-body .container.news-page {
    position: relative;
    max-width: min(920px, 100%);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(16px, 3vw, 32px);
    padding-right: clamp(16px, 3vw, 32px);
    padding-bottom: clamp(40px, 5vw, 56px);
    box-sizing: border-box;
    min-width: 0;
}

body.news-page-body #headerContainer {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-bottom: 0;
}

.news-hero {
    position: relative;
    z-index: 1;
    margin: 0 0 clamp(24px, 3.5vw, 32px);
    padding: clamp(28px, 5vw, 44px) 0 clamp(24px, 4vw, 32px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.news-hero-title,
.news-hero-lead,
.news-filters,
.news-featured,
.news-list,
.news-loading,
.news-empty,
.news-load-more-wrap,
.news-article-back,
.news-article-wrap {
    position: relative;
    z-index: 1;
}

/* Reliable show/hide (some rules set display:flex on loaders) */
.news-loading[hidden],
.news-empty[hidden],
.news-list[hidden],
.news-featured[hidden],
.news-filters[hidden],
.news-load-more-wrap[hidden],
#newsArticle[hidden],
#newsArticleError[hidden] {
    display: none !important;
}

.news-hero-title {
    margin: 0 0 10px;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.1;
}

.news-hero-lead {
    margin: 0;
    max-width: 40rem;
    font-size: clamp(15px, 2.2vw, 17px);
    color: rgba(255, 255, 255, 0.52);
    line-height: 1.55;
}

.news-featured {
    margin-bottom: clamp(32px, 5vw, 48px);
}

.news-section-label {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.news-featured-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .news-featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .news-featured-grid--single {
        grid-template-columns: 1fr;
    }
    .news-featured-grid:not(.news-featured-grid--single) .news-card--featured:first-child {
        grid-column: 1 / -1;
    }
}

.news-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}

.news-filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.news-filter-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.news-filter-chip.is-active {
    border-color: rgba(102, 126, 234, 0.55);
    background: rgba(102, 126, 234, 0.18);
    color: #fff;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.news-card {
    position: relative;
    display: block;
    color: inherit;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.news-card-hit {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
}

.news-card-inner {
    position: relative;
    z-index: 1;
    pointer-events: none;
}

.news-card-inner a {
    pointer-events: auto;
}

.news-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.news-card-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.news-author-link {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 500;
}

.news-author-link:hover {
    color: #a8b8ff;
    text-decoration: underline;
}

@media (min-width: 560px) {
    .news-card--has-image .news-card-inner {
        grid-template-columns: 200px minmax(0, 1fr);
    }
}

.news-card-media {
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.news-card--has-image .news-card-media {
    aspect-ratio: auto;
    min-height: 140px;
}

.news-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: clamp(16px, 3vw, 22px);
    min-width: 0;
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.42);
}

.news-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(102, 126, 234, 0.25);
    color: #a8b8ff;
}

.news-card-title {
    margin: 0 0 8px;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1.25;
}

.news-card--featured .news-card-title {
    font-size: clamp(20px, 3.5vw, 26px);
}

.news-card-summary {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.58);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary:empty {
    display: none;
}

.news-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0 0;
}

.news-tag-pill {
    display: inline-block;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    line-height: 1.3;
}

a.news-tag-pill:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(129, 140, 248, 0.35);
    color: #e0e7ff;
}

.news-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 4px 0 0;
    font-size: 12px;
}

.news-card-links:empty {
    display: none;
}

.news-card-links a {
    color: #8ea4ff;
    text-decoration: none;
}

.news-card-links a:hover {
    text-decoration: underline;
}

.news-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    color: rgba(255, 255, 255, 0.45);
}

.news-loading p {
    margin: 0;
}

.news-empty,
.news-load-more-wrap {
    text-align: center;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.45);
}

.news-empty {
    margin: 0;
}

.news-spinner {
    width: 36px;
    height: 36px;
    margin: 0 auto 12px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: news-spin 0.8s linear infinite;
}

@keyframes news-spin {
    to {
        transform: rotate(360deg);
    }
}

.news-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Article detail */

.news-article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 clamp(20px, 3vw, 28px);
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
}

.news-article-back:hover {
    color: #a5b4fc;
}

.news-article-wrap {
    margin: 0;
    padding: 0;
    border: none;
}

.news-article-header {
    margin: 0 0 clamp(28px, 4vw, 36px);
    padding-bottom: clamp(20px, 3vw, 28px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.news-article-hero-img {
    display: block;
    width: 100%;
    max-height: min(420px, 56vw);
    object-fit: cover;
    border-radius: 14px;
    margin: 0 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
    margin: 0 0 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

.news-article-title {
    margin: 0 0 14px;
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: #fff;
}

.news-article-summary {
    margin: 0 0 16px;
    font-size: clamp(16px, 2.4vw, 18px);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.62);
    max-width: 42rem;
}

.news-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.news-article-tags .news-tag-pill {
    font-size: 12px;
}

/* WYSIWYG / pasted HTML body */
.news-prose,
.news-article-content {
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.86);
    max-width: 100%;
    overflow-wrap: break-word;
}

.news-prose > *:first-child,
.news-article-content > *:first-child {
    margin-top: 0;
}

.news-prose > *:last-child,
.news-article-content > *:last-child {
    margin-bottom: 0;
}

.news-prose p,
.news-article-content p {
    margin: 0 0 1.1em;
}

.news-prose h1,
.news-prose h2,
.news-article-content h1,
.news-article-content h2 {
    margin: 1.6em 0 0.65em;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.news-prose h1,
.news-article-content h1 {
    font-size: 1.75rem;
}

.news-prose h2,
.news-article-content h2 {
    font-size: 1.45rem;
}

.news-prose h3,
.news-article-content h3 {
    margin: 1.35em 0 0.5em;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.3;
}

.news-prose h4,
.news-article-content h4 {
    margin: 1.2em 0 0.45em;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.news-prose ul,
.news-prose ol,
.news-article-content ul,
.news-article-content ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}

.news-prose li,
.news-article-content li {
    margin-bottom: 0.4em;
}

.news-prose li:last-child,
.news-article-content li:last-child {
    margin-bottom: 0;
}

.news-prose blockquote,
.news-article-content blockquote {
    margin: 0 0 1.1em;
    padding: 12px 16px;
    border-left: 3px solid rgba(129, 140, 248, 0.55);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 10px 10px 0;
    color: rgba(255, 255, 255, 0.72);
}

.news-prose hr,
.news-article-content hr {
    margin: 1.75em 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.news-prose img,
.news-article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.25em 0;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.news-prose a,
.news-article-content a {
    color: #a5b4fc;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.news-prose a:hover,
.news-article-content a:hover {
    color: #c7d2fe;
}

.news-prose strong,
.news-article-content strong {
    color: #fff;
    font-weight: 600;
}

.news-prose div:empty,
.news-article-content div:empty {
    display: none;
}

.news-prose br + br,
.news-article-content br + br {
    display: block;
    margin-top: 0.5em;
    content: '';
}

.news-related {
    margin-top: clamp(36px, 5vw, 48px);
    padding-top: clamp(24px, 3.5vw, 32px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.news-related h2 {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
}

.news-related-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.news-related-list a {
    color: #a5b4fc;
    text-decoration: none;
    font-size: 15px;
    line-height: 1.4;
}

.news-related-list a:hover {
    text-decoration: underline;
}

.news-page-footer {
    margin-top: clamp(32px, 4vw, 48px);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.38);
    font-size: 13px;
}

.news-page-footer a {
    color: #a5b4fc;
    text-decoration: none;
}

/* Discord-style YouTube embeds inside article bodies (news-youtube-embed.js) */
.yt-embed {
    margin: 20px 0;
    max-width: 560px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    overflow: hidden;
    background: #0f0f0f;
    box-shadow: 0 4px 22px rgba(0, 0, 0, 0.28);
}

/* When an article has no hero image, the first YouTube video is promoted to
   the hero slot at the top and shown full width. */
.news-article-header > .yt-embed-hero {
    max-width: 100%;
    width: 100%;
    margin: 0 0 20px;
}

/* News list cards: YouTube thumbnail with a play badge in the media slot. */
.news-card-media--video {
    position: relative;
}

.news-card-playicon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.news-card-playicon svg {
    opacity: 0.92;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.news-card:hover .news-card-playicon svg {
    opacity: 1;
    transform: scale(1.05);
}

.yt-embed-play {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: #000;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.yt-embed-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.yt-embed-play:hover .yt-embed-thumb {
    transform: scale(1.03);
    opacity: 0.92;
}

.yt-embed-playicon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.yt-embed-playicon svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.yt-embed-playbg {
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.yt-embed-play:hover .yt-embed-playbg {
    opacity: 1;
}

.yt-embed-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    border: 0;
}

.yt-embed-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 11px 15px 13px;
}

.yt-embed-title {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
}

.yt-embed-title:hover {
    text-decoration: underline;
}

.yt-embed-author {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
}

.yt-embed-author:empty {
    display: none;
}
