/* =========================================================
   École des Sables — Charte graphique
   Couleurs extraites du logo officiel (Logo EDS.svg)
   ========================================================= */
:root {
  /* Couleurs de marque */
  --rouge:        #c91620;  /* « ECOLE »  */
  --rouge-fonce:  #b31018;  /* « DES »    */
  --bordeaux:     #870628;  /* « SABLES » */
  --noir:         #12100f;  /* « GERMAINE ACOGNY » */

  /* Palette « sable » */
  --sable-clair:  #faf6ef;
  --sable:        #f1e7d6;
  --sable-fonce:  #e4d4bb;

  --blanc:        #ffffff;
  --gris:         #6b625a;

  /* Typographie */
  --font-titre: "Oswald", "Arial Narrow", sans-serif;
  --font-texte: "Inter", system-ui, -apple-system, sans-serif;

  --max: 1200px;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(135, 6, 40, 0.10);
  --transition: .28s cubic-bezier(.2,.7,.3,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-texte);
  color: var(--noir);
  background: var(--sable-clair);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--font-titre); font-weight: 600; line-height: 1.05; letter-spacing: .01em; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); text-transform: uppercase; }
h3 { font-size: clamp(1.2rem, 2.4vw, 1.7rem); text-transform: uppercase; }

.eyebrow {
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .8rem;
  color: var(--rouge);
  font-weight: 600;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 246, 239, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sable-fonce);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding: .7rem 0;
}
.brand { display: flex; align-items: center; gap: .7rem; }
.brand img { height: 54px; width: auto; }
.brand span {
  font-family: var(--font-titre); text-transform: uppercase;
  font-size: .8rem; letter-spacing: .12em; color: var(--bordeaux); max-width: 130px; line-height: 1.1;
}
.menu { display: flex; gap: .3rem; list-style: none; align-items: center; }
.menu > li { position: relative; }
.menu > li > a {
  font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .06em;
  font-size: .95rem; padding: .6rem .85rem; display: block; border-radius: 8px;
  transition: var(--transition);
}
.menu > li > a:hover { background: var(--sable); color: var(--rouge); }
.submenu {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: var(--blanc); border: 1px solid var(--sable-fonce);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: .5rem; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: var(--transition);
}
.menu > li:hover .submenu,
.menu > li:focus-within .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu a { display: block; padding: .55rem .7rem; border-radius: 8px; font-size: .92rem; }
.submenu a:hover { background: var(--sable); color: var(--rouge); }

.btn {
  display: inline-block; font-family: var(--font-titre); text-transform: uppercase;
  letter-spacing: .08em; background: var(--rouge); color: var(--blanc);
  padding: .7rem 1.4rem; border-radius: 999px; transition: var(--transition);
  border: 2px solid var(--rouge); cursor: pointer; font-size: .95rem;
}
.btn:hover { background: var(--bordeaux); border-color: var(--bordeaux); transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--rouge); }
.btn.ghost:hover { background: var(--rouge); color: var(--blanc); }

/* Lien d'évitement (accessibilité) */
.skip-link {
  position: absolute; left: 50%; top: -60px; transform: translateX(-50%); z-index: 2000;
  background: var(--rouge); color: #fff; padding: .6rem 1.2rem; border-radius: 0 0 10px 10px;
  font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .06em; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* Bouton recherche */
.search-btn {
  margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--bordeaux);
  font-size: 1.5rem; line-height: 1; padding: .2rem .5rem; border-radius: 8px; transition: var(--transition);
}
.search-btn:hover { color: var(--rouge); background: var(--sable); }
.search-btn + .lang-switch { margin-left: .4rem; }

/* Overlay de recherche */
.search-overlay {
  position: fixed; inset: 0; z-index: 1200; display: none;
  background: rgba(12,8,10,.6); backdrop-filter: blur(4px); padding: 8vh 1.2rem 2rem;
}
.search-overlay.open { display: block; }
.search-box {
  position: relative; width: min(640px, 100%); margin: 0 auto; background: var(--blanc);
  border-radius: var(--radius); box-shadow: 0 30px 70px rgba(0,0,0,.35); padding: 1rem;
}
.search-input {
  width: 100%; font: inherit; font-size: 1.15rem; padding: .9rem 3rem .9rem 1rem;
  border: 2px solid var(--sable-fonce); border-radius: 10px; background: var(--sable-clair);
}
.search-input:focus { outline: none; border-color: var(--rouge); }
.search-close { position: absolute; top: 1.5rem; right: 1.6rem; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--gris); }
.search-close:hover { color: var(--rouge); }
.search-results { list-style: none; margin-top: .6rem; max-height: 60vh; overflow-y: auto; }
.search-results a { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: baseline; padding: .7rem .8rem; border-radius: 8px; }
.search-results a:hover, .search-results a:focus { background: var(--sable); }
.search-results .r-type { grid-row: span 2; font-family: var(--font-titre); text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; color: #fff; background: var(--rouge); padding: .2rem .5rem; border-radius: 999px; align-self: center; }
.search-results .r-title { font-weight: 600; color: var(--bordeaux); }
.search-results .r-sub { font-size: .85rem; color: var(--gris); }
.search-hint { padding: 1rem .8rem; color: var(--gris); font-style: italic; }

/* Focus visible clavier */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .gal-item:focus-visible {
  outline: 3px solid var(--rouge); outline-offset: 2px; border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.lang-switch { display: flex; gap: 2px; margin-left: auto; border: 1px solid var(--sable-fonce); border-radius: 999px; padding: 2px; background: var(--blanc); }
.lang-switch button {
  font-family: var(--font-titre); font-size: .8rem; letter-spacing: .05em; border: 0; cursor: pointer;
  background: transparent; color: var(--gris); padding: .3rem .7rem; border-radius: 999px; transition: var(--transition);
}
.lang-switch button.active { background: var(--rouge); color: #fff; }
.lang-switch button:not(.active):hover { color: var(--rouge); }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.burger span { display: block; width: 26px; height: 3px; background: var(--bordeaux); margin: 5px 0; border-radius: 3px; transition: var(--transition); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative; min-height: 78vh; display: grid; align-items: end;
  color: var(--blanc); overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,16,15,.15) 0%, rgba(135,6,40,.35) 55%, rgba(18,16,15,.85) 100%);
  z-index: 1;
}
.hero img.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
  animation: slowzoom 18s ease-in-out infinite alternate;
}
@keyframes slowzoom { from { transform: scale(1); } to { transform: scale(1.08); } }
.hero .wrap { position: relative; z-index: 2; padding-block: 3.5rem; }
.hero h1 { text-shadow: 0 4px 24px rgba(0,0,0,.4); }
.hero p.lead { max-width: 620px; font-size: 1.15rem; margin-top: 1rem; text-shadow: 0 2px 12px rgba(0,0,0,.5); }
.hero .actions { margin-top: 1.8rem; display: flex; gap: .8rem; flex-wrap: wrap; }

/* ---------------- Sections ---------------- */
section.block { padding-block: clamp(3rem, 7vw, 6rem); }
.section-head { max-width: 760px; margin-bottom: 2.5rem; }
.section-head h2 { margin-top: .4rem; }
.section-head p { color: var(--gris); margin-top: .8rem; font-size: 1.08rem; }

.bg-sable { background: var(--sable); }
.bg-bordeaux { background: var(--bordeaux); color: var(--sable-clair); }
.bg-bordeaux .eyebrow { color: var(--sable-fonce); }
.bg-bordeaux h2, .bg-bordeaux h3 { color: var(--blanc); }
.bg-bordeaux p { color: rgba(255,255,255,.85); }

/* Intro / texte à deux colonnes */
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3rem; align-items: center; }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.prose p + p { margin-top: 1rem; }

/* Chiffres clés */
.stats { display: flex; gap: 2.5rem; flex-wrap: wrap; margin-top: 2rem; }
.stat .num { font-family: var(--font-titre); font-size: 3rem; color: var(--rouge); line-height: 1; }
.stat .lbl { text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; color: var(--gris); }

/* ---------------- Répertoire (dynamique) ---------------- */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.8rem; }
.card {
  background: var(--blanc); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: var(--transition); display: flex; flex-direction: column;
  border: 1px solid var(--sable-fonce);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(135,6,40,.18); }
.card .thumb { position: relative; aspect-ratio: 3/2; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.card:hover .thumb img { transform: scale(1.06); }
.card .year {
  position: absolute; top: .8rem; left: .8rem; background: var(--rouge); color: #fff;
  font-family: var(--font-titre); padding: .25rem .7rem; border-radius: 999px; font-size: .9rem; letter-spacing: .05em;
}
.card .body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card .body h3 { color: var(--bordeaux); }
.card .cho { font-size: .88rem; color: var(--rouge); font-weight: 600; }
.card .cho .pays { color: var(--gris); font-weight: 400; }
.card .body p { color: var(--gris); font-size: .95rem; }

/* Jigeen feature */
.feature { display: grid; grid-template-columns: .9fr 1.1fr; gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.feature img { width: 100%; height: 100%; object-fit: cover; min-height: 340px; }
.feature .txt { background: var(--bordeaux); color: var(--sable-clair); padding: clamp(2rem, 4vw, 3.5rem); display: flex; flex-direction: column; justify-content: center; }
.feature .txt h2 { color: #fff; }
.feature .txt .eyebrow { color: var(--sable-fonce); }

/* ---------------- CTA ---------------- */
.cta { text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.85); max-width: 620px; margin: 1rem auto 1.8rem; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--noir); color: var(--sable-fonce); padding-block: 3.5rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.site-footer h4 { font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .1em; color: #fff; margin-bottom: 1rem; font-size: 1rem; }
.site-footer a { color: var(--sable-fonce); transition: var(--transition); }
.site-footer a:hover { color: var(--rouge); }
.site-footer ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.socials { display: flex; gap: .8rem; margin-top: 1rem; }
.socials a { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; display: grid; place-items: center; }
.socials a:hover { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.footer-brand img { height: 90px; margin-bottom: 1rem; filter: brightness(0) invert(1); opacity: .9; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.5rem; padding-top: 1.5rem; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

.loading { text-align: center; color: var(--gris); padding: 3rem; font-style: italic; }

/* ---------------- Formulaire ---------------- */
.form-card {
  background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(1.6rem, 4vw, 2.6rem);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem 1.4rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .06em; font-size: .82rem; color: var(--bordeaux); }
.field input, .field select, .field textarea {
  font-family: var(--font-texte); font-size: 1rem; padding: .75rem .9rem;
  border: 1px solid var(--sable-fonce); border-radius: 10px; background: var(--sable-clair);
  color: var(--noir); transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--rouge); background: #fff; box-shadow: 0 0 0 3px rgba(201,22,32,.12);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.form-feedback { font-size: .95rem; }
.form-feedback.ok { color: #1a7d3c; }
.form-feedback.err { color: var(--rouge); }
.form-feedback.pending { color: var(--gris); font-style: italic; }
.contact-aside { display: flex; flex-direction: column; gap: 1.2rem; }
.contact-aside .item h4 { font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .08em; color: var(--rouge); font-size: .9rem; margin-bottom: .2rem; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------------- Galerie ---------------- */
.gallery {
  columns: 3; column-gap: 1rem;
}
.gal-item {
  display: block; width: 100%; margin: 0 0 1rem; padding: 0; border: 0; cursor: pointer;
  position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sable);
  break-inside: avoid; box-shadow: var(--shadow); line-height: 0;
}
.gal-item img { width: 100%; height: auto; transition: var(--transition); }
.gal-item:hover img { transform: scale(1.05); }
.gal-cap {
  position: absolute; inset: auto 0 0 0; padding: 1.4rem .9rem .7rem; text-align: left;
  color: #fff; font-size: .82rem; line-height: 1.3;
  background: linear-gradient(transparent, rgba(18,16,15,.8));
  opacity: 0; transform: translateY(8px); transition: var(--transition);
}
.gal-item:hover .gal-cap { opacity: 1; transform: translateY(0); }
@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 560px) { .gallery { columns: 1; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 1000; display: none;
  background: rgba(12,8,10,.94); place-items: center; padding: 2rem;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 82vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb-cap { color: var(--sable-fonce); text-align: center; margin-top: 1rem; font-size: .95rem; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer;
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.6rem; line-height: 1; transition: var(--transition);
  display: grid; place-items: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: var(--rouge); }
.lb-close { top: 1.5rem; right: 1.5rem; }
.lb-prev { left: 1.5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1.5rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 560px) { .lb-prev { left: .5rem; } .lb-next { right: .5rem; } }

/* ---------------- Vidéos ---------------- */
.videos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.8rem; }
.video-card { background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-thumb, .video-frame { position: relative; display: block; width: 100%; aspect-ratio: 16/9; border: 0; padding: 0; cursor: pointer; overflow: hidden; background: #000; }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.video-thumb:hover img { transform: scale(1.05); opacity: .85; }
.video-thumb .play {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%;
  background: var(--rouge); display: grid; place-items: center; transition: var(--transition);
}
.video-thumb .play::after { content: ""; border-style: solid; border-width: 12px 0 12px 20px; border-color: transparent transparent transparent #fff; margin-left: 4px; }
.video-thumb:hover .play { transform: scale(1.12); background: var(--bordeaux); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-title { padding: 1rem 1.2rem; font-family: var(--font-titre); text-transform: uppercase; letter-spacing: .04em; font-size: 1rem; color: var(--bordeaux); }

/* ---------------- Newsletter & Don ---------------- */
.support { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; }
.support .panel { border-radius: var(--radius); padding: clamp(1.8rem, 4vw, 2.8rem); box-shadow: var(--shadow); }
.support .news { background: var(--blanc); border: 1px solid var(--sable-fonce); }
.support .don { background: var(--bordeaux); color: var(--sable-clair); }
.support .don h3, .support .news h3 { margin-bottom: .6rem; }
.support .don h3 { color: #fff; }
.support .don p { color: rgba(255,255,255,.85); }
.newsletter-form { display: flex; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.newsletter-form input { flex: 1; min-width: 180px; padding: .75rem .9rem; border: 1px solid var(--sable-fonce); border-radius: 999px; font: inherit; background: var(--sable-clair); }
.newsletter-form input:focus { outline: none; border-color: var(--rouge); box-shadow: 0 0 0 3px rgba(201,22,32,.12); }
@media (max-width: 780px) { .support { grid-template-columns: 1fr; } }

/* ---------------- Partenaires ---------------- */
.partners { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1.2rem; align-items: stretch; margin-top: 1.5rem; }
.partner { display: grid; place-items: center; padding: 1.4rem 1rem; background: var(--blanc); border: 1px solid var(--sable-fonce); border-radius: var(--radius); min-height: 96px; text-align: center; font-family: var(--font-titre); color: var(--bordeaux); text-transform: uppercase; letter-spacing: .05em; font-size: .95rem; transition: var(--transition); }
.partner:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.partner img { max-height: 64px; width: auto; filter: grayscale(1); opacity: .8; transition: var(--transition); }
.partner:hover img { filter: none; opacity: 1; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .split, .feature { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .burger { display: block; }
  .menu {
    position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--blanc); border-bottom: 1px solid var(--sable-fonce); padding: 1rem;
    gap: .2rem; box-shadow: var(--shadow);
    transform: translateY(-120%); transition: var(--transition); max-height: 85vh; overflow-y: auto;
  }
  .menu.open { transform: translateY(0); }
  .submenu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: var(--sable-clair); margin: .2rem 0 .4rem; }
  .menu > li:not(:hover) .submenu { display: none; }
  .menu > li.expanded .submenu { display: block; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand span { display: none; }
}
