/* News (blog) section: index, article and the site home rail. Consumes the shared tokens of main.css. */
.news-scope {
    --news-surface: rgba(255, 255, 255, 0.05);
    --news-border: rgba(255, 255, 255, 0.12);
    --news-muted: var(--ntf-color-aaaaaa);
    --news-accent: var(--ntf-color-fb1a3f);
    --news-radius: 18px;
    color: var(--text-color);
}

body.light .news-scope {
    --news-surface: rgba(0, 0, 0, 0.04);
    --news-border: rgba(0, 0, 0, 0.1);
    --news-muted: #555555;
}

.news-page,
.news-article {
    background: var(--background-color);
    padding-block: 28px 80px;
}

.news-scope a {
    color: inherit;
    text-decoration: none;
}

/* Index header */
.news-header {
    padding-block: 28px 36px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--news-border);
}

.news-header__eyebrow {
    margin: 0 0 12px;
    color: var(--news-accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.news-header__title {
    margin: 0;
    font-size: clamp(2.8rem, 1.8rem + 4vw, 5.2rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.news-header__text {
    margin: 16px 0 0;
    color: var(--news-muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

.news-empty {
    color: var(--news-muted);
}

/* Meta line: tag · date · reading time */
.news-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    color: var(--news-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.news-meta__item + .news-meta__item::before {
    content: "·";
    margin-right: 10px;
}

.news-meta__tag {
    color: var(--news-accent);
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.news-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 800;
}

.news-readmore:hover,
.news-readmore:focus-visible {
    color: var(--news-accent);
}

.news-section-title {
    margin: 0 0 24px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Lead story */
.news-featured {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 64px;
}

.news-featured__media,
.news-card__media {
    display: block;
    overflow: hidden;
    border-radius: var(--news-radius);
    background: var(--news-surface);
}

.news-featured__media {
    aspect-ratio: 16 / 9;
}

.news-card__media {
    aspect-ratio: 16 / 9;
}

.news-featured__media img,
.news-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 450ms ease;
}

.news-featured:hover .news-featured__media img,
.news-card:hover .news-card__media img {
    transform: scale(1.04);
}

.news-featured__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.news-featured__title {
    margin: 0;
    font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.9rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.news-featured__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--news-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Grid */
/* Grid: one column on small devices, at most two columns from tablets up. */
.news-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px 36px;
}

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

/* Site home rail: the event rail (`scolllaterale` + `.large-2`) owns the card width and
   the horizontal scroll; news cards adopt the event card proportions inside it. */
.news-rail .news-card {
    gap: 12px;
}

.news-rail .news-card__body {
    gap: 8px;
}

.news-rail .news-card__media {
    aspect-ratio: 1;
    border-radius: var(--event-card-media-radius, var(--news-radius));
}

.news-rail .news-card__title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: 0;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-rail .news-card__excerpt,
.news-rail .news-meta__item + .news-meta__item {
    display: none;
}

.news-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.news-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-card__title {
    margin: 0;
    font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.65rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -0.005em;
}

.news-featured__title a:hover,
.news-featured__title a:focus-visible,
.news-card__title a:hover,
.news-card__title a:focus-visible {
    text-decoration: underline;
    text-decoration-color: var(--news-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

.news-card__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--news-muted);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Infinite scroll */
.news-more {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}

.news-more__link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border: 1px solid var(--news-border);
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 800;
}

.news-more__link:hover,
.news-more__link:focus-visible {
    border-color: var(--news-accent);
    color: var(--news-accent);
}

.news-more.is-loading .news-more__link {
    pointer-events: none;
    opacity: 0.6;
}

.news-more.is-loading .news-more__link::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: news-spin 700ms linear infinite;
}

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

/* Article */
.news-article__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.news-article__header .hc-breadcrumbs {
    margin-bottom: 8px;
}

.news-article__title {
    margin: 0;
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);
    font-weight: 900;
    line-height: 1.06;
    letter-spacing: -0.015em;
}

.news-article__lead {
    margin: 0;
    color: var(--news-muted);
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
    line-height: 1.6;
}

.news-article__cover {
    margin: 32px 0 0;
    overflow: hidden;
    border-radius: var(--news-radius);
    aspect-ratio: 16 / 9;
}

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

.news-article__main {
    min-width: 0;
}

/* Below the desktop breakpoint the outline follows the article instead of preceding its title. */
@media (max-width: 1023px) {
    .news-article__layout .hc-toc {
        order: 1;
    }
}

.news-article__body.hc-article__body {
    min-width: 0;
    margin-top: 40px;
    font-size: 1.08rem;
    line-height: 1.8;
}

.news-article__body.hc-article__body a {
    color: var(--news-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-article__body h2 {
    scroll-margin-top: calc(var(--nav-viewport-offset, 80px) + 24px);
}

/* Article aside: outline with reading progress, latest news */
.news-aside .news-aside__panel {
    padding: 20px;
    border: 1px solid var(--news-border);
    border-radius: var(--news-radius);
    background: var(--news-surface);
}

.news-aside__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.news-aside__title {
    margin: 0 0 16px;
    color: var(--news-muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.news-aside__head .news-aside__title {
    margin: 0;
}

.news-aside__hint {
    color: var(--news-muted);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

.news-toc__progress {
    height: 3px;
    margin: 14px 0 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--news-border);
}

.news-toc__progress-bar {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--news-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 120ms linear;
}

.news-toc__list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: news-toc;
}

.news-toc__link {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 -10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--news-muted);
    font-size: 0.92rem;
    line-height: 1.4;
    transition: background-color 150ms ease, color 150ms ease;
}

.news-toc__link::before {
    min-width: 1.6em;
    color: var(--news-muted);
    content: counter(news-toc, decimal-leading-zero);
    counter-increment: news-toc;
    font-size: 0.74rem;
    font-weight: 800;
}

.news-toc__link:hover,
.news-toc__link:focus-visible {
    background: var(--news-surface);
    color: var(--text-color);
}

.news-toc__link.is-active {
    background: rgba(251, 26, 63, 0.12);
    color: var(--text-color);
    font-weight: 700;
}

.news-toc__link.is-active::before {
    color: var(--news-accent);
}

.news-mini-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-mini {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.news-mini__thumb {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 1;
    background: var(--news-surface);
}

.news-mini__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms ease;
}

.news-mini:hover .news-mini__thumb img,
.news-mini:focus-visible .news-mini__thumb img {
    transform: scale(1.06);
}

.news-mini__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.news-mini__date {
    color: var(--news-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.news-mini__title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.news-mini:hover .news-mini__title,
.news-mini:focus-visible .news-mini__title {
    color: var(--news-accent);
}

.news-aside__all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding: 11px 16px;
    border: 1px solid var(--news-border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
}

.news-aside__all:hover,
.news-aside__all:focus-visible {
    border-color: var(--news-accent);
    color: var(--news-accent);
}

@media (min-width: 1024px) {
    .news-article__layout.hc-article-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 24px 56px;
    }
}

@media (min-width: 900px) {
    .news-featured {
        grid-template-columns: 1.5fr 1fr;
        gap: 44px;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-featured__media img,
    .news-card__media img,
    .news-mini__thumb img,
    .news-toc__progress-bar {
        transition: none;
    }
}
