/* ============================================================
   RythmZone — fiches publiques des écoles, associations et
   organisateurs, et annuaire (06/10/2026)
   Idée directrice : « l'affiche de bal ». Le nom de la structure
   est composé en grand sur sa photo, comme sur une affiche ; tout
   le reste reste sobre et lisible, y compris quand le visiteur
   agrandit le texte (tailles en rem, rien ne déborde).
   ============================================================ */

:root {
  --nuit: #0f0220;
  --prune: #1a0533;
  --encre: #251043;
  --trait: rgba(255, 255, 255, .13);
  --texte: #F6F1FA;
  --doux: #BDB3CB;
  --lilas: #C084FC;
  --violet: #7C3AED;
  --rose: #EC4899;
  --or: #F5C451;
  --vert: #6EE7B7;
  --rouge: #FCA5A5;
  --titre: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --corps: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --large: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--nuit);
  color: var(--texte);
  font-family: var(--corps);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
img { max-width: 100%; }
h1, h2, h3, p, ul, ol, figure, blockquote, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
a { color: var(--lilas); text-underline-offset: .18em; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 4px; }
.cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.evitement {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  padding: .7rem 1rem; border-radius: 8px; background: var(--or); color: #1a0533; font-weight: 700; text-decoration: none;
}
.evitement:focus { top: .6rem; }

/* ---------- Barre du site ---------- */
.barre {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .2rem 1rem;
  width: min(100% - 2rem, var(--large)); margin: 0 auto; min-height: 3.75rem; padding: .5rem 0;
}
.barre__logo { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-family: var(--titre); font-weight: 700; font-size: 1.2rem; }
.barre__logo img { width: 2.4rem; height: 2.4rem; border-radius: 9px; object-fit: cover; }
.barre__logo span span { color: var(--lilas); }
.barre__lien { color: var(--texte); font-weight: 500; text-decoration: none; padding: .6rem 0; border-bottom: 2px solid transparent; }
.barre__lien:hover { border-bottom-color: var(--rose); }

/* ---------- L'affiche : photo, nom, actions ---------- */
.affiche {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(22rem, 64vh, 38rem);
}
.affiche__photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.affiche::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15, 2, 32, .2) 0%, rgba(15, 2, 32, .5) 42%, rgba(15, 2, 32, .93) 82%, var(--nuit) 100%);
}
.affiche--sans-photo {
  min-height: clamp(17rem, 44vh, 26rem);
  background:
    radial-gradient(58rem 30rem at 88% -12%, rgba(236, 72, 153, .42), transparent 62%),
    radial-gradient(48rem 30rem at -6% -10%, rgba(124, 58, 237, .62), transparent 64%),
    var(--prune);
}
.affiche--sans-photo::after { background: linear-gradient(180deg, transparent 55%, var(--nuit) 100%); }
.affiche__texte { width: min(100% - 2rem, var(--large)); margin: 0 auto; padding: 5rem 0 2.2rem; }
.affiche__logo {
  display: grid; place-items: center; width: 5.25rem; height: 5.25rem; margin-bottom: 1.1rem;
  border-radius: 50%; overflow: hidden; background: var(--prune);
  border: 3px solid rgba(255, 255, 255, .9); box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  font-family: var(--titre); font-weight: 900; font-size: 1.9rem; color: var(--lilas);
}
.affiche__logo img { width: 100%; height: 100%; object-fit: cover; }
.affiche__genre { font-size: 1.1rem; font-weight: 500; color: #E9DDFB; text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
.affiche h1 {
  font-family: var(--titre); font-weight: 900;
  font-size: clamp(2.5rem, 7.4vw, 5.1rem); line-height: 1; letter-spacing: -.015em;
  max-width: 17ch; margin: .12em 0 .32em; text-wrap: balance; overflow-wrap: anywhere;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .55);
}
.affiche__faits { display: flex; flex-wrap: wrap; gap: .35rem 1.4rem; color: #E9DDFB; }
.affiche__faits a { color: inherit; }
.affiche__faits li:empty { display: none; }
.affiche__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }

.etoiles { color: var(--or); letter-spacing: .08em; white-space: nowrap; }
.etoiles i { font-style: normal; color: rgba(255, 255, 255, .28); }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.35rem; border-radius: 10px; border: 2px solid transparent;
  font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--rose));
  transition: transform .12s ease, filter .12s ease;
}
.bouton:hover { color: #fff; filter: brightness(1.1); }
.bouton:active { transform: translateY(1px); }
.bouton[disabled] { opacity: .6; cursor: default; }
.bouton--contour { background: rgba(15, 2, 32, .55); border-color: rgba(255, 255, 255, .55); }
.bouton--contour:hover { border-color: #fff; }
.bouton--suivi { background: rgba(15, 2, 32, .55); border-color: var(--lilas); }
.bouton--large { width: 100%; }

/* ---------- Sommaire de la fiche ---------- */
.sommaire {
  position: sticky; top: 0; z-index: 20;
  background: rgba(15, 2, 32, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--trait);
}
.sommaire ul { display: flex; gap: .3rem; width: min(100% - 2rem, var(--large)); margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.sommaire ul::-webkit-scrollbar { display: none; }
.sommaire a {
  display: block; padding: .95rem .75rem; white-space: nowrap; color: var(--doux); text-decoration: none; font-weight: 500;
  border-bottom: 3px solid transparent;
}
.sommaire li:first-child a { padding-left: 0; }
.sommaire a:hover, .sommaire a[aria-current="true"] { color: #fff; border-bottom-color: var(--rose); }

/* ---------- Corps ---------- */
.corps { width: min(100% - 2rem, var(--large)); margin: 0 auto; padding: 3rem 0 4rem; display: grid; gap: 3.5rem; }
.corps__principal { min-width: 0; }
.corps__cote { min-width: 0; }
@media (min-width: 62rem) {
  .corps { grid-template-columns: minmax(0, 1fr) 22rem; gap: 4rem; align-items: start; }
  .corps__cote { position: sticky; top: 4.75rem; }
}
.bloc + .bloc { margin-top: 3.75rem; }
.bloc { scroll-margin-top: 4.5rem; }
.bloc h2 { font-family: var(--titre); font-weight: 700; font-size: 1.85rem; line-height: 1.15; margin-bottom: 1.15rem; }
.corps__cote .bloc h2 { font-size: 1.45rem; }
.bloc h2 small { font-family: var(--corps); font-weight: 400; font-size: 1rem; color: var(--doux); margin-left: .5rem; }
.vide { color: var(--doux); }
.texte-libre { max-width: 40rem; white-space: pre-line; font-size: 1.12rem; line-height: 1.7; }

/* ---------- Photos ---------- */
.mosaique { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem; }
.mosaique a { display: block; position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 10px; background: var(--prune); }
.mosaique img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.mosaique a:hover img { transform: scale(1.04); }
.mosaique li:first-child { grid-column: span 2; }
.mosaique li:first-child a { aspect-ratio: 16 / 10; }
.mosaique--1 li:first-child a { aspect-ratio: 16 / 9; }
/* Une photo qui s'étend pour qu'aucune case ne reste vide (classes posées par rzFicheClasseMosaique) */
.mosaique .m2 { grid-column: span 2; }
.mosaique .m2 a { aspect-ratio: 2 / 1; }
@media (min-width: 40rem) {
  .mosaique .m2 { grid-column: auto; }
  .mosaique .m2 a { aspect-ratio: 1; }
  .mosaique .l2 { grid-column: span 2; }
  .mosaique .l3 { grid-column: span 3; }
  .mosaique .l4 { grid-column: span 4; }
  .mosaique .l2 a { aspect-ratio: 2 / 1; }
  .mosaique .l3 a { aspect-ratio: 3 / 1; }
  .mosaique .l4 a { aspect-ratio: 4 / 1; }
}
@media (min-width: 40rem) {
  .mosaique { grid-template-columns: repeat(4, 1fr); grid-auto-flow: dense; }
  .mosaique li:first-child { grid-row: span 2; }
  .mosaique li:first-child a { aspect-ratio: auto; height: 100%; }
  .mosaique--1 { grid-template-columns: 1fr; }
  .mosaique--1 li:first-child { grid-column: auto; grid-row: auto; }
  .mosaique--1 li:first-child a { aspect-ratio: 16 / 9; height: auto; }
  .mosaique--2 li { grid-column: span 2; grid-row: auto !important; }
  .mosaique--2 a { aspect-ratio: 4 / 3 !important; height: auto !important; }
}

.visionneuse {
  width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
  background: rgba(8, 1, 18, .97); color: var(--texte);
}
.visionneuse::backdrop { background: rgba(8, 1, 18, .97); }
.visionneuse__scene { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.visionneuse__haut { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; color: var(--doux); }
.visionneuse__image { display: grid; place-items: center; min-height: 0; padding: 0 .5rem; touch-action: pan-y; }
.visionneuse__image img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.visionneuse__bas { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem 1.1rem; }
.visionneuse__legende { flex: 1; text-align: center; min-height: 1.6em; }
.rond {
  display: inline-grid; place-items: center; width: 3rem; height: 3rem; flex: none; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 1.3rem; cursor: pointer;
}
.rond:hover { background: rgba(255, 255, 255, .2); }
.rond[hidden] { display: none; }

/* ---------- Le carnet des cours ---------- */
.carnet__jour { display: grid; gap: .35rem 1.5rem; padding: 1.15rem 0; border-top: 1px solid var(--trait); }
.carnet__jour:last-child { border-bottom: 1px solid var(--trait); }
.carnet__jour h3 { font-family: var(--titre); font-weight: 700; font-size: 1.3rem; color: var(--lilas); }
.cours { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: .2rem 1rem; padding: .5rem 0; }
.cours__heure { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.cours__titre { font-weight: 600; }
.cours__details, .cours__desc { color: var(--doux); }
@media (min-width: 40rem) { .carnet__jour { grid-template-columns: 8.5rem minmax(0, 1fr); } }
@media (max-width: 26rem) { .cours { grid-template-columns: 1fr; } }

/* ---------- Soirées ---------- */
.soiree { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: 1.1rem; align-items: start; padding: 1.1rem 0; border-top: 1px solid var(--trait); }
.soiree:last-child { border-bottom: 1px solid var(--trait); }
.soiree__date { text-align: center; padding: .55rem .2rem .6rem; border-radius: 12px; background: var(--encre); border: 1px solid var(--trait); line-height: 1.1; }
.soiree__date b { display: block; font-family: var(--titre); font-weight: 900; font-size: 1.9rem; }
.soiree__date span { font-size: .95rem; color: var(--lilas); }
.soiree h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 600; }
.soiree p { color: var(--doux); }
.soiree__prix { color: var(--texte); font-weight: 600; }

/* ---------- Avis ---------- */
.note { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.1rem; margin-bottom: 1.4rem; }
.note__chiffre { font-family: var(--titre); font-weight: 900; font-size: 3.4rem; line-height: 1; }
.note__chiffre small { font-family: var(--corps); font-weight: 400; font-size: 1.05rem; color: var(--doux); }
.note .etoiles { font-size: 1.5rem; }
.avis { padding: 1.2rem 0; border-top: 1px solid var(--trait); }
.avis__texte { max-width: 40rem; margin: .35rem 0; white-space: pre-line; font-size: 1.1rem; }
.avis__auteur { color: var(--doux); }
.regles { margin-top: 1.6rem; color: var(--doux); }
.regles summary { cursor: pointer; padding: .55rem 0; color: var(--lilas); width: fit-content; }
.regles p { max-width: 40rem; margin-top: .5rem; }

.depot { margin-top: 2rem; padding: 1.4rem; border-radius: 14px; background: var(--encre); border: 1px solid var(--trait); }
.depot h3 { font-size: 1.2rem; margin-bottom: .9rem; }
.choix-note { display: flex; gap: .15rem; margin-bottom: 1rem; }
.choix-note input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-note label { font-size: 2.3rem; line-height: 1; padding: .15rem .2rem; color: rgba(255, 255, 255, .28); cursor: pointer; }
/* Étoiles dans l'ordre 1 à 5 (flèches du clavier dans le bon sens) : sont dorées l'étoile choisie et celles qui la précèdent */
.choix-note input:checked + label { color: var(--or); }
.choix-note label:has(~ input:checked) { color: var(--or); }
.choix-note:hover label { color: rgba(255, 255, 255, .28); }
.choix-note label:hover { color: var(--or); }
.choix-note label:has(~ label:hover) { color: var(--or); }
.choix-note input:focus-visible + label { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 6px; }

/* ---------- Formulaires ---------- */
.champ { display: block; margin-bottom: 1rem; }
.champ > span { display: block; font-weight: 600; margin-bottom: .35rem; }
.champ > span small { font-weight: 400; color: var(--doux); }
.champ input, .champ textarea, .champ select {
  width: 100%; padding: .8rem .9rem; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .06); color: var(--texte); font: inherit; font-size: 1rem;
}
.champ select option { background: var(--prune); }
.champ textarea { resize: vertical; min-height: 6rem; }
.champ input:focus, .champ textarea:focus, .champ select:focus { outline: 3px solid var(--or); outline-offset: 1px; border-color: transparent; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.retour { margin-top: .8rem; min-height: 1.5em; }
.retour--ok { color: var(--vert); }
.retour--non { color: var(--rouge); }

/* ---------- Colonne : venir ---------- */
.adresse { font-style: normal; margin-bottom: .9rem; }
.carte { height: 14rem; border-radius: 12px; overflow: hidden; background: var(--encre); margin-bottom: .9rem; z-index: 0; }

/* ---------- Pied ---------- */
.pied { border-top: 1px solid var(--trait); padding: 2rem 0 3rem; color: var(--doux); }
.pied div { width: min(100% - 2rem, var(--large)); margin: 0 auto; display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: space-between; }
.pied nav { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; }

/* ---------- Page d'attente (fiche non visible) ---------- */
.attente { min-height: 70vh; display: grid; place-items: center; padding: 2rem 1rem; text-align: center; }
.attente div { max-width: 30rem; }
.attente h1 { font-family: var(--titre); font-size: 2rem; line-height: 1.15; margin-bottom: .8rem; }
.attente p { color: var(--doux); margin-bottom: 1.4rem; }

/* ============================================================
   Annuaire
   ============================================================ */
.annuaire-tete { width: min(100% - 2rem, var(--large)); margin: 0 auto; padding: 2.5rem 0 1.5rem; }
.annuaire-tete h1 { font-family: var(--titre); font-weight: 900; font-size: clamp(2.1rem, 6vw, 3.9rem); line-height: 1.02; letter-spacing: -.012em; max-width: 18ch; text-wrap: balance; }
.annuaire-tete p { max-width: 38rem; margin-top: 1rem; color: var(--doux); font-size: 1.12rem; }
.filtres { width: min(100% - 2rem, var(--large)); margin: 0 auto; display: grid; gap: .8rem; align-items: end; padding-bottom: 1.5rem; border-bottom: 1px solid var(--trait); }
.filtres .champ { margin: 0; }
.filtres .champ input, .filtres .champ select, .filtres .bouton { height: 3.25rem; }
@media (min-width: 48rem) { .filtres { grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) minmax(0, 1.2fr) auto; } }
.resultats { width: min(100% - 2rem, var(--large)); margin: 0 auto; padding: 1.5rem 0 4rem; }
.resultats__compte { color: var(--doux); margin-bottom: 1.2rem; }
.affichettes { display: grid; gap: 1.6rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.affichette a { display: block; color: inherit; text-decoration: none; }
.affichette__image {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 14px; padding: 1.1rem;
  background:
    radial-gradient(22rem 14rem at 95% -10%, rgba(236, 72, 153, .45), transparent 62%),
    radial-gradient(20rem 15rem at -10% -5%, rgba(124, 58, 237, .65), transparent 64%),
    var(--prune);
}
.affichette__image img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.affichette__image::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(15, 2, 32, 0) 30%, rgba(15, 2, 32, .9) 100%); }
.affichette a:hover img { transform: scale(1.04); }
.affichette h2 { font-family: var(--titre); font-weight: 900; font-size: 1.65rem; line-height: 1.05; text-wrap: balance; overflow-wrap: anywhere; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.affichette__genre { margin-top: .7rem; font-weight: 600; }
.affichette__details { color: var(--doux); }
.pages { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 2.5rem; }
.invitation { margin-top: 3rem; padding: 1.6rem; border-radius: 14px; background: var(--encre); border: 1px solid var(--trait); display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.invitation p { max-width: 36rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .barre__lien, .sommaire, .affiche__actions, .depot, #contact, .visionneuse, .pied nav { display: none !important; }
  body { background: #fff; color: #000; }
}
