/* =========================================================
   GALLERY MODULE BASE
========================================================= */

.gallery-module {
    padding: 70px 0;
}

.gallery-head {
    text-align: center;
    margin-bottom: 35px;
}

.gallery-head h2 {
    font-size: clamp(30px, 4vw, 46px);
    margin: 0 0 12px;
}

.gallery-head p {
    max-width: 760px;
    margin: 0 auto;
    color: #64748b;
}

/* =========================================================
   LAYOUT 1 - SIMPLE GRID
========================================================= */

.gallery-layout-1 .gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.gallery-layout-1 .gallery-item {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
}

.gallery-layout-1 .gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.gallery-layout-1 .gallery-item:hover img {
    transform: scale(1.06);
}

.gallery-layout-1 .gallery-item span {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;

    background: rgba(0,0,0,.65);
    color: #fff;

    padding: 10px 12px;
    border-radius: 10px;
}

/* =========================================================
   LAYOUT 5 - WORK / REFERENCE CARDS
========================================================= */

.gallery-layout-5 .work-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.gallery-layout-5 .work-gallery-card {
    position: relative;
    display: block;
    overflow: hidden;
    min-height: 260px;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15,23,42,.14);
}

.gallery-layout-5 .work-gallery-card img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.gallery-layout-5 .work-gallery-card:hover img {
    transform: scale(1.08);
}

.gallery-layout-5 .work-gallery-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;

    padding: 24px;

    background: linear-gradient(
        transparent,
        rgba(0,0,0,.72)
    );
}

.gallery-layout-5 .work-gallery-overlay h3 {
    color: #fff;
    margin: 0;
    font-size: 22px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    .gallery-layout-1 .gallery-grid,
    .gallery-layout-5 .work-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 576px) {
    .gallery-layout-1 .gallery-grid,
    .gallery-layout-5 .work-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   LAYOUT 2 - MASONRY
========================================================= */

.gallery-layout-2 .gallery-masonry {
    column-count: 4;
    column-gap: 20px;
}

.gallery-layout-2 .gallery-masonry-item {
    display: block;
    position: relative;
    margin-bottom: 20px;
    break-inside: avoid;
    overflow: hidden;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15,23,42,.12);
}

.gallery-layout-2 .gallery-masonry-item img {
    width: 100%;
    display: block;
    transition: transform .35s ease;
}

.gallery-layout-2 .gallery-masonry-item:hover img {
    transform: scale(1.06);
}

.gallery-layout-2 .gallery-masonry-item span {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    background: rgba(15,23,42,.78);
    color: #fff;
    padding: 10px 12px;
    border-radius: 12px;
}

/* =========================================================
   LAYOUT 3 - SIMPLE SLIDER
========================================================= */

.gallery-layout-3 .gallery-slider {
    position: relative;
    max-width: 1050px;
    margin: 0 auto;
}

.gallery-layout-3 .gallery-slider-track {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15,23,42,.18);
    aspect-ratio: 16 / 8;
    background: #0f172a;
}

.gallery-layout-3 .gallery-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .35s ease;
}

.gallery-layout-3 .gallery-slide.active {
    opacity: 1;
    visibility: visible;
}

.gallery-layout-3 .gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-layout-3 .gallery-slide span {
    position: absolute;
    left: 24px;
    bottom: 24px;
    background: rgba(15,23,42,.78);
    color: #fff;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 800;
}

.gallery-layout-3 .gallery-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;

    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.gallery-layout-3 .gallery-slider-prev {
    left: -22px;
}

.gallery-layout-3 .gallery-slider-next {
    right: -22px;
}

.gallery-layout-3 .gallery-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.gallery-layout-3 .gallery-slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 0;
    background: #cbd5e1;
    cursor: pointer;
}

.gallery-layout-3 .gallery-slider-dot.active {
    background: var(--roof-blue, #14b8a6);
}

/* =========================================================
   LAYOUT 4 - REFERENCE CARDS
========================================================= */

.gallery-layout-4 .gallery-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.gallery-layout-4 .gallery-reference-card {
    display: block;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 18px 45px rgba(15,23,42,.12);
    transition: transform .25s ease, box-shadow .25s ease;
}

.gallery-layout-4 .gallery-reference-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 26px 70px rgba(15,23,42,.18);
}

.gallery-layout-4 .gallery-reference-image {
    overflow: hidden;
}

.gallery-layout-4 .gallery-reference-image img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.gallery-layout-4 .gallery-reference-card:hover img {
    transform: scale(1.08);
}

.gallery-layout-4 .gallery-reference-body {
    padding: 22px;
}

.gallery-layout-4 .gallery-reference-body h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 21px;
}

.gallery-layout-4 .gallery-reference-body span {
    color: var(--roof-blue, #14b8a6);
    font-weight: 900;
}

/* =========================================================
   LAYOUT 5 - BEFORE / AFTER PAIRS
========================================================= */

.gallery-layout-5 .gallery-beforeafter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}

.gallery-layout-5 .gallery-beforeafter-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(15,23,42,.14);
}

.gallery-layout-5 .gallery-beforeafter-item {
    position: relative;
    display: block;
    min-height: 260px;
    overflow: hidden;
}

.gallery-layout-5 .gallery-beforeafter-item img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.gallery-layout-5 .gallery-beforeafter-item:hover img {
    transform: scale(1.06);
}

.gallery-layout-5 .gallery-beforeafter-item span {
    position: absolute;
    left: 16px;
    top: 16px;
    background: rgba(15,23,42,.82);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 900;
}

/* =========================================================
   GALLERY RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
    .gallery-layout-2 .gallery-masonry {
        column-count: 3;
    }

    .gallery-layout-4 .gallery-card-grid,
    .gallery-layout-5 .gallery-beforeafter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .gallery-layout-2 .gallery-masonry {
        column-count: 2;
    }

    .gallery-layout-4 .gallery-card-grid,
    .gallery-layout-5 .gallery-beforeafter-grid {
        grid-template-columns: 1fr;
    }

    .gallery-layout-3 .gallery-slider-track {
        aspect-ratio: 4 / 3;
    }

    .gallery-layout-3 .gallery-slider-prev {
        left: 10px;
    }

    .gallery-layout-3 .gallery-slider-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-layout-2 .gallery-masonry {
        column-count: 1;
    }

    .gallery-layout-5 .gallery-beforeafter-card {
        grid-template-columns: 1fr;
    }
}