/* =========================================================
   ABQ HOME TECHS — PROJECT GALLERY
   ========================================================= */

.work-gallery-section {
    margin: 2.5rem 0;
}

.work-gallery-section h2,
.work-gallery-section h3,
.work-gallery-section h4 {
    color: #111;
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* =========================================================
   GALLERY GRID
   ========================================================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

/* =========================================================
   PROJECT CARD
   ========================================================= */

.gallery-project {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.gallery-project:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* =========================================================
   PROJECT COVER
   ========================================================= */

.project-cover {
    position: relative;
    background: #f3f4f6;
    overflow: hidden;
}

.project-cover-trigger {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}

.project-cover-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.project-cover-trigger img,
.project-cover-thumb img {
    display: block;
    width: 100%;
    height: 320px;
    object-fit: cover;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.project-cover-trigger:hover img {
    transform: scale(1.025);
    filter: brightness(1.04);
}

/* =========================================================
   PHOTO COUNT
   ========================================================= */

.project-image-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 5px 9px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    pointer-events: none;
}

/* =========================================================
   PROJECT INFORMATION
   ========================================================= */

.project-gallery-info {
    padding: 1rem 1rem 1.1rem;
}

.project-title {
    margin: 0;
    color: #111;
    font-size: 1.15rem;
    line-height: 1.3;
    font-weight: 700;
}

.project-city {
    margin-top: 0.35rem;
    color: #e66a00;
    font-size: 0.85rem;
    font-weight: 700;
}

.project-description {
    margin: 0.55rem 0 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =========================================================
   SMALL PROJECT PHOTO STRIP
   ========================================================= */

.project-photo-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 0.9rem;
}

.project-mini-trigger {
    display: block;
    width: 100%;
    height: 64px;
    padding: 0;
    border: 0;
    background: #f3f4f6;
    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;
}

.project-mini-trigger img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.project-mini-trigger:hover img {
    transform: scale(1.06);
    filter: brightness(1.06);
}

/* =========================================================
   ALL GALLERY BUTTONS
   ========================================================= */

.gallery-trigger {
    -webkit-appearance: none;
    appearance: none;
}

.gallery-trigger:focus-visible {
    outline: 3px solid #9acd32;
    outline-offset: 2px;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    width: 100vw;
    height: 100vh;
    padding: 30px 80px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.94);
    align-items: center;
    justify-content: center;
}

.gallery-lightbox.is-open {
    display: flex;
}

/* =========================================================
   LIGHTBOX IMAGE AREA
   ========================================================= */

.lightbox-image-area {
    width: 100%;
    max-width: 1250px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    animation: galleryZoomIn 0.2s ease-out;
}

/* =========================================================
   LIGHTBOX CAPTION
   ========================================================= */

.lightbox-caption {
    width: 100%;
    max-width: 1000px;
    margin-top: 12px;
    color: #fff;
    text-align: center;
    font-size: 1rem;
    line-height: 1.45;
}

/* =========================================================
   LIGHTBOX COUNTER
   ========================================================= */

.lightbox-counter {
    margin-top: 5px;
    color: #bdbdbd;
    font-size: 0.82rem;
}

/* =========================================================
   LIGHTBOX CLOSE
   ========================================================= */

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 3;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 34px;
    line-height: 42px;
    cursor: pointer;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* =========================================================
   PREVIOUS / NEXT
   ========================================================= */

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 52px;
    height: 70px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.20);
}

.lightbox-prev {
    left: 18px;
}

.lightbox-next {
    right: 18px;
}

/* =========================================================
   LIGHTBOX BODY LOCK
   ========================================================= */

body.gallery-lightbox-open {
    overflow: hidden;
}

/* =========================================================
   ANIMATION
   ========================================================= */

@keyframes galleryZoomIn {
    from {
        transform: scale(0.96);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1000px) {

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-cover-trigger img {
        height: 250px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 650px) {

    .work-gallery-section {
        margin: 2rem 0;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-cover-trigger img {
        height: 240px;
    }

    .project-photo-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-mini-trigger {
        height: 58px;
    }

    .gallery-lightbox {
        padding: 65px 12px 25px;
    }

    .lightbox-content {
        max-width: 100%;
        max-height: 70vh;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 42px;
        height: 58px;
        font-size: 30px;
    }

    .lightbox-prev {
        left: 6px;
    }

    .lightbox-next {
        right: 6px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }

    .lightbox-caption {
        font-size: 0.9rem;
        padding: 0 35px;
    }
}

/* =========================================================
   VERY SMALL PHONES
   ========================================================= */

@media (max-width: 400px) {

    .project-cover-trigger img {
        height: 210px;
    }

    .project-gallery-info {
        padding: 0.85rem;
    }

    .project-photo-strip {
        gap: 3px;
    }

    .project-mini-trigger {
        height: 52px;
    }
}
