/* sexagon.ml — identité visuelle (accueil)
   Rizière profonde, pousse, or du grain, eau du casier. */
:root {
  --riziere: #17402A;
  --riziere-2: #1F5236;
  --pousse: #4E7A22;
  --pousse-clair: #8DB33A;
  --or: #E0A526;
  --or-fonce: #A8740B;
  --eau: #EEF4EF;
  --encre: #1E2722;
  --gris: #5B665F;
  --filet: #D5E1D8;
  --blanc: #FFFFFF;
  --lutte: #B3261E;
  --titre: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --texte: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.sx {
  font-family: var(--texte);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--encre);
  background: var(--blanc);
  overflow-x: hidden;
}
.sx h1, .sx h2, .sx h3, .sx h4, .sx h5 {
  font-family: var(--titre);
  color: var(--riziere);
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.sx a { color: var(--pousse); text-underline-offset: 3px; }
.sx a:hover { color: var(--riziere); }
.sx :focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 3px; }
.sx .riz { display: inline-block; vertical-align: middle; }

/* ---------- Navigation ---------- */
.sx-nav {
  position: sticky; top: 0; z-index: 1030;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(1.4) blur(6px);
  border-bottom: 1px solid var(--filet);
}
.sx-nav .navbar { padding: .55rem 0; }
.sx-marque { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.sx-marque svg { width: 30px; height: 48px; color: var(--or); }
.sx-marque b { font-family: var(--titre); font-size: 1.35rem; color: var(--riziere); letter-spacing: .02em; }
.sx-marque small { display: block; font-size: .78rem; color: var(--gris); line-height: 1.1; }
.sx-nav .nav-link { color: var(--encre) !important; font-weight: 600; font-size: .98rem; padding: .5rem .8rem !important; border-radius: 6px; }
.sx-nav .nav-link:hover { background: var(--eau); color: var(--riziere) !important; }
.sx-nav .btn-contact { margin-left: .4rem; }

/* ---------- Boutons ---------- */
.sx .btn-or {
  background: var(--or); color: var(--riziere); border: 0;
  font-weight: 700; padding: .8rem 1.4rem; border-radius: 8px;
}
.sx .btn-or:hover { background: #F0B83A; color: var(--riziere); }
.sx .btn-ligne {
  border: 2px solid currentColor; color: var(--riziere); background: transparent;
  font-weight: 700; padding: .65rem 1.25rem; border-radius: 8px;
}
.sx .btn-ligne:hover { background: var(--riziere); color: var(--blanc); border-color: var(--riziere); }
.sx .btn-ligne.clair { color: var(--blanc); }
.sx .btn-ligne.clair:hover { background: var(--blanc); color: var(--riziere); border-color: var(--blanc); }

/* ---------- Bandeau ---------- */
.sx-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: min(78vh, 680px);
  background: var(--riziere);
  color: var(--blanc);
  overflow: hidden;
}
.sx-hero-texte {
  position: relative; z-index: 2;
  padding: clamp(3rem, 7vw, 6.5rem) clamp(1.25rem, 5vw, 5rem);
  display: flex; flex-direction: column; justify-content: center;
  max-width: 44rem; margin-left: auto;
}
.sx-hero h1 {
  color: var(--blanc);
  font-size: clamp(2.5rem, 5.6vw, 4.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  text-wrap: balance;
}
.sx-hero .chapeau { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: #DCE8DF; max-width: 34rem; margin-bottom: .6rem; }
.sx-hero .lieu { color: var(--or); font-weight: 600; margin-bottom: 2rem; }
.sx-hero .actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.sx-hero-photo { position: relative; }
.sx-hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.sx-hero-photo::after { /* fondu vers le vert, côté texte */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--riziere) 0%, rgba(23,64,42,.35) 18%, rgba(23,64,42,0) 40%);
}
.sx-hero-epi {
  position: absolute; z-index: 3;
  left: 50.5%; bottom: -14px;
  width: clamp(150px, 17vw, 250px); height: auto; aspect-ratio: 200 / 320;
  color: var(--or);
  transform-origin: 30% 100%;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.25));
  pointer-events: none;
}
.sx-casiers { display: block; width: 100%; height: 22px; }
.sx-frise { background: var(--riziere); padding: 6px 0 10px; line-height: 0; }
.sx-frise .sx-casiers { height: 14px; color: var(--riziere-2); }

/* une seule entrée animée : le texte monte, l'épi se pose */
@media (prefers-reduced-motion: no-preference) {
  .sx-hero-texte > * { animation: sx-monte .8s cubic-bezier(.2,.7,.2,1) both; }
  .sx-hero-texte > :nth-child(2) { animation-delay: .08s; }
  .sx-hero-texte > :nth-child(3) { animation-delay: .16s; }
  .sx-hero-texte > :nth-child(4) { animation-delay: .24s; }
  .sx-hero-epi { animation: sx-epi 1.4s .3s cubic-bezier(.2,.7,.2,1) both; }
}
@keyframes sx-monte { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sx-epi { from { opacity: 0; transform: rotate(-9deg) translateY(30px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
.sx-section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.sx-section.eau { background: var(--eau); }
.sx-entete { display: flex; align-items: end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.sx-entete h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); font-weight: 700; margin: 0; max-width: 30ch; text-wrap: balance; }
.sx-entete .intro { color: var(--gris); max-width: 46ch; margin: .6rem 0 0; font-size: 1.1rem; }
.sx-entete .intro p { margin: 0; }
.sx-entete .voir { font-weight: 700; white-space: nowrap; }

/* Mission */
.sx-mission .texte { font-size: 1.15rem; max-width: 60ch; }
.sx-mission .texte strong { color: var(--riziere); }
.sx-mission-epi {
  background: var(--eau); border-radius: 18px; padding: 2rem;
  display: grid; grid-template-columns: 110px 1fr; gap: 1.5rem; align-items: center;
}
.sx-mission-epi svg { width: 110px; height: 176px; color: var(--pousse); }
.sx-mission-epi p { font-family: var(--titre); font-size: 1.3rem; line-height: 1.3; color: var(--riziere); margin: 0 0 1rem; }

/* Axes */
.sx-axes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 2.5rem; }
.sx-axe {
  display: block; text-decoration: none; color: inherit !important;
  border-top: 2px solid var(--riziere); padding: 1.4rem 0 2rem;
}
.sx-axe svg { width: 26px; height: 26px; color: var(--or-fonce); margin-bottom: .7rem; }
.sx-axe h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: .45rem; }
.sx-axe p { color: var(--gris); margin: 0; }
.sx-axe:hover h3 { color: var(--pousse); }

/* Agenda */
.sx-agenda { list-style: none; padding: 0; margin: 0; max-width: 58rem; }
.sx-evt {
  display: grid; grid-template-columns: 6.5rem 1fr; gap: 1.5rem;
  padding: 1.4rem 0; border-top: 1px solid var(--filet);
  text-decoration: none; color: inherit !important;
}
.sx-agenda li:last-child .sx-evt { border-bottom: 1px solid var(--filet); }
.sx-evt .date { background: var(--riziere); color: var(--blanc); border-radius: 10px; text-align: center; padding: .7rem .4rem; align-self: start; }
.sx-evt .date .j { display: block; font-family: var(--titre); font-size: 2rem; font-weight: 800; line-height: 1; }
.sx-evt .date .m { display: block; font-size: .9rem; color: var(--or); font-weight: 600; }
.sx-evt h3 { font-size: 1.25rem; margin: 0 0 .3rem; }
.sx-evt:hover h3 { color: var(--pousse); }
.sx-evt .quand { font-weight: 600; color: var(--pousse); margin-bottom: .2rem; }
.sx-evt p { margin: 0; color: var(--gris); }
.sx-public { display: inline-block; margin-top: .55rem; font-size: .85rem; font-weight: 600; color: var(--riziere); background: var(--eau); border: 1px solid var(--filet); border-radius: 99px; padding: .1rem .7rem; }
.sx-note { color: var(--gris); margin-bottom: 1rem; }

/* Galerie */
.sx-galerie { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1rem; }
.sx-galerie figure { margin: 0; }
.sx-galerie img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; display: block; }
.sx-galerie figcaption { font-size: .92rem; color: var(--gris); margin-top: .45rem; }

/* Partenaires */
.sx-logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 2rem 3rem; }
.sx-logos img { height: 56px; width: auto; max-width: 170px; object-fit: contain; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.sx-logos img:hover { filter: none; opacity: 1; }

/* Équipe */
.sx-equipe { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 2.2rem 1.5rem; }
.sx-membre { text-align: center; }
.sx-membre img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--eau); border: 4px solid var(--blanc); box-shadow: 0 0 0 2px var(--filet); }
.sx-membre h3 { font-size: 1.05rem; margin: .9rem 0 .2rem; }
.sx-membre .role { color: var(--gris); font-size: .95rem; }
.sx-membre .role p { margin: 0; }

/* Actualités */
.sx-actus { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 2.5rem; }
.sx-actu { display: flex; flex-direction: column; text-decoration: none; color: inherit !important; }
.sx-actu .visuel { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--riziere); position: relative; margin-bottom: 1rem; }
.sx-actu .visuel img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.sx-actu:hover .visuel img { transform: scale(1.03); }
.sx-actu .visuel svg { position: absolute; right: 8%; bottom: -10px; width: 90px; height: 144px; color: var(--or); opacity: .9; }
.sx-badge { align-self: flex-start; font-size: .82rem; font-weight: 700; color: var(--blanc); background: var(--pousse); border-radius: 4px; padding: .12rem .55rem; margin-bottom: .6rem; }
.sx-badge.lutte { background: var(--lutte); }
.sx-actu h3 { font-size: 1.4rem; margin-bottom: .4rem; }
.sx-actu:hover h3 { color: var(--pousse); }
.sx-actu p { color: var(--gris); margin-bottom: .5rem; }
.sx-actu time { font-size: .92rem; color: var(--gris); }

/* Réseaux */
.sx-reseaux .cadre { border: 1px solid var(--filet); border-radius: 12px; padding: 1rem; height: 100%; background: var(--blanc); }
.sx-reseaux h3 { font-size: 1.1rem; margin-bottom: .8rem; }
.sx-reseaux .fb-page, .sx-reseaux .fb-page > span, .sx-reseaux .fb-page iframe { width: 100% !important; max-width: 500px; }
.sx-reseaux iframe { width: 100%; min-height: 420px; border: 0; }

/* ---------- Pied de page ---------- */
.sx-pied { position: relative; background: var(--riziere); color: #DCE8DF; padding: 4rem 0 2rem; overflow: hidden; }
.sx-pied .sx-casiers { position: absolute; top: 0; left: 0; right: 0; color: var(--riziere-2); }
.sx-pied h2 { color: var(--blanc); font-size: 1.6rem; }
.sx-pied a { color: var(--blanc); }
.sx-pied a:hover { color: var(--or); }
.sx-pied .epi { position: absolute; right: 4%; bottom: -30px; width: 170px; height: 272px; color: var(--or); opacity: .35; }
.sx-pied .reseaux a { font-size: 1.5rem; margin-right: 1rem; }
.sx-pied .bas { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2.5rem; padding-top: 1.2rem; font-size: .92rem; }

/* ---------- Mobile ---------- */
@media (max-width: 991.98px) {
  .sx-hero { grid-template-columns: 1fr; min-height: 0; }
  .sx-hero-photo { order: -1; height: 46vw; min-height: 220px; }
  .sx-hero-photo::after { background: linear-gradient(0deg, var(--riziere) 0%, rgba(23,64,42,0) 45%); }
  .sx-hero-texte { margin: 0; padding-top: 2rem; }
  .sx-hero-epi { left: auto; right: 5%; top: calc(max(46vw, 220px) - 110px); bottom: auto; width: 110px; }
  .sx-axes { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sx-equipe { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sx-galerie { grid-template-columns: 1fr 1fr; }
  .sx-galerie figure:first-child { grid-column: 1 / -1; }
}
@media (max-width: 575.98px) {
  .sx-axes, .sx-actus { grid-template-columns: 1fr; }
  .sx-equipe { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sx-membre img { width: 108px; height: 108px; }
  .sx-evt { grid-template-columns: 4.6rem 1fr; gap: 1rem; }
  .sx-evt .date .j { font-size: 1.6rem; }
  .sx-mission-epi { grid-template-columns: 70px 1fr; padding: 1.4rem; }
  .sx-mission-epi svg { width: 70px; height: 112px; }
  .sx-hero-epi { top: calc(max(46vw, 220px) - 70px); width: 92px; }
}
