/* ==========================================================================
   News overview (news/index.html) – builds on the .home-* components in index.css
   ========================================================================== */

.news-hero .home-subhero__content {
    margin-bottom: 2rem;
}

.news-hero h1 {
    margin-bottom: 1rem;
}

.news-hero .home-subhero__lead {
    margin-bottom: 0;
}

.news-section {
    padding-top: clamp(3rem, 6vw, 4.5rem);
}

/* --- Shared meta ------------------------------------------------------- */
.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.news-type,
.news-size {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.news-type {
    color: var(--home-accent-strong);
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.news-type--patch,
.news-type--update {
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.35);
}

.news-type--announcement {
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.news-type--devlog {
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
}

.news-size {
    color: rgba(226, 234, 248, 0.75);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.news-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1.1rem;
    font-size: 0.83rem;
    color: var(--home-text-subtle);
}

.news-info > * {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.news-info i {
    font-size: 0.8rem;
    color: var(--home-accent);
}

/* --- Featured article -------------------------------------------------- */
.news-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    overflow: hidden;
    border-radius: calc(var(--home-radius) + 4px);
    color: inherit;
    background:
        radial-gradient(circle at 100% 0%, rgba(6, 182, 212, 0.1), transparent 45%),
        var(--home-surface);
    border: 1px solid var(--home-border);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.news-featured:hover {
    border-color: var(--home-border-accent);
    box-shadow: 0 24px 50px rgba(6, 182, 212, 0.1);
}

.news-featured__media {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    background: #000;
}

.news-featured__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

.news-featured__label {
    position: absolute;
    top: 1.1rem;
    left: 1.1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #04121f;
    background: var(--home-gradient);
}

.news-featured__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.75rem, 4vw, 3rem);
}

.news-featured h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.news-featured__body > p {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--home-text-muted);
    margin-bottom: 1.5rem;
}

.news-featured .news-info {
    margin-bottom: 1.75rem;
}

.news-featured__more i {
    transition: transform 0.25s ease;
}

.news-featured:hover .news-featured__more i {
    transform: translateX(4px);
}

/* --- Grid -------------------------------------------------------------- */
.news-divider {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: clamp(3rem, 6vw, 4.5rem) 0 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--home-border);
}

.news-divider h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.news-divider span {
    font-size: 0.9rem;
    color: var(--home-text-subtle);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--home-radius);
    color: inherit;
    background: var(--home-surface);
    border: 1px solid var(--home-border);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--home-border-accent);
    box-shadow: 0 18px 40px rgba(6, 182, 212, 0.1);
}

.news-featured:focus-visible,
.news-card:focus-visible {
    outline: 2px solid var(--home-accent-strong);
    outline-offset: 3px;
}

.news-card__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.news-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.35rem 1.4rem 1.5rem;
}

.news-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}

.news-card__body > p {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--home-text-muted);
    margin-bottom: 1.1rem;
}

.news-card .news-info {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.news-card .news-info > * + *::before {
    content: "·";
    margin-right: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
}

.news-card .news-info {
    gap: 0.35rem 0.65rem;
}

/* --- Pagination ------------------------------------------ */
.news-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
}

.news-pagination > :last-child {
    justify-self: end;
}

.news-pagination__info {
    font-size: 0.9rem;
    color: var(--home-text-subtle);
}

/* --- Insights: blog types, sponsored, byline, updates list ---------------- */
.news-type--article {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.35);
}

.news-type--case_study {
    color: #f9a8d4;
    background: rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.32);
}

/* Paid post - deliberately plain and readable, never styled like a category */
.news-sponsored {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.12);
    border: 1px dashed rgba(245, 158, 11, 0.45);
}

.news-byline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--home-text, #e2eaf8);
}

.news-byline__avatar {
    position: relative;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #06b6d4);
    border-radius: 50%;
}

.news-byline__avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-divider .home-link {
    font-size: 0.92rem;
}

.news-updates {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--home-border);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.015);
}

.news-updates li + li {
    border-top: 1px solid var(--home-border);
}

.news-update {
    display: grid;
    grid-template-columns: 6.5rem auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.4rem;
    color: inherit;
    transition: background 0.2s ease;
}

.news-update:hover {
    color: inherit;
    background: rgba(255, 255, 255, 0.035);
}

.news-update time {
    font-size: 0.85rem;
    color: var(--home-text-subtle);
    font-variant-numeric: tabular-nums;
}

.news-update strong {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.news-update__project {
    font-size: 0.85rem;
    color: var(--home-text-subtle);
}

.news-update > i {
    color: var(--home-text-subtle);
    transition: transform 0.2s ease, color 0.2s ease;
}

.news-update:hover > i {
    color: var(--home-accent-strong);
    transform: translateX(3px);
}

.news-update:focus-visible {
    outline: 2px solid var(--home-accent-strong);
    outline-offset: -2px;
}

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

    .news-featured {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-update {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.4rem 0.75rem;
    }

    .news-update time {
        grid-column: 1 / -1;
    }

    .news-update__project {
        display: none;
    }

    .news-pagination {
        grid-template-columns: 1fr 1fr;
    }

    .news-pagination__info {
        grid-column: 1 / -1;
        grid-row: 1;
        text-align: center;
    }

    .news-pagination .home-btn {
        padding: 0.75rem 1rem;
    }
}

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