/*
 * NORYX DESIGN SYSTEM — NEWS COMPONENT v1.2.0
 * Date: 2026-10-07
 *
 * Requires: assets/css/noryx-design-system.css (Foundation v1)
 *
 * This file owns News presentation only.
 * No DOM discovery, no geometry/text binders, no content-count heuristics.
 * Semantic category colors remain semantic by contract.
 */

body.news {
    background:
        url('../../../img/backgrounds/bg-news-noryx.jpg')
        no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
}

.nx-news-page {
    position: relative;
    z-index: 10;
}

.nx-news-page__container {
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
}

.nx-news-matrix {
    padding: 2.5rem;
}

.nx-news-header {
    margin-bottom: 2rem;
    text-align: center;
}

.nx-news-page-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.nx-news-subtitle {
    margin: .5rem 0 0;
    font-size: .875rem;
    text-shadow: 0 0 10px rgba(0,0,0,.50);
}

/* ============================================================
   FILTER / CATEGORY TABS
   ============================================================ */
.nx-news-filters {
    width: 100%;
    margin-bottom: 1.5rem;
    padding: .65rem;
    justify-content: center;
    gap: .45rem;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.05),
        0 10px 28px rgba(0,0,0,.35);
    backdrop-filter: blur(var(--nx-blur-glass));
    -webkit-backdrop-filter: blur(var(--nx-blur-glass));
}

.nx-news-tab {
    padding: .65rem 1.25rem;
    clip-path:
        polygon(
            8px 0,
            100% 0,
            100% calc(100% - 8px),
            calc(100% - 8px) 100%,
            0 100%,
            0 8px
        );
    font-family: var(--nx-font-display);
    font-size: .875rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.nx-news-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

/* News category icon is part of the semantic tab identity.
   It follows the tab text instead of the structural accent token. */
.nx-news-tab > i,
.nx-news-tab > svg {
    color: currentColor;
}

/* Neutral "All" is intentionally white, matching the approved semantic
   neutral behavior rather than inheriting structural cyan. */
.nx-news-tab--all {
    color: #FFFFFF;
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.25);
}

.nx-news-tab--all:hover {
    color: #FFFFFF;
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.50);
}

.nx-news-tab--all.is-active {
    color: var(--nx-surface-base);
    background: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 0 0 30px rgba(255,255,255,.40);
}

/* Update green is bright enough to require dark active text. */
.nx-news-tab.nx-tab--update.is-active {
    color: var(--nx-surface-base);
}

/* ============================================================
   LIST / CARDS
   ============================================================ */
.nx-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.nx-news-card {
    min-width: 0;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    border-top-width: 4px;
    backdrop-filter: blur(var(--nx-blur-glass));
    -webkit-backdrop-filter: blur(var(--nx-blur-glass));
    transition:
        transform .30s ease,
        border-color .30s ease,
        box-shadow .30s ease,
        background-color .20s ease;
}

.nx-news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 20px rgba(0,0,0,.60);
}

.nx-news-card--update {
    border-top-color: var(--nx-sem-update);
}
.nx-news-card--event {
    border-top-color: var(--nx-sem-event);
}
.nx-news-card--maintenance {
    border-top-color: var(--nx-sem-maintenance);
}
.nx-news-card--other {
    border-top-color: var(--nx-sem-other);
}

.nx-news-card--update:hover {
    border-color: var(--nx-sem-update);
}
.nx-news-card--event:hover {
    border-color: var(--nx-sem-event);
}
.nx-news-card--maintenance:hover {
    border-color: var(--nx-sem-maintenance);
}
.nx-news-card--other:hover {
    border-color: var(--nx-sem-other);
}

.nx-news-card__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    background: rgba(0,0,0,.30);
    border-bottom: 1px solid var(--nx-border-inner);
}

.nx-news-card__body {
    min-width: 0;
    min-height: 180px;
    padding: 1.25rem;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.nx-news-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
    color: var(--nx-text-muted);
    font-size: .75rem;
}

.nx-news-card__date i {
    margin-right: .25rem;
    color: var(--nx-accent);
}

.nx-news-card__title {
    min-width: 0;
    margin: 0 0 .5rem;
    color: var(--nx-text-primary);
    font-family: var(--nx-font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.38;
    overflow-wrap: anywhere;
}

.nx-news-card__excerpt {
    min-width: 0;
    margin: 0;
    flex: 1 1 auto;
    color: var(--nx-text-muted);
    font-size: .875rem;
    line-height: 1.625;
    overflow-wrap: anywhere;
}

/* ============================================================
   BADGES — semantic registry from Foundation
   ============================================================ */
.nx-news-badge {
    padding: .15rem .75rem;
    clip-path:
        polygon(
            4px 0,
            100% 0,
            100% calc(100% - 4px),
            calc(100% - 4px) 100%,
            0 100%,
            0 4px
        );
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .06em;
    line-height: 1.35;
    text-transform: uppercase;
}

.nx-news-important {
    margin-left: .25rem;
    vertical-align: middle;
}

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.nx-news-article {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.nx-news-single-image {
    display: block;
    width: 100%;
    max-height: 400px;
    margin-bottom: 1.5rem;
    object-fit: contain;
    background: rgba(0,0,0,.20);
    border: 1px solid var(--nx-border-inner);
}

.nx-news-single-title {
    margin-bottom: 1rem;
    font-size: clamp(1.875rem, 3vw, 2.25rem);
    line-height: 1.2;
}

.nx-news-single-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    color: var(--nx-text-muted);
    font-size: .875rem;
    border-bottom: 1px solid var(--nx-border-inner);
}

.nx-news-single-meta .fa-calendar,
.nx-news-single-meta .fa-calendar-alt,
.nx-news-single-meta .fa-user {
    margin-right: .25rem;
    color: var(--nx-accent);
}

.nx-news-single-content {
    color: var(--nx-text-content);
    font-size: 1rem;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.nx-news-back {
    margin-top: 2rem;
    padding: .5rem 1.5rem;
    border-color: var(--nx-border-outer);
    clip-path:
        polygon(
            4px 0,
            100% 0,
            100% calc(100% - 4px),
            calc(100% - 4px) 100%,
            0 100%,
            0 4px
        );
    font-family: var(--nx-font-display);
    letter-spacing: .02em;
    box-shadow:
        inset 0 0 0 1px rgba(var(--nx-border-inner-rgb), .35),
        0 6px 18px rgba(var(--nx-surface-rgb), .45);
}

.nx-news-back:hover {
    background: var(--nx-accent-bg-active);
    border-color: var(--nx-accent);
    color: var(--nx-text-primary);
}

.nx-news-back:hover i {
    color: var(--nx-accent);
}

/* ============================================================
   PAGINATION — structural, never category-colored
   ============================================================ */
.nx-news-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-top: 2rem;
}

.nx-news-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 2.5rem;
    padding: .5rem 1rem;
    color: var(--nx-text-muted);
    background: var(--nx-surface-control);
    border: 1px solid var(--nx-border-inner);
    clip-path:
        polygon(
            4px 0,
            100% 0,
            100% calc(100% - 4px),
            calc(100% - 4px) 100%,
            0 100%,
            0 4px
        );
    font-family: var(--nx-font-display);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        color .20s ease,
        background-color .20s ease,
        border-color .20s ease,
        box-shadow .20s ease,
        transform .20s ease;
}

.nx-news-page-link:hover {
    color: var(--nx-text-primary);
    background: var(--nx-accent-bg-hover);
    border-color: var(--nx-accent);
    box-shadow: 0 0 14px rgba(var(--nx-accent-rgb), .10);
    transform: translateY(-2px);
}

.nx-news-page-link.is-active {
    color: var(--nx-cta-primary-text);
    background: var(--nx-accent);
    border-color: var(--nx-accent);
    box-shadow: 0 0 16px rgba(var(--nx-accent-rgb), .22);
}

.nx-news-page-link:focus-visible {
    outline: 2px solid var(--nx-accent);
    outline-offset: 2px;
}

/* ============================================================
   EMPTY / 404
   ============================================================ */
.nx-news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem 1rem;
    color: var(--nx-text-muted);
    font-size: 1.25rem;
    text-align: center;
}

.nx-news-empty__icon {
    color: var(--nx-accent);
    font-size: 3rem;
}

.nx-news-404 {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.nx-news-404__copy {
    margin: 1rem auto 0;
    max-width: 46rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1023px) {
    .nx-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .nx-news-matrix {
        padding: 1.5rem;
    }

    .nx-news-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .nx-news-filters {
        align-items: stretch;
    }

    .nx-news-tab {
        flex: 1 1 calc(50% - .45rem);
        min-width: 0;
        padding-inline: .75rem;
    }

    .nx-news-single-meta {
        gap: .75rem;
    }
}

@media (max-width: 430px) {
    .nx-news-matrix {
        padding: 1.25rem;
    }

    .nx-news-tab {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nx-news-card,
    .nx-news-tab,
    .nx-news-page-link {
        transition-duration: .01ms;
    }

    .nx-news-card:hover,
    .nx-news-tab:hover,
    .nx-news-page-link:hover {
        transform: none;
    }
}
