/*
Theme Name: Jazz à Vialas
Theme URI:
Author: Nils Raymond
Description: Thème WordPress sur mesure pour le Festival Jazz à Vialas (Association Jazz en Cévennes). Conversion fidèle du site statique HTML/CSS — parité visuelle au pixel près.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: jazz-a-vialas
*/

/* --- VARIABLES ET RÉGLAGES DE BASE --- */
:root {
    --text-color: #ffffff;
    --nav-bg: #1c0545; /* Violet foncé du menu */
    --accent-color: #e5b3e6; /* Touche rosée/magenta */
}

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

/* --- LE FOND DE PAGE (Fini les coupures !) --- */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    background-color: #150338; /* Couleur de secours */

    /* L'IMAGE EST FIXÉE ICI */
    background-image: url('assets/images/fond_long.png');
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
    /* La propriété magique qui fige l'image et empêche la coupure : */
    background-attachment: fixed;
}

/* --- LOGO --- */
.logo-container {
    text-align: center;
    padding-top: 30px;
    padding-bottom: 20px;
    width: 100%;
}

.main-logo {
    max-width: 450px;
    height: auto;
}

/* --- MENU DE NAVIGATION --- */
header {
    display: flex;
    justify-content: center;
    width: 100%;
    position: sticky; /* Le menu reste en haut au défilement */
    top: 20px;
    z-index: 1000;
}

nav {
    background: var(--nav-bg);
    border-radius: 50px;
    padding: 15px 40px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.3s;
}

nav a:hover, nav a.active {
    opacity: 0.7;
    color: var(--accent-color);
}

/* --- CONTENU PRINCIPAL --- */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Textes de bienvenue */
.home-main {
    justify-content: flex-start; /* Permet au contenu de s'empiler naturellement */
    margin-top: 20px;
}

.welcome-text {
    text-align: center;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
    margin-bottom: 50px;
}

h1 {
    font-size: 4rem;
    margin-bottom: 15px;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

/* --- BOÎTES DE CONTENU (Semi-transparentes) --- */
.content-box {
    background: rgba(28, 5, 69, 0.85); /* Fond violet semi-transparent */
    padding: 50px;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    width: 100%;
    backdrop-filter: blur(8px);
    margin-bottom: 40px;
}

.content-box h2 {
    color: var(--accent-color);
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-align: center;
}

/* Spécifique à la nouvelle boîte de présentation */
.presentation-box {
    max-width: 800px;
    text-align: left;
    line-height: 1.8;
    font-size: 1.1rem;
}

.presentation-box .intro-text {
    font-size: 1.3rem;
    color: var(--accent-color);
    text-align: center;
    margin-bottom: 40px;
    font-weight: 700;
}

.presentation-box h3 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.presentation-box p {
    margin-bottom: 20px;
}

/* --- GRILLES ET CARTES (Pour les autres pages) --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    text-align: left;
}

.card {
    background: rgba(255, 255, 255, 0.08);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
}

/* Vidéos */
.iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

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

/* --- FOOTER --- */
footer {
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(5px);
    padding: 30px 20px;
    text-align: center;
    margin-top: auto; /* Pousse le footer tout en bas */
}

.partners-img {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

.copyright {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #ccc;
}

/* --- BOUTON JAUNE (Appel à l'action) --- */
.btn-yellow {
    display: inline-block;
    background-color: #ffd700; /* Un beau jaune lumineux */
    color: #1c0545; /* Texte en violet foncé pour un contraste parfait */
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-yellow:hover {
    transform: scale(1.05); /* Le bouton grossit légèrement au survol */
    background-color: #ffea00; /* Le jaune devient un peu plus clair */
}

.button-container {
    text-align: center; /* Permet de centrer le bouton */
    margin: 20px 0 30px 0; /* Ajoute de l'espace au-dessus et en dessous */
}

/* --- DESIGN DE L'IMAGE DE PRÉSENTATION (Accueil) --- */
.presentation-img-container {
    text-align: center; /* Centre l'image */
    margin-top: 30px; /* Espace au-dessus */
    margin-bottom: 30px; /* Espace en dessous */
}

.presentation-img {
    max-width: 100%; /* S'adapte à la largeur du conteneur */
    height: auto; /* Garde les proportions */
    border-radius: 20px; /* Bords arrondis pour le design sobre */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); /* Ombre pour la profondeur */
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    nav { padding: 15px 20px; border-radius: 20px; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 15px; }
    h1 { font-size: 2.8rem; }
    h2 { font-size: 1.5rem; }
    .main-logo { max-width: 250px; }
    .content-box { padding: 30px 20px; }
}

/* --- ACCORDÉONS (Page Infos Pratiques) --- */
.accordion-container {
    margin-top: 40px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

details.accordion {
    background: rgba(255, 255, 255, 0.08); /* Fond translucide */
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: background-color 0.3s;
}

details.accordion:hover {
    background: rgba(255, 255, 255, 0.12); /* S'éclaire un peu au survol */
}

details.accordion summary {
    padding: 20px 25px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-color);
    cursor: pointer;
    list-style: none; /* Enlève la petite flèche par défaut du navigateur */
    position: relative;
    outline: none;
    text-align: left;
}

/* Enlève la flèche par défaut sur les navigateurs basés sur WebKit (Chrome/Safari) */
details.accordion summary::-webkit-details-marker {
    display: none;
}

/* Création du bouton "+" personnalisé */
details.accordion summary::after {
    content: '+';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

/* Le "+" devient "-" quand l'accordéon est ouvert */
details.accordion[open] summary::after {
    content: '−';
}

.accordion-content {
    padding: 0 25px 25px 25px;
    text-align: left;
    line-height: 1.8;
}

.accordion-content h4 {
    color: var(--text-color);
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.accordion-content ul {
    margin-left: 20px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.accordion-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.accordion-content a:hover {
    text-decoration: underline;
}

/* --- DESIGN DE LA GRILLE DE PHOTOS (Accueil) --- */
.presentation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes desktop */
    gap: 20px; /* Espace entre les photos */
    margin-top: 30px;
    margin-bottom: 30px;
}

.presentation-grid img {
    width: 100%;
    height: auto;
    border-radius: 20px; /* Bords arrondis pour le design sobre */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); /* Ombre pour la profondeur */
    aspect-ratio: 1 / 1; /* Force un format carré pour un rendu propre */
    object-fit: cover; /* S'assure que l'image remplit le carré sans déformation */
}

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    nav { padding: 15px 20px; border-radius: 20px; }
    nav ul { flex-wrap: wrap; justify-content: center; gap: 15px; }
    h1 { font-size: 2.8rem; }
    h2 { font-size: 1.5rem; }
    .main-logo { max-width: 250px; }
    .content-box { padding: 30px 20px; }

    /* Grille mobile : 1 seule colonne */
    .presentation-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* --- IMAGES AVEC LÉGENDE --- */
.photo-container {
    margin: 30px auto; /* Espace autour de l'image */
    text-align: center; /* Centre l'image et le texte */
    max-width: 100%;
}

.photo-container img {
    max-width: 100%;
    height: auto;
    border-radius: 20px; /* Conserve les bords arrondis de votre design */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); /* L'ombre pour détacher l'image du fond */
}

.photo-container figcaption {
    margin-top: 12px; /* L'espace entre la photo et le texte */
    font-size: 0.9rem; /* Un texte légèrement plus petit que le texte normal */
    color: rgba(255, 255, 255, 0.7); /* Blanc légèrement transparent pour ne pas agresser l'œil */
    font-style: italic; /* L'italique est le standard pour les légendes */
    line-height: 1.4;
}

/* --- BOUTON DE DON SPÉCIAL (Pulsation) --- */
.btn-donate {
    display: inline-block;
    background-color: #ffd700;
    color: #1c0545;
    padding: 18px 40px; /* Plus grand qu'un bouton classique */
    border-radius: 50px;
    text-decoration: none;
    font-weight: 800; /* Texte plus épais */
    font-size: 1.3rem;
    text-transform: uppercase; /* En majuscules pour plus d'impact */
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
    animation: pulse-yellow 2s infinite; /* Active l'animation de pulsation */
}

.btn-donate:hover {
    transform: scale(1.05) translateY(-3px); /* Se soulève légèrement au survol */
    background-color: #ffea00;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
    animation: none; /* Arrête la pulsation quand on le survole */
}

/* L'animation de pulsation (halo lumineux) */
@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

/* --- ANIMATION ET ACCORDÉONS PULSANTS AVEC VIGNETTE (PROGRAMMATION) --- */
.pulse-accordion {
    border: 1px solid rgba(229, 179, 230, 0.4) !important;
    animation: pulse-concert 2s infinite ease-in-out;
    transition: all 0.3s ease;
}

.pulse-accordion:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--accent-color) !important;
    cursor: pointer;
}

details.pulse-accordion[open] {
    animation: none;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(28, 5, 69, 0.5) !important;
    box-shadow: none;
}

/* Alignement parfait de la vignette carrée et du texte du titre */
details.pulse-accordion summary {
    display: flex;
    align-items: center;
    gap: 20px; /* Équilibre parfait de l'espace entre le carré et le texte */
    padding: 10px 60px 10px 15px !important; /* Protège l'espace de votre icône +/- à droite */
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* La vignette carrée du groupe dans le titre */
.accordion-thumb {
    width: 65px;
    height: 65px;
    object-fit: cover; /* Empêche la déformation de la photo */
    border-radius: 12px; /* Bords arrondis en harmonie avec vos boîtes */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0; /* Empêche l'image de se rétrécir si le texte est long */
}

/* L'animation de pulsation */
@keyframes pulse-concert {
    0% { box-shadow: 0 0 0 0 rgba(229, 179, 230, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(229, 179, 230, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 179, 230, 0); }
}

/* --- L'ILLUSION D'OPTIQUE (Ouverture de l'accordéon) --- */

/* 1. La miniature s'estompe au clic (mais garde sa place pour ne pas décaler le texte) */
details.pulse-accordion .accordion-thumb {
    transition: all 0.4s ease;
}
details.pulse-accordion[open] .accordion-thumb {
    opacity: 0.2;
    transform: scale(0.8);
    filter: blur(3px);
}

/* 2. La grande image est cachée un peu plus haut par défaut */
details.pulse-accordion .presentation-img-container {
    opacity: 0;
    transform: translateY(-30px);
    transition: all 0.5s ease-out;
}

/* 3. La grande image glisse vers le bas et apparaît doucement quand on ouvre */
details.pulse-accordion[open] .presentation-img-container {
    opacity: 1;
    transform: translateY(0);
}

/* --- ARCHIVES (section dédiée de la page Le festival) --- */
/* Chaque archive est une cellule de la grille : on annule la marge auto
   de .photo-container pour respecter l'espacement de la grille. */
.accordion-content .grid .photo-container {
    margin: 0;
}

.archive-text {
    text-align: left;
    line-height: 1.8;
}

.archive-credit {
    display: inline-block;
    margin-top: 4px;
    font-style: normal;
    color: rgba(255, 255, 255, 0.55);
}

/* --- NOMS D'ARTISTES : surbrillance (survol) + léger scintillement --- */
.artist-name {
    /* Couleur de repos = celle de la boîte ; transition douce vers le survol. */
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
    /* Petite « salve » de lumière dorée par nom : éclat bref puis disparition. */
    animation: jav-twinkle 12s ease-in-out infinite;
}

/* Survol : le nom s'illumine en doré avec un halo (sans décaler le texte). */
.artist-name:hover {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.85);
    animation: none;
}

/* Les virgules entre les noms : pas d'animation, mais estompées comme les noms. */
.artist-sep {
    transition: opacity 0.25s ease;
}

/* Quand on survole la liste, les salves continuent de tourner mais les autres
   noms (et les virgules) sont estompés pour faire ressortir le nom survolé. */
.artists-list:hover .artist-name,
.artists-list:hover .artist-sep {
    opacity: 0.3;
}
/* Le nom réellement survolé : pleine opacité, doré vif, figé. */
.artists-list:hover .artist-name:hover {
    opacity: 1;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.85);
    animation: none;
}

/* Délais répartis (mod 8) : chaque nom démarre sa salve à un moment différent,
   donc peu de noms s'illuminent en même temps. */
.artist-name:nth-child(8n+1) { animation-delay: 0s;   }
.artist-name:nth-child(8n+2) { animation-delay: 2.6s; }
.artist-name:nth-child(8n+3) { animation-delay: 5.1s; }
.artist-name:nth-child(8n+4) { animation-delay: 7.4s; }
.artist-name:nth-child(8n+5) { animation-delay: 1.3s; }
.artist-name:nth-child(8n+6) { animation-delay: 9.2s; }
.artist-name:nth-child(8n+7) { animation-delay: 3.8s; }
.artist-name:nth-child(8n+8) { animation-delay: 6.5s; }
/* Durées variées (autre modulo) : les départs dérivent dans le temps,
   ce qui casse encore la synchronisation. */
.artist-name:nth-child(3n) { animation-duration: 15s; }
.artist-name:nth-child(5n) { animation-duration: 17s; }
.artist-name:nth-child(7n) { animation-duration: 13s; }

/* La salve : long repos, montée rapide vers un éclat vif (halo en deux couches
   = lumière qui irradie), puis disparition plus lente. */
@keyframes jav-twinkle {
    0%, 78%, 100% {
        color: rgba(255, 255, 255, 0.8);
        text-shadow: none;
    }
    83% {
        color: #fff3c4; /* éclat doré-blanc */
        text-shadow: 0 0 4px rgba(255, 215, 0, 0.95), 0 0 16px rgba(255, 215, 0, 0.7);
    }
    90% {
        color: #ffd700;
        text-shadow: 0 0 6px rgba(255, 215, 0, 0.25);
    }
}

/* Accessibilité : pas d'animation si l'utilisateur la désactive (le survol reste). */
@media (prefers-reduced-motion: reduce) {
    .artist-name {
        animation: none;
    }
}
