/* Non-étoile — site. Charte reprise de l'ancien site : fond blanc, Rubik, menu gris à gauche, nom dans une
   pastille cerclée de noir, volets vert acide, liens violets, boutons en pastille, programme en bandeaux gris.
   Jamais de capitales forcées. */

@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("../fonts/rubik-italic-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --blanc: #fff;
  --noir: #000;
  --gris: #949494;          /* liens du menu */
  --gris-fonce: #636363;    /* bandeaux du programme */
  --acide: #dcff23;         /* volets */
  --violet: #8f05ff;        /* liens */
  --rouge: #c0261b;
  --colonne: 604px;         /* largeur du texte */
  --gauche: 210px;          /* place du menu sur ordinateur */
  --e: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 40px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--blanc);
  color: var(--noir);
  font-family: "Rubik", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

a { color: var(--violet); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--noir); outline-offset: 2px; }
img { max-width: 100%; height: auto; display: block; }
strong, b { font-weight: 600; }

.invisible {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.evitement { position: absolute; left: -9999px; top: 0; z-index: 30; padding: 8px 14px; background: var(--acide); color: var(--noir); }
.evitement:focus { left: 8px; top: 8px; }


/* ---------- En-tête : nom dans sa pastille, menu à gauche ---------- */

.entete {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 20;
  width: 300px;
}
.nom {
  margin: 0;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}
.nom a {
  display: block;
  padding: 0 4px 1px;
  border: 1px solid var(--noir);
  border-radius: 500px;
  background: var(--blanc);
  color: var(--noir);
  text-align: right;
  text-decoration: none;
}
.nom a:hover { background: var(--acide); }

.menu-bouton { display: none; }
.menu ul { list-style: none; margin: 12px 0 0; padding: 0 0 0 16px; }
.menu a {
  display: inline-block;
  padding: 1px 0;
  color: var(--gris);
  line-height: 20px;
}
.menu a:hover, .menu a[aria-current="true"] { color: var(--noir); text-decoration: none; }


/* ---------- Contenu ---------- */

.contenu {
  width: min(var(--colonne), calc(100% - var(--gauche) - 32px));
  margin: 0 0 0 max(var(--gauche), calc((100% - var(--colonne)) / 2));
  padding: 120px 0 40vh;
}

.rubrique { padding: 0 0 140px; scroll-margin-top: 40px; }
/* Comme sur l'ancien site : une rubrique à la fois à l'écran, entourée de vide. Chaque rubrique est suivie d'un
   écran entier vide : deux rubriques ne sont jamais visibles ensemble, et entre deux l'écran passe par le blanc. */
.contenu:not(.page) .rubrique { padding-bottom: 100vh; padding-bottom: 100svh; }
.contenu:not(.page) .rubrique:last-child { min-height: 0; padding-bottom: 0; }
.rubrique > p, .texte p, .volet-texte p { margin: 0 0 1em; }
.rubrique h3, .texte h3 { margin: 1.6em 0 .3em; font-size: 15px; font-weight: 700; }
.rubrique > h3:first-of-type { margin-top: 0; }
.rubrique ul, .texte ul, .texte ol { margin: 0 0 1em; padding-left: 1.2em; }


/* ---------- Volets (à propos) ---------- */

.volet { margin: 0 0 4px; }
.volet summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e);
  padding: 0 10px;
  background: var(--acide);
  border-radius: 400px;
  font-weight: 700;
  line-height: 22.5px;
  cursor: pointer;
  list-style: none;
}
.volet summary::-webkit-details-marker { display: none; }
.volet summary::after { content: "+"; font-weight: 400; }
.volet[open] summary::after { content: "–"; }
.volet summary:hover { background: var(--noir); color: var(--acide); }
.volet-texte { padding: 14px 10px 24px; }
/* Listes de noms (membres) en colonnes */
.volet-texte ul { columns: 4 130px; column-gap: 24px; margin: 0 0 1.2em; padding-left: 1em; }
.volet-texte li { break-inside: avoid; line-height: 1.3; margin-bottom: 2px; }


/* ---------- Boutons vers les pages (appels, inscriptions) ---------- */

.boutons { list-style: none; margin: 0; padding: 0; display: grid; justify-items: center; gap: 12px; }
.bouton {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid var(--noir);
  border-radius: 500px;
  background: var(--blanc);
  color: var(--noir);
  font: inherit;
  line-height: 1.1;
  text-align: center;
  cursor: pointer;
}
.bouton:hover { background: var(--acide); text-decoration: none; }


/* ---------- Programme (agenda Google) ---------- */

.programme-jour {
  margin: 18px 0 4px !important;
  color: var(--gris-fonce);
  font-size: 13px !important;
  font-weight: 700;
}
.programme ul { list-style: none; margin: 0; padding: 0; }
.evenement { margin: 0 0 2px; background: var(--gris-fonce); color: var(--blanc); font-size: 13px; line-height: 1.45; }
.evenement summary, .evenement-ligne { display: flex; gap: 0; padding: 2px 5px; }
.evenement summary { cursor: pointer; list-style: none; }
.evenement summary::-webkit-details-marker { display: none; }
.evenement summary .quoi { text-decoration: underline; text-underline-offset: 2px; }
.evenement summary:hover .quoi { text-decoration-thickness: 2px; }
.heure { flex: 0 0 auto; width: 125px; padding-right: 10px; font-weight: 700; }
.evenement-texte { padding: 10px 12px 4px; background: #f3f3f3; color: var(--noir); font-size: 14px; }
.evenement-texte p { margin: 0 0 .8em; }
.lieu { color: var(--gris-fonce); }
.programme-vide { color: var(--gris-fonce); }


/* ---------- Pages (appels, inscriptions) ---------- */

.page { padding-top: 120px; }
.page h1 { margin: 0 0 24px; font-size: 24px; font-weight: 500; line-height: 1.2; }
.page h1::before { content: ""; }
.texte h3 { display: inline-block; padding: 0 10px; background: var(--acide); border-radius: 400px; }
.note-admin { padding: 6px 12px; background: var(--acide); border-radius: 400px; }

.documents { list-style: none; margin: 24px 0; padding: 0; }
.documents li { margin: 0 0 6px; }
.documents a::before { content: "↓ "; }
.documents small { color: var(--gris-fonce); }

.images { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 32px 0; }
.images img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #f3f3f3; }
.images img:only-child { aspect-ratio: auto; }

.introuvable { padding-top: 160px; }


/* ---------- Formulaires ---------- */

.formulaire { margin: 56px 0 0; padding-top: 24px; border-top: 1px solid var(--noir); scroll-margin-top: 40px; }
.formulaire h2 { margin: 0 0 20px; padding: 0 10px; display: inline-block; background: var(--acide); border-radius: 400px; font-size: 15px; font-weight: 700; }
.formulaire form { display: grid; gap: 20px; }
.champ { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.champ > label, .champ > legend { font-weight: 600; padding: 0; }
.champ legend { margin-bottom: 6px; }
.requis { color: var(--violet); }
.aide { color: var(--gris-fonce); font-size: 13px; }
.erreur { color: var(--rouge); font-size: 14px; }
.en-erreur input:not([type="checkbox"]):not([type="radio"]), .en-erreur textarea { border-color: var(--rouge); box-shadow: 0 0 0 1px var(--rouge); }

.formulaire input[type="text"], .formulaire input[type="email"], .formulaire input[type="tel"],
.formulaire input[type="number"], .formulaire textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--noir);
  border-radius: 22px;
  background: var(--blanc);
  color: var(--noir);
  font: inherit;
}
.formulaire textarea { min-height: 140px; border-radius: 16px; resize: vertical; }
.formulaire input:focus, .formulaire textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--acide); }
.formulaire input[type="file"] { font: inherit; padding: 8px 0; }
.formulaire input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 18px;
  border: 1px solid var(--noir);
  border-radius: 500px;
  background: var(--blanc);
  font: inherit;
  cursor: pointer;
}
.formulaire input[type="file"]::file-selector-button:hover { background: var(--acide); }
.option { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; cursor: pointer; }
.option input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; accent-color: var(--noir); }
.formulaire button[type="submit"] { justify-self: start; min-width: 160px; }
.formulaire button[type="submit"]:disabled { opacity: .5; cursor: wait; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.message { padding: 10px 16px; border: 1px solid var(--noir); border-radius: 22px; }
.message.ok { background: var(--acide); }
.message.erreur { border-color: var(--rouge); color: var(--rouge); font-size: 15px; }
.cloture { font-weight: 600; }


/* ---------- Tablette et téléphone : en-tête en haut, menu qui se déplie ---------- */

@media (max-width: 899px) {
  .entete {
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: auto;
    padding: 8px 16px;
    background: var(--blanc);
  }
  .nom { flex: 1 1 auto; font-size: 26px; }
  .menu-bouton {
    display: inline-block;
    min-height: 34px;
    padding: 4px 16px;
    border: 1px solid var(--noir);
    border-radius: 500px;
    background: var(--blanc);
    color: var(--noir);
    font: inherit;
    cursor: pointer;
  }
  .menu-bouton[aria-expanded="true"] { background: var(--acide); }
  .menu { flex: 1 0 100%; }
  .menu ul { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 4px; padding: 0 4px; }
  .menu a { padding: 6px 0; font-size: 16px; }
  /* Avec JavaScript, le menu est replié derrière le bouton */
  .js .menu { display: none; }
  .js .menu.ouvert { display: block; }
  .contenu, .page {
    width: auto;
    margin: 0 16px;
    padding-top: 40px;
  }
  .contenu:not(.page) .rubrique { padding-bottom: calc(100vh - 40px); padding-bottom: calc(100svh - 40px); }
  html { scroll-padding-top: 70px; }
  .rubrique, .formulaire { scroll-margin-top: 70px; }
}
@media (min-width: 640px) and (max-width: 899px) {
  .contenu, .page { width: min(var(--colonne), calc(100% - 32px)); margin: 0 auto; }
}
@media (max-width: 480px) {
  .heure { width: 62px; }
  .volet-texte ul { columns: 2 120px; }
}

@media print {
  .entete, .formulaire form { display: none; }
  .contenu { margin: 0; width: auto; padding: 0; }
  .volet-texte { display: block; }
}
