/* ==========================================================================
   Découvrir Autrement · feuille de style commune
   Direction « Carnet de plongée » : abysses + papier, cyan Méditerranée,
   vert Eau douce, Barlow Condensed (titres) + Inter (texte).
   Mobile d'abord, sans framework.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Couleurs de la charte (Charte.dc.html) */
  --abysses: #0A2533;        /* fonds sombres, texte principal */
  --papier: #F5F7F6;         /* fond clair */
  --blanc: #FFFFFF;
  --cyan: #00AEEF;           /* Cyan Méditerranée : signature, accent sur fond sombre */
  --vert: #3DAA35;           /* Vert eau douce */
  --lien: #00739E;           /* texte accent sur fond clair (AA) */
  --alerte: #F2C14E;         /* statut de protection, réglementation */

  /* Nuances dérivées (maquette Main.dc.html) */
  --texte-2: #3E5563;        /* texte secondaire sur fond clair */
  --sur-fonce: #C9D7DE;      /* texte courant sur fond sombre */
  --sur-fonce-2: #9FB7C3;    /* texte discret sur fond sombre */
  --nuit-2: #163D50;
  --nuit-3: #1E4A60;
  --nuit-bord: #3E6276;
  --bord: #E1E8EB;
  --bord-2: #D5E1E6;
  --brume: #E6EEF1;

  /* Accent du livre courant (surchargé par .livre--eau-douce) */
  --accent: var(--cyan);

  /* Typographie */
  --f-titre: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-texte: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Mise en page */
  --largeur: 1240px;
  --gouttiere: 16px;
  --rayon: 20px;
}

@media (min-width: 640px) {
  :root { --gouttiere: 24px; }
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--abysses);
  font-family: var(--f-texte);
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: break-word;
}
@media (min-width: 640px) { body { font-size: 17px; } }

img, svg, picture { max-width: 100%; height: auto; display: block; }

a { color: var(--lien); text-underline-offset: 0.15em; }
a:hover { color: var(--abysses); }

h1, h2, h3, h4 { margin: 0; }
p, ul, ol, dl, figure { margin: 0; }

/* Focus visible : contraste ≥ 3:1 sur fond clair (lien) comme sur fond sombre (cyan) */
:focus-visible {
  outline: 3px solid var(--lien);
  outline-offset: 3px;
  border-radius: 4px;
}
.sombre :focus-visible { outline-color: var(--cyan); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 100;
  background: var(--cyan); color: var(--abysses);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 8px; }

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

/* ---------- 3. Typo utilitaire ---------- */
.titre-xl, .titre-l, .titre-m, .titre-s {
  font-family: var(--f-titre);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
.titre-xl { font-size: clamp(2.6rem, 8vw, 5.25rem); line-height: 0.95; letter-spacing: 0.005em; }
.titre-l  { font-size: clamp(2.25rem, 5.5vw, 3.5rem); }
.titre-m  { font-size: clamp(1.6rem, 3vw, 1.875rem); line-height: 1.05; }
.titre-s  { font-size: 1.625rem; line-height: 1.1; }

.surtitre {
  font-family: var(--f-titre);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lien);
}
.sombre .surtitre { color: var(--accent); }
@media (min-width: 640px) { .surtitre { font-size: 1.125rem; } }

.texte-2 { color: var(--texte-2); }
.latin { font-style: italic; }

/* ---------- 4. Mise en page ---------- */
.container {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.section { padding-block: 64px; }
@media (min-width: 900px) { .section { padding-block: 96px; } }
.section--serre { padding-block: 40px; }
.section--brume { background: var(--brume); }

.sombre { background: var(--abysses); color: var(--papier); }

.section-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 16px 24px; padding-bottom: 40px;
}
.section-head > h2 { max-width: 640px; }
.section-head > p { max-width: 440px; color: var(--texte-2); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack--l { gap: 24px; }

/* ---------- 5. En-tête et navigation ---------- */
.site-header { background: var(--abysses); color: var(--papier); position: relative; z-index: 10; }
.site-header__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 16px; padding-block: 14px;
}
@media (min-width: 960px) { .site-header__inner { padding-block: 18px; } }

/* Logo-cartouche (reprend le bandeau de la couverture) */
.brand {
  display: inline-flex; flex-direction: column;
  background: var(--blanc); color: var(--accent);
  border: 3px solid var(--accent);
  padding: 6px 12px;
  font-family: var(--f-titre); font-weight: 700; font-size: 1.1875rem;
  line-height: 1; letter-spacing: 0.03em; text-transform: uppercase;
  text-decoration: none;
}
.brand:hover { color: var(--accent); }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  background: transparent; color: var(--papier);
  border: 1.5px solid var(--nuit-bord); border-radius: 999px;
  font: 600 0.9375rem/1 var(--f-texte); cursor: pointer;
}
.nav-toggle svg { width: 20px; height: 20px; }
.no-js .nav-toggle { display: none; }

.site-nav { width: 100%; }
.site-nav ul {
  list-style: none; margin: 0; padding: 8px 0 4px;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 0.9375rem; font-weight: 500;
}
.site-nav a {
  display: block; padding: 10px 0;
  color: var(--papier); text-decoration: none;
}
.site-nav a:hover { color: var(--cyan); }
.site-nav a[aria-current="page"] {
  color: var(--cyan);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.site-nav .btn-pill { display: inline-flex; margin-top: 8px; }
.site-nav .btn-pill:hover { color: var(--abysses); }

/* Menu replié sur mobile uniquement quand le JS est actif */
.js .site-nav[data-open="false"] { display: none; }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .site-nav, .js .site-nav[data-open="false"] { display: block; width: auto; }
  .site-nav ul { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding: 0; }
  .site-nav .btn-pill { margin-top: 0; }
}

/* ---------- 6. Boutons ---------- */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  background: var(--accent); color: var(--abysses);
  border-radius: 999px; font-weight: 600; text-decoration: none;
}
.btn-pill:hover { background: var(--papier); color: var(--abysses); }
.btn-pill--sombre { background: var(--abysses); color: var(--papier); }
.btn-pill--sombre:hover { background: var(--lien); color: var(--blanc); }

.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-store {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 12px 20px;
  background: var(--papier); color: var(--abysses);
  border: 1.5px solid var(--papier); border-radius: 12px;
  font-weight: 600; text-decoration: none;
}
.btn-store svg { width: 20px; height: 20px; flex-shrink: 0; }
.btn-store:hover { background: var(--cyan); border-color: var(--cyan); color: var(--abysses); }
.btn-store--ghost { background: transparent; color: var(--papier); border-color: var(--nuit-bord); }
.btn-store--ghost:hover { background: transparent; color: var(--cyan); border-color: var(--cyan); }
/* Variante sur fond clair */
.stores--clair .btn-store { background: var(--abysses); border-color: var(--abysses); color: var(--papier); }
.stores--clair .btn-store:hover { background: var(--lien); border-color: var(--lien); color: var(--blanc); }
.stores--clair .btn-store--ghost { background: transparent; color: var(--abysses); border-color: var(--abysses); }
.stores--clair .btn-store--ghost:hover { background: var(--brume); color: var(--abysses); }

.lien-fleche { font-weight: 600; }
.lien-fleche::after { content: " →"; }

/* ---------- 7. Hero d'accueil ---------- */
.hero { overflow: hidden; }
.hero__inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 48px 56px;
  padding-block: 48px 72px;
}
@media (min-width: 900px) { .hero__inner { padding-block: 72px 96px; } }
.hero__texte { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero__chapo { max-width: 560px; font-size: 1.0625rem; color: var(--sur-fonce); }
@media (min-width: 640px) { .hero__chapo { font-size: 1.1875rem; } }
.hero .stores { padding-top: 8px; }
.hero__note { font-size: 0.875rem; color: var(--sur-fonce-2); }
.hero__note a { color: var(--sur-fonce); }

.hero__livres { flex: 1 1 300px; display: flex; justify-content: center; position: relative; }
.hero__anneau {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  border-radius: 50%; pointer-events: none;
}
.hero__anneau--1 { width: min(440px, 105%); aspect-ratio: 1; border: 1px solid var(--nuit-3); }
.hero__anneau--2 { width: min(580px, 140%); aspect-ratio: 1; border: 1px solid var(--nuit-2); }
.hero__pile { position: relative; width: min(420px, 100%); aspect-ratio: 420 / 440; }
.hero__pile img { position: absolute; height: auto; border-radius: 4px; }
.hero__pile .couv-eau { right: 0; top: 0; width: 55%; box-shadow: 0 24px 48px rgba(0,0,0,.45); transform: rotate(5deg); }
.hero__pile .couv-mer { left: 0; top: 11%; width: 62%; box-shadow: 0 30px 60px rgba(0,0,0,.5); transform: rotate(-4deg); }

/* ---------- 8. En-tête des pages intérieures ---------- */
.page-hero__inner { padding-block: 48px 56px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { .page-hero__inner { padding-block: 72px 80px; } }
.page-hero h1 { max-width: 900px; }
.page-hero .chapo { max-width: 680px; font-size: 1.0625rem; color: var(--sur-fonce); }
@media (min-width: 640px) { .page-hero .chapo { font-size: 1.1875rem; } }

.fil-ariane ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 0.875rem; color: var(--sur-fonce-2); }
.fil-ariane li + li::before { content: "/"; margin-right: 8px; color: var(--nuit-bord); }
.fil-ariane a { color: var(--sur-fonce); }

/* ---------- 9. Cartes ---------- */
.grille {
  display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}
.grille--large { grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); }

.carte {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 640px) { .carte { padding: 32px; } }
.carte__num { font-family: var(--f-titre); font-weight: 700; font-size: 1.25rem; color: var(--lien); }
.carte p { color: var(--texte-2); }

/* Livres de la collection */
.livre {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 24px;
  padding: 24px; display: flex; flex-wrap: wrap; gap: 24px 28px; align-items: center;
}
@media (min-width: 640px) { .livre { padding: 28px; flex-wrap: nowrap; } }
.livre__couv { width: 130px; flex-shrink: 0; border-radius: 3px; box-shadow: 0 12px 24px rgba(10,37,51,.25); }
@media (min-width: 640px) { .livre__couv { width: 150px; } }
.livre__corps { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1 1 220px; }
.livre__corps p { color: var(--texte-2); font-size: 0.9375rem; }
.livre__liens { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9375rem; font-weight: 600; }
.livre__retire { color: var(--texte-2); font-weight: 500; }

.etiquette {
  align-self: flex-start; display: inline-block;
  background: var(--accent); color: var(--abysses);
  padding: 4px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600;
}
.livre--eau-douce, .etiquette--eau-douce { --accent: var(--vert); }

/* ---------- 10. Encadré « exemple de fiche » ---------- */
.vedette {
  background: var(--abysses); color: var(--papier);
  border-radius: 28px; overflow: hidden;
  display: flex; flex-wrap: wrap;
}
.vedette__media {
  flex: 1 1 460px; min-width: 0; background: var(--blanc);
  display: flex; align-items: center; justify-content: center;
  min-height: 260px;
}
.vedette__media img { width: 100%; height: 100%; max-height: 460px; object-fit: contain; }
.vedette__corps {
  flex: 1 1 420px; min-width: 0; padding: 32px 24px;
  display: flex; flex-direction: column; gap: 18px; justify-content: center;
}
@media (min-width: 640px) { .vedette__corps { padding: 48px; } }
.vedette__corps p { color: var(--sur-fonce); }
.vedette__corps .latin { color: var(--sur-fonce-2); }
.vedette .btn-pill { align-self: flex-start; margin-top: 8px; }

.puces { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.puce { background: var(--nuit-2); color: var(--papier); padding: 6px 14px; border-radius: 999px; font-size: 0.875rem; }
.puce--alerte { background: var(--alerte); color: var(--abysses); font-weight: 600; }

/* ---------- 11. Étapes (mode d'emploi) ---------- */
.etapes {
  list-style: none; padding: 0; display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}
.etape { display: flex; flex-direction: column; gap: 12px; border-top: 2px solid var(--abysses); padding-top: 20px; }
.etape__num { font-family: var(--f-titre); font-weight: 700; font-size: 2.75rem; line-height: 1; color: var(--lien); }
.etape h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.3; }
.etape p { color: var(--texte-2); }

/* ---------- 12. Auteurs ---------- */
.auteur { display: flex; flex-direction: column; gap: 10px; }
.auteur h3 { margin-top: 8px; }
.auteur p { color: var(--texte-2); font-size: 1rem; }
.portrait {
  aspect-ratio: 4 / 3; border-radius: 16px; background: var(--bord-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--texte-2); font-size: 0.875rem; text-align: center; padding: 8px;
}

/* ---------- 13. Partenaires ---------- */
.bandeau-partenaires { border-top: 1px solid var(--bord-2); }
.bandeau-partenaires__inner {
  padding-block: 56px; display: flex; flex-wrap: wrap; gap: 32px;
  align-items: center; justify-content: space-between;
}
@media (min-width: 900px) { .bandeau-partenaires__inner { padding-block: 72px; } }
.bandeau-partenaires h2 { flex: 1 1 220px; font-size: 2rem; }
.bandeau-partenaires ul {
  flex: 3 1 600px; list-style: none; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}
.tuile {
  display: flex; align-items: center; min-height: 64px; height: 100%;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px;
  padding: 16px 20px; color: var(--abysses); font-weight: 600; font-size: 0.9375rem;
  text-decoration: none; line-height: 1.35;
}
.tuile:hover { border-color: var(--lien); color: var(--lien); }

.partenaire {
  display: grid; gap: 20px 32px; padding-block: 40px;
  border-top: 1px solid var(--bord-2);
}
.partenaire:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 760px) { .partenaire { grid-template-columns: 220px 1fr; } }
.partenaire__logo {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px;
  padding: 16px; display: flex; align-items: center; justify-content: center;
  min-height: 120px; align-self: start;
}
.partenaire__logo img { max-height: 90px; width: auto; }

/* ---------- 14. Contenu rédactionnel ---------- */
.prose { max-width: 70ch; display: flex; flex-direction: column; gap: 1em; }
.prose h2 { margin-top: 1em; }
.prose h3 { margin-top: 0.5em; }
.prose ul, .prose ol { padding-left: 1.25em; display: flex; flex-direction: column; gap: 0.4em; }
.prose blockquote {
  margin: 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--cyan);
  font-size: 1.125rem; font-style: italic;
}

.deux-colonnes { display: grid; gap: 40px; align-items: start; }
@media (min-width: 900px) {
  .deux-colonnes { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 56px; }
  .deux-colonnes--inverse { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}

.illustration img { border-radius: 16px; width: 100%; }
.illustration figcaption { margin-top: 10px; font-size: 0.875rem; color: var(--texte-2); }
.illustration--blanc img { background: var(--blanc); border: 1px solid var(--bord); }
.couv-ombre img { max-width: 320px; margin-inline: auto; border-radius: 4px; box-shadow: 0 24px 48px rgba(10,37,51,.3); }

.encadre {
  background: var(--brume); border-radius: 18px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.encadre--alerte { background: #FBEFCF; border-left: 6px solid var(--alerte); }

/* Contenu à fournir : volontairement visible pour la relecture */
.a-completer {
  display: inline-block; background: #FFF4D6; color: #5A4300;
  border: 1px dashed #B58A00; border-radius: 6px;
  padding: 2px 8px; font-size: 0.9375rem; font-weight: 500;
}
p.a-completer, div.a-completer { display: block; padding: 12px 16px; }

/* Listes de définitions (pictogrammes, mentions) */
.definitions { display: grid; gap: 8px 24px; }
@media (min-width: 640px) { .definitions { grid-template-columns: 220px 1fr; } }
.definitions dt { font-weight: 600; }
.definitions dd { margin: 0; color: var(--texte-2); }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 70ch; }
.faq details { background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 18px; }
.faq summary { font-weight: 600; cursor: pointer; min-height: 28px; }
.faq details p { margin-top: 10px; color: var(--texte-2); }

/* Liste des pages bonus RA (générée) */
.liste-ra { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.liste-ra li { background: var(--blanc); border: 1px solid var(--bord); border-radius: 14px; padding: 14px 18px; display: flex; gap: 14px; align-items: baseline; }
.liste-ra__page { font-family: var(--f-titre); font-weight: 700; font-size: 1.25rem; color: var(--lien); min-width: 4.5ch; }
.liste-ra__chapitre { display: block; font-size: 0.8125rem; color: var(--texte-2); }

/* ---------- 15. Pied de page ---------- */
.site-footer { color: var(--sur-fonce); }
.site-footer__inner {
  padding-block: 56px 32px; display: flex; flex-wrap: wrap; gap: 32px 40px; justify-content: space-between;
}
.site-footer__marque { flex: 2 1 320px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__nom { font-family: var(--f-titre); font-weight: 700; font-size: 2rem; text-transform: uppercase; color: var(--papier); line-height: 1.1; }
.site-footer__nom span { font-weight: 500; color: var(--cyan); }
.site-footer__marque p { max-width: 420px; font-size: 0.9375rem; }
.site-footer nav { flex: 1 1 200px; }
.site-footer nav ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.9375rem; }
.site-footer nav a { color: var(--sur-fonce); display: inline-block; padding: 4px 0; }
.site-footer nav a:hover { color: var(--cyan); }
.site-footer__bas {
  padding-block: 20px 32px; border-top: 1px solid var(--nuit-3);
  font-size: 0.8125rem; color: var(--sur-fonce-2);
}

/* ---------- 16. Utilitaires d'espacement ---------- */
.titre-espace { margin-bottom: 32px; }
@media (min-width: 900px) { .titre-espace { margin-bottom: 48px; } }
.suite { margin-top: 32px; }
@media (min-width: 900px) { .suite { margin-top: 40px; } }
.section--sans-haut { padding-top: 0; }
.liste-nue { list-style: none; padding: 0; }
.deux-colonnes + .deux-colonnes { margin-top: 16px; }
