@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600;700;800&display=swap");

.media-gallery-section {
    padding: 45px 0 80px;
    background: #ffffff;
}

.media-gallery-heading {
    margin-bottom: 35px;
    text-align: center;
}

.media-gallery-heading h2 {
    margin: 0;
    color: #00675f;
    font-size: 40px;
    font-weight: 400;
    line-height: 1.2;
    font-family: "Montserrat";
}

.media-gallery-heading h2 span {
    color: #ed0029;
    font-style: normal;
}

.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    max-width: 1180px;
    margin: 0 auto;
}

.media-gallery-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eeeeee;
    border: 1px solid rgba(7, 95, 91, 0.12);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    opacity: 0;
    animation: galleryReveal 0.7s ease forwards;
    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease,
        border-color 0.4s ease;
}

.media-gallery-card:nth-child(1) {
    animation-delay: 0.05s;
}

.media-gallery-card:nth-child(2) {
    animation-delay: 0.1s;
}

.media-gallery-card:nth-child(3) {
    animation-delay: 0.15s;
}

.media-gallery-card:nth-child(4) {
    animation-delay: 0.2s;
}

.media-gallery-card:nth-child(5) {
    animation-delay: 0.25s;
}

.media-gallery-card:nth-child(6) {
    animation-delay: 0.3s;
}

.media-gallery-card:nth-child(7) {
    animation-delay: 0.35s;
}

.media-gallery-card:nth-child(8) {
    animation-delay: 0.4s;
}

.media-gallery-card:nth-child(9) {
    animation-delay: 0.45s;
}

.media-gallery-card:nth-child(10) {
    animation-delay: 0.5s;
}

.media-gallery-card:nth-child(11) {
    animation-delay: 0.55s;
}

.media-gallery-card:nth-child(12) {
    animation-delay: 0.6s;
}

.media-gallery-card:nth-child(13) {
    animation-delay: 0.65s;
}

.media-gallery-card:nth-child(14) {
    animation-delay: 0.7s;
}

.media-gallery-card:nth-child(15) {
    animation-delay: 0.75s;
}

.media-gallery-card:nth-child(16) {
    animation-delay: 0.8s;
}

.media-gallery-card img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.4s ease;
}

.media-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(
            180deg,
            rgba(0, 70, 66, 0.02),
            rgba(0, 40, 37, 0.7)
        );
    opacity: 0;
    transition: opacity 0.4s ease;
}

.media-gallery-zoom {
    display: flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: scale(0.7) rotate(-10deg);
    transition:
        opacity 0.35s ease,
        transform 0.4s ease;
}

.media-gallery-card:hover {
    z-index: 2;
    border-color: rgba(7, 95, 91, 0.35);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
    transform: translateY(-7px);
}

.media-gallery-card:hover img {
    filter: brightness(0.82) contrast(1.04);
    transform: scale(1.08);
}

.media-gallery-card:hover .media-gallery-overlay {
    opacity: 1;
}

.media-gallery-card:hover .media-gallery-zoom {
    opacity: 1;
    transform: scale(1) rotate(0);
}

@keyframes galleryReveal {
    from {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Tablet */

@media (max-width: 991.98px) {
    .media-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

/* Mobile */

@media (max-width: 575.98px) {
    .media-gallery-section {
        padding: 30px 0 50px;
    }

    .media-gallery-heading {
        margin-bottom: 24px;
    }

    .media-gallery-heading h2 {
        font-size: 2rem;
    }

    .media-gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .media-gallery-card {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .media-gallery-card {
        opacity: 1;
        animation: none;
    }
}


.lg-toolbar .lg-download,
.lg-toolbar .lg-fullscreen,
.lg-toolbar .lg-zoom-in,
.lg-toolbar .lg-zoom-out,
.lg-toolbar .lg-actual-size {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.lg-toolbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.lg-backdrop {
    z-index: 999998 !important;
}

.lg-outer {
    z-index: 999999 !important;
}


/* =========================================
   LightGallery top toolbar
   ========================================= */

.lg-toolbar {
    display: flex !important;
    width: auto !important;

    align-items: center !important;
    justify-content: flex-end !important;

    top: 0 !important;
    right: 0 !important;
    left: auto !important;

    padding: 0 12px !important;

    background: rgba(0, 0, 0, 0.45) !important;
    border-radius: 0 0 0 12px;
}

.lg-toolbar .lg-icon {
    position: relative !important;
    float: none !important;

    display: inline-flex !important;
    width: 46px !important;
    height: 46px !important;

    align-items: center !important;
    justify-content: center !important;

    opacity: 1 !important;
    visibility: visible !important;
}

/* Keep every action on the right */

.lg-toolbar .lg-download,
.lg-toolbar .lg-fullscreen,
.lg-toolbar .lg-zoom-in,
.lg-toolbar .lg-zoom-out,
.lg-toolbar .lg-actual-size,
.lg-toolbar .lg-close {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Close button should be last */

.lg-toolbar .lg-close {
    order: 100;
}

/* =========================================
   Remove counter from top
   Keep it above thumbnails
   ========================================= */

.lg-components .lg-counter {
    position: absolute !important;

    top: auto !important;
    right: auto !important;
    bottom: 88px !important;
    left: 50% !important;

    width: auto !important;
    height: auto !important;

    padding: 5px 12px !important;

    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.58) !important;

    border-radius: 20px;

    font-size: 13px !important;
    line-height: 1.2 !important;

    opacity: 1 !important;
    transform: translateX(-50%);
}

/* =========================================
   Bottom thumbnails
   ========================================= */

.lg-components {
    z-index: 1085 !important;
}

.lg-outer .lg-thumb-outer {
    position: relative !important;

    width: 100% !important;

    background: rgba(0, 0, 0, 0.88) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lg-outer .lg-thumb {
    margin: 0 auto !important;
    padding: 9px 0 !important;
}

.lg-outer .lg-thumb-item {
    overflow: hidden !important;

    border: 2px solid transparent !important;
    border-radius: 8px !important;

    opacity: 0.62;

    transition:
        opacity 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.lg-outer .lg-thumb-item:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.lg-outer .lg-thumb-item.active {
    border-color: #ffffff !important;
    opacity: 1;
}

.lg-outer .lg-thumb-item img {
    width: 100% !important;
    height: 100% !important;

    object-fit: cover !important;
}

/* Main image gets space for thumbnails */

.lg-outer .lg-content {
    bottom: 95px !important;
}

/* Caption above thumbnails */

.lg-outer .lg-sub-html {
    bottom: 92px !important;

    padding: 8px 15px !important;

    background: rgba(0, 0, 0, 0.45) !important;
}

/* Navigation arrows */

.lg-prev,
.lg-next {
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.45) !important;
}

/* =========================================
   Mobile
   ========================================= */

@media (max-width: 575.98px) {
    .lg-toolbar {
        padding: 0 5px !important;
    }

    .lg-toolbar .lg-icon {
        width: 38px !important;
        height: 42px !important;
    }

    .lg-outer .lg-thumb-item {
        border-radius: 5px !important;
    }

    .lg-components .lg-counter {
        bottom: 78px !important;
        font-size: 12px !important;
    }

    .lg-outer .lg-content {
        bottom: 86px !important;
    }

    .lg-outer .lg-sub-html {
        bottom: 82px !important;
    }
}