/* ── Materials Archive (archive-material.php) ─────────────── */

/* ── Hero — white bg, red eyebrow, navy H1 ───────────────── */
.mat-archive__hero {
    background: #fff;
    padding: 4rem 0 3rem;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.mat-archive__hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Eyebrow — matching .services-grid__eyebrow pattern */
.mat-archive__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--wp--preset--color--primary, #B00000);
    margin: 0 0 1rem;
}

.mat-archive__eyebrow-line {
    display: inline-block;
    width: 32px;
    height: 2px;
    background: currentColor;
    flex-shrink: 0;
}

.mat-archive__hero-heading {
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    font-weight: 900;
    color: var(--wp--preset--color--secondary, #0B2169);
    letter-spacing: -.03em;
    line-height: 1.1;
    margin: 0;
    max-width: 700px;
}

/* ── Sticky category tabs — identical to blog archive ─────── */
.mat-archive__tabs-bar {
    position: sticky;
    top: var(--site-header-height, 70px);
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.mat-archive__tabs {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.mat-archive__tabs::-webkit-scrollbar { display: none; }

.mat-tab {
    display: inline-flex;
    align-items: center;
    padding: 1rem 1.25rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color .2s, border-color .2s;
    flex-shrink: 0;
}
.mat-tab:hover { color: var(--wp--preset--color--secondary, #0B2169); }
.mat-tab.is-active {
    color: var(--wp--preset--color--primary, #B00000);
    border-bottom-color: var(--wp--preset--color--primary, #B00000);
}

/* ── Category rows ────────────────────────────────────────── */
.mat-archive__rows {
    padding: 4rem 0;
}

.mat-row {
    margin-bottom: 4rem;
    scroll-margin-top: calc( var(--site-header-height, 70px) + 60px );
}
.mat-row:last-child { margin-bottom: 0; }

.mat-row__header {
    margin-bottom: 1.5rem;
}

.mat-row__title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--wp--preset--color--secondary, #0B2169);
    letter-spacing: -.02em;
    margin: 0;
}

/* ── Cards grid — 3 columns ───────────────────────────────── */
.mat-row__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* ── Individual card ──────────────────────────────────────── */
.mat-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.09);
    text-decoration: none;
    transition: box-shadow .3s ease, transform .3s ease;
}

.mat-card:hover {
    box-shadow: 0 8px 36px rgb(var(--nifty-primary-rgb) / .18);
    transform: translateY(-3px);
}

/* Image */
.mat-card__img-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--wp--preset--color--secondary, #0B2169);
}

.mat-card__img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--wp--preset--color--secondary, #0B2169);
    transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.mat-card:hover .mat-card__img {
    transform: scale(1.05);
}

/* Card body */
.mat-card__body {
    padding: 1.125rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    flex: 1;
    border-top: 1px solid rgba(0,0,0,.07);
}

/* Category label */
.mat-card__cat {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--wp--preset--color--primary, #B00000);
}

/* Material name */
.mat-card__title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--wp--preset--color--secondary, #0B2169);
    line-height: 1.3;
    margin: 0;
}

/* Specs row */
.mat-card__specs {
    display: flex;
    gap: 1rem;
    margin-top: .375rem;
    padding-top: .75rem;
    border-top: 1px solid rgba(0,0,0,.07);
    flex-wrap: wrap;
}

.mat-card__spec {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.mat-card__spec-label {
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #9ca3af;
}

.mat-card__spec-value {
    font-size: .875rem;
    font-weight: 700;
    color: var(--wp--preset--color--secondary, #0B2169);
}

/* Learn More link */
.mat-card__learn-more {
    display: inline-block;
    margin-top: auto;
    padding-top: .75rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--wp--preset--color--primary, #B00000);
    transition: opacity .2s;
}
.mat-card:hover .mat-card__learn-more { opacity: .7; }

/* ── Mobile carousel nav (hidden on desktop) ──────────────── */
.mat-row__nav { display: none; }

.mat-row__progress-track {
    flex: 1;
    height: 3px;
    background: rgba(0,0,0,.12);
    border-radius: 2px;
    overflow: hidden;
}

.mat-row__progress-fill {
    height: 100%;
    width: 0%;
    background: var(--wp--preset--color--primary, #B00000);
    border-radius: 2px;
    transition: width .3s ease;
}

.mat-row__arrows {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}

.mat-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15);
    background: rgba(255,255,255,.9);
    color: var(--wp--preset--color--secondary, #0B2169);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    padding: 0;
}
.mat-arrow:hover:not(:disabled) {
    background: var(--wp--preset--color--secondary, #0B2169);
    color: #fff;
    border-color: transparent;
}
.mat-arrow:disabled { opacity: .3; cursor: not-allowed; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
    .mat-row__cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
    .mat-archive__rows { padding: 3rem 0; }
    .mat-row { margin-bottom: 3rem; }
    .mat-archive__hero { padding: 3rem 0 2.5rem; }
    .mat-tab { padding: .875rem 1rem; font-size: .7rem; }
}

@media (max-width: 560px) {
    .mat-row__cards {
        display: flex !important;
        overflow-x: scroll;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
    }
    .mat-row__cards::-webkit-scrollbar { display: none; }

    .mat-card {
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
        border-radius: 8px;
        transform: none !important;
    }

    .mat-row__nav {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-top: 1rem;
    }
}
