﻿/* =========================================================
   CATEGORY PAGE
========================================================= */

.category-page {
    min-height: calc(100vh - 80px);
    padding: 2rem 1.25rem 5rem;
}

.category-container {
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}


/* =========================================================
   CATEGORY INTRO
========================================================= */

.category-intro {
    margin: 1rem 0 2rem;
    text-align: start;
}




.category-intro h1 {
    margin: 0;
    color: var(--color-primary);
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -.055em;
    line-height: 1;
}


/* =========================================================
   CATEGORY GRID
========================================================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
}


/* =========================================================
   CATEGORY CARD
========================================================= */

.category-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1.18 / 1;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background: var(--color-primary);
    border: 1px solid rgba(23, 22, 20, .08);
    border-radius: 14px;
    box-shadow: 0 5px 18px rgba(23, 22, 20, .05), 0 1px 2px rgba(23, 22, 20, .025);
    isolation: isolate;
    transition: transform var(--transition), box-shadow var(--transition);
}

    .category-card:hover {
        color: #fff;
        box-shadow: 0 12px 30px rgba(23, 22, 20, .10), 0 2px 5px rgba(23, 22, 20, .035);
    }


/* =========================================================
   CATEGORY IMAGE
========================================================= */
.category-image-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #f3f3f3;
    z-index: 0;
}

/* Premium loading skeleton */
.image-skeleton {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient( 110deg, #eeeeee 8%, #f8f8f8 18%, #eeeeee 33% );
    background-size: 200% 100%;
    animation: premiumShimmer 1.5s linear infinite;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

    .image-skeleton.is-hidden {
        opacity: 0;
        visibility: hidden;
    }

@keyframes premiumShimmer {
    to {
        background-position-x: -200%;
    }
}


/* Actual image */
.category-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    opacity: 0;
    transform: scale(1.02);
    filter: saturate(.88);
    transition: opacity 0.5s ease, transform 600ms cubic-bezier(.2, .8, .2, 1), filter 600ms ease;
}

    .category-image.is-loaded {
        opacity: 1;
        transform: scale(1);
    }

.category-card:hover .category-image {
    transform: scale(1.028);
    filter: saturate(1);
}


/* =========================================================
   CATEGORY OVERLAY
========================================================= */

.category-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient( to top, rgba(10, 10, 9, .92) 0%, rgba(10, 10, 9, .65) 32%, rgba(10, 10, 9, .18) 65%, rgba(10, 10, 9, 0) 100% );
}


/* =========================================================
   CATEGORY CONTENT
========================================================= */

.category-content {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}



    .category-content h2 {
        width: 100%;
        margin: 0;
        overflow: hidden;
        color: #fff;
        font-size: 1.05rem;
        font-weight: 700;
        letter-spacing: -.02em;
        line-height: 1.2;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.category-meta {
    display: flex;
    align-items: center;
    margin-top: .6rem;
}

    .category-meta span {
        display: inline-flex;
        align-items: center;
        color: rgba(255, 255, 255, .82);
        font-size: .72rem;
        font-weight: 500;
        line-height: 1.2;
    }


/* =========================================================
   ACCESSIBILITY
========================================================= */

.category-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}


/* =========================================================
   TABLET
========================================================= */


@media (max-width: 768px) {

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .9rem;
    }

    .category-card {
        aspect-ratio: 1.15 / 1;
    }

    .category-content {
        padding: .95rem;
    }

        .category-content h2 {
            font-size: 1rem;
        }
}




/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 560px) {

    .category-page {
        padding: 1.25rem .9rem 3rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .category-card {
        aspect-ratio: 1.55 / 1;
        border-radius: 13px;
    }

    .category-content {
        padding: 1rem;
    }

        .category-content h2 {
            font-size: 1.05rem;
        }

    .category-meta {
        margin-top: .55rem;
    }

        .category-meta span {
            font-size: .72rem;
        }
}



/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {

    .category-page {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .category-card {
        aspect-ratio: 1.45 / 1;
    }

    .category-content {
        padding: .9rem;
    }

        .category-content h2 {
            font-size: 1rem;
        }

    .category-meta span {
        font-size: .7rem;
    }
}
