/* =========================================================
   EBIF ENGINEERING CONSULT
   GALLERY — CLEAN FINAL CSS
========================================================= */


/* =========================================================
   PAGE HERO
========================================================= */

.page-hero {
    background: #172126;
    color: #fff;
    padding: 115px 0 90px;
}

.page-hero h1 {
    font: 800 clamp(48px, 6vw, 78px) / .98 Oswald, sans-serif;
    margin: 18px 0;
    letter-spacing: -.05em;
}

.page-hero p {
    max-width: 650px;
    color: #b9c3c5;
    font-size: 17px;
}


/* =========================================================
   GALLERY HERO
========================================================= */

.gallery-hero {
    position: relative;

    min-height: 620px;
    height: 70vh;
    max-height: 760px;

    display: flex;
    align-items: center;

    background-size: cover;
    background-position: center;

    overflow: hidden;
}

.gallery-hero .page-hero-overlay {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(0, 0, 0, .80) 0%,
            rgba(0, 0, 0, .56) 45%,
            rgba(0, 0, 0, .20) 100%
        );
}

.gallery-hero .page-hero-content {
    position: relative;
    z-index: 2;

    width: 100%;
    max-width: 1240px;

    margin: 0 auto;
    padding: 40px 55px 0;

    box-sizing: border-box;
}

.gallery-hero .eyebrow {
    display: block;

    color: #fff;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .16em;
    text-transform: uppercase;

    margin-bottom: 22px;
}

.gallery-hero h1 {
    color: #fff;

    font-size: clamp(52px, 5.4vw, 78px);
    font-weight: 800;

    line-height: .98;
    letter-spacing: -.045em;

    max-width: 760px;
    margin: 0 0 28px;
}

.gallery-hero p {
    color: rgba(255, 255, 255, .90);

    max-width: 620px;

    font-size: 17px;
    line-height: 1.7;

    margin: 0;
}


/* =========================================================
   GALLERY SECTION
========================================================= */

.gallery-section {
    padding: 110px 0;
}

.gallery-section > .container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}


/* =========================================================
   GALLERY FILTER
========================================================= */

.gallery-filter {
    width: fit-content;

    margin: 0 auto 55px;
    padding: 4px;

    display: inline-flex;
    align-items: center;

    gap: 0;

    background: #eef1ef;
    border: 1px solid #d9dedc;
    border-radius: 999px;

    box-shadow: 0 8px 24px rgba(23, 32, 38, .06);
}

.gallery-filter-button {
    appearance: none;

    min-width: 135px;
    height: 44px;

    padding: 0 22px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border: 0;
    border-radius: 999px;

    background: transparent;
    color: #596467;

    cursor: poRoboto Slab;

    font: 700 12px/1 Oswald, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;

    transition:
        background .22s ease,
        color .22s ease,
        box-shadow .22s ease,
        transform .15s ease;
}

.gallery-filter-button i {
    font-size: 12px;
}

.gallery-filter-button:hover {
    color: #172026;
}

.gallery-filter-button.is-active {
    background: #172026;
    color: #fff;

    box-shadow: 0 5px 14px rgba(23, 32, 38, .18);
}

.gallery-filter-button:focus-visible {
    outline: 3px solid rgba(162, 127, 66, .35);
    outline-offset: 2px;
}

.gallery-filter-button:active {
    transform: scale(.98);
}


/* =========================================================
   GALLERY GRID
========================================================= */

.gallery-grid {
    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 30px;

    transition: opacity .25s ease;
}

.gallery-grid.gallery-loading {
    opacity: .45;
    poRoboto Slab-events: none;
}


/* =========================================================
   GALLERY CARD
========================================================= */

.gallery-card {
    min-width: 0;
}


/* =========================================================
   GALLERY IMAGE / VIDEO BUTTON
========================================================= */

.gallery-image {
    appearance: none;

    position: relative;

    display: block;

    width: 100%;
    height: 330px;

    padding: 0;
    margin: 0;

    border: 0;

    background-color: #e9edeb;
    background-size: cover;
    background-position: center;

    overflow: hidden;

    cursor: poRoboto Slab;

    font: inherit;
    text-align: left;
    color: inherit;

    transition:
        transform .4s ease,
        box-shadow .3s ease;
}

.gallery-image::before {
    poRoboto Slab-events: none;
}

.gallery-image::after {
    content: "";

    position: absolute;
    inset: 0;

    poRoboto Slab-events: none;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, .48),
            transparent 55%
        );

    opacity: 0;

    transition: opacity .3s ease;
}

.gallery-image:hover {
    transform: scale(1.01);

    box-shadow:
        0 15px 35px rgba(23, 32, 38, .12);
}

.gallery-image:hover::after {
    opacity: 1;
}

.gallery-image:focus-visible {
    outline: 3px solid rgba(162, 127, 66, .55);
    outline-offset: 4px;
}


/* =========================================================
   MEDIA TYPE LABEL
========================================================= */

.gallery-media-type {
    position: absolute;

    z-index: 3;

    top: 16px;
    left: 16px;

    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 8px 11px;

    background: rgba(23, 32, 38, .88);
    color: #fff;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.gallery-media-type i {
    font-size: 11px;
}


/* =========================================================
   VIDEO PLAY BUTTON
========================================================= */

.gallery-card-video .gallery-image::before {
    content: "";

    position: absolute;

    z-index: 2;

    left: 50%;
    top: 50%;

    width: 62px;
    height: 62px;

    border-radius: 50%;

    transform: translate(-50%, -50%);

    background: rgba(255, 255, 255, .94);

    box-shadow:
        0 8px 25px rgba(0, 0, 0, .22);

    poRoboto Slab-events: none;
}

.gallery-card-video .gallery-image::after {
    content: "\f04b";

    position: absolute;

    z-index: 4;

    left: 50%;
    top: 50%;

    transform: translate(-45%, -50%);

    font-family: "Font Awesome 6 Free";
    font-weight: 900;

    color: #172026;

    font-size: 19px;

    background: transparent;

    opacity: 1;

    poRoboto Slab-events: none;
}


/* =========================================================
   VIEW BUTTON
========================================================= */

.gallery-view {
    position: absolute;

    z-index: 5;

    right: 20px;
    bottom: 20px;

    padding: 10px 15px;

    background: rgba(255, 255, 255, .94);
    color: #172026;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .04em;

    opacity: 0;

    transform: translateY(8px);

    transition:
        opacity .3s ease,
        transform .3s ease;
}

.gallery-image:hover .gallery-view,
.gallery-image:focus-visible .gallery-view {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   CARD CONTENT
========================================================= */

.gallery-card-content {
    padding-top: 18px;
}

.gallery-card-content > span {
    display: block;

    color: #78858a;

    font-size: 11px;
    font-weight: 700;

    letter-spacing: .13em;
    text-transform: uppercase;

    margin-bottom: 8px;
}

.gallery-card-content h2 {
    color: #172026;

    font-size: 25px;
    line-height: 1.2;

    margin: 0;
}


/* =========================================================
   PAGINATION
========================================================= */

.gallery-pagination {
    display: flex;

    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 55px;

    transition: opacity .25s ease;
}

.gallery-pagination-loading {
    opacity: .55;
    poRoboto Slab-events: none;
}

.gallery-page-button,
.gallery-page-number {
    min-width: 44px;
    height: 44px;

    padding: 0 14px;

    border: 1px solid #d9dedc;

    background: #fff;
    color: #172026;

    cursor: poRoboto Slab;

    font: 700 12px/1 Oswald, sans-serif;

    transition:
        background .2s ease,
        color .2s ease,
        border-color .2s ease;
}

.gallery-page-number.active {
    background: #172026;
    color: #fff;
    border-color: #172026;
}

.gallery-page-button:not(:disabled):hover,
.gallery-page-number:not(.active):hover {
    background: #eef1ef;
}

.gallery-page-button:disabled {
    opacity: .4;
    cursor: not-allowed;
}


/* =========================================================
   EMPTY / ERROR
========================================================= */

.gallery-error,
.gallery-empty {
    grid-column: 1 / -1;

    padding: 50px 20px;

    text-align: center;

    color: #596467;
}

.gallery-retry {
    border: 0;

    background: #172026;
    color: #fff;

    padding: 12px 18px;

    cursor: poRoboto Slab;

    font-weight: 700;
}


/* =========================================================
   GALLERY MODAL
========================================================= */

/*
   IMPORTANT:
   Very high z-index so the FAQ bot, WhatsApp button,
   header, etc. cannot appear over the gallery preview.
*/

.gallery-modal {
    position: fixed;

    inset: 0;

    z-index: 999999;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 25px;
}

.gallery-modal.is-open {
    display: flex;
}

.gallery-modal-backdrop {
    position: absolute;

    inset: 0;

    background: rgba(7, 11, 13, .94);

    backdrop-filter: blur(3px);
}


/* =========================================================
   MODAL DIALOG
========================================================= */

.gallery-modal-dialog {
    position: relative;

    z-index: 2;

    width: min(1120px, 100%);

    max-height: 94vh;

    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================================================
   MODAL MEDIA
========================================================= */

.gallery-modal-media-wrap {
    position: relative;

    width: min(1000px, calc(100vw - 150px));

    max-height: 84vh;

    background: #101619;

    overflow: hidden;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, .45);
}

.gallery-modal-media-wrap img,
.gallery-modal-media-wrap iframe {
    display: block;

    width: 100%;

    height: min(70vh, 650px);

    border: 0;

    object-fit: contain;

    background: #101619;
}

.gallery-modal-media-wrap iframe {
    aspect-ratio: 16 / 9;

    height: auto;

    min-height: 420px;
}

.gallery-modal-media-wrap iframe[hidden],
.gallery-modal-media-wrap img[hidden] {
    display: none !important;
}


/* =========================================================
   MODAL INFORMATION
========================================================= */

.gallery-modal-info {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    padding: 70px 30px 25px;

    background:
        linear-gradient(
            transparent,
            rgba(0, 0, 0, .84)
        );

    color: #fff;
}

.gallery-modal-info span {
    display: inline-block;

    margin-right: 10px;

    color: #d0d7d5;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: .12em;
    text-transform: uppercase;
}

.gallery-modal-info h2 {
    margin: 6px 0 0;

    font: 700 24px/1.2 Oswald, sans-serif;
}


/* =========================================================
   MODAL EXIT
========================================================= */

.gallery-modal-close {
    position: absolute;

    z-index: 20;

    top: -8px;
    right: 0;

    display: inline-flex;

    align-items: center;

    gap: 9px;

    padding: 11px 14px;

    border: 0;

    background: #fff;
    color: #172026;

    cursor: poRoboto Slab;

    font-weight: 800;

    letter-spacing: .08em;

    transition:
        background .2s ease,
        color .2s ease;
}

.gallery-modal-close:hover {
    background: #172026;
    color: #fff;
}


/* =========================================================
   MODAL PREVIOUS / NEXT
========================================================= */

.gallery-modal-prev,
.gallery-modal-next {
    position: absolute;

    z-index: 20;

    top: 50%;

    width: 48px;
    height: 48px;

    padding: 0;

    border: 0;

    border-radius: 50%;

    background: #fff;
    color: #172026;

    cursor: poRoboto Slab;

    transform: translateY(-50%);

    display: grid;
    place-items: center;

    transition:
        background .2s ease,
        color .2s ease,
        transform .2s ease;
}

.gallery-modal-prev {
    left: -70px;
}

.gallery-modal-next {
    right: -70px;
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover {
    background: #172026;
    color: #fff;
}


/* =========================================================
   MODAL CONTROLS
========================================================= */

.gallery-modal-controls {
    position: absolute;

    left: 50%;
    bottom: -60px;

    transform: translateX(-50%);

    display: flex;

    align-items: center;

    gap: 18px;

    color: #fff;
}

.gallery-control {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    border: 1px solid rgba(255, 255, 255, .35);

    background: rgba(0, 0, 0, .40);

    color: #fff;

    padding: 10px 14px;

    cursor: poRoboto Slab;

    font: inherit;

    transition:
        background .2s ease,
        color .2s ease;
}

.gallery-control:hover {
    background: #fff;
    color: #172026;
}

.gallery-control.is-playing {
    background: #fff;
    color: #172026;
}

.gallery-counter {
    white-space: nowrap;

    font-size: 12px;
    font-weight: 800;
}


/* =========================================================
   BODY LOCK
========================================================= */

.gallery-modal-open {
    overflow: hidden;
}


/* =========================================================
   IMPORTANT FAQ AI FIX
========================================================= */

/*
   When the gallery preview is open, hide the floating
   FAQ AI completely so it cannot cover:

   - Previous button
   - Next button
   - Video
   - Image
   - Modal controls
*/

body.gallery-modal-open .faq-ai {
    display: none !important;
}


/*
   Also hide floating WhatsApp while the gallery preview
   is open, if your WhatsApp button exists.
*/

body.gallery-modal-open .whatsapp-float {
    display: none !important;
}


/*
   Prevent common floating widgets from sitting above
   the gallery modal.
*/

body.gallery-modal-open .faq-ai-launcher,
body.gallery-modal-open .whatsapp-float {
    visibility: hidden !important;
    poRoboto Slab-events: none !important;
}


/* =========================================================
   LARGE DESKTOP
========================================================= */

@media (min-width: 1400px) {

    .gallery-hero .page-hero-content {
        max-width: 1340px;

        padding-left: 70px;
        padding-right: 70px;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 900px) {

    .gallery-hero {
        min-height: 600px;
    }

    .gallery-hero .page-hero-content {
        padding-left: 40px;
        padding-right: 40px;
    }

    .gallery-hero h1 {
        font-size: clamp(46px, 8vw, 68px);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 24px;
    }

    .gallery-section {
        padding: 80px 0;
    }

    .gallery-modal {
        padding: 16px;
    }

    .gallery-modal-media-wrap {
        width: calc(100vw - 90px);
    }

    .gallery-modal-prev {
        left: -58px;
    }

    .gallery-modal-next {
        right: -58px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

    .page-hero {
        padding: 80px 0 65px;
    }

    .gallery-section {
        padding: 70px 0;
    }

    .gallery-hero {
        min-height: 600px;

        background-position: center;
    }

    .gallery-hero .page-hero-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(0, 0, 0, .82),
                rgba(0, 0, 0, .42)
            );
    }

    .gallery-hero .page-hero-content {
        padding-left: 24px;
        padding-right: 24px;
    }

    .gallery-hero h1 {
        font-size: 44px;
        line-height: 1;
    }

    .gallery-hero p {
        font-size: 15px;
        line-height: 1.65;
    }


    /* Gallery */

    .gallery-grid {
        grid-template-columns: 1fr;

        gap: 35px;
    }

    .gallery-image {
        height: 280px;
    }

    .gallery-view {
        opacity: 1;

        transform: none;

        right: 14px;
        bottom: 14px;
    }

    .gallery-card-content h2 {
        font-size: 22px;
    }


    /* Filter */

    .gallery-filter {
        width: 100%;

        max-width: 330px;

        margin-bottom: 40px;

        align-self: center;
    }

    .gallery-filter-button {
        min-width: 0;

        flex: 1;

        padding: 0 14px;
    }


    /* Modal */

    .gallery-modal {
        padding: 10px;
    }

    .gallery-modal-dialog {
        width: 100%;
    }

    .gallery-modal-media-wrap {
        width: 100%;

        max-height: 78vh;
    }

    .gallery-modal-media-wrap img {
        height: 65vh;
    }

    .gallery-modal-media-wrap iframe {
        min-height: 230px;
    }


    /* Mobile navigation */

    /* Mobile navigation - Centered & Transparent */

.gallery-modal-prev,
.gallery-modal-next {
    top: 50% !important;               /* Keeps arrows vertically centered on image */
    bottom: auto !important;
    transform: translateY(-50%) !important;

    width: 42px;
    height: 42px;

    background: rgba(0, 0, 0, 0.45);   /* Semi-transparent dark background */
    color: #ffffff;                    /* White arrow icons for contrast */
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px);        /* Soft frosted glass effect */

    z-index: 30;                       /* Ensures arrows stay clickable on top */
}

.gallery-modal-prev {
    left: 10px !important;              /* Positioned over the left side of image */
}

.gallery-modal-next {
    right: 10px !important;             /* Positioned over the right side of image */
}

.gallery-modal-prev:hover,
.gallery-modal-next:hover,
.gallery-modal-prev:active,
.gallery-modal-next:active {
    background: rgba(23, 32, 38, 0.85); /* Slightly darker background on tap/click */
    color: #ffffff;
}


    /* Exit */

    .gallery-modal-close {
        top: 10px;
        right: 10px;
    }

    .gallery-modal-close span {
        display: none;
    }


    /* Controls */

    .gallery-modal-controls {
        bottom: -55px;
    }


    /* Information */

    .gallery-modal-info {
        padding: 55px 18px 18px;
    }

    .gallery-modal-info h2 {
        font-size: 19px;
    }

}

.gallery-control span {
    display: none !important;
}