/* ═══════════════════════════════════════════════════════════════════
   site.css - feuille de style partagée des pages internes
   (ADID, BASES, ERGO, MÉTHODES, STIC, VIP, Laboratoire, Assistants ADDIE)
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --cream: #ede8d0;
  --cream-light: #f8f4e7;
  --cream-deep: #d7cfb2;
  --ink: #2b1114;
  --ink-soft: #665554;
  --terracotta: #c63c15;
  --terracotta-dark: #8e2812;
  --gold: #d39a1c;
  --sage: #7d8767;
  --line: rgba(43, 17, 20, 0.18);
  --white: #fffdf6;
  --shadow: 0 22px 60px rgba(70, 39, 29, 0.14);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(
    rgba(43, 17, 20, 0.08) 0.65px,
    transparent 0.65px
  );
  background-size: 9px 9px;
  content: "";
  opacity: 0.24;
  pointer-events: none;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}

.shell {
  width: min(1240px, calc(100% - 48px));
  margin-inline: auto;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
}
.skip-link:focus {
  transform: translateY(0);
}

/* ─────────────────────────────  EN-TÊTE  ───────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(198, 60, 21, 0.94);
  color: var(--white);
  backdrop-filter: blur(16px);
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--white);
  text-decoration: none;
}
.brand-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  object-fit: cover;
}
.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand strong {
  font-size: 0.94rem;
}
.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.72rem;
}

main {
  flex: 1 0 auto;
  padding-bottom: clamp(48px, 7vw, 96px);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.main-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}
.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.16);
}
.main-nav .nav-contact {
  margin-left: 6px;
  padding-inline: 16px;
  background: var(--cream-light);
  color: var(--ink);
}

/* Menu déroulant « Salles de classe » (élément <details>, sans JS). */
.nav-dropdown {
  position: relative;
}
.nav-dropdown > summary {
  list-style: none;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--white);
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 180ms ease;
}
.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}
.nav-dropdown > summary::after {
  content: " ▾";
  font-size: 0.75em;
}
.nav-dropdown > summary:hover,
.nav-dropdown > summary:focus-visible,
.nav-dropdown[open] > summary {
  background: rgba(255, 255, 255, 0.16);
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  padding: 8px;
  border-radius: 14px;
  background: var(--terracotta-dark);
  box-shadow: var(--shadow);
}
.nav-dropdown-panel a {
  padding: 9px 12px;
  border-radius: 10px;
}

.menu-button {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 750;
  cursor: pointer;
}
.menu-lines,
.menu-lines::before,
.menu-lines::after {
  width: 20px;
  height: 2px;
  display: block;
  background: currentColor;
  transition: transform 180ms ease;
}
.menu-lines {
  position: relative;
}
.menu-lines::before,
.menu-lines::after {
  position: absolute;
  left: 0;
  content: "";
}
.menu-lines::before {
  top: -6px;
}
.menu-lines::after {
  top: 6px;
}
.menu-button[aria-expanded="true"] .menu-lines {
  background: transparent;
}
.menu-button[aria-expanded="true"] .menu-lines::before {
  top: 0;
  transform: rotate(45deg);
}
.menu-button[aria-expanded="true"] .menu-lines::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ─────────────────────────  TITRE DE PAGE  ─────────────────────────── */
.page-head {
  padding-block: clamp(40px, 6vw, 76px) clamp(28px, 4vw, 44px);
}
.eyebrow {
  margin-bottom: 14px;
  color: var(--terracotta-dark);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.page-head h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.page-head .lead {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
}

/* ─────────────────────────  GRILLE DE CARTES  ──────────────────────── */
main {
  padding-bottom: clamp(48px, 7vw, 96px);
}
#courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  perspective: 1000px;
  color: inherit;
  text-decoration: none;
}
.card-inner {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform 600ms ease;
}
.card:hover .card-inner,
.card:focus-visible .card-inner,
.card:focus-within .card-inner {
  transform: rotateY(180deg);
}
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 10px 26px rgba(43, 17, 20, 0.12);
}
img.card-front {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
div.card-front {
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--cream-deep);
}
div.card-front h3 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.card-back {
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--terracotta);
  color: var(--white);
  text-align: center;
  transform: rotateY(180deg);
}
.card-back span {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.35;
}
.card-back strong {
  font-weight: 850;
}

/* ────────────  PAGES DOCUMENT (BASES : intro + aperçu PDF)  ────────── */
.intro-text {
  max-width: 760px;
  margin-bottom: 32px;
}
.intro-text h1 {
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.intro-text p {
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.slide-preview-container {
  display: flex;
  justify-content: center;
}
.slide-preview {
  width: min(100%, 900px);
  margin: 0;
}
.slide-pdf {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.slide-preview figcaption {
  margin-top: 10px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

/* Référence bibliographique (page Assistants ADDIE). */
.reference {
  max-width: 760px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ─────────────────────────────  PIED DE PAGE  ──────────────────────── */
.site-footer {
  padding-top: 44px;
  background: var(--cream-deep);
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 36px;
}
.footer-inner strong {
  font-size: 0.95rem;
}
.footer-inner p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 22px;
}
.footer-inner a,
.footer-legal a {
  text-underline-offset: 4px;
}
.footer-legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.75rem;
}
.footer-legal p {
  margin-bottom: 0;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

/* ─────────────────────────────  RESPONSIVE  ────────────────────────── */
@media (max-width: 1040px) {
  .main-nav a,
  .nav-dropdown > summary {
    padding-inline: 7px;
    font-size: 0.78rem;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 32px, 700px);
  }
  .header-inner {
    min-height: 66px;
  }
  .menu-button {
    display: inline-flex;
  }
  .main-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 0 0 18px 18px;
    background: var(--terracotta-dark);
    box-shadow: var(--shadow);
  }
  .main-nav.is-open {
    display: flex;
  }
  .main-nav a,
  .nav-dropdown > summary {
    padding: 11px 13px;
    font-size: 0.9rem;
  }
  .nav-dropdown-panel {
    position: static;
    margin-top: 4px;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.16);
  }
  .main-nav .nav-contact {
    margin: 5px 0 0;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }
  #courses {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-inner nav {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
