:root {
    --bg: #ffffff;
    --fg: #111111;
    --surface: #f9f9f9;
    --border: #e0e0e0;
    /* Pastel accents for animations */
    --accent-peach: #ffd3c2;
    --accent-mint: #bbf0d0;
    --accent-lavender: #d4c2fa;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Original Paper effect background */
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(255, 77, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(0, 0, 0, 0.03) 0%, transparent 50%);
    position: relative;
    overflow-x: hidden;
}

/* Scanline effect for flair */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.05) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.2;
    z-index: 9999;
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), visibility 0.8s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    animation: preloaderPulse 2.5s ease-in-out infinite;
}

.preloader-logo {
    width: 280px;
    max-width: 85vw;
    filter: drop-shadow(0 15px 30px rgba(0,0,0,0.08));
}

.preloader-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.03);
}

.preloader-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-mint);
    transition: width 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.8; }
}

/* Header / Hero */
header {
    text-align: center;
    padding: 5rem 2rem 3rem;
    animation: fadeIn 1.5s ease-out forwards;
}

.logo-wrapper {
    margin-bottom: 2rem;
}

.logo {
    width: 150px;
    max-width: 100%;
    filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.1));
    opacity: 0;
    transition: opacity 0.5s ease;
}

.logo.landed {
    opacity: 1;
    animation: float 6s ease-in-out infinite;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.8s ease-out 0.5s forwards;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    color: #666;
    margin-top: 0.5rem;
    opacity: 0;
    animation: slideUp 0.8s ease-out 0.8s forwards;
}

.intro {
    font-size: 1rem;
    font-weight: 300;
    color: #555;
    max-width: 500px;
    margin: 1.5rem auto 0;
    line-height: 1.6;
    opacity: 0;
    animation: slideUp 1s ease-out 1s forwards;
}

/* Events Section */
.events-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-grow: 1;
}

.events-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    color: var(--fg);
    cursor: pointer;
    transition: color 0.3s ease;
    display: inline-block;
    width: 100%;
}

.events-section h2:hover {
    color: var(--accent-mint);
}

.events-section h2::after {
    content: ' ▼ Mode Déplié';
    font-size: 1rem;
    opacity: 0.5;
    font-weight: 300;
    float: right;
    margin-top: 0.5rem;
}

.events-section.feed-active h2::after {
    content: ' ▲ Mode Grille';
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.events-feed {
    display: none;
    flex-direction: column;
    gap: 15rem; /* Massive gap for editorial feel */
    padding-top: 5rem;
    padding-bottom: 10rem;
    width: 100%;
    align-items: stretch;
}

.feed-event {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.feed-event.visible {
    opacity: 1;
    transform: translateY(0);
}

.feed-info {
    padding: 0 2rem;
    max-width: 800px;
}

.feed-info h3 {
    font-size: clamp(3rem, 8vw, 5rem); /* Huge Apple-style typography */
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -3px;
    color: var(--fg);
}

.feed-desc {
    font-size: 1.3rem;
    color: #333;
    white-space: pre-wrap;
    line-height: 1.5;
    margin-bottom: 0;
    font-weight: 300;
    max-width: 650px;
}

@media (min-width: 900px) {
    .feed-event:nth-child(even) {
        align-items: flex-end;
    }

    .feed-event:nth-child(even) .feed-info {
        text-align: right;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }
}

.feed-media-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-flow: dense;
    gap: 3rem;
    padding: 0 2rem;
}

.feed-media-item {
    grid-column: span 12;
    background: transparent;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 40px 80px rgba(0,0,0,0.1);
    transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 1s ease;
    opacity: 0;
    transform: scale(0.95);
    animation: mediaIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes mediaIn {
    to { opacity: 1; transform: scale(1); }
}

.feed-media-item:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 0 50px 100px rgba(0,0,0,0.15);
}

.feed-media-item img, 
.feed-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 20px;
}

@media (min-width: 900px) {
    .feed-media-item { grid-column: span 4; aspect-ratio: 1/1; }
    .feed-media-item:nth-child(4n+1) { grid-column: span 8; aspect-ratio: 16/9; }
    .feed-media-item:nth-child(4n+4) { grid-column: span 12; aspect-ratio: 21/9; }
    .feed-media-item.ig-item { 
        grid-column: span 12 !important; 
        aspect-ratio: auto !important; 
        box-shadow: none;
    }
}

.feed-media-item.ig-item {
    background: transparent;
    display: flex;
    justify-content: center;
    min-height: auto;
    box-shadow: none;
    overflow: visible;
}

.feed-media-item.ig-item .instagram-media {
    margin: 0 !important;
}

@media (max-width: 768px) {
    .feed-media-grid {
        gap: 1.5rem;
        padding: 0 1rem;
    }
    .feed-media-item {
        grid-column: span 12;
        aspect-ratio: 4/3;
    }
}

/* Event Cards */
.event-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.event-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-lavender);
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

.event-image-container {
    width: 100%;
    height: 200px;
    background: #eee;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.event-card:hover .event-image {
    transform: scale(1.05);
}

.event-info {
    padding: 1.5rem;
}

.event-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.event-card:hover .event-title {
    color: #111;
}

.event-teaser {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.4s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 95vh;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
    border-color: rgba(0,0,0,0.1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: var(--fg);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--accent-peach);
    color: #111;
    border-color: transparent;
}

.modal-body {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-media-container {
    flex: 1.5;
    background: #000;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.modal-media-gallery {
    flex: 1;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

.modal-thumbnails {
    display: flex;
    gap: 10px;
    padding: 15px;
    overflow-x: auto;
    background: #111;
    border-top: 1px solid #222;
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .modal-thumbnails {
        padding: 10px;
        gap: 8px;
    }
    .modal-thumbnail {
        width: 50px;
        height: 50px;
    }
}

/* Hide scrollbar for thumbnails */
.modal-thumbnails::-webkit-scrollbar {
    height: 6px;
}
.modal-thumbnails::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.modal-thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: #222;
}

.modal-thumbnail:hover, .modal-thumbnail.active {
    opacity: 1;
    border-color: var(--accent-mint);
    transform: scale(1.05);
}

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

.media-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.media-blur-bg {
    position: absolute;
    top: -10%; 
    left: -10%;
    width: 120%; 
    height: 120%;
    background-size: cover;
    background-position: center;
    filter: blur(40px); /* Increased blur for more glass-like effect */
    opacity: 0.4; /* Slightly lower opacity */
    z-index: 0;
}

.media-slide img, .media-slide video {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* Added shadow to media to pop against blur */
}

.media-slide iframe, .media-slide .instagram-media {
    position: relative;
    z-index: 1;
    margin: auto !important;
    max-width: 540px !important; /* IG standard max width */
    width: 95% !important;
}

/* Removed feed-gallery as we now use grid */

.modal-info {
    flex: 1;
    padding: 2.5rem 2rem;
    background: var(--surface);
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-description {
    color: #444;
    line-height: 1.6;
    font-size: 1.05rem;
    white-space: pre-wrap;
}

/* Videos Section */
.videos-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 4rem auto;
}

.videos-section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    color: var(--fg);
}

.video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.lite-youtube {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.lite-youtube:hover {
    transform: scale(1.02);
}

.play-button {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 15px 0 15px 25px;
    border-color: transparent transparent transparent #111;
}

.lite-youtube:hover .play-button {
    background: var(--accent-peach);
    transform: scale(1.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Skeleton / Loading State */
.events-grid:empty {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.events-grid:empty::after, .events-grid:empty::before {
    content: '';
    height: 350px;
    background: linear-gradient(90deg, #f0f0f0 25%, #f8f8f8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s infinite;
    border-radius: 8px;
}

@keyframes skeleton {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@media (min-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    color: #888;
    font-size: 0.9rem;
}

.socials {
    margin-top: 1rem;
}

.socials a {
    color: var(--fg);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.3s ease;
}

.socials a:hover {
    color: #111;
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(1deg); }
}
