/* ============================================================
   Media page - Photo Gallery
   Extracted from the live Media page inline <style>.
   ============================================================ */

/* Gallery section typography */
.md-gallery-section h2,
.md-sub-title {
    font-family: "Playfair Display", serif;
}

.md-gallery-section p,
.md-gallery-section span {
    font-family: "Poppins", sans-serif;
}

.md-gallery-section {
    background-color: #ffffff;
    padding: 80px 0;
}

.md-sub-title {
    color: #498e22;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.md-animated-heading {
    color: #0c193e;
    font-weight: 800;
}

/* Grid & items */
.md-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(224px, 329px));
    justify-content: center;
    gap: 20px;
}

.md-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f5f5dc;
    cursor: pointer;
    border: 1px solid #e5e5e7;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.md-gallery-item:hover {
    transform: translateY(-4px);
    border-color: #c21048;
    box-shadow: 0 12px 30px rgba(12, 25, 62, 0.14);
}

.md-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Light overlay effect */
.md-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 25, 62, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.4s ease;
}

.md-gallery-item:hover .md-gallery-overlay {
    opacity: 1;
}

.md-gallery-item:hover img {
    transform: scale(1.1);
}

.md-gallery-icon {
    color: #ffffff;
    background: #c21048;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.md-gallery-item:hover .md-gallery-icon {
    transform: translateY(0);
}

/* Fancybox */
.fancybox__backdrop {
    background: rgba(12, 25, 62, 0.95);
}

.fancybox__content {
    animation: fadeInScale 0.35s ease;
}

.fancybox__caption {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
}

/* Fallback lightbox (used if Fancybox fails to load) */
.md-gallery-fallback {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 25, 62, 0.95);
    z-index: 9999;
}

.md-gallery-fallback.is-open {
    display: flex;
}

.md-gallery-fallback-inner {
    position: relative;
    max-width: min(92vw, 1400px);
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-gallery-fallback img {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.md-gallery-fallback-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #0c193e;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.md-gallery-fallback-caption {
    position: absolute;
    left: 50%;
    bottom: -42px;
    transform: translateX(-50%);
    color: #ffffff;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.contact-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 10px 50px 10px;
}

@media (max-width: 767.98px) {
    .md-gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 14px;
    }

    .md-gallery-item {
        height: 180px;
    }

    .md-gallery-icon {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }

    .md-gallery-fallback {
        padding: 14px;
    }

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

    .md-gallery-fallback-caption {
        position: static;
        transform: none;
        margin-top: 12px;
        white-space: normal;
    }

    .md-gallery-fallback-inner {
        flex-direction: column;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}
