/* ==========================================================================
   GALLERY.CSS - Dynamic Gallery & Cloudinary Image Grid Styles
   Court Marriage Guwahati | cloudinary-powered gallery
   ========================================================================== */

/* ── Gallery Section ─────────────────────────────────────────────────── */
.gallery-grid-section {
    padding: 60px 0 80px;
    background: #f0f4f8;
}

/* ── Filter Pills ────────────────────────────────────────────────────── */
.gallery-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
}

.gallery-tab {
    padding: 10px 22px;
    border-radius: 50px;
    border: 2px solid #d0d9e8;
    background: #ffffff;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.3px;
}

.gallery-tab:hover {
    border-color: #0b3d91;
    color: #0b3d91;
    background: rgba(11, 61, 145, 0.06);
    transform: translateY(-2px);
}

.gallery-tab.active {
    background: linear-gradient(135deg, #04132b, #0b3d91);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(11, 61, 145, 0.3);
    transform: translateY(-2px);
}

/* ── Stats Bar ───────────────────────────────────────────────────────── */
.gallery-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding: 14px 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.gallery-count-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.gallery-count-label strong {
    color: #0b3d91;
    font-weight: 700;
}

.gallery-view-toggles {
    display: flex;
    gap: 6px;
}

.view-toggle-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}

.view-toggle-btn.active,
.view-toggle-btn:hover {
    background: #0b3d91;
    color: #fff;
    border-color: #0b3d91;
}

/* ── Gallery Grid ────────────────────────────────────────────────────── */
.gallery-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    min-height: 200px;
    position: relative;
}

.gallery-grid-container.masonry-view {
    columns: 3;
    gap: 20px;
    display: block;
}

.gallery-grid-container.masonry-view .gallery-card {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* ── Gallery Card (Seamless Image Card — No Borders/Padding) ────────── */
.gallery-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background: #091322;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    aspect-ratio: 4 / 3;
}

.gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(4, 19, 43, 0.16);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-card:hover img {
    transform: scale(1.06);
}

/* Floating Pill Badge (Top Left of Image) */
.gallery-pill-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background: rgba(255, 255, 255, 0.92);
    color: #0b3d91;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 11px;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    backdrop-filter: blur(6px);
}

/* Card Hover Overlay with Center Zoom Circle + Title Banner */
.gallery-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 19, 43, 0.35);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.gallery-card:hover .gallery-card-overlay {
    opacity: 1;
}

.gallery-zoom-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: #0b3d91;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin: auto;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.gallery-card:hover .gallery-zoom-trigger {
    transform: scale(1.1);
    background: #ffffff;
    color: #c59b27;
}

.gallery-card-title-banner {
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
    padding: 12px 14px 10px;
    background: linear-gradient(to top, rgba(4,19,43,0.95) 0%, transparent 100%);
    border-radius: 0 0 14px 14px;
    margin: -16px;
}

/* ── Cloudinary Badge ────────────────────────────────────────────────── */
.cloudinary-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(4, 19, 43, 0.8);
    color: #c59b27;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
}

/* ── Skeleton Loading ─────────────────────────────────────────────────── */
.gallery-skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 18px;
    aspect-ratio: 4/3;
}

@keyframes shimmer {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* ── Empty State ─────────────────────────────────────────────────────── */
.gallery-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.gallery-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: #c7d0dc;
}

.gallery-empty-state h3 {
    font-size: 18px;
    color: #64748b;
    margin-bottom: 8px;
}

.gallery-empty-state p {
    font-size: 14px;
}

/* ── Cloudinary Load More ─────────────────────────────────────────────── */
.gallery-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 32px;
    background: linear-gradient(135deg, #04132b, #0b3d91);
    color: #fff;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(11, 61, 145, 0.3);
}

/* ── Lightbox Split-Card Modal (Matching Desktop & Mobile Screenshot 3) ── */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
}

.lightbox-card-dialog {
    position: relative;
    z-index: 10;
    display: flex;
    width: 90%;
    max-width: 860px;
    height: 490px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    animation: lightboxPopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lightboxPopIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.lightbox-media-col {
    flex: 1.25;
    position: relative;
    background: #08101e;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

/* Close button inside top-right of media column */
.lightbox-close-circle {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-close-circle:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: transparent;
    transform: scale(1.1);
}

/* Left & Right navigation arrows overlapping image boundaries */
.lightbox-arrow-prev,
.lightbox-arrow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    color: #0b3d91;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
}

.lightbox-arrow-prev {
    left: 14px;
}

.lightbox-arrow-next {
    right: 14px;
}

.lightbox-arrow-prev:hover,
.lightbox-arrow-next:hover {
    background: #0b3d91;
    color: #ffffff;
    transform: translateY(-50%) scale(1.12);
}

.lightbox-info-col {
    flex: 0.95;
    background: #ffffff;
    padding: 36px 30px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.lightbox-info-main {
    display: flex;
    flex-direction: column;
}

.lightbox-category {
    font-size: 11px;
    color: #c59b27;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
}

.lightbox-title {
    font-size: 21px;
    font-weight: 800;
    color: #04132b;
    line-height: 1.35;
    margin-bottom: 12px;
}

.lightbox-caption {
    font-size: 13.5px;
    color: #475569;
    line-height: 1.65;
}

.lightbox-counter {
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    display: inline-block;
    width: fit-content;
    margin-top: 24px;
}

/* ── Lightbox Mobile Responsiveness (Matching Mobile Screenshot 3) ────── */
@media (max-width: 768px) {
    .lightbox-card-dialog {
        flex-direction: column;
        height: auto;
        max-height: 88vh;
        width: 90%;
        max-width: 380px;
        border-radius: 24px;
        overflow-y: auto;
    }

    .lightbox-media-col {
        height: 240px;
        flex: none;
        position: relative;
    }

    .lightbox-arrow-prev,
    .lightbox-arrow-next {
        top: calc(240px - 2px);
        transform: translateY(-50%);
        width: 44px;
        height: 44px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
    }

    .lightbox-arrow-prev {
        left: 14px;
    }

    .lightbox-arrow-next {
        right: 14px;
    }

    .lightbox-arrow-prev:hover,
    .lightbox-arrow-next:hover {
        transform: translateY(-50%) scale(1.08);
    }

    .lightbox-info-col {
        padding: 28px 22px 24px;
    }

    .lightbox-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .lightbox-caption {
        font-size: 13px;
    }

    .lightbox-counter {
        margin-top: 18px;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .gallery-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .gallery-grid-container.masonry-view {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .gallery-grid-section { padding: 30px 0 50px; }
    .gallery-filter-tabs { gap: 8px; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; padding-bottom: 8px; }
    .gallery-tab { padding: 8px 16px; font-size: 13px; flex-shrink: 0; }
    .gallery-grid-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .gallery-grid-container.masonry-view {
        columns: 1 !important;
    }
    .gallery-card {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: 4 / 3;
    }
    .gallery-stats-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid-container {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    .gallery-grid-container.masonry-view {
        columns: 1 !important;
        gap: 18px !important;
    }
}
