/* =============================================
   ARTICLES.CSS — Production-Grade
   Industrial-Luxury · Dark-Tech · Dot Rad Plus
   ============================================= */

/* ══════════════════════════════════════════════
   SECTION WRAPPER
   ══════════════════════════════════════════════ */
.articles-section {
    position: relative;
    padding: 60px 0 68px;
    overflow: hidden;
    background: var(--bg-primary);
}

/* ══════════════════════════════════════════════
   BACKGROUND GRID — Engineering Blueprint
   Dual-layer grid matching about-grid-bg
   + slightly boosted white lines (0.08–0.12)
   ══════════════════════════════════════════════ */
.articles-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* primary grid — 80px, white-ish lines for subtle tech feel */
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        /* fine sub-grid — 16px, barely visible */
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        /* warm amber glow — top-right accent */
        radial-gradient(ellipse 60% 45% at 88% 12%, rgba(245, 184, 0, 0.09) 0%, transparent 70%);
    background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px, 100% 100%;
    pointer-events: none;
    z-index: 0;
}

.articles-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* warm glow — bottom-left */
        radial-gradient(circle at 15% 82%, rgba(245, 184, 0, 0.06) 0%, transparent 50%),
        /* subtle depth vignette */
        radial-gradient(circle at 30% 55%, rgba(13, 18, 32, 0.7) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* ══════════════════════════════════════════════
   CONTAINER
   ══════════════════════════════════════════════ */
.articles-container {
    position: relative;
    z-index: 1;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 40px;
}

/* ══════════════════════════════════════════════
   HEADER — matches .products-hdr / .about-eyebrow
   Pattern: label + separator line + nav buttons
   ══════════════════════════════════════════════ */
.articles-hdr {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
}

/* Eyebrow label — LATEST ARTICLES */
.articles-hdr__label {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent);
    opacity: 0.85;
    white-space: nowrap;
}

/* Separator line — fills space between label and nav */
.articles-hdr__line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        var(--accent-border) 0%,
        transparent 100%);
}

/* ══════════════════════════════════════════════
   NAVIGATION BUTTONS
   ══════════════════════════════════════════════ */
.articles-hdr__nav {
    display: flex;
    gap: 10px;
}

.articles-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border-subtle);
    border-radius: 0;                 /* ★ sharp corners — industrial rule */
    background: var(--bg-panel);
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        background   var(--t-fast),
        border-color var(--t-fast),
        color        var(--t-fast),
        transform    var(--t-fast);
}

.articles-nav-btn:hover:not(:disabled) {
    background: var(--accent-dim);
    border-color: var(--accent-border);
    color: var(--accent);
    transform: translateY(-2px);
}

.articles-nav-btn:active:not(:disabled) {
    transform: translateY(0);
}

.articles-nav-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none !important;
}

/* ══════════════════════════════════════════════
   SLIDER WRAPPER — Edge fade mask
   ══════════════════════════════════════════════ */
.articles-slider-wrapper {
    overflow: hidden;
    position: relative;
    /* fallback height so it’s never collapsed even before JS runs */
    min-height: 320px;
    /* fade edges so first/last cards blend smoothly */
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 4%,
        black 96%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 4%,
        black 96%,
        transparent 100%
    );
}

/* ══════════════════════════════════════════════
   SLIDER TRACK — Flex row, geometry by JS
   ══════════════════════════════════════════════ */
.articles-slider-track {
    display: flex;
    gap: 20px;
    transition: transform 0.52s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    /* track grows with content (real cards + clones); width is NOT fixed */
}

/* ══════════════════════════════════════════════
   ARTICLE CARD
   Width is set dynamically by articles.js.
   ══════════════════════════════════════════════ */
.articles-card {
    flex: 0 0 auto;                  /* never shrink or grow */
    flex-shrink: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 0;                 /* ★ sharp corners */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* fallback dimensions – guarantee visibility before JS sets exact width */
    width: 280px;                    /* will be overridden by JS */
    min-height: 320px;               /* prevents height collapse when images are loading */
    transition:
        border-color var(--t-fast),
        transform    var(--t-fast),
        box-shadow    var(--t-fast);
}

/* clones inherit everything from .articles-card */
.articles-card.is-clone {
    pointer-events: none;            /* clones are non-interactive */
}

/* ── Hover ── */
.articles-card:hover {
    border-color: var(--accent-border);
    transform: translateY(-4px);
    box-shadow:
        0 14px 38px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(245, 184, 0, 0.10);
}

/* ══════════════════════════════════════════════
   CARD — IMAGE SECTION
   ══════════════════════════════════════════════ */
.articles-card__img {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.articles-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}

.articles-card:hover .articles-card__img img {
    transform: scale(1.05);
}


/* ══════════════════════════════════════════════
   CARD — BODY (text content)
   ══════════════════════════════════════════════ */
.articles-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 18px 20px;
    border-top: 1px solid var(--border-subtle);
}

.articles-card__meta {
    font-family: var(--font-ui);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.articles-card__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;                  /* standard property */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.articles-card__excerpt {
    font-family: var(--font-body);
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.articles-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    transition: gap var(--t-fast), color var(--t-fast);
}

.articles-card__link::after {
    content: '→';
    transition: transform var(--t-fast);
}

.articles-card__link:hover {
    gap: 14px;
    color: var(--accent-hover);
}

.articles-card__link:hover::after {
    transform: translateX(4px);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 1024px)
   ══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .articles-container {
        padding: 0 28px;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   Switch to native horizontal scroll + snap.
   Override ALL JS inline styles via !important.
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .articles-section {
        padding: 40px 0 48px;
    }

    .articles-container {
        padding: 0 20px;
    }

    /* ── Cards: fixed width, JS doesn't control mobile ── */
    .articles-card {
        width: 280px !important;
        min-width: 280px;
        flex: 0 0 280px !important;
        scroll-snap-align: start;
    }

    /* ── Track: native scroll, no transforms ── */
    .articles-slider-track {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        transform: none !important;
        transition: none !important;
        padding: 4px 0;
        gap: 16px;
    }

    .articles-slider-track::-webkit-scrollbar {
        height: 3px;
    }
    .articles-slider-track::-webkit-scrollbar-thumb {
        background: var(--accent-border);
        border-radius: 2px;
    }
    .articles-slider-track::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }

    /* ── Header: hide nav arrows + subtitle on mobile ── */
    .articles-hdr {
        margin-bottom: 22px;
    }
    .articles-hdr__nav {
        display: none;
    }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .articles-card {
        width: 250px !important;
        min-width: 250px;
        flex: 0 0 250px !important;
    }
    .articles-card__img {
        height: 160px;
    }
    .articles-card__body {
        padding: 14px 14px 16px;
    }
    .articles-card__title {
        font-size: 0.9rem;
    }
    .articles-card__excerpt {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}