/**
 * Advanced Yearly Gallery - Responsive Master Layout
 * Configured with strict side-by-side dropdown rules matching image_3eacc6.png.
 */

#ayg-gallery-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

#ayg-gallery-wrapper *,
#ayg-gallery-wrapper *::before,
#ayg-gallery-wrapper *::after {
    box-sizing: border-box;
}

/* =========================================================================
   1. CONTROL BAR LAYOUT (Absolute 1-Row Force Rules)
   ========================================================================= */
#ayg-main-controls-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap !important; /* Strictly prevents the bar from breaking into 2 rows */
    gap: 16px;
    margin-bottom: 32px;
}

.ayg-filter-dropdowns-wrapper {
    display: flex;
    gap: 16px;
}

/* Rounded Search Bar Container */
.ayg-search-pill-container {
    position: relative;
    width: 320px;
    flex-shrink: 1; /* Allows search to shrink slightly if space is tight */
}

.ayg-search-pill-container input[type="text"]#ayg-main-card-search,
.ayg-search-pill-container input[type="text"]#ayg-timeline-search {
    width: 100% !important;
    background-color: #dbe1e6 !important;
    border: none !important;
    outline: none !important;
    padding: 12px 45px 12px 24px !important;
    border-radius: 50px !important;
    font-size: 1rem !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    height: 44px !important;
    transition: all 0.25s ease;
}

.ayg-search-pill-container .ayg-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #0f172a;
    font-size: 18px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dropdown Flex Wrapper (Strict single-row layout enforcement) */
.ayg-filter-buttons-group { 
    display: flex !important; 
    flex-direction: row !important; /* Forces side-by-side positioning */
    align-items: center !important; 
    gap: 12px !important;
    flex-wrap: nowrap !important; /* Denies any wrapping whatsoever */
    flex-shrink: 0 !important;
}

/* Absolute Reset on ANY nested wrapper divs (e.g., Avada/WPBakery custom forms) */
.ayg-filter-buttons-group > div,
.ayg-filter-buttons-group .ayg-custom-dropdown {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
}

/* Individual Selector Elements */
select#ayg-year-filter-dropdown.ayg-dropdown-trigger,
select#ayg-sort-dropdown.ayg-dropdown-trigger,
.ayg-filter-buttons-group select {
    display: inline-block !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background-color: #ffffff !important;
    padding: 10px 36px 10px 16px !important;
    border-radius: 12px !important;
    border: 1px solid #cbd5e1 !important;
    color: #1a3a6c !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    height: 44px !important;
    font-size: 0.9rem !important;
    min-width: 120px !important;
    width: auto !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%231a3a6c' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: calc(100% - 14px) center !important;
}

/* =========================================================================
   2. PRIMARY LEVEL MAIN SECTIONS GRID LAYOUT
   ========================================================================= */
.ayg-years-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: 0 auto;
    width: 100%;
}

.ayg-year-card {
    display: flex;
    background: #dbe3eb;
    border-radius: 28px;
    padding: 32px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    align-items: center;
    gap: 35px;
    width: 100%;
    transition: transform 0.2s ease;
}

.ayg-card-img {
    width: 45%;
    height: 320px;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    flex-shrink: 0;
}

.ayg-card-content {
    width: 55%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.ayg-card-content h2 {
    font-size: 2.2rem !important;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: #1a3a6c;
    line-height: 1.25;
}

.ayg-excerpt-text {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 24px;
}

.ayg-btn-view {
    background: #ffffff;
    color: #1a3a6c;
    border: none;
    padding: 12px 36px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.ayg-btn-view:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

/* =========================================================================
   3. INTERNAL INTERACTIVE SLIDER DOT INDICATORS (Alignment Fix)
   ========================================================================= */
.ayg-carousel-pagination-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 40px auto 0 auto !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
}

.ayg-carousel-pill {
    display: inline-flex !important;
    flex-direction: row !important;
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    border-radius: 50px !important;
    padding: 6px 12px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    margin: 0 auto !important;
    width: auto !important;
    min-width: 160px !important;
    box-sizing: border-box !important;
}

.ayg-carousel-nav {
    background: #1a3a6c !important;
    color: #ffffff !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.2s, transform 0.15s !important;
}

.ayg-carousel-nav:hover {
    background: #011a4f !important;
    transform: scale(1.05) !important;
}

.ayg-carousel-dots {
    display: flex !important;
    flex-direction: row !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.ayg-dot {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    user-select: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.ayg-dot.active {
    background: #1a3a6c !important;
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(26, 58, 108, 0.3) !important;
}

/* =========================================================================
   4. DEEP LEVEL EXPANDED SUB-GALLERY INNER STYLES
   ========================================================================= */
#ayg-tier-events-list {
    width: 100%;
}

.ayg-back-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-bottom: 15px;
}

.ayg-back-btn:hover { background: rgba(255, 255, 255, 0.25); }

.ayg-banner {
    width: 100%;
    height: 380px;
    background-size: cover;
    background-position: center;
    border-radius: 28px;
}

.ayg-banner-text {
    margin: 35px 0;
    color: #ffffff;
}

.ayg-banner-text h2 {
    color: #ffffff;
    font-size: 2.5rem !important;
    font-weight: 700;
    line-height: 1.3;
}

.ayg-month-section-block {
    margin-bottom: 45px;
}

.ayg-month-section-title {
    font-size: 2rem !important;
    color: #ffffff;
    font-weight: 700;
    margin: 0 0 20px 0;
    border-left: 5px solid #dbe3eb;
    padding-left: 14px;
}

.ayg-albums-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.ayg-album-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ayg-album-cover-wrap { cursor: pointer; }

.ayg-album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
}

.ayg-album-cover {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ayg-album-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 58, 108, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.25s ease;
    gap: 8px;
}

.ayg-album-card:hover .ayg-album-overlay { opacity: 1; }
.ayg-album-overlay .dashicons { font-size: 32px; width: 32px; height: 32px; }
.ayg-img-count { font-weight: 600; font-size: 0.95rem; }
.ayg-album-details { padding: 20px; }

.ayg-album-details h3 {
    font-size: 1.25rem !important;
    margin: 0 0 8px 0;
    color: #1a3a6c;
    font-weight: 600;
}

.ayg-album-details p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* =========================================================================
   5. LIGHTBOX OVERLAY MODAL LAYOUT (Absolute Centering Override Strategy)
   ========================================================================= */
.ayg-lightbox-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(10, 17, 31, 0.95) !important;
    z-index: 999999 !important;
    display: none;
    box-sizing: border-box !important;
}

/* Overriding theme-forced layout structures by using a precise 50% absolute window tracking point */
.ayg-lightbox-window {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important; /* Force true coordinate centering independent of parent wrappers */
    width: auto !important;
    height: auto !important;
    max-width: 80% !important;
    max-height: 85vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000000 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ayg-lightbox-canvas {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}

.ayg-lightbox-canvas img {
    max-width: 100% !important;
    max-height: 85vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    display: block !important;
}

/* Fixed Layout Viewport Controls */
.ayg-lightbox-nav {
    position: fixed !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    width: 54px !important;
    height: 54px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 22px !important;
    z-index: 1000002 !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    margin: 0 !important;
}

.ayg-lightbox-nav:hover {
    background: #ffffff !important;
    color: #1a3a6c !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.ayg-nav-left { left: 40px !important; }
.ayg-nav-right { right: 40px !important; }

.ayg-lightbox-close {
    position: fixed !important;
    top: 30px !important;
    right: 40px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 38px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 1000005 !important;
    transition: color 0.2s ease !important;
    user-select: none !important;
}

.ayg-lightbox-close:hover { color: #ffffff !important; }

/* =========================================================================
   6. RESPONSIVENESS LAYER
   ========================================================================= */
@media(max-width: 1024px) {
    .ayg-albums-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

@media(max-width: 900px) {
    .ayg-year-card { flex-direction: column; align-items: flex-start; gap: 24px; padding: 24px; }
    .ayg-card-img { width: 100%; height: 280px; }
    .ayg-card-content { width: 100%; }
    .ayg-card-content h2 { font-size: 1.85rem !important; }
}

@media (max-width: 768px) {
    .ayg-lightbox-window {
        max-width: 90% !important;
    }
    .ayg-lightbox-nav {
        width: 42px !important;
        height: 42px !important;
        font-size: 16px !important;
    }
    .ayg-nav-left { left: 15px !important; }
    .ayg-nav-right { right: 15px !important; }
    .ayg-lightbox-close { top: 20px !important; right: 20px !important; }
}

@media(max-width: 600px) {
    #ayg-main-controls-bar { 
        flex-direction: column; 
        align-items: stretch;
        gap: 12px;
    }
    
    .ayg-search-pill-container { 
        width: 100%; 
    }
    
    .ayg-filter-buttons-group { 
        display: flex;
        flex-direction: row; 
        justify-content: space-between; 
        width: 100%; 
        gap: 10px;
    }

    select#ayg-year-filter-dropdown.ayg-dropdown-trigger,
    select#ayg-sort-dropdown.ayg-dropdown-trigger {
        flex: 1;
        min-width: 0; 
    }

    .ayg-year-card { border-radius: 20px; padding: 16px; }
    .ayg-card-img { height: 200px; border-radius: 14px; }
    .ayg-card-content h2 { font-size: 1.5rem !important; }
    .ayg-albums-grid { grid-template-columns: 1fr; }
    .ayg-album-cover { height: 180px; }
    .ayg-banner { height: 220px; border-radius: 16px; }
    .ayg-banner-text h2 { font-size: 1.5rem !important; }
    .ayg-lightbox-close { position: absolute !important; top: 20px !important; right: 20px !important; font-size: 32px; }
}

.ayg-filtered-out { display: none !important; }