/* Avensud Formation — feuille de style principale */

:root {
  --nuit: #0F2346;
  --nuit-2: #1A3462;
  --soleil: #F4B63F;
  --soleil-clair: #FBE3A8;
  --ocre: #9A5A12;          /* accent texte sur fond clair (AA) */
  --calcaire: #F4F5F0;
  --blanc: #FFFFFF;
  --ardoise: #4B5A74;
  --ciel: #DDE6F2;
  --trait: #D3D9E2;

  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 128px);
  --radius-s: 6px;
  --radius-l: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--calcaire);
  color: var(--nuit);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; max-width: 18ch; }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
ul, ol { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid var(--soleil); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--soleil); color: var(--nuit); padding: 10px 16px; border-radius: var(--radius-s); font-weight: 600; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: var(--section) 0; }
.section-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head p { margin: 0; color: var(--ardoise); max-width: 46ch; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px;
  font: 600 1rem/1.2 var(--text);
  border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-sun { background: var(--soleil); color: var(--nuit); }
.btn-sun:hover { background: var(--soleil-clair); }
.btn-line { border-color: currentColor; color: inherit; }
.btn-line:hover { background: rgba(255,255,255,.08); }
.btn-ink { background: var(--nuit); color: var(--blanc); }
.btn-ink:hover { background: var(--nuit-2); }

/* En-tête */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--nuit); color: var(--blanc);
  transition: box-shadow .2s;
}
.site-header.is-scrolled { box-shadow: 0 1px 0 rgba(244,182,63,.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blanc); }
.brand-mark { width: 36px; height: 36px; color: var(--soleil); }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; line-height: 1; }
.brand-name span { font-weight: 400; margin-left: 6px; color: var(--ciel); }

.nav ul { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { display: block; padding: 10px 12px; text-decoration: none; font-weight: 500; color: var(--ciel); border-radius: var(--radius-s); }
.nav a:not(.btn):hover { color: var(--blanc); text-decoration: underline; }
.nav-cta { margin-left: 12px; min-height: 42px; padding: 8px 20px; }

.menu-toggle { display: none; width: 48px; height: 48px; border: 0; background: transparent; color: var(--blanc); cursor: pointer; border-radius: var(--radius-s); }
.menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
  display: block; width: 24px; height: 2px; background: currentColor; margin: 0 auto; border-radius: 2px;
  transition: transform .25s, opacity .2s; content: ""; position: relative;
}
.menu-toggle-bars::before { position: absolute; top: -7px; }
.menu-toggle-bars::after { position: absolute; top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero { background: var(--nuit); color: var(--blanc); padding: clamp(48px, 8vw, 96px) 0 0; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.hero-place { color: var(--soleil); font-weight: 500; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 5.2rem); font-weight: 800; letter-spacing: -0.035em; line-height: .98; max-width: 15ch; }
.hero-lead { font-size: 1.15rem; color: var(--ciel); max-width: 44ch; margin: 28px 0 36px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-art { align-self: end; }
.sunrise { width: 100%; height: auto; }

.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(221,230,242,.22); margin-top: clamp(32px, 5vw, 56px); }
.hero-facts li { padding: 28px 24px 40px 0; }
.hero-facts li + li { padding-left: 24px; border-left: 1px solid rgba(221,230,242,.22); }
.hero-facts strong { display: block; font-family: var(--display); font-size: 1.2rem; font-weight: 600; margin-bottom: 4px; }
.hero-facts span { color: var(--ciel); font-size: .95rem; }

/* Lever de soleil : la seule animation automatique du site */
.sun { transform-box: fill-box; transform-origin: center; animation: rise 1.6s cubic-bezier(.2,.7,.2,1) both .15s; }
.sun-rays { animation: glow 1.4s ease-out both .9s; }
.horizon rect { transform-box: fill-box; transform-origin: center; animation: stretch .9s cubic-bezier(.2,.7,.2,1) both; }
.horizon rect:nth-child(2) { animation-delay: .06s; }
.horizon rect:nth-child(3) { animation-delay: .12s; }
.horizon rect:nth-child(4) { animation-delay: .18s; }
.horizon rect:nth-child(5) { animation-delay: .24s; }
.horizon rect:nth-child(6) { animation-delay: .30s; }
@keyframes rise { from { transform: translateY(105%); } to { transform: translateY(0); } }
@keyframes glow { from { opacity: 0; } to { opacity: 1; } }
@keyframes stretch { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Approche */
.approach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 96px); }
.approach-intro h2 { margin-bottom: 28px; }
.approach-intro > p { max-width: 52ch; color: #2A3A55; }
.photo-slot { margin: 40px 0 0; }
.photo-slot img, .photo-placeholder { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; border-radius: var(--radius-l) var(--radius-l) var(--radius-l) 0; overflow: hidden; }
.photo-placeholder svg { width: 100%; height: 100%; }
.photo-slot figcaption { margin-top: 12px; font-size: .9rem; color: var(--ardoise); }

.principles { align-self: center; border-top: 2px solid var(--nuit); }
.principles li { padding: 28px 0; border-bottom: 1px solid var(--trait); display: grid; grid-template-columns: 22px 1fr; column-gap: 20px; }
.principles li::before {
  content: ""; grid-row: 1 / span 2; width: 22px; height: 11px; margin-top: 6px;
  background: var(--soleil); border-radius: 22px 22px 0 0;
}
.principles h3 { margin-bottom: 6px; }
.principles p { margin: 0; color: var(--ardoise); }

/* Catalogue */
.catalog { background: var(--blanc); }
.catalog-list { border-top: 2px solid var(--nuit); }
.course {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 24px 64px;
  padding: 36px 0; border-bottom: 1px solid var(--trait);
}
.course h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 12px; }
.course-main p { margin: 0; color: #2A3A55; max-width: 54ch; }
.course-meta { margin: 0; display: grid; gap: 10px; align-content: start; padding-top: 6px; }
.course-meta div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.course-meta dt { color: var(--ocre); font-weight: 600; font-size: .92rem; }
.course-meta dd { margin: 0; font-size: .97rem; }
.catalog-note { margin: 36px 0 0; font-size: 1.1rem; }
.catalog-note a { color: var(--ocre); font-weight: 600; }

/* Déroulé */
.steps { background: var(--ciel); }
.step-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.step-list li { position: relative; padding: 0 20px 0 0; }
.step-list li::before {
  content: ""; position: absolute; left: 0; right: 0; top: 27px; height: 2px; background: var(--nuit); opacity: .25;
}
.step-list li:last-child::before { right: auto; width: 56px; }
.step-num {
  position: relative; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--nuit); color: var(--soleil);
  font-family: var(--display); font-weight: 800; font-size: 1.4rem;
  margin-bottom: 24px;
}
.step-list h3 { margin-bottom: 8px; }
.step-list p { margin: 0; color: #2A3A55; font-size: .98rem; }

/* Financement */
.funding-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(40px, 7vw, 96px); align-items: start; }
.funding-intro { position: sticky; top: 112px; }
.funding-intro h2 { margin-bottom: 24px; }
.funding-intro p { color: #2A3A55; max-width: 44ch; margin-bottom: 32px; }
.funding-list { margin: 0; border-top: 2px solid var(--nuit); }
.funding-list div { padding: 24px 0; border-bottom: 1px solid var(--trait); }
.funding-list dt { font-family: var(--display); font-weight: 600; font-size: 1.3rem; margin-bottom: 6px; }
.funding-list dd { margin: 0; color: var(--ardoise); }

/* Accessibilité */
.access { background: var(--nuit); color: var(--blanc); position: relative; overflow: hidden; }
.access::after {
  content: ""; position: absolute; right: -120px; bottom: -200px; width: 420px; height: 420px;
  border-radius: 50%; border: 2px solid rgba(244,182,63,.3); pointer-events: none;
}
.access-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(40px, 7vw, 96px); align-items: center; position: relative; z-index: 1; }
.access h2 { margin-bottom: 24px; }
.access p { color: var(--ciel); max-width: 58ch; }
.access-card { background: var(--nuit-2); border-radius: var(--radius-l); padding: 32px; border-top: 6px solid var(--soleil); }
.access-card p { color: var(--blanc); margin: 0 0 10px; }
.access-card-title { color: var(--soleil) !important; font-weight: 600; }
.access-name { font-family: var(--display); font-size: 1.5rem; font-weight: 600; }
.access-card a { color: var(--blanc); }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(32px, 6vw, 80px); }
.faq-list { border-top: 2px solid var(--nuit); }
.faq details { border-bottom: 1px solid var(--trait); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 22px 0; font-family: var(--display); font-weight: 600; font-size: 1.2rem; line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 22px; height: 11px; border-radius: 22px 22px 0 0;
  background: var(--trait); transition: background-color .2s, transform .25s;
  transform: rotate(180deg);
}
.faq details[open] summary::after { background: var(--soleil); transform: rotate(0); }
.faq summary:hover { color: var(--nuit-2); }
.faq details p { margin: 0 0 24px; color: #2A3A55; max-width: 62ch; }

/* Contact */
.contact { background: var(--blanc); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(40px, 7vw, 96px); }
.contact-intro h2 { margin-bottom: 24px; }
.contact-intro > p { color: #2A3A55; max-width: 42ch; }
.coords { font-style: normal; margin-top: 36px; padding-top: 24px; border-top: 2px solid var(--nuit); }
.coords p { margin-bottom: 18px; }
.coords a { font-weight: 500; }

.form { display: grid; gap: 20px; align-content: start; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.opt { font-weight: 400; color: var(--ardoise); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--nuit);
  background: var(--calcaire); border: 1.5px solid var(--trait); border-radius: var(--radius-s);
  padding: 12px 14px; min-height: 48px;
  transition: border-color .2s, background-color .2s;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--nuit); background: var(--blanc); box-shadow: 0 0 0 3px var(--soleil); }
.field [aria-invalid="true"] { border-color: #B3261E; }
.form-legal { font-size: .88rem; color: var(--ardoise); margin: 0; }
.form .btn { justify-self: start; }
.form-status { margin: 0; font-weight: 500; min-height: 1.6em; }
.form-status.is-error { color: #B3261E; }

.map-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 0; margin-top: clamp(56px, 8vw, 96px); }
.map { width: 100%; height: 100%; min-height: 360px; border: 0; border-radius: var(--radius-l) 0 0 var(--radius-l); filter: saturate(.85); }
.map-info { background: var(--nuit); color: var(--blanc); padding: 36px; border-radius: 0 var(--radius-l) var(--radius-l) 0; }
.map-info h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: 18px; color: var(--soleil); }
.map-info p { color: var(--ciel); }
.map-info strong { color: var(--blanc); }
.map-info a { color: var(--soleil); font-weight: 600; }

/* Pied de page */
.site-footer { background: var(--nuit); color: var(--ciel); padding-bottom: 32px; font-size: .95rem; }
.footer-horizon {
  height: 34px;
  background:
    linear-gradient(var(--soleil), var(--soleil)) top / 100% 6px no-repeat,
    linear-gradient(rgba(244,182,63,.6), rgba(244,182,63,.6)) 0 14px / 100% 4px no-repeat,
    linear-gradient(rgba(244,182,63,.3), rgba(244,182,63,.3)) 0 24px / 100% 3px no-repeat;
  margin-bottom: 56px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.footer-brand { font-family: var(--display); font-weight: 800; font-size: 1.5rem; color: var(--blanc); margin-bottom: 8px; }
.footer-small { font-size: .85rem; opacity: .8; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { color: var(--blanc); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(221,230,242,.18); }
.footer-bottom p { margin: 0; font-size: .88rem; }

/* Page mentions légales */
.legal-hero { background: var(--nuit); color: var(--blanc); padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 64px); }
.legal-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); font-weight: 800; letter-spacing: -0.03em; }
.legal-hero p { color: var(--ciel); margin: 16px 0 0; }
.legal { padding: var(--section) 0; }
.legal-body { max-width: 72ch; }
.legal-body h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 56px 0 16px; max-width: none; }
.legal-body h2:first-child { margin-top: 0; }
.legal-body h3 { margin: 28px 0 8px; }
.legal-body p, .legal-body li { color: #2A3A55; }
.legal-body ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1em; }
.todo { background: var(--soleil-clair); padding: 0 .3em; border-radius: 3px; }

/* Responsive */
@media (max-width: 1020px) {
  .step-list { grid-template-columns: 1fr; gap: 0; }
  .step-list li { display: grid; grid-template-columns: 56px 1fr; column-gap: 24px; padding: 0 0 32px; }
  .step-list li::before { left: 27px; right: auto; top: 56px; bottom: 0; width: 2px; height: auto; }
  .step-list li:last-child::before { display: none; }
  .step-num { grid-row: 1 / span 2; margin: 0; }
  .step-list h3 { padding-top: 14px; }
}

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: 72px 0 auto 0; background: var(--nuit);
    padding: 8px var(--gutter) 28px; border-top: 1px solid rgba(221,230,242,.18);
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility 0s .2s;
  }
  .nav.is-open { opacity: 1; transform: none; visibility: visible; transition: opacity .2s, transform .2s; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a:not(.btn) { padding: 14px 0; font-size: 1.15rem; border-bottom: 1px solid rgba(221,230,242,.12); border-radius: 0; }
  .nav-cta { margin: 20px 0 0; width: 100%; min-height: 50px; }

  .hero-grid, .approach-grid, .funding-grid, .access-grid, .faq-grid, .contact-grid, .section-head { grid-template-columns: 1fr; }
  .hero-art { max-width: 520px; margin: 0 auto; width: 100%; }
  .funding-intro { position: static; }
  .course { grid-template-columns: 1fr; }
  .map-wrap { grid-template-columns: 1fr; }
  .map { border-radius: var(--radius-l) var(--radius-l) 0 0; min-height: 300px; }
  .map-info { border-radius: 0 0 var(--radius-l) var(--radius-l); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 1rem; }
  .hero-facts { grid-template-columns: 1fr; }
  .hero-facts li, .hero-facts li + li { padding: 18px 0; border-left: 0; }
  .hero-facts li + li { border-top: 1px solid rgba(221,230,242,.22); }
  .hero-actions .btn { flex: 1 1 100%; }
  .field-row { grid-template-columns: 1fr; }
  .form .btn { justify-self: stretch; }
  .course-meta div { grid-template-columns: 70px 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .map-info { padding: 28px 24px; }
  .access-card { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
