/* =============================================
   0. VARIABLES DE COULEURS (NUANCIER)
   ============================================= */
:root {
    --bg-system: #e2e2e2;        /* Gris de fond et bordures de structure */
    --bg-content: #f9f5f2;       /* Crème/Blanc cassé des fonds de blocs */
    --accent-red: #ff0026;       /* Rouge principal (textes, boutons, bannières) */
    --shadow-color: rgba(0, 0, 0, 0.2);
    
}

/* =============================================
   1. BASE & RESET
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Acumin, sans-serif;
    background: var(--bg-system);
    overflow: hidden; 
}

@font-face {
    font-family: 'Staatliches-Regular';
    src: url('FONTS/Staatliches-Regular.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

#layout {
    display: grid;
    grid-template-columns: 20% 1fr;
    height: 100vh;
    width: 100%;
    background-color: var(--bg-system);
    overflow: hidden;
}

/* =============================================
   2. SIDEBAR (PC)
   ============================================= */
#sidebar {
    padding: 24px 90px 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    border: 8px solid var(--bg-system); 
    position: relative;
    z-index: 10;
    background: var(--bg-content);
    border-radius: 30px;
    transition: padding-bottom 0.3s ease;
}

.sidebar-top img.main-logo { max-width: 100px; }

.title-wrapper { position: relative; display: inline-block; }

.title-wrapper p {
    font-size: 14px;
    line-height: 1.2;
    color: var(--accent-red);
    margin-bottom: 20px;
}

.partenaires-wrapper h2 {
    font-size: 25px;
    margin: 0;
    color: var(--accent-red);
    font-family: 'Staatliches-Regular', Arial, sans-serif;
    line-height: 1.0;
    font-weight: normal;
    text-transform: uppercase;
}
.partenaires-wrapper p {
    font-family: Acumin, sans-serif;
    font-size: 10px;
    color: var(--accent-red);
}

.sidebar-link-btn {
    margin-left: auto;
    margin-right: 2px;
    padding: 8px 20px;
    background: var(--bg-content);
    border-radius: 25px;
    border: 4px solid transparent; 
    box-shadow: 0px 0px 2px 0px var(--shadow-color);
    
    text-decoration: none; 
    font-size: 18px;
    font-family: 'Staatliches-Regular',"Arial Black", sans-serif;
    font-weight: 500;
    letter-spacing: +0.03em;
    display: inline-block;
    transform-origin: center;
    line-height: 1;
    color: var(--accent-red);
}

.sidebar-link-btn:hover {
    border: 2px solid var(--accent-red);
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.sidebar-legal {
    order: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Acumin, sans-serif;
    font-size: 10px;
    gap: 5px;
}

.sidebar-legal-link {
    color: var(--accent-red);
    opacity: 0.6;
    text-decoration: none !important;
}

.sidebar-legal-separator {
    color: var(--accent-red);
    opacity: 0.6;
}

.sidebar-legal-link:hover { opacity: 1; }

.sidebar-socials {
    order: 1;
    display: flex;
    gap: 3px;
}

.sidebar-socials img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* =============================================
   3. GRILLE PRINCIPALE (PC)
   ============================================= */
#main {
    display: grid;
    grid-template-rows: 1fr 1fr;
    height: 100vh;
    margin-left: -8px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.row { display: grid; height: 100%; }
.row-top { grid-template-columns: 1fr 2fr; }
/* 1. On change la grille pour que la 2ème colonne s'adapte au contenu */
.row-bottom { 
    grid-template-columns: 1fr auto !important;
}

.frame {
    background: var(--bg-content);
    border: 8px solid var(--bg-system);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    margin-right: -8px;
    margin-bottom: -8px;
    z-index: 5;
}

.row-bottom .frame:last-child {
    width: auto !important; /* Force le ratio à décider de la largeur */
    margin-right: 0;
    margin-bottom: 0;
    height: 100%;
    aspect-ratio: 1 / 1; /* Carré par défaut */
    transition: aspect-ratio 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 6;
}

/* Extension au survol */
.row-bottom .frame:last-child:hover {
    aspect-ratio: 16 / 9;
}
.row .frame:last-child {
    width: 100%;
    margin-right: 0;
}

.row-bottom .frame {
    height: 100%;
    margin-bottom: 0;
}

.row-top .frame { z-index: 6; } 

.frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.frame.placeholder.cookies-refused { background: var(--bg-content); }
.blocked-msg {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-red); font-weight: bold;
    display: none; z-index: 20;
}
.frame.placeholder.cookies-refused .blocked-msg { display: block; }
.frame.placeholder.cookies-refused iframe { opacity: 0; pointer-events: none; }

/* =============================================
   4. BANNIERE COOKIES
   ============================================= */
#cookie-banner {
    position: fixed;
    bottom: 0; left: 0; width: 100%;
    background-color: var(--accent-red);
    color: var(--bg-content);
    padding: 20px;
    z-index: 9999;
    display: none;
    box-sizing: border-box;
}

.cookie-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.cookie-text { font-size: 0.7rem; flex: 1; min-width: 280px; }
.cookie-buttons { display: flex; gap: 10px; }
.btn-cookie {
    padding: 6px 16px;
    border: 4px solid var(--bg-content);
    cursor: pointer;
    font-weight: bold;
    background: transparent;
    color: var(--bg-content);
    border-radius: 24px;
}
.btn-cookie.accept { background-color: var(--bg-content); color: var(--accent-red); }

#cookie-mini-btn {
    position: fixed; bottom: 14px; right: 14px;
    width: 40px; height: 40px;
    background-color: var(--accent-red); color: var(--bg-content);
    border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; z-index: 9998;
}

/* =============================================
   5. RESPONSIVE (MOBILE & TABLETTE)
   ============================================= */
@media screen and (max-width: 1200px) {
    /* On autorise le scroll vertical et on remet la hauteur en auto */
    html, body { 
        overflow-x: hidden; 
        overflow-y: auto; 
        height: auto; 
        background: var(--bg-system); /* On s'assure que le fond gris est bien là */
    }

    #layout { 
        display: flex; 
        flex-direction: column; 
        height: auto; 
        width: 100%;
        gap: 0; /* On gère l'espace via les bordures/marges des enfants */
    }
	
#sidebar { display: contents; }

    .sidebar-top {
        order: 1;
        width: 100%;
        padding: 40px 20px 40px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
    }
	
    /* On casse les grilles de lignes pour tout empiler */
    #main, .row { 
	order: 2;
        display: flex;
        flex-direction: column;
        height: auto;
        width: 100%;
        margin-left: 0;
        overflow: visible;
    }
	
.sidebar-bottom {
        order: 3;
        width: 100%;
        padding: 20px 20px 20px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        margin-top: auto;
    }

    /* Style unique pour chaque frame sur mobile */
    .frame {
        /* On force la largeur pour laisser voir le gris sur les côtés */
        width: calc(100% - 20px) !important; 
        margin: 0 10px 10px 10px !important; /* Marge entre les bulles */
        height: auto !important;
        border: 8px solid var(--bg-system) !important; /* Le gris qui fait office de séparateur */
        border-radius: 30px !important;
        position: relative;
        left: 0;
        right: 0;
    }

    /* Désactiver l'aspect-ratio sur mobile pour forcer la hauteur fixe de l'iframe */
    .row-bottom .frame:last-child {
        aspect-ratio: auto !important;
        width: calc(100% - 20px) !important;
    }

    /* Hauteurs adaptées pour le contenu mobile */
    .frame iframe { 
        height: 100%; 
        min-height: 400px; /* Sécurité pour le contenu */
    }

    /* Ajustements spécifiques selon vos classes */
    .frame-player iframe { height: 650px !important; }
    .frame-agenda iframe { height: 450px !important; }
    .frame-video iframe { height: 440px !important; }
    .frame-insta iframe { height: 450px !important; }

    /* Optionnel : Ajuster la taille du logo sur mobile */
    .sidebar-top img.main-logo {
        max-width: 80px;
        margin-bottom: 20px;
    }
}