/* ============================================================
   PROJETS EAC — Styles par domaine artistique
   Dépendance : style.css, bulles-style.css (variables de base)

   Système : la fonction get_domaine_eac_class() dans shortcodes.php
   ajoute une classe "domaine-xxx" sur les blocs .structure-projets,
   .bloc-articles-projet et .bloc-page-fille.
   Ce CSS active les bonnes variables CSS selon le domaine détecté.
   ============================================================ */


/* ============================================================
   VARIABLES PAR DOMAINE
   ============================================================ */

.domaine-musique {
    --current-bulle-color:      #0D5A90;
    --current-bulle-bg:         #A5D4F6;
    --current-bulle-bg-audio:   #64a3d1;
    --current-bulle-border:     #115384;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/musique.svg');
}

.domaine-arts-plastiques {
    --current-bulle-color:      #0d8a2a;
    --current-bulle-bg:         #c8edcf;
    --current-bulle-bg-audio:   #3ea1eb;
    --current-bulle-border:     #126b27;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/palette.svg');
}

.domaine-theatre {
    --current-bulle-color:      #90270d;
    --current-bulle-bg:         #fcbcac;
    --current-bulle-bg-audio:   #f6a5a5;
    --current-bulle-border:     #7a1f08;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/theatre.svg');
}

.domaine-danse {
    --current-bulle-color:      #7a0d90;
    --current-bulle-bg:         #efb1fc;
    --current-bulle-bg-audio:   #e6a5f6;
    --current-bulle-border:     #62087a;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/danse.svg');
}

.domaine-patrimoine {
    --current-bulle-color:      #7a5c0d;
    --current-bulle-bg:         #f5e6c0;
    --current-bulle-bg-audio:   #e8d4a0;
    --current-bulle-border:     #614808;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/patrimoine.svg');
}

.domaine-cinema {
    --current-bulle-color:      #2a2a7a;
    --current-bulle-bg:         #c4c4f0;
    --current-bulle-bg-audio:   #a0a0e0;
    --current-bulle-border:     #1e1e62;
    --current-bulle-icone:      url('/wp-content/themes/eac78-theme/assets/icone/cinema.svg');
}


/* ============================================================
   LAYOUT GRILLE PROJETS
   ============================================================ */

.structure-projets {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .structure-projets {
        grid-template-columns: 1fr;
    }
}


/* ============================================================
   BLOCS ARTICLES ET PAGES FILLES
   ============================================================ */

.bloc-articles-projet,
.structure-projets .bloc-page-fille {
    animation: fadeInProjet 0.4s ease-in;
}

@keyframes fadeInProjet {
    from { opacity: 0; transform: translateY(0.8rem); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Titres h2 avec icône domaine */
.structure-projets h2 {
    color: var(--current-bulle-color);
    border-bottom: 1px solid var(--current-bulle-color);
    position: relative;
    padding-left: 3rem;
    margin-bottom: 0.8rem;
}

.structure-projets h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background-image: var(--current-bulle-icone);
    background-size: contain;
    background-repeat: no-repeat;
}

/* Titres h3 pages filles */
.structure-projets h3 {
    border-left: 3px solid var(--current-bulle-color);
    padding-left: 0.8rem;
    margin-bottom: 0.5rem;
}

.structure-projets h3 a {
    font-style: italic;
    font-size: 1.5rem;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
}

.structure-projets h3 a:hover {
    color: var(--current-bulle-color);
}


/* ============================================================
   LISTES D'ARTICLES
   ============================================================ */

.structure-projets ul {
    list-style: square;
    color: var(--current-bulle-color);
    padding-left: 1.8rem;
    margin: 0 0 1rem 0;
}

.structure-projets ul li {
    margin-bottom: 0.3rem;
}

.structure-projets ul li a {
    text-decoration: none;
    color: var(--current-bulle-color);
    font-weight: 500;
    transition: color 0.2s ease;
}

.structure-projets ul li a:hover {
    color: #000;
    text-decoration: underline;
}

/* Compositeur (si ajouté plus tard) */
.structure-projets .compositeur {
    font-style: italic;
    font-weight: 400;
    font-size: 0.9em;
    opacity: 0.75;
}


/* ============================================================
   SINGLE ARTICLE PROJET — enveloppe visuelle
   ============================================================ */

/* Badge domaine en pill */
.badge-domaine {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 14px;
    border-radius: 20px;
    background: var(--current-bulle-bg);
    color: var(--current-bulle-color);
    border: 1px solid var(--current-bulle-color);
    margin-bottom: 0.8rem;
    letter-spacing: 0.03em;
}

/* Titre projet */
.titre-projet {
    font-size: 2.8rem;
    font-weight: 400;
    color: var(--current-bulle-color);
    border-bottom: 1px solid var(--current-bulle-color);
    padding-bottom: 1rem;
    margin: 0 0 1.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

/* Enveloppe article projet :
   accent latéral fort + bordure tiretée sur les 3 autres côtés */
article.domaine-musique,
article.domaine-arts-plastiques,
article.domaine-theatre,
article.domaine-danse,
article.domaine-patrimoine,
article.domaine-cinema {
    border-left: 6px solid var(--current-bulle-color);
    border-top: 1.5px dashed var(--current-bulle-color);
    border-right: 1.5px dashed var(--current-bulle-color);
    border-bottom: 1.5px dashed var(--current-bulle-color);
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    padding: 0 var(--spacing-md);
    margin: 1.5rem auto;
    max-width: 80rem;
}

/* H2 bandeaux dans les projets */
article.domaine-musique h2,
article.domaine-arts-plastiques h2,
article.domaine-theatre h2,
article.domaine-danse h2,
article.domaine-patrimoine h2,
article.domaine-cinema h2 {
    background-color: var(--current-bulle-color);
    color: white;
    padding: 0.6rem 1rem 0.6rem 1.2rem;
    margin: 1.5rem calc(-1 * var(--spacing-md));
    border-radius: 0;
}

/* Liens → style directionnel */
article.domaine-musique .entry-content a,
article.domaine-arts-plastiques .entry-content a,
article.domaine-theatre .entry-content a,
article.domaine-danse .entry-content a,
article.domaine-patrimoine .entry-content a,
article.domaine-cinema .entry-content a {
    color: var(--current-bulle-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

article.domaine-musique .entry-content a:hover,
article.domaine-arts-plastiques .entry-content a:hover,
article.domaine-theatre .entry-content a:hover,
article.domaine-danse .entry-content a:hover,
article.domaine-patrimoine .entry-content a:hover,
article.domaine-cinema .entry-content a:hover {
    color: #000;
    text-decoration: underline;
}


/* ============================================================
   STRUCTURE PAGES — cartes pages filles avec couleur domaine
   ============================================================ */

.structure-pages {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin: 1.5rem 0;
}

@media (max-width: 640px) {
    .structure-pages { grid-template-columns: 1fr; }
}

.structure-pages .page-fille {
    border: 1.5px solid var(--current-bulle-color, #7a1a1a);
    border-left: 10px solid var(--current-bulle-color, #7a1a1a);
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    background: var(--color-background-primary, #fff);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.structure-pages .page-fille:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Titre h3 avec accent couleur */
.structure-pages .page-fille h3 {
    margin: 0 0 0.7rem;
    font-size: 2.1rem;
    font-style: italic;
}

.structure-pages .page-fille h3 a {
    color: var(--current-bulle-color, #7a1a1a);
    text-decoration: none;
    transition: color 0.2s ease;
}

.structure-pages .page-fille h3 a:hover {
    text-decoration: underline;
}

/* Image mise en avant */
.structure-pages .page-fille .featured-image {
    margin-bottom: 0.7rem;
    border-radius: 4px;
    overflow: hidden;
}

.structure-pages .page-fille .featured-image img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.structure-pages .page-fille:hover .featured-image img {
    transform: scale(1.03);
}

/* Extrait */
.structure-pages .page-fille p {
    font-size: 1.4rem;
    color: var(--color-text-secondary, #555);
    margin: 0;
    line-height: 1.6;
}


/* ============================================================
   STRUCTURE PROJETS — liste articles avec couleur domaine
   ============================================================ */

.structure-projets .bloc-page-fille,
.structure-projets .bloc-articles-projet {
    border-left: 5px solid var(--current-bulle-color, #7a1a1a);
    border-top: 1.5px dashed color-mix(in srgb, var(--current-bulle-color, #7a1a1a) 40%, transparent);
    border-right: 1.5px dashed color-mix(in srgb, var(--current-bulle-color, #7a1a1a) 40%, transparent);
    border-bottom: 1.5px dashed color-mix(in srgb, var(--current-bulle-color, #7a1a1a) 40%, transparent);
    border-radius: 0 8px 8px 0;
    padding: 0.8rem 1rem;
    background: var(--color-background-primary, #fff);
}

/* Titres h2 et h3 */
.structure-projets h2 {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--current-bulle-color, #7a1a1a);
    border-bottom: 1px solid var(--current-bulle-color, #7a1a1a);
    padding-bottom: 0.3rem;
    margin: 0 0 0.6rem;
    padding-left: 0;
}

.structure-projets h2::before {
    display: none; /* pas d'icône SVG dans les listes */
}

.structure-projets h2 a {
    color: var(--current-bulle-color, #7a1a1a);
    text-decoration: none;
}

.structure-projets h2 a:hover {
    text-decoration: underline;
}

.structure-projets h3 {
    font-size: 1rem;
    font-style: italic;
    color: var(--current-bulle-color, #7a1a1a);
    border-left: 3px solid var(--current-bulle-color, #7a1a1a);
    padding-left: 0.6rem;
    margin: 0 0 0.4rem;
}

.structure-projets h3 a {
    color: rgba(0,0,0,0.7);
    text-decoration: none;
}

.structure-projets h3 a:hover {
    color: var(--current-bulle-color, #7a1a1a);
}

/* Listes d'articles avec puce colorée */
.structure-projets ul {
    list-style: square;
    color: var(--current-bulle-color, #7a1a1a);
    padding-left: 1.6rem;
    margin: 0;
}

.structure-projets ul li {
    margin-bottom: 0.25rem;
}

.structure-projets ul li a {
    color: var(--current-bulle-color, #7a1a1a);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.structure-projets ul li a:hover {
    color: #000;
    text-decoration: underline;
}

.structure-projets .compositeur {
    font-style: italic;
    font-weight: 400;
    font-size: 0.88em;
    opacity: 0.7;
}

/* Sous-pages */
.structure-projets .sous-pages {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px dashed color-mix(in srgb, var(--current-bulle-color, #7a1a1a) 30%, transparent);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

@media (max-width: 640px) {
    .structure-projets .sous-pages { grid-template-columns: 1fr; }
}


/* ============================================================
   ÉDITIONS DES PROJETS DÉPARTEMENTAUX  (logique Édition → Domaines)
   Shortcodes : [projets_editions], [projet_edition]
   Fichier PHP : inc/projets-editions.php
   ============================================================ */

/* --- Page d'entrée : cartes des éditions ------------------- */
.editions-projets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28rem, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-md) 0;
}

.carte-edition {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    background: #fff;
    border: 1.5px solid color-mix(in srgb, var(--site-principal-color) 25%, transparent);
    border-top: 6px solid var(--site-principal-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.carte-edition:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}

/* L'édition en cours occupe toute la largeur */
.carte-edition--courante {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--site-secondary-color) 18%, #fff));
}

.edition-bandeau {
    position: absolute;
    top: -1.2rem;
    right: var(--spacing-md);
    background: var(--site-principal-color);
    color: #fff;
    font-size: var(--font-size-sm);
    padding: 0.2rem 1.2rem;
    border-radius: var(--radius-xl);
}

.carte-edition p { text-indent: 0; }

.edition-annee {
    font-size: var(--font-size-sm);
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--site-principal-color);
    margin: 0;
}

.carte-edition h3.edition-theme {
    border: none;
    padding: 0;
    margin: 0;
    font-size: var(--font-size-2xl);
}

.carte-edition--courante h3.edition-theme { font-size: var(--font-size-3xl); }

.edition-theme a {
    color: rgba(0, 0, 0, 0.8);
    text-decoration: none;
}

.edition-theme a:hover { color: var(--site-principal-color); }

.edition-pitch {
    color: #555;
    font-size: var(--font-size-base);
}

.edition-lien {
    margin-top: auto;
    align-self: flex-end;
    color: var(--site-principal-color);
    font-weight: 600;
    text-decoration: none;
}

.edition-lien:hover { text-decoration: underline; }

/* --- Pastilles de domaine (réutilisées partout) ----------- */
.edition-domaines,
.nav-edition ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    padding: 0;
    margin: var(--spacing-xs) 0;
}

.pastille-domaine {
    font-size: var(--font-size-sm);
    padding: 0.2rem 1rem;
    border-radius: var(--radius-xl);
    background: var(--current-bulle-bg, #eee);
    color: var(--current-bulle-color, #333);
    border: 1px solid var(--current-bulle-color, #333);
}

.pastille-domaine a {
    color: inherit;
    text-decoration: none;
}

.pastille-domaine a:hover { text-decoration: underline; }

/* --- Page d'une édition ----------------------------------- */
.edition-projet .liste-projet {
    list-style: square;
    padding-left: 1.8rem;
    margin: 0;
}

.edition-projet .liste-projet li { margin-bottom: 0.8rem; }

.edition-projet .liste-projet a {
    font-weight: 600;
    text-decoration: none;
    color: var(--current-bulle-color, var(--site-principal-color));
}

.edition-projet .liste-projet a:hover { text-decoration: underline; }

.edition-projet .extrait {
    display: block;
    font-size: var(--font-size-sm);
    color: #555;
    line-height: 1.5;
}

/* Tronc commun : aux couleurs du site */
.edition-commun {
    --current-bulle-color: var(--site-principal-color);
    background: #fff;
    border-left: 6px solid var(--site-principal-color);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-md) 0;
    box-shadow: var(--shadow-light);
}

.edition-commun h3,
.edition-titre-domaines {
    margin-left: 0;
    margin-right: 0;
}

/* Grille des domaines */
.edition-domaines-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-sm) 0 var(--spacing-md);
}

.bloc-domaine {
    background: #fff;
    border: 1.5px dashed color-mix(in srgb, var(--current-bulle-color) 40%, transparent);
    border-top: 6px solid var(--current-bulle-color);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    scroll-margin-top: var(--spacing-lg);
    animation: fadeInProjet 0.4s ease-in;
}

.bloc-domaine:target {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--current-bulle-color) 35%, transparent);
}

.bloc-domaine h3 {
    margin: 0 0 var(--spacing-sm);
    border-left: none;
    padding-left: 0;
    color: var(--current-bulle-color);
    font-size: var(--font-size-xl);
}

/* --- Article d'un projet ---------------------------------- */
main > article:not([class*="domaine-"]) .entete-projet {
    --current-bulle-color: var(--site-principal-color);
}

.entete-projet {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding-top: var(--spacing-sm);
}

.entete-projet .titre-projet { flex-basis: 100%; }

.badge-edition {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 20px;
    background: var(--site-principal-color);
    color: #fff;
    text-decoration: none;
    margin-bottom: 0.8rem;
}

.badge-edition:hover { background: var(--site-accent-color); }

.badge-commun {
    --current-bulle-bg: color-mix(in srgb, var(--site-secondary-color) 30%, #fff);
    --current-bulle-color: var(--site-principal-color);
}

/* Navigation vers les autres domaines de l'édition */
.nav-edition {
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px dashed var(--current-bulle-color, var(--site-principal-color));
}

.nav-edition-titre { text-indent: 0; }

.nav-edition-titre a {
    color: var(--current-bulle-color, var(--site-principal-color));
    font-weight: 600;
}

@media (max-width: 640px) {
    .carte-edition--courante h3.edition-theme { font-size: var(--font-size-2xl); }
    .edition-domaines-grille { grid-template-columns: 1fr; }
}

/* Correctif : la pastille domaine utilisait 0.85rem (≈ 8,5 px avec la base 10 px) */
.entete-projet .badge-domaine { font-size: var(--font-size-sm); }

/* Diagnostic affiché aux personnes connectées quand une édition est vide */
.diagnostic-edition {
    border: 2px dashed var(--site-accent-color);
    background: #fff7f5;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-md);
    margin: var(--spacing-md) 0;
    font-size: var(--font-size-sm);
}
.diagnostic-edition p { text-indent: 0; }
