/* =========================================================
   LABYRINTH CATEGORIES
========================================================= */

.lab-categories-section {
    width: 100%;
    padding: 65px 6.5%;
    padding-top: 220px ;
    box-sizing: border-box;
    background: #eeebeb;
}

.lab-categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    gap: 4px;
}

.lab-category-card {
    position: relative;
    display: block;
    width: 100%;
    height: 400px;
    overflow: hidden;
    background: #eeeae8;
    text-decoration: none !important;
}

.lab-category-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .8s cubic-bezier(.22,.61,.36,1);
}

.lab-category-card:hover .lab-category-image {
    transform: scale(1.05);
}

.lab-category-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(
            180deg,
            rgba(0,0,0,.04) 15%,
            rgba(0,0,0,.15) 45%,
            rgba(0,0,0,.82) 100%
        );
}

.lab-category-content {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 35px;
    z-index: 2;
}

.lab-category-title {
    margin: 0 0 30px !important;
    padding: 0 !important;
    color: #fff !important;
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 38px !important;
    font-weight: 500 !important;
    font-style: italic !important;
    line-height: 1 !important;
}

.lab-category-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #c49328 !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

.lab-category-arrow {
    font-size: 16px;
    line-height: 1;
    transition: transform .3s ease;
}

.lab-category-card:hover .lab-category-arrow {
    transform: translateX(5px);
}


/* When only two categories are enabled, keep both cards together in the
   center with deliberate space on the outer edges and between cards. */
@media (min-width: 768px) {
    .lab-categories-section.lab-categories-count-2 .lab-categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
        gap: 16px;
        justify-content: center;
    }
}

@media (max-width: 1024px) and (min-width: 768px) {

    .lab-categories-section {
        padding: 50px 4%;
    }

    .lab-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lab-category-card {
        height: 420px;
    }
}

@media (max-width: 767px) {
    /*
       Mobile reference layout:
       the category itself remains one full viewport scroll panel,
       while the visual card is a smaller centered portrait box with
       equal breathing room around it.
    */
    .lab-categories-section {
        padding: 0 !important;
        background: #eeebeb !important;
    }

    .lab-categories-grid {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
    }

    .lab-category-card {
        position: relative !important;
        width: 100% !important;
        height: 100svh !important;
        min-height: 100svh !important;
        max-height: 100svh !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background: #eeebeb !important;
        overflow: hidden !important;
    }

    /* The actual visual card: 4:5 portrait like the supplied reference. */
    .lab-category-image,
    .lab-category-overlay {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: min(76vw, 320px) !important;
        height: min(96vw, calc(100svh - 120px), 400px) !important;
        aspect-ratio: auto !important;
        transform: translate(-50%, -50%) !important;
    }

    .lab-category-image {
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
    }

    .lab-category-overlay {
        background: linear-gradient(
            180deg,
            rgba(0,0,0,.02) 15%,
            rgba(0,0,0,.10) 48%,
            rgba(0,0,0,.62) 100%
        ) !important;
    }

    .lab-category-content {
        left: 50% !important;
        right: auto !important;
        bottom: 50% !important;
        width: min(76vw, 320px) !important;
        padding: 0 22px !important;
        box-sizing: border-box !important;
        transform: translate(-50%, min(48vw, 200px)) !important;
        z-index: 2 !important;
    }

    .lab-category-title {
        color: #fff !important;
        font-size: 32px !important;
        margin: 0 0 20px !important;
    }

    .lab-category-link {
        font-size: 11px !important;
    }
}
