/* ============================================================
   Gallery.css — Fluid Component Grid Extensions
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #f2faf5;
    --surface-white: #ffffff;
    --text-dark: #111827;
    --text-muted: #4b5563;
    --text-light: #9ca3af;
    --brand-green-deep: #14532d;
    --brand-green-mid: #047857;
    --brand-green-accent: #16a34a;
    --radius-lg: 1.2rem;
    --radius-md: 0.75rem;
    --radius-sm: 0.5rem;
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    overflow-x: hidden;
    color: var(--text-dark);
}

/* ── Gallery Core Wrapper Area ── */
.gp-sec-1 {
    width: 100%;
    min-height: 100vh;
    padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 5vw, 6%);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ── Advanced Adaptive Header Element ── */
.gallery-header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 2rem;
    padding: clamp(2rem, 5vw, 4.5rem) clamp(1.5rem, 5vw, 6%);
    background-image: linear-gradient(
        15deg,
        rgba(151, 34, 34, 0.15) 0% ,
        rgba(97, 46, 46, 0) 50%,
        rgba(20, 122, 75, 0) 50%,
        rgba(20, 122, 75, 0.25) 100%
    ), 
    url("../../images/gallery/gallery-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-bottom: 1px solid rgba(4, 120, 87, 0.1);
}

.header-left {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--brand-green-accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.breadcrumbs .active {
    color: var(--text-muted);
}

.gallery-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: var(--brand-green-deep);
    font-weight: 800;
    margin: 0.5rem 0;
    line-height: 1.15;
}

.gallery-subtitle {
    color: var(--text-muted);
    max-width: 650px;
    line-height: 1.7;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
}

/* ── Interactive 3D Stack Artworks ── */
.header-right-nothing {
    position: relative;
    width: 150px;
    height: 150px;
    perspective: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right-artwork {
    position: absolute;
    padding: 12px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: var(--transition-smooth);
    transform-style: preserve-3d;
}

.header-right-artwork svg {
    display: block;
    width: clamp(70px, 10vw, 90px);
    height: clamp(70px, 10vw, 90px);
}

.header-right-artwork.card-1 {
    z-index: 1;
    transform: rotateZ(-12deg) rotateX(15deg) translate3d(0, 0, 0);
}

.header-right-artwork.card-2 {
    z-index: 2;
    transform: rotateZ(8deg) rotateX(10deg) translate3d(20px, 10px, 15px);
}

.header-right-nothing:hover .header-right-artwork.card-1 {
    transform: rotateZ(-26deg) rotateX(5deg) translate3d(-20px, -8px, 10px);
}

.header-right-nothing:hover .header-right-artwork.card-2 {
    z-index: 3;
    transform: rotateZ(22deg) rotateX(5deg) translate3d(40px, 8px, 30px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.18);
}

/* ── Structural Central Workspace Frame ── */
#whole {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: clamp(1rem, 3vw, 2.5rem);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.02);
}

/* ── Modern Scrollable Tab Container ── */
.category-tabs-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.category-tabs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem 0.25rem 0.5rem 0.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: #f3f4f6;
    border: none;
    outline: none;
    padding: 0.65rem 1.4rem;
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    background: var(--brand-green-mid);
    color: var(--surface-white);
    box-shadow: 0 4px 14px rgba(4, 120, 87, 0.3);
}

.tab-btn:hover:not(.active) {
    background: #e5e7eb;
    color: var(--text-dark);
}

/* ── Advanced Autogrow CSS Grid Layout ── */
.events-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: clamp(1rem, 2vw, 1.75rem);
    padding: 0.5rem 0;
}

/* ── Premium Interactive Cards ── */
.album-card-item {
    display: flex;
    flex-direction: column;
    background: var(--surface-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid #f0f0f0;
}

.album-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #e5e7eb;
}

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

.card-overlay-actions {
    position: absolute;
    inset: 0;
    background: rgba(20, 83, 45, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-smooth);
    backdrop-filter: blur(2px);
}

.view-album-badge {
    background: var(--surface-white);
    color: var(--brand-green-deep);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    transform: translateY(15px);
    transition: var(--transition-smooth);
}

.album-card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(4, 120, 87, 0.08);
    border-color: rgba(4, 120, 87, 0.15);
}

.album-card-item:hover .album-img-wrapper img {
    transform: scale(1.08);
}

.album-card-item:hover .card-overlay-actions {
    opacity: 1;
}

.album-card-item:hover .view-album-badge {
    transform: translateY(0);
}

.album-details {
    padding: 1rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.album-details h3 {
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.album-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px dashed #f0f0f0;
    padding-top: 0.5rem;
}

.meta-date, .meta-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-date i, .meta-count i {
    color: var(--brand-green-accent);
}

/* Fallback Design */
.no-records-fallback {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-light);
    padding: 5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.no-records-fallback i {
    font-size: 3rem;
    color: #e5e7eb;
}

/* ── View More Pagination Element ── */
.pagination-footer-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
}

.viewMore-global-btn {
    background-color: var(--brand-green-mid);
    padding: 0.75rem 2.25rem;
    border-radius: 50px;
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    font-weight: 600;
    color: var(--surface-white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(4, 120, 87, 0.2);
    transition: var(--transition-smooth);
}

.viewMore-global-btn:hover {
    background-color: #065f46;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(4, 120, 87, 0.3);
}

/* ── Branding Footer Panel ── */
.gallery-footer-branding {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 3vw, 2rem);
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    border: 1px solid rgba(0, 0, 0, 0.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.branding-icon-box {
    background: #dcfce7;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.branding-text-content h4 {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    color: var(--brand-green-deep);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.branding-text-content p {
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0.5rem;
}

.branding-text-content strong {
    font-size: clamp(0.85rem, 1.3vw, 0.95rem);
    color: var(--brand-green-mid);
}

/* ==========================================================================
   RE-ENGINEERED PREMIUM MODAL VIEW SYSTEM (Matches Single-Column Blueprint)
   ========================================================================== */

/* 1. Modal Overlay Backdrop Background */
.gallery-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 12, 0.96); /* Deep dark velvet backdrop masking */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.25rem, 2vw, 1.5rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Open state modifier trigger */
.gallery-modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* 2. Central Modal Card Box Frame */
.gallery-modal {
    background: #ffffff;
    border-radius: 24px;
    width: 100%;
    max-width: 620px; /* Forces uniform, perfectly balanced card form factor */
    max-height: 94vh;
    overflow-y: auto; /* Independent safe modal scroll layout pipeline fallback */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transform: scale(0.97) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: flex;
    flex-direction: column; /* Forces top-down single column stacking order */
}

.gallery-modal-overlay.open .gallery-modal {
    transform: scale(1) translateY(0);
}

/* 3. Floating Window Close Trigger Icon Button */
.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    z-index: 1010;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-close-btn:hover {
    background: #ffffff;
    transform: scale(1.08) rotate(90deg);
    color: #ef4444;
}

/* 4. Top Component Node: Slider Frame Canvas Core Box */
.modal-left {
    width: 100%;
    background: #090d16;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Bounded Media Viewport Frame Layer */
.modal-viewport-wrapper {
    position: relative;
    width: 100%;
    background: #020408;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 16 / 9; /* Guarantees high-precision landscape geometry constraints */
}

/* Main Display Asset Element Target */
.modal-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Perfectly maps pixels across layout frame with zero dead spaces */
    display: block;
    transition: opacity 0.2s ease-in-out;
}

/* Carousel Control Navigation Array Handles */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 20;
    color: #111827;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.modal-nav-btn:hover {
    background: #ffffff;
    color: #047857; /* Smooth match into context branding color schemes */
    transform: translateY(-50%) scale(1.05);
}
.modal-nav-btn.prev { left: 12px; }
.modal-nav-btn.next { right: 12px; }

/* Horizontal Slider Navigation Strip Track Layout */
.modal-thumbnails {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: #0b101d;
    overflow-x: auto;
    scrollbar-width: none; /* Disables ambient scroll track bar aesthetics */
}
.modal-thumbnails::-webkit-scrollbar {
    display: none;
}

.modal-thumb {
    width: 65px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.4;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-thumb.active {
    border-color: #16a34a; /* Distinct highlight outline boundary indicators */
    opacity: 1;
    transform: scale(1.02);
}

.modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 5. Bottom Component Node: Text Presentation Context Block Panels */
.modal-right {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #ffffff;
}

.modal-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-event-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.modal-event-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.modal-divider { 
    color: #e5e7eb; 
}

.modal-event-desc {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
}

/* Feature Grid Container Block Highlights Panel */
.modal-highlights {
    background: #f0fdf4;
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid #047857;
}

.modal-highlights h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #14532d;
    margin-bottom: 0.75rem;
}

.modal-highlights ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-highlights ul li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4b5563;
}

/* Injects custom inline checkmarks dynamically using inline encoding vectors */
.modal-highlights ul li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #16a34a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center;
    background-size: 10px;
    flex-shrink: 0;
}

/* 6. Desktop Specific Scaling Rule Override */
@media (min-width: 1025px) {
    .gallery-modal {
        max-width: 800px; /* Allows a wider profile layout on large workstation monitors */
    }
    .modal-viewport-wrapper {
        aspect-ratio: 16 / 8.5; /* Slightly scales viewport index depth to remain elegantly above desktop fold lines */
    }
}
/* ================================================================
   Comprehensive Media Queries (All Viewports Coverage)
   ================================================================ */

/* Medium Devices (Tablets, iPads) */
@media (max-width: 1024px) {
    .gallery-modal {
        grid-template-columns: 1fr; /* Switch to dynamic stacked block presentation */
        max-width: 680px;
        max-height: 90vh;
    }
    
    .modal-left {
        height: 48vh; /* Fixed balance for picture viewport height track */
    }
    
    .modal-main-img {
        max-height: 40vh;
    }
    
    .modal-right {
        height: auto;
        overflow-y: visible; /* Use modal's general master scroll flow instead */
    }
}

/* Small Devices (Landscape Phones & Small Tablets) */
@media (max-width: 820px) {
    .gallery-header {
        grid-template-columns: 1fr;
        justify-content: center;
        text-align: center;
    }
    
    .gallery-subtitle {
        margin: 0 auto;
    }
    
    .header-right-nothing {
        margin: 0 auto;
    }
}

/* Micro Devices (Smartphones, Portrait Viewports) */
@media (max-width: 600px) {
    .gp-sec-1 {
        padding: 1.5rem 1rem;
    }
    
    .gallery-header {
        padding: 2.5rem 1rem;
    }
    
    .header-left {
        padding: 1.25rem;
    }
    
    .gallery-footer-branding {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    /* Optimize slider elements for smaller touch viewports */
    .modal-left {
        height: 38vh;
    }
    
    .modal-nav-btn {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
    
    .modal-thumb {
        width: 65px;
        height: 48px;
    }
    
    .modal-close-btn {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }
}