/* Featured Events Section */

/* Smooth fade-in and slide-up animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured section container - no animation to prevent layout shift */
/* Space is reserved, only cards animate */

/* Stagger animation for accordion cards */
.accordion-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.accordion-card:nth-child(1) { animation-delay: 0.4s; }
.accordion-card:nth-child(2) { animation-delay: 0.5s; }
.accordion-card:nth-child(3) { animation-delay: 0.6s; }
.accordion-card:nth-child(4) { animation-delay: 0.7s; }
.accordion-card:nth-child(5) { animation-delay: 0.8s; }
.accordion-card:nth-child(6) { animation-delay: 0.9s; }
.accordion-card:nth-child(7) { animation-delay: 1.0s; }

/* --- Desktop View --- */
@media (min-width: 769px) {
    .featured-events-section {
        /* Remove old clip-path and fixed sizing */
        margin: 0;
        padding: 4rem 0;
    }
    
    /* Responsive adjustments for different screen sizes */
    @media (min-width: 1400px) {
        :root {
            --card-collapsed-preferred: 6vw; /* Slightly smaller on very wide screens */
        }
    }
    
    @media (max-width: 1200px) {
        :root {
            --card-collapsed-preferred: 8vw; /* Slightly larger on medium screens */
        }
    }
    
    @media (max-width: 900px) {
        :root {
            --card-collapsed-preferred: 9vw; /* Even larger on smaller desktop screens */
            --card-collapsed-max: 90px;
        }
    }

    .slider-container, .slider {
        width: 100%;
        height: 100%;
    }

    .slider .item {
        list-style-type: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-position: center;
        background-size: cover;
        transition: all 0.75s ease-in-out;
    }

    #featured-background {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-position: center;
        filter: blur(20px);
        opacity: 0.3;
        z-index: 1;
        transition: background-image 0.5s ease;
    }

    /* Featured Section Header */
    .featured-section-header {
        position: relative;
        z-index: 3;
        text-align: center;
        margin-bottom: 3rem;
    }

    .featured-title {
        font-size: clamp(2.5rem, 5vw, 3rem);
        font-family: var(--font-title-en); /* Use theme title font */
        font-weight: 700;
        margin: 0 0 1rem 0;
        color: var(--text-color); /* Use theme text color */
        letter-spacing: -0.02em;
    }

    .featured-subtitle {
        font-size: clamp(1rem, 2.5vw, 1.3rem);
        font-family: var(--font-body-en); /* Use theme body font */
        font-weight: 400;
        margin: 0;
        color: var(--text-color-light); /* Use theme light text color */
        max-width: 600px;
        margin: 0 auto;
        line-height: 1.4;
    }

    .slider .item.is-feature {
        z-index: 10;
        background: none !important;
    }

    .is-feature .feature-bubble {
        position: absolute;
        top: 50%;
        left: 5%;
        transform: translateY(-50%);
        width: 55%;
        height: 90%;
        border-radius: 20px;
        box-shadow: 0 15px 35px rgba(0,0,0,0.3);
        overflow: hidden;
        background-size: cover;
        background-position: center;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .is-feature .content {
        width: 100%;
        padding: 1.5rem 2rem;
        color: white;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 20%, transparent 100%);
        text-shadow: 0 2px 5px rgba(0,0,0,0.5);
        box-sizing: border-box;
    }

    .is-feature .content .event-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .is-feature .content .read-more-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .slider .item.is-preview {
        width: 200px;
        height: 250px;
        top: 50%;
        transform: translateY(-50%);
        border-radius: 20px;
        border: 3px solid var(--color-primary);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 5;
    }

    .is-preview .feature-bubble {
        display: none;
    }

    .is-preview.is-preview-1 { left: 70%; }
    .is-preview.is-preview-2 { left: calc(70% + 220px); }
    .is-preview.is-preview-3 { left: calc(70% + 440px); }
    .is-preview.is-preview-4 { left: calc(70% + 660px); }
    .is-preview.is-preview-5 { left: calc(70% + 880px); }
    .is-preview.is-preview-6 { left: calc(70% + 1100px); }

    .slider .item.is-hidden {
        opacity: 0;
        pointer-events: none;
    }

    .nav {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 20;
        display: flex;
        gap: 1rem;
    }

    .nav .btn {
        background-color: var(--color-primary);
        color: var(--button-text-color);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        font-size: 25px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s, color 0.3s;
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }

    .nav .btn:hover {
        background-color: var(--color-primary-light);
    }

    @media (max-width: 1200px) {
        .is-preview.is-preview-1 { left: 65%; }
        .is-preview.is-preview-2 { left: calc(65% + 220px); }
        .slider .item.is-preview-3,
        .slider .item.is-preview-4,
        .slider .item.is-preview-5,
        .slider .item.is-preview-6 { display: none; }
    }

    @media (max-width: 992px) {
        .is-feature .feature-bubble { width: 90%; left: 5%; }
        .slider .item.is-preview { display: none; }
    }

    [data-theme="dark"] .is-feature .content {
        background: rgba(0, 0, 0, 0.7);
    }
    [data-theme="dark"] .nav .btn {
        background-color: var(--color-quaternary);
    }
    [data-theme="dark"] .nav .btn:hover {
        background-color: var(--color-primary);
    }
}

.featured-events-section {
    position: relative;
    width: 100%;
    min-height: 60vh; /* Reduced from 100vh for better proportions */
    overflow: hidden;
    background-color: var(--background-color); /* Use theme background */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0; /* Reduced padding from 4rem to 3rem */
    margin: 2rem 0; /* Add spacing between sections */
}

/* --- CSS Custom Properties for Adaptive Sizing */
:root {
    --card-collapsed-min: 120px; /* Much wider minimum */
    --card-collapsed-preferred: 12vw; /* Much larger percentage of viewport */
    --card-collapsed-max: 200px; /* Much wider maximum */
    --card-expanded-multiplier: 3; /* Reduced to 3x since cards are now wider */
    --card-gap: clamp(12px, 1.5vw, 24px); /* Larger gaps */
    --container-max-width: 2400px; /* Much wider container */
}

/* Desktop Accordion Gallery */
.accordion-container {
    position: relative;
    z-index: 2;
    width: 95vw; /* Use 95% of viewport width - no artificial max limit */
    max-width: none; /* Allow growth when card expands */
    height: 50vh; /* Reduced from 70vh for more compact size */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Always center the container */
}

.accordion-gallery {
    display: flex;
    width: 100%;
    height: 100%;
    gap: var(--card-gap);
    align-items: flex-end;
    justify-content: center;
    padding: 0 clamp(10px, 2vw, 30px);
}

.accordion-card {
    position: relative;
    /* Adaptive collapsed width that scales with screen */
    flex: 0 0 clamp(var(--card-collapsed-min), var(--card-collapsed-preferred), var(--card-collapsed-max));
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    filter: grayscale(0.3) brightness(0.9);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); /* Reduced from 32px to 20px blur */
}

.accordion-card:hover {
    flex: 0 0 clamp(240px, calc(var(--card-collapsed-preferred) * var(--card-expanded-multiplier)), 400px);
    filter: grayscale(0) brightness(1);
    z-index: 10;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.accordion-card:hover ~ .accordion-card {
    flex: 0 0 clamp(100px, calc(var(--card-collapsed-preferred) * 0.85), 160px);
    filter: grayscale(0.8) brightness(0.7);
    transform: scale(0.95);
}

/* Staggered/Zigzag Heights - Adjusted for smaller container */
.accordion-card:nth-child(odd) {
    height: 85%; /* Reduced from 100% to fit in smaller container */
    align-self: flex-end;
}

.accordion-card:nth-child(even) {
    height: 85%; /* Reduced from 100% to fit in smaller container */
    align-self: flex-start;
    margin-top: 3%; /* Reduced gap for tighter zigzag */
}

/* Special positioning for middle cards to create more dynamic zigzag */
.accordion-card:nth-child(3),
.accordion-card:nth-child(5) {
    height: 85%; /* Reduced from 100% to fit in smaller container */
    align-self: center;
}

/* Ensure expanded cards maintain their zigzag position - HEIGHT UNCHANGED */
.accordion-card.expanded:nth-child(odd) {
    height: 85%; /* Same height as collapsed */
    align-self: flex-end;
}

.accordion-card.expanded:nth-child(even) {
    height: 85%; /* Same height as collapsed */
    align-self: flex-start;
    margin-top: 3%; /* Reduced gap for tighter zigzag */
}

.accordion-card.expanded:nth-child(3),
.accordion-card.expanded:nth-child(5) {
    height: 100%; /* Same height as collapsed */
    align-self: center;
    margin-top: 0;
}

.accordion-card.expanded {
    /* 4x expansion with adaptive sizing - WIDTH ONLY */
    flex: 0 0 clamp(240px, calc(var(--card-collapsed-preferred) * var(--card-expanded-multiplier)), 400px);
    /* HEIGHT STAYS THE SAME - no height changes */
    filter: grayscale(0) brightness(1);
    /* REMOVED: transform: translateY(-5px) - No vertical movement */
    z-index: 10;
    /* KEEP original zigzag position - no align-self override */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); /* Reduced from 60px to 30px blur */
}

.accordion-card.inactive {
    /* Much less compression - keep cards substantial when another expands */
    flex: 0 0 clamp(100px, calc(var(--card-collapsed-preferred) * 0.85), 160px);
    filter: grayscale(0.8) brightness(0.7);
    transform: scale(0.95);
}

.accordion-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: white;
    position: relative;
}

.accordion-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.accordion-card.expanded .accordion-content {
    transform: translateY(0);
}

.accordion-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) 0.1s;
}

.accordion-card.expanded .accordion-title {
    opacity: 1;
    transform: translateY(0);
}

.accordion-cta {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) 0.2s;
}

.accordion-card.expanded .accordion-cta {
    opacity: 1;
    transform: translateY(0);
}

.accordion-cta:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Mobile View --- */
@media (max-width: 768px) {
    .featured-events-section {
        margin: 1rem 0;
        min-height: 60vh;
        padding: 2rem 0;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
    }
    
    .featured-section-header {
        margin-bottom: 1.5rem;
        padding: 0 1rem;
        position: relative;
        z-index: 10;
        text-align: center;
    }

    .featured-section-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .featured-section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Hide desktop accordion on mobile */
    .accordion-gallery {
        display: none;
    }

    #featured-background {
        display: none;
    }

    /* Mobile accordion wrapper */
    .mobile-accordion-wrapper {
        position: relative;
        width: 100%;
        background: var(--color-background);
        padding: 10px 0;
        margin: 0;
    }

    /* Mobile accordion container */
    .mobile-accordion-container {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        position: relative;
        z-index: 1;
        padding: 0 1rem;
        background: transparent;
    }

    /* Mobile slider - vertical accordion */
    .slider-mobile-vertical {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 1rem 0;
        gap: 8px;
    }

    /* Mobile accordion card - vertical */
    .mobile-accordion-card-vertical {
        position: relative;
        width: 100%;
        background-size: cover;
        background-position: center;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 6px 12px rgba(0,0,0,0.3);
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        margin-bottom: 12px;
        cursor: pointer;
        z-index: 1;
        -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
        user-select: none; /* Prevent text selection */
        border: 1px solid rgba(255,255,255,0.1);
    }

    .mobile-accordion-card-vertical::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 100%);
        z-index: 0;
    }

    .mobile-accordion-card-vertical.collapsed {
        max-height: 50px;
    }

    .mobile-accordion-card-vertical.expanded {
        max-height: 300px;
    }
    
    /* Ensure card content is completely hidden when collapsed */
    .mobile-accordion-card-vertical.collapsed .mobile-accordion-content {
        visibility: hidden;
        height: 0;
        padding: 0;
        margin: 0;
        opacity: 0;
    }
    
    .mobile-accordion-card-vertical.expanded .mobile-accordion-content {
        visibility: visible;
        height: auto;
        padding: 0 1rem 1rem;
        margin: 0;
        opacity: 1;
        transition: opacity 0.3s ease-in-out;
    }

    /* Header for vertical accordion cards */
    .mobile-accordion-header {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 15px;
        position: relative;
        z-index: 2; /* Higher z-index to ensure it's clickable */
        color: white;
        height: 50px;
        box-sizing: border-box;
        cursor: pointer;
        width: 100%; /* Ensure it spans the full width */
    }

    .mobile-accordion-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
        color: white;
        text-shadow: 0 2px 4px rgba(0,0,0,0.6);
        opacity: 0;
        transform: translateY(15px);
        transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1) 0.1s;
    }

    .mobile-accordion-card-vertical.expanded .mobile-accordion-header h3 {
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-accordion-toggle {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        transition: transform 0.3s ease, background-color 0.3s ease;
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.5);
        cursor: pointer;
        z-index: 3;
    }
    
    .mobile-accordion-toggle:hover,
    .mobile-accordion-toggle:active {
        background-color: rgba(255, 255, 255, 0.5);
    }
    
    .mobile-accordion-toggle i {
        font-size: 20px;
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .mobile-accordion-card-vertical.expanded .mobile-accordion-toggle i {
        transform: rotate(180deg);
    }

    /* Content inside mobile accordion cards */
    .mobile-accordion-card-vertical .mobile-accordion-content {
        padding: 0 1rem 1rem;
        color: white;
        height: 0;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        position: relative;
        z-index: 1;
        pointer-events: none;
    }

    .mobile-accordion-card-vertical.expanded .mobile-accordion-content {
        height: auto;
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .mobile-accordion-desc {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        opacity: 0.9;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    }

    .mobile-accordion-cta {
        display: inline-block;
        background-color: var(--color-primary);
        color: white;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        transition: background-color 0.2s ease;
        text-shadow: none;
        border: 1px solid rgba(255,255,255,0.2);
    }

    .mobile-accordion-cta:hover {
        background-color: var(--color-primary-dark);
    }

    /* Dark theme adjustments */
    .dark-theme .mobile-accordion-cta {
        background-color: var(--color-accent);
        color: var(--color-dark);
    }

    .dark-theme .mobile-accordion-cta:hover {
        background-color: var(--color-accent-dark);
    }
}
/* End of mobile media query */
