﻿
/* =====================================================
   PUBLIC PHOTO GALLERY
===================================================== */
.gallery-page,
.gallery-details-page {
    color: var(--temple-text, #33251c);
}

.gallery-hero,
.gallery-details-hero {
    padding: 65px 0 55px;
    background: linear-gradient(135deg, #430d0d, #6f1717 65%, #8f1d1d);
    color: #fff8e7;
    border-bottom: 4px solid var(--temple-gold, #d4a72c);
}

.gallery-mantra {
    color: #f2d477;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 14px;
}

.gallery-hero h1,
.gallery-details-hero h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    margin-bottom: 16px;
}

.gallery-hero-subtitle {
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.8;
    color: #fff1d4;
}

.gallery-hero-divider {
    margin-top: 25px;
    color: #f2d477;
    letter-spacing: 2px;
}

.gallery-albums-section,
.gallery-details-content {
    padding: 65px 0;
    background: var(--temple-paper, #fffdf7);
}

.gallery-section-heading {
    max-width: 720px;
    margin: 0 auto 42px;
}

.gallery-eyebrow {
    color: var(--temple-saffron, #d97706);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    font-weight: 700;
}

.gallery-section-heading h2 {
    color: var(--temple-maroon, #6f1717);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    margin: 12px 0;
}

.gallery-section-heading p {
    color: #756557;
    line-height: 1.8;
}

/* =====================================================
   ALBUM CARDS
===================================================== */

.gallery-album-card {
    height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eadfc9;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgb(67 13 13 / 7%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

    .gallery-album-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 28px rgb(67 13 13 / 13%);
    }

.gallery-album-image-link,
.gallery-media-image-link {
    display: block;
    text-decoration: none;
}

.gallery-album-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #f4ead7;
}

    .gallery-album-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.4s ease;
    }

.gallery-album-card:hover .gallery-album-image img {
    transform: scale(1.06);
}

.gallery-image-placeholder {
    display: flex;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: var(--temple-maroon, #6f1717);
}

    .gallery-image-placeholder i {
        font-size: 3rem;
    }

.gallery-image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgb(67 13 13 / 48%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-album-card:hover .gallery-image-overlay,
.gallery-album-image-link:focus-visible .gallery-image-overlay {
    opacity: 1;
}

.gallery-image-overlay span {
    border: 1px solid #f2d477;
    border-radius: 30px;
    padding: 10px 18px;
}

.gallery-photo-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgb(67 13 13 / 90%);
    color: #fff8e7;
    padding: 7px 11px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.gallery-album-content {
    padding: 22px;
}

.gallery-album-date {
    color: #8c6b3e;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.gallery-album-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
}

    .gallery-album-content h3 a {
        color: var(--temple-maroon, #6f1717);
        text-decoration: none;
    }

        .gallery-album-content h3 a:hover {
            color: var(--temple-saffron, #d97706);
        }

.gallery-album-description {
    color: #756557;
    line-height: 1.7;
    margin-bottom: 18px;
    overflow-wrap: anywhere;
}

.gallery-view-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--temple-maroon, #6f1717);
    font-weight: 700;
    text-decoration: none;
}

    .gallery-view-link:hover {
        color: var(--temple-saffron, #d97706);
    }

/* =====================================================
   ALBUM DETAILS
===================================================== */

.gallery-back-link {
    display: inline-block;
    color: #f2d477;
    text-decoration: none;
    margin-bottom: 25px;
}

    .gallery-back-link:hover {
        color: #fff;
    }

.gallery-details-meta {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 20px 0;
    color: #fff1d4;
}

.gallery-details-description {
    max-width: 780px;
    margin: 0 auto;
    color: #fff1d4;
    line-height: 1.8;
}

/* =====================================================
   MEDIA GRID
===================================================== */

.gallery-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.gallery-media-card {
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #eadfc9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgb(67 13 13 / 7%);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

    .gallery-media-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 9px 22px rgb(67 13 13 / 12%);
    }

/*
   The image trigger can be an <a> or a <button>.
   These styles support the button-based lightbox.
*/

.gallery-media-image-link {
    position: relative;
    width: 100%;
    height: 260px;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #f4ead7;
    text-align: left;
    cursor: zoom-in;
}

    .gallery-media-image-link img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

    .gallery-media-image-link:hover img {
        transform: scale(1.04);
    }

    .gallery-media-image-link:focus-visible {
        outline: 3px solid var(--temple-gold, #d4a72c);
        outline-offset: -3px;
    }

.gallery-media-zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 9px;
    border-radius: 50%;
    color: #fff;
    background: rgb(67 13 13 / 88%);
    pointer-events: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-media-image-link:hover .gallery-media-zoom {
    background: var(--temple-maroon, #6f1717);
    transform: scale(1.08);
}

.gallery-media-video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #1b1b1b;
    object-fit: contain;
}

.gallery-media-caption {
    padding: 13px 15px;
    color: #5c4636;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* =====================================================
   IMAGE LIGHTBOX / IMAGE VIEWER
===================================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 65px 85px 35px;
    background: rgb(12 8 6 / 96%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

    .gallery-lightbox.is-open {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

/* Prevent background scrolling while the viewer is open */

body.gallery-lightbox-open {
    overflow: hidden;
}

/* Main image and caption container */

.gallery-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

    .gallery-lightbox-content img {
        display: block;
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: calc(100% - 65px);
        object-fit: contain;
        border-radius: 4px;
        box-shadow: 0 10px 40px rgb(0 0 0 / 45%);
        user-select: none;
        -webkit-user-drag: none;
    }

.gallery-lightbox-caption {
    max-width: 900px;
    margin: 15px 0 5px;
    color: #fff8e7;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
}

.gallery-lightbox-counter {
    display: block;
    color: #e8d5bb;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* Shared styles for lightbox controls */

.gallery-lightbox-close,
.gallery-lightbox-nav {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff8e7;
    background: rgb(255 255 255 / 12%);
    border: 1px solid rgb(255 255 255 / 25%);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

    .gallery-lightbox-close:hover,
    .gallery-lightbox-nav:hover {
        color: #fff;
        background: var(--temple-maroon, #6f1717);
        border-color: var(--temple-gold, #d4a72c);
    }

    .gallery-lightbox-close:focus-visible,
    .gallery-lightbox-nav:focus-visible {
        outline: 3px solid var(--temple-gold, #d4a72c);
        outline-offset: 3px;
    }

/* Close button */

.gallery-lightbox-close {
    top: 18px;
    right: 22px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 1.4rem;
}

/* Previous and next buttons */

.gallery-lightbox-nav {
    top: 50%;
    width: 50px;
    height: 60px;
    border-radius: 8px;
    font-size: 1.25rem;
    transform: translateY(-50%);
}

    .gallery-lightbox-nav:hover {
        transform: translateY(-50%) scale(1.05);
    }

.gallery-lightbox-prev {
    left: 20px;
}

.gallery-lightbox-next {
    right: 20px;
}

/* Disable navigation if there is only one image */

.gallery-lightbox-nav:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* =====================================================
   EMPTY STATE
===================================================== */

.gallery-empty-state {
    max-width: 600px;
    margin: 25px auto;
    padding: 45px 20px;
    background: #fff;
    border: 1px dashed #d9c6a5;
    border-radius: 12px;
}

.gallery-empty-icon {
    color: var(--temple-saffron, #d97706);
    font-size: 3rem;
    margin-bottom: 18px;
}

.gallery-empty-state h3 {
    color: var(--temple-maroon, #6f1717);
    font-weight: 700;
}

.gallery-empty-state p {
    color: #756557;
    line-height: 1.8;
}

/* =====================================================
   NAVIGATION BUTTON
===================================================== */

.gallery-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 12px;
    padding: 11px 20px;
    border-radius: 6px;
    background: var(--temple-maroon, #6f1717);
    color: #fff8e7;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
}

    .gallery-back-button:hover {
        background: var(--temple-dark-maroon, #430d0d);
        color: #fff;
    }

.gallery-details-bottom {
    margin-top: 40px;
}

/* =====================================================
   DEVOTIONAL FOOTER
===================================================== */

.gallery-devotional-footer {
    padding: 35px 0;
    background: #fff4df;
    border-top: 1px solid #ead8b6;
}

    .gallery-devotional-footer p {
        color: var(--temple-saffron, #d97706);
        margin-bottom: 8px;
    }

    .gallery-devotional-footer h2 {
        color: var(--temple-maroon, #6f1717);
        font-size: 1.5rem;
        font-weight: 700;
    }

    .gallery-devotional-footer span {
        color: #756557;
        font-size: 0.9rem;
    }

/* =====================================================
   RESPONSIVE LAYOUTS
===================================================== */

@media (max-width: 991.98px) {
    .gallery-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-lightbox {
        padding-right: 70px;
        padding-left: 70px;
    }

    .gallery-lightbox-prev {
        left: 12px;
    }

    .gallery-lightbox-next {
        right: 12px;
    }
}

@media (max-width: 575.98px) {
    .gallery-hero,
    .gallery-details-hero {
        padding: 45px 0 38px;
    }

    .gallery-albums-section,
    .gallery-details-content {
        padding: 40px 0;
    }

    .gallery-album-image {
        height: 220px;
    }

    .gallery-album-content {
        padding: 18px;
    }

    .gallery-media-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gallery-media-image-link {
        height: 250px;
    }

    .gallery-media-video {
        aspect-ratio: 4 / 3;
    }

    /* Mobile image viewer */

    .gallery-lightbox {
        padding: 60px 10px 90px;
    }

    .gallery-lightbox-content img {
        max-width: 100%;
        max-height: calc(100% - 75px);
    }

    .gallery-lightbox-close {
        top: 10px;
        right: 10px;
        width: 42px;
        height: 42px;
    }

    .gallery-lightbox-nav {
        top: auto;
        bottom: 18px;
        width: 46px;
        height: 46px;
        transform: none;
    }

        .gallery-lightbox-nav:hover {
            transform: scale(1.05);
        }

    .gallery-lightbox-prev {
        left: 20px;
    }

    .gallery-lightbox-next {
        right: 20px;
    }

    .gallery-lightbox-caption {
        max-width: 80%;
        margin-top: 12px;
        font-size: 0.9rem;
    }

    .gallery-lightbox-counter {
        font-size: 0.8rem;
    }
}

/* =====================================================
   ACCESSIBILITY: REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .gallery-album-card,
    .gallery-album-image img,
    .gallery-media-card,
    .gallery-media-image-link img,
    .gallery-media-zoom,
    .gallery-lightbox,
    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        transition: none;
    }
}


/* =====================================================
   FIX: GALLERY DETAILS HERO ALIGNMENT
===================================================== */
.gallery-details-hero-compact .container {
    text-align: center;
}

.gallery-details-hero-compact .gallery-back-link {
    display: block;
    width: fit-content;
    margin: 0 auto 15px;
}

.gallery-details-heading {
    width: 100%;
    text-align: center;
}

.gallery-details-hero-compact .gallery-mantra {
    text-align: center;
    margin-bottom: 8px;
}

.gallery-details-hero-compact h1 {
    text-align: center;
    margin: 0 0 12px;
}

.gallery-details-hero-compact .gallery-details-meta {
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.gallery-details-hero-compact .gallery-details-description {
    margin: 10px auto 0;
    text-align: center;
}

@media (max-width: 575.98px) {
    .gallery-details-hero-compact .gallery-back-link {
        margin-bottom: 12px;
    }

    .gallery-details-hero-compact .gallery-details-meta {
        flex-direction: column;
        gap: 8px;
    }
}


/* =====================================================
   GALLERY DETAILS HEADER - NO HERO
===================================================== */
.gallery-album-header {
    padding: 22px 0 28px;
    background: var(--temple-paper, #fffdf7);
    border-bottom: 1px solid #eadfc9;
}

.gallery-album-header .gallery-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    color: var(--temple-maroon, #6f1717);
    font-weight: 600;
}

    .gallery-album-header .gallery-back-link:hover {
        color: var(--temple-saffron, #d97706);
    }

.gallery-album-heading {
    text-align: center;
}

    .gallery-album-heading h1 {
        color: var(--temple-maroon, #6f1717);
        font-size: clamp(1.7rem, 3vw, 2.4rem);
        font-weight: 700;
        margin-bottom: 10px;
        overflow-wrap: anywhere;
    }

.gallery-album-header .gallery-details-meta {
    justify-content: center;
    gap: 8px 20px;
    margin: 10px 0;
    color: #756557;
    font-size: 0.9rem;
}

.gallery-album-header .gallery-details-description {
    max-width: 760px;
    margin: 10px auto 0;
    color: #756557;
    line-height: 1.7;
}

@media (max-width: 575.98px) {
    .gallery-album-header {
        padding: 16px 0 20px;
    }

        .gallery-album-header .gallery-back-link {
            margin-bottom: 14px;
            font-size: 0.9rem;
        }

    .gallery-album-heading h1 {
        font-size: 1.65rem;
    }

    .gallery-album-header .gallery-details-meta {
        gap: 8px 14px;
    }
}

```css
/* =====================================================
   FIX: PHOTOS & VIDEOS TOOLBAR ALIGNMENT
===================================================== */
.gallery-album-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
    margin-bottom: 28px;
}

.gallery-album-toolbar > div {
    min-width: 0;
}

.gallery-album-toolbar h2 {
    margin: 5px 0 0;
    line-height: 1.25;
}

.gallery-toolbar-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 8px;
    white-space: nowrap;
    width: auto;
    margin: 0;
    padding: 9px 14px;
    border: 1px solid #d9c6a5;
    border-radius: 6px;
    color: var(--temple-maroon, #6f1717);
    background: #fff;
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
}

    .gallery-toolbar-back:hover {
        color: #fff;
        background: var(--temple-maroon, #6f1717);
    }

@media (max-width: 575.98px) {
    .gallery-album-toolbar {
        gap: 10px;
        margin-bottom: 20px;
    }

        .gallery-album-toolbar h2 {
            font-size: 1.3rem;
        }

    .gallery-toolbar-back {
        gap: 6px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
}

/* =====================================================
   GALLERY PAGINATION
===================================================== */
.gallery-pagination {
    margin-top: 45px;
}

.gallery-pagination .pagination {
    gap: 6px;
    margin-bottom: 15px;
}

.gallery-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 42px;
    min-height: 42px;
    padding: 9px 13px;
    color: var(--temple-maroon, #6f1717);
    background: #fff;
    border: 1px solid #eadfc9;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: none;
}

    .gallery-pagination .page-link:hover {
        color: #fff;
        background: var(--temple-maroon, #6f1717);
        border-color: var(--temple-maroon, #6f1717);
    }

.gallery-pagination .page-item.active .page-link {
    color: #fff8e7;
    background: var(--temple-maroon, #6f1717);
    border-color: var(--temple-maroon, #6f1717);
}

.gallery-pagination .page-item.disabled .page-link {
    color: #aa9c8e;
    background: #f7f2e9;
    border-color: #eadfc9;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-pagination-summary {
    margin: 0;
    color: #756557;
    font-size: 0.9rem;
}

@media (max-width: 575.98px) {
    .gallery-pagination {
        margin-top: 30px;
    }

        .gallery-pagination .pagination {
            gap: 4px;
        }

        .gallery-pagination .page-link {
            min-width: 36px;
            min-height: 38px;
            padding: 7px 10px;
            font-size: 0.9rem;
        }
}



