/* ==========================================================================
   EPEF — Mise en page : conteneur, en-tête, menus, pied de page, sections
   ========================================================================== */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--c-anthracite); color: var(--c-creme);
  padding: 10px 16px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); position: relative; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding-block: clamp(48px, 7vw, 80px); }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head--row { max-width: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .kicker { justify-content: center; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(36px, 6vw, 88px); align-items: center; }
.two-col--top { align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px; }

@media (max-width: 900px) {
  .two-col, .three-col { grid-template-columns: 1fr; }
}

/* ---------- En-tête ---------- */
[data-include="header"] { min-height: var(--header-h); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background-color .35s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.site-header > .container { height: 100%; display: flex; align-items: center; gap: 24px; }

.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.site-brand img { height: 52px; width: auto; }
.site-brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.site-brand-text b { font-family: var(--font-title); font-weight: 400; font-size: 1.45rem; letter-spacing: .04em; }
.site-brand-text small { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute); font-weight: 700; }

/* Logo clair / sombre selon le thème */
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

/* Navigation bureau */
.desktop-nav { margin-left: auto; }
.desktop-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; text-decoration: none;
  background: none; border: 0; cursor: pointer; color: var(--ink);
  transition: background-color .2s, color .2s;
}
.nav-link .icon { width: 15px; height: 15px; transition: transform .25s var(--ease); }
.nav-link:hover, .nav-item:focus-within > .nav-link, .nav-item.is-open > .nav-link { background: var(--bg-alt); }
.nav-link[aria-current="page"], .nav-item.is-current > .nav-link { color: var(--accent-ink); }
.nav-item.is-open > .nav-link .icon { transform: rotate(180deg); }

.dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%;
  min-width: 260px; padding: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity .2s, transform .25s var(--ease), visibility .2s;
}
.dropdown::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; } /* pont pour le survol */
.nav-item:hover > .dropdown, .nav-item.is-open > .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.dropdown a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; font-size: .95rem;
}
.dropdown a:hover, .dropdown a:focus-visible { background: var(--bg-alt); color: var(--accent-ink); }
.dropdown a[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }
.dropdown a .icon { width: 14px; height: 14px; opacity: .55; }
.dropdown-label {
  display: block; padding: 12px 14px 4px; margin-top: 6px; border-top: 1px solid var(--line);
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-mute);
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.theme-toggle, .nav-toggle {
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: none; border: 1px solid var(--line); cursor: pointer; color: var(--ink);
  transition: background-color .2s, border-color .2s, transform .3s var(--ease);
}
.theme-toggle:hover, .nav-toggle:hover { background: var(--bg-alt); border-color: var(--line-strong); }
.theme-toggle .icon { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 1120px) {
  .desktop-nav, .header-actions .btn { display: none; }
  .nav-toggle { display: inline-grid; }
  .header-actions { margin-left: auto; }
}

/* Menu mobile */
.mobile-nav {
  position: fixed; inset: 0; z-index: 150;
  background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .45s var(--ease), visibility .45s;
  visibility: hidden;
  overflow-y: auto;
}
.mobile-nav.is-open { transform: none; visibility: visible; }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding-inline: var(--gutter); border-bottom: 1px solid var(--line); flex: none; }
.mobile-nav-body { padding: 16px var(--gutter) 40px; flex: 1; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav > .mobile-nav-body > ul > li { border-bottom: 1px solid var(--line); }
.mobile-nav .m-link {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--font-title); font-size: 1.6rem; text-decoration: none; color: var(--ink);
}
.mobile-nav .m-link .icon { transition: transform .3s var(--ease); }
.mobile-nav .m-link[aria-expanded="true"] .icon { transform: rotate(180deg); }
.mobile-nav .m-sub { padding: 0 0 16px 4px; }
.mobile-nav .m-sub a { display: block; padding: 9px 0; text-decoration: none; color: var(--ink-soft); font-size: 1.05rem; }
.mobile-nav .m-sub a[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }
.mobile-nav .m-sub .dropdown-label { border: 0; padding-left: 0; }
.mobile-nav-foot { padding: 24px var(--gutter) 32px; border-top: 1px solid var(--line); display: grid; gap: 12px; color: var(--ink-soft); font-size: .95rem; }
body.nav-open { overflow: hidden; }

/* ---------- En-tête de page intérieure ---------- */
.page-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero-bg); color: var(--hero-ink);
  padding-block: clamp(64px, 9vw, 120px) clamp(56px, 7vw, 96px);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(240, 191, 89, .16), transparent 60%),
    radial-gradient(50% 70% at 0% 100%, rgba(208, 123, 74, .18), transparent 60%);
}
.page-hero .kicker { color: var(--hero-accent); }
.page-hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); max-width: 16ch; margin-bottom: .35em; }
.page-hero h1 .accent { color: var(--hero-accent); }
.page-hero .lead { color: rgba(255, 251, 246, .82); max-width: 640px; margin: 0; }
.page-hero-mark {
  position: absolute; right: -60px; bottom: -80px; width: clamp(240px, 30vw, 420px);
  opacity: .09; pointer-events: none; z-index: -1;
}
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; margin-bottom: 28px; color: rgba(255, 251, 246, .7); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--c-creme); text-decoration: underline; }
.breadcrumb span[aria-hidden] { opacity: .5; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--c-anthracite); color: rgba(255, 251, 246, .78); padding-top: clamp(64px, 8vw, 96px); font-size: .95rem; }
[data-theme="dark"] .site-footer { background: #1A1A1A; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--c-jaune); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; padding-bottom: 56px; }
.footer-brand img { width: 120px; margin-bottom: 20px; }
.footer-brand p { max-width: 34ch; }
.footer-tagline { font-family: var(--font-title); font-size: 1.25rem; color: var(--c-creme); }
.site-footer .kicker { color: var(--c-jaune); margin-bottom: 16px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom {
  border-top: 1px solid rgba(255, 251, 246, .1);
  padding-block: 22px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: .85rem; color: rgba(255, 251, 246, .55);
}
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
