/* APE Gorges : feuille de style unique, sans dépendance externe. */

:root {
  /* Couleurs relevées sur le logo */
  --orange: #f26b0f;
  --pink: #e6007e;
  --lime: #a8c536;
  --blue: #0b6496;
  --purple: #7a1f82;

  --ink: #1d2329;
  --muted: #5b6670;
  --line: #e3e6e8;
  --bg: #ffffff;
  --bg-alt: #f6f7f5;
  --bg-help: #eef5f9;

  --radius: 10px;
  --header-h: 76px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

/* Liseré aux couleurs du logo */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg,
    var(--orange) 0 20%, var(--pink) 20% 40%, var(--lime) 40% 60%,
    var(--blue) 60% 80%, var(--purple) 80% 100%);
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 750; letter-spacing: -.02em; max-width: 18ch; }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.0625rem; font-weight: 650; }
p { margin: 0 0 1em; }

a { color: var(--blue); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip:focus { top: 12px; }

/* Boutons */
.btn {
  display: inline-block;
  padding: .7em 1.3em;
  border: 2px solid var(--blue);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color .15s, color .15s;
}
.btn:hover { background: #084c72; border-color: #084c72; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.btn-small { padding: .5em 1.1em; font-size: .9375rem; }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  min-height: var(--header-h);
}
.brand { display: block; flex: none; }
.brand img { display: block; height: 60px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: block; padding: .45em .75em; border-radius: 6px;
  color: var(--ink); font-size: .9375rem; font-weight: 500; text-decoration: none;
}
.main-nav a:hover { background: var(--bg-alt); color: var(--blue); }

/* Accueil */
.hero { padding: 72px 0 64px; }
.eyebrow {
  margin-bottom: .75em;
  color: var(--blue); font-size: .875rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
}
.lead { font-size: 1.1875rem; color: var(--muted); max-width: 58ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }

/* Même grille que .cols-2 pour s'aligner sur les sections suivantes */
.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px;
  margin: 56px 0 0;
}
.facts > div { padding-top: 24px; border-top: 1px solid var(--line); }
.facts dt { font-size: 1.5rem; font-weight: 700; }
/* Masqué, sans bouger le texte autour, jusqu'à ce que le script ait mis la bonne valeur. */
.en-attente { visibility: hidden; }
.facts dd { margin: .25em 0 0; color: var(--muted); font-size: .9375rem; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.intro { color: var(--muted); max-width: 62ch; margin-bottom: 2em; }
.note { color: var(--muted); font-size: .9375rem; }

.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }

.mission { border-top: 3px solid var(--accent); padding-top: 20px; }
.mission p { color: var(--muted); margin: 0; }

/* L'année */
.seasons {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  list-style: none; margin: 0 0 24px; padding: 0;
}
.seasons > li {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.seasons h3 { display: flex; align-items: center; gap: .5em; }
.seasons h3::before {
  content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--accent);
}
.seasons ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: .9375rem; }
.seasons ul li + li { margin-top: .4em; }

/* Commissions */
.commissions {
  display: grid; grid-template-columns: repeat(3, 1fr);
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.commissions li {
  position: relative; padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line);
}
.commissions h3 { margin-bottom: .2em; transition: color .2s; }
.commissions p { margin: 0; color: var(--muted); font-size: .9375rem; }

/* Survol : un trait bleu se déroule sous la tuile, le titre se colore et un chevron glisse après lui. */
.commissions li::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left;
  pointer-events: none; transition: transform .3s ease;
}
.commissions h3 button::after {
  content: ""; display: inline-block; width: .45em; height: .45em;
  margin-left: .45em; vertical-align: .1em;
  border-top: 2px solid; border-right: 2px solid;
  opacity: 0; transform: translateX(-6px) rotate(45deg);
  transition: transform .3s ease, opacity .3s ease;
}
.commissions li:is(:hover, :has(:focus-visible)) h3 { color: var(--blue); }
.commissions li:is(:hover, :has(:focus-visible))::after { transform: scaleX(1); }
.commissions li:is(:hover, :has(:focus-visible)) h3 button::after { opacity: 1; transform: translateX(0) rotate(45deg); }

@media (prefers-reduced-motion: reduce) {
  .commissions li::after,
  .commissions h3 button::after { transition: none; }
}

/* Le titre est un bouton qui ouvre la carte ; son ::before couvre toute la tuile pour la rendre cliquable. */
.commissions h3 button {
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.commissions h3 button::before { content: ""; position: absolute; inset: 0; border-radius: 4px; }
.commissions h3 button:focus-visible { outline: none; }
.commissions h3 button:focus-visible::before { outline: 3px solid var(--blue); outline-offset: 3px; }

.commission-card {
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px);
  padding: 0; border: 0; border-radius: var(--radius);
  color: var(--ink); background: var(--bg);
  box-shadow: 0 20px 50px rgba(29, 35, 41, .25);
}
.commission-card::backdrop { background: rgba(29, 35, 41, .55); }
.commission-card img {
  display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; background: var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent);
  mask-image: linear-gradient(to bottom, #000 65%, transparent);
}
.commission-card img[hidden] { display: none; }
.commission-card-body { padding: 28px; }
.commission-card h3 { padding-right: 40px; font-size: 1.375rem; }
.commission-card p { color: var(--muted); }
.commission-card p:has(+ .bullets) { margin-bottom: .4em; }
.commission-card .people { margin-top: 20px; }
/* La croix reste en haut de la carte quand on la fait défiler, et passe devant l'image (que son masque fait passer devant). */
.commission-card > form { position: sticky; top: 0; z-index: 1; height: 0; }
.commission-card-close {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--ink);
  font-size: 1.375rem; line-height: 1; cursor: pointer;
}
.commission-card-close:hover { border-color: var(--blue); color: var(--blue); }

/* Sur grand écran, l'image passe à gauche du texte et s'estompe vers lui. */
@media (min-width: 761px) {
  .commission-card:has(> img:not([hidden])) { width: min(960px, calc(100% - 32px)); }
  .commission-card[open]:has(> img:not([hidden])) { display: grid; grid-template-columns: 2fr 3fr; }
  .commission-card:has(> img:not([hidden])) > form { display: contents; }
  .commission-card:has(> img:not([hidden])) > img {
    height: 100%; aspect-ratio: auto;
    -webkit-mask-image: linear-gradient(to right, #000 55%, transparent);
    mask-image: linear-gradient(to right, #000 55%, transparent);
  }
}

.dormant {
  margin-top: 40px; padding: 24px; max-width: 760px;
  border-left: 3px solid var(--line); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
}
.dormant p { color: var(--muted); }
.dormant p:last-child { margin: 0; }

/* Bureau et contacts */
.people { margin: 0; }
.people > div {
  display: grid; grid-template-columns: 9.5em 1fr; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
.people > div[hidden] { display: none; }
.people > div:first-child, .people > div[hidden] + div { border-top: 1px solid var(--line); }
.people dt { color: var(--muted); font-size: .9375rem; padding-top: .1em; }
.people dd { margin: 0; font-weight: 500; }
/* Liste de noms sans fonction (parents délégués), dans le même style. */
.people-list {
  list-style: none; margin: 0; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.people .nom, .people-list .nom { font-variant-caps: all-small-caps; letter-spacing: .04em; }
.people dd.placeholder, .people-list.placeholder { color: var(--muted); font-style: italic; font-weight: 400; }
.list-order { margin: .5em 0 0; color: var(--muted); font-size: .8125rem; }
.after-list { margin-top: 1.5em; }
/* Les colonnes partagent les lignes de la grille : les titres, les listes et les textes s'alignent. */
.team { row-gap: 0; }
.team > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; }

.contacts { list-style: none; margin: 0 0 1.5em; padding: 0; }
.contacts li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.contacts li:first-child { border-top: 1px solid var(--line); }
.contacts span { display: block; color: var(--muted); font-size: .9375rem; }
.contacts a { font-weight: 600; }

.bullets { margin: 0 0 1em; padding-left: 1.1em; color: var(--muted); }
.bullets li + li { margin-top: .4em; }

.contact-block { margin-top: 64px; }
.contacts-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.contacts-row li { border-top: 1px solid var(--line); }

/* Adhérer */
.help { background: var(--bg-help); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { position: relative; padding: 0 0 .7em 1.75em; }
.checklist li::before {
  content: ""; position: absolute; left: .15em; top: .45em;
  width: .7em; height: .4em;
  border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue);
  transform: rotate(-45deg);
}

/* Liens utiles */
.links {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  list-style: none; margin: 0; padding: 0;
}
.links a {
  display: block; height: 100%; padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s;
}
.links a:hover { border-color: var(--blue); }
.links strong { display: block; color: var(--blue); }
.links span { display: block; margin-top: .25em; color: var(--muted); font-size: .9375rem; }

/* Pied de page */
.site-footer {
  padding: 40px 0; background: var(--bg-alt); border-top: 1px solid var(--line);
  font-size: .9375rem;
}
.footer-inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: 40px; }
.site-footer p { margin: 0 0 .35em; }
.legal { color: var(--muted); font-size: .875rem; }

/* Tablette */
@media (max-width: 960px) {
  .seasons, .links { grid-template-columns: repeat(2, 1fr); }
  .commissions { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 760px) {
  :root { --header-h: 108px; }

  .header-inner { flex-wrap: wrap; gap: 0 16px; padding-top: 8px; }
  .brand img { height: 48px; }
  .site-header .btn-small { margin-left: auto; }
  .main-nav {
    order: 3; width: calc(100% + 48px); margin: 6px -24px 0;
    overflow-x: auto; scrollbar-width: none;
    border-top: 1px solid var(--line);
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav ul { padding: 4px 16px; }
  .main-nav a { white-space: nowrap; }

  .hero { padding: 48px 0; }
  .section { padding: 56px 0; }

  .facts { grid-template-columns: 1fr; margin-top: 40px; }
  .facts > div { padding: 16px 0; }
  .facts > div:last-child { border-bottom: 1px solid var(--line); }

  .cols-3, .cols-2, .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .commissions { grid-template-columns: 1fr; }
  .people > div { grid-template-columns: 1fr; gap: 2px; }
  .team > div { display: block; grid-row: auto; }
  .contact-block { margin-top: 48px; }
  .contacts-row { grid-template-columns: 1fr; }
  .contacts-row li + li { border-top: 0; }
}

@media (max-width: 480px) {
  .seasons, .links { grid-template-columns: 1fr; }
}
