/* =====================================================================
   Petite École Musicale — site public
   Motif : la portée musicale (5 lignes) structure l'en-tête, l'accueil
   et le pied de page. Le reste reste calme et lisible.
   ===================================================================== */

@font-face { font-family: "Young Serif"; src: url("../fonts/young-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #1c2240;      /* encre de partition (couleur du logo) */
  --paper: #ffffff;
  --mist: #eef2fb;     /* fond doux */
  --cobalt: #2a49b5;   /* liens et actions */
  --cobalt-dark: #1f3890;
  --sun: #f5c443;      /* signal joyeux, utilisé avec parcimonie */
  --line: #cfd6ea;
  --muted: #555d80;
  --error: #b42318;
  --ok: #1d6b45;

  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Atkinson", "Segoe UI", Arial, sans-serif;
  --wrap: 72rem;
  --gap: clamp(1rem, 3vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cobalt); text-underline-offset: .18em; }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* La portée : cinq lignes */
.staff {
  height: 33px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 8px);
  opacity: .85;
}

/* ---------- En-tête ---------- */
.site-header { padding-top: .9rem; }
.header-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gap) .5rem; display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: flex-end; gap: .7rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { width: 68px; height: auto; }
.brand-name { font-family: var(--serif); font-size: 1.35rem; line-height: 1.1; padding-bottom: .2rem; }
.brand-name small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--muted); margin-top: .15rem; }

.main-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .3rem; }
.main-nav a { display: block; padding: .45rem .7rem; color: var(--ink); text-decoration: none; border-radius: 6px; font-weight: 700; font-size: .98rem; }
.main-nav a:hover { background: var(--mist); color: var(--ink); }
.main-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--sun); border-radius: 0; }
.main-nav .has-sub { position: relative; }
.main-nav .sub { list-style: none; margin: 0; padding: .4rem; position: absolute; left: 0; top: 100%; min-width: 17rem; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(28,34,64,.12); z-index: 5; display: none; }
.main-nav .sub a { font-weight: 400; }
.main-nav .has-sub:hover .sub, .main-nav .has-sub:focus-within .sub { display: block; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .header-inner { align-items: center; }
  .menu-toggle { display: inline-block; font: 700 1rem var(--sans); color: var(--ink); background: var(--mist); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .9rem; cursor: pointer; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .main-nav > ul { flex-direction: column; padding-bottom: .5rem; }
  .main-nav .sub { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 1rem; min-width: 0; }
  .brand img { width: 52px; }
  .brand-name { font-size: 1.15rem; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-block; font: 700 1rem/1.2 var(--sans); padding: .8rem 1.25rem; border-radius: 999px; border: 2px solid var(--ink); color: var(--ink); background: var(--paper); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--mist); color: var(--ink); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.btn-primary:hover { background: var(--cobalt-dark); border-color: var(--cobalt-dark); color: #fff; }

/* ---------- Accueil ---------- */
.hero { max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) var(--gap) 1rem; }
.hero-text { max-width: 42rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* Les photos d'instruments posées comme des notes sur une portée */
.notes {
  list-style: none; margin: 2.5rem 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(.6rem, 2vw, 1.4rem);
  position: relative; min-height: 22rem; align-items: start;
}
.notes::before {
  content: ""; position: absolute; left: -100vw; right: -100vw; top: 7.5rem; height: 9rem; z-index: -1;
  background: repeating-linear-gradient(to bottom, var(--line) 0 2px, transparent 2px 2.25rem);
}
.note { margin: 0; }
.note img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 5px solid var(--paper); box-shadow: 0 0 0 2px var(--ink); }
.note span { display: block; text-align: center; font-size: .95rem; margin-top: .5rem; color: var(--muted); }
.note.n1 { margin-top: 9rem; }
.note.n2 { margin-top: 6.75rem; }
.note.n3 { margin-top: 4.5rem; }
.note.n4 { margin-top: 2.25rem; }
.note.n5 { margin-top: 0; }
@media (max-width: 720px) {
  .notes { grid-template-columns: repeat(5, 9rem); overflow-x: auto; padding-bottom: 1rem; scroll-snap-type: x mandatory; min-height: 0; }
  .note { scroll-snap-align: start; }
  .note.n1, .note.n2, .note.n3, .note.n4, .note.n5 { margin-top: 0; }
  .notes::before { top: 1.5rem; height: 6rem; background: repeating-linear-gradient(to bottom, var(--line) 0 2px, transparent 2px 1.5rem); }
}

.about { max-width: var(--wrap); margin: 0 auto; padding: 3rem var(--gap); display: grid; grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.about .prose p:first-child { font-family: var(--serif); font-size: 1.3rem; line-height: 1.45; }
.about figure { margin: 0; }
.about figure img { border-radius: 10px; width: 100%; }
@media (max-width: 760px) { .about { grid-template-columns: 1fr; } }

.parcours { background: var(--mist); padding: 3.5rem var(--gap); }
.parcours h2 { max-width: var(--wrap); margin: 0 auto 1.5rem; }
.parcours ol { list-style: none; counter-reset: etape; max-width: var(--wrap); margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.25rem; }
.parcours li { counter-increment: etape; }
.parcours a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); background: var(--paper); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.parcours a:hover { border-color: var(--cobalt); }
.parcours img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.parcours strong { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; padding: .9rem 1rem .3rem; line-height: 1.25; }
.parcours strong::before { content: counter(etape); display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--ink); color: #fff; font: 700 .85rem var(--sans); margin-right: .5rem; vertical-align: .15em; }
.parcours span { padding: 0 1rem 1rem; color: var(--muted); font-size: .97rem; }

.home-bottom { max-width: var(--wrap); margin: 0 auto; padding: 3.5rem var(--gap); display: grid; grid-template-columns: 3fr 2fr; gap: clamp(1.5rem, 4vw, 4rem); }
.home-stages { border-left: 4px solid var(--sun); padding-left: 1.5rem; align-self: start; }
@media (max-width: 760px) { .home-bottom { grid-template-columns: 1fr; } }

/* ---------- Pages intérieures ---------- */
.page { max-width: var(--wrap); margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gap) 3rem; }
.page-head { margin-bottom: 1.5rem; }
.crumb { margin: 0 0 .3rem; font-weight: 700; }
.crumb a { text-decoration: none; }
.crumb a::before { content: "‹ "; }
.page-body { display: grid; grid-template-columns: minmax(0, 44rem); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.page-body.has-image { grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); }
.page-figure { margin: 0; }
.page-figure img { border-radius: 10px; width: 100%; }
@media (max-width: 760px) { .page-body.has-image { grid-template-columns: 1fr; } .page-figure { order: -1; } }

.prose { max-width: 44rem; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .35em; }
.prose img { border-radius: 8px; margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.5rem; font-size: .98rem; display: block; overflow-x: auto; }
.prose td, .prose th { border-top: 1px solid var(--line); padding: .7rem .8rem .7rem 0; vertical-align: top; text-align: left; }
.prose tr:last-child td { border-bottom: 1px solid var(--line); }
.prose td:first-child { font-weight: 700; width: 45%; }
.prose blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 4px solid var(--sun); }

/* Pages cours */
.course-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; max-width: 52rem; }
.course-list a { display: grid; grid-template-columns: 11rem 1fr; gap: 1.25rem; align-items: center; color: var(--ink); text-decoration: none; padding: .75rem; border-radius: 10px; border: 1px solid var(--line); }
.course-list a:hover { border-color: var(--cobalt); }
.course-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.course-list h2 { font-size: 1.35rem; margin-bottom: .3rem; }
.course-list p { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .course-list a { grid-template-columns: 6rem 1fr; } }

.course-footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.siblings h2 { font-size: 1.2rem; }
.siblings ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.siblings a { display: inline-block; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }

/* ---------- Agenda ---------- */
.agenda { max-width: 46rem; margin-top: 2rem; }
.month { font-size: 1.25rem; margin: 2rem 0 .75rem; color: var(--muted); }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.event-list time { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; line-height: 1.1; }
.event-list time b { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; }
.event-list h3 { margin: .2rem 0 .25rem; }
.event-list .meta { color: var(--muted); margin-bottom: .4rem; }
.event-list.compact li { grid-template-columns: 3.6rem 1fr; align-items: center; }
.event-list.compact time { width: 3.6rem; height: 3.6rem; font-size: .72rem; }
.event-list.compact time b { font-size: 1.3rem; }
.event-list.compact span { color: var(--muted); }
.tag { display: inline-block; font: 700 .75rem var(--sans); background: var(--sun); color: var(--ink); border-radius: 999px; padding: .1rem .55rem; vertical-align: .2em; }
.past { margin-top: 2.5rem; }
.past summary { cursor: pointer; font-weight: 700; color: var(--cobalt); }
.past .event-list time { background: var(--muted); }
.empty { color: var(--muted); }

/* ---------- Formulaires ---------- */
.form-section { max-width: 46rem; margin-top: 3rem; scroll-margin-top: 1rem; }
.form-section > h2 { padding-bottom: .5rem; border-bottom: 3px solid var(--ink); }
.public-form fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
.public-form legend { font-family: var(--serif); font-size: 1.2rem; padding: 0; margin-bottom: .75rem; }
.hint { font-family: var(--sans); font-size: .9rem; color: var(--muted); }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .3rem; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); padding: .65rem .75rem; border: 2px solid var(--line); border-radius: 8px; background: var(--paper); }
.field input:focus, .field textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(42,73,181,.2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-cp { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1rem; }
@media (max-width: 520px) { .grid-2, .grid-cp { grid-template-columns: 1fr; } }
.has-error input, .has-error textarea { border-color: var(--error); }
.error { color: var(--error); font-weight: 700; font-size: .95rem; margin: .3rem 0 0; }
.form-errors { border-left: 4px solid var(--error); background: #fdf0ef; padding: .9rem 1.1rem; margin-bottom: 1.5rem; border-radius: 0 8px 8px 0; }
.form-errors p { margin: 0; }

.lieu { margin-bottom: 1rem; }
.lieu h3 { font-family: var(--sans); font-weight: 700; font-size: 1rem; color: var(--muted); margin: 0 0 .4rem; }
.choice { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .45rem; cursor: pointer; font-weight: 400; }
.choice:hover { border-color: var(--cobalt); }
.choice input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; flex: none; accent-color: var(--cobalt); }
.choice small { display: block; color: var(--muted); }
.choice:has(input:checked) { border-color: var(--cobalt); background: var(--mist); }
.choice.is-full { opacity: .6; cursor: not-allowed; }
.consent .choice { border: 0; padding-left: 0; }
.hp { position: absolute; left: -5000px; width: 1px; height: 1px; overflow: hidden; }

.confirmation { background: #eaf6ef; border-left: 4px solid var(--ok); padding: 1.2rem 1.4rem; border-radius: 0 8px 8px 0; }
.confirmation p:last-child { margin-bottom: 0; }
.notice { background: var(--mist); padding: 1.2rem 1.4rem; border-radius: 8px; }
.notice p:last-child { margin-bottom: 0; }
.warn { color: var(--error); font-weight: 700; }
.narrow { max-width: 34rem; }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: 2rem; }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 1.5rem var(--gap) 2.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 3rem; color: var(--muted); font-size: .95rem; }
.footer-inner p { margin: 0 0 .3rem; }
.footer-name { font-family: var(--serif); color: var(--ink); font-size: 1.1rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .site-header nav, .menu-toggle, .site-footer, .hero-actions, .course-footer { display: none; }
}
