/* =====================================
   RAVIAN PHARMACEUTICALS GALLERY
===================================== */

.rp-gallery-section {
    padding: 40px 0;
    background: #fff;
    overflow: hidden;
}

/* Section Heading */

/* Gallery Card */

.rp-gallery-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #e9eee9;
    box-shadow: 0 5px 20px rgba(20, 59, 42, 0.07);
    transition:
        transform 0.35s ease,
        box-shadow 0.35s ease;
}

.rp-gallery-link {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    text-decoration: none;
}

.rp-gallery-link img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s ease;
}

.rp-gallery-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(24, 40, 105, 0.52);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.rp-gallery-zoom {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    color: #174b32;
    font-size: 17px;
    transform: scale(0.75);
    transition:
        transform 0.35s ease,
        background 0.35s ease,
        color 0.35s ease;
}

.rp-gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 32px rgba(20, 59, 42, 0.14);
}

.rp-gallery-card:hover img {
    transform: scale(1.08);
}

.rp-gallery-card:hover .rp-gallery-overlay,
.rp-gallery-link:focus-visible .rp-gallery-overlay {
    opacity: 1;
}

.rp-gallery-card:hover .rp-gallery-zoom,
.rp-gallery-link:focus-visible .rp-gallery-zoom {
    transform: scale(1);
}

.rp-gallery-link:focus-visible {
    outline: 3px solid #c5a253;
    outline-offset: -3px;
}

/* =====================================
   LIGHTBOX
===================================== */

.rp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 65px 80px 45px;
    background: rgba(7, 15, 11, 0.96);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.rp-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.rp-lightbox-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 65px;
    padding: 15px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rp-lightbox-counter {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
}

.rp-lightbox-close {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rp-lightbox-close:hover {
    background: #ffffff;
    color: #153c2a;
    transform: rotate(90deg);
}

/* Image Container */

.rp-lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    min-width: 0;
    min-height: 0;
}

.rp-lightbox-content img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.35);
}

.rp-lightbox-caption {
    margin: 0;
    color: #e7eee9;
    font-size: 13px;
    text-align: center;
}

/* Previous / Next Buttons */

.rp-lightbox-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 17px;
    cursor: pointer;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.rp-lightbox-nav:hover {
    background: #ffffff;
    color: #153c2a;
}

.rp-lightbox-prev {
    left: 25px;
}

.rp-lightbox-next {
    right: 25px;
}

.rp-lightbox button:focus-visible {
    outline: 3px solid #c5a253;
    outline-offset: 4px;
}

/* Responsive */

@media (max-width: 991px) {
    .rp-gallery-section {
        padding: 65px 0;
    }

    .rp-gallery-heading {
        margin-bottom: 35px;
    }

    .rp-lightbox {
        padding-left: 65px;
        padding-right: 65px;
    }

    .rp-lightbox-prev {
        left: 12px;
    }

    .rp-lightbox-next {
        right: 12px;
    }
}

@media (max-width: 575px) {
    .rp-gallery-section {
        padding: 50px 0;
    }

    .rp-gallery-heading {
        margin-bottom: 28px;
    }

    .rp-gallery-heading p {
        font-size: 13px;
        line-height: 1.8;
    }

    .rp-gallery-grid {
        --bs-gutter-x: 12px;
        --bs-gutter-y: 12px;
    }

    .rp-gallery-card {
        border-radius: 8px;
    }

    .rp-gallery-link {
        aspect-ratio: 1 / 1;
    }

    .rp-gallery-zoom {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .rp-lightbox {
        padding: 70px 12px 35px;
    }

    .rp-lightbox-header {
        padding: 12px 16px;
    }

    .rp-lightbox-content img {
        max-height: calc(100vh - 160px);
    }

    .rp-lightbox-nav {
        top: auto;
        bottom: 12px;
        width: 42px;
        height: 42px;
        font-size: 14px;
        transform: none;
    }

    .rp-lightbox-prev {
        left: calc(50% - 52px);
    }

    .rp-lightbox-next {
        right: calc(50% - 52px);
    }

    .rp-lightbox-caption {
        font-size: 12px;
    }
}

/* Respect reduced motion preferences */

@media (prefers-reduced-motion: reduce) {
    .rp-gallery-card,
    .rp-gallery-link img,
    .rp-gallery-overlay,
    .rp-gallery-zoom,
    .rp-lightbox,
    .rp-lightbox-close,
    .rp-lightbox-nav {
        transition: none;
    }
}