/*
 * Page d'accueil : accroche avec vidéo, bandeau d'informations, équipe et portraits,
 * cartes « Nos plus », actualités qui défilent et fenêtre de détail.
 */

@keyframes cemBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cemSpin { to { transform: rotate(360deg); } }
@keyframes cemDrawLine { to { stroke-dashoffset: 0; } }
@keyframes cemAller {
  0% { stroke-dashoffset: 1000; opacity: 1; } 40% { stroke-dashoffset: 0; opacity: 1; }
  88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes cemRetour {
  0%, 42% { stroke-dashoffset: 1000; opacity: 1; } 82% { stroke-dashoffset: 0; opacity: 1; }
  88% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes eauGauche { to { -webkit-mask-position: -200px 0; mask-position: -200px 0; } }
@keyframes eauDroite { to { -webkit-mask-position: 200px 0; mask-position: 200px 0; } }
@keyframes bubbleUp {
  0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: .9; }
  100% { transform: translateY(-260px) scale(1.1); opacity: 0; }
}

/* ---------- Accroche ---------- */

.accroche {
  max-width: 1040px; margin: 0 auto; padding: 48px 24px 80px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 40px; align-items: center;
}
/* Côte à côte : la vidéo un peu plus large que le texte (le texte garde au moins 400 px : « Corps en mouvement » tient sur une ligne) */
@media (min-width: 900px) {
  .accroche { grid-template-columns: minmax(400px, .85fr) minmax(0, 1.15fr); }
}
.accroche-texte { display: flex; flex-direction: column; gap: 22px; }
.accroche-surtitre { font-size: 14px; color: var(--framboise); font-weight: 600; }
.accroche h1 {
  margin: 0; font-family: Delius, sans-serif; font-weight: 700; font-size: clamp(30px, 8vw, 40px);
  line-height: 1.12; color: var(--encre); text-wrap: balance; position: relative;
}
.accroche-titre-couleur { color: var(--turquoise-fonce); white-space: nowrap; }
.accroche-texte p { margin: 0; font-size: 17px; line-height: 1.65; text-wrap: pretty; }
.accroche-boutons { display: flex; flex-wrap: wrap; gap: 12px; }

.accroche-media { position: relative; aspect-ratio: 4 / 3; }
.accroche-dessin { position: absolute; right: -10px; top: -20px; width: 150px; pointer-events: none; transform: rotate(8deg); }
.accroche-video {
  position: absolute; inset: 0 0 20px 0; border-radius: 300px 300px 24px 24px;
  overflow: hidden; background: #EFE6DA; z-index: 1;
}
.accroche-video video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); }
.accroche-points { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.accroche-points span { position: absolute; display: block; border-radius: 50%; animation: cemBob 3.2s ease-in-out infinite; }
.accroche-points span:nth-child(1) { width: 72px; height: 72px; background: var(--rose); left: -24px; top: 40px; }
.accroche-points span:nth-child(2) { width: 48px; height: 48px; background: var(--vert); right: 60px; bottom: 0; animation-delay: .6s; }
.accroche-points span:nth-child(3) { width: 30px; height: 30px; background: var(--turquoise); left: -20px; bottom: 80px; animation-delay: 1.2s; }

/* ---------- Bandeau turquoise d'informations ---------- */

.infos {
  position: relative; margin-top: -40px; padding: 40px clamp(20px, 5vw, 48px);
  background-color: #328E87FE; backdrop-filter: blur(6px); box-shadow: 0 18px 40px rgba(80, 60, 40, .10);
  clip-path: polygon(0 18px, 100% 0, 100% calc(100% - 18px), 0 100%);
}
.infos-grille {
  max-width: 820px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px 28px;
}
.info { display: flex; align-items: center; gap: 12px; transition: transform .3s; }
.info:hover { transform: translateY(-3px); }
.info-icone {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .8); flex: none;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}
.info-texte { font-size: 14.5px; color: #fff; font-weight: 500; line-height: 1.35; }

/* ---------- L'équipe ---------- */

.equipe { max-width: 1040px; margin: 0 auto; padding: 72px 24px 40px; display: flex; flex-direction: column; gap: 48px; }
.equipe-haut {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 56px; align-items: center;
}
.equipe-photo-cadre { display: flex; justify-content: center; padding: 20px 0; }
.equipe-polaroid {
  --on: 0; background: #fff; padding: 14px 14px 40px; border-radius: 6px; box-shadow: var(--ombre-polaroid);
  transform: rotate(-3deg); width: 88%; position: relative; overflow: hidden; transition: transform .4s;
}
.equipe-polaroid:hover { --on: 1; transform: rotate(0deg) scale(1.02); }
/* Disque coloré qui grandit derrière la photo au survol */
.equipe-cercle { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.equipe-cercle > div {
  position: absolute; left: 50%; top: 50%; width: 200%; aspect-ratio: 1;
  transform: translate(-50%, -50%) scale(var(--on)); transition: transform 1s cubic-bezier(.4, 0, .2, 1);
}
.equipe-cercle > div > div {
  width: 100%; height: 100%; border-radius: 50%; animation: cemSpin 12s linear infinite;
  background: conic-gradient(var(--rose) 0 33%, var(--vert) 33% 66%, var(--turquoise) 66% 100%);
}
.equipe-photo {
  position: relative; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  background: #EFE6DA; pointer-events: none;
}
.equipe-polaroid .points { right: 16px; bottom: 12px; }
.equipe-polaroid .points i { width: 12px; height: 12px; }

.equipe-texte { display: flex; flex-direction: column; gap: 18px; }
.equipe h2 {
  margin: 0; font-family: Delius, sans-serif; font-weight: 700; font-size: clamp(28px, 7vw, 34px);
  color: var(--encre); line-height: 1.2;
}
.equipe-nombre {
  display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em;
  border-radius: 50%; background: var(--framboise); color: #fff; font-size: .9em; vertical-align: middle; margin: 0 .05em;
}
.equipe-texte p { margin: 0; font-size: 16px; line-height: 1.7; text-wrap: pretty; }

/* Portraits reliés par le trait animé */
.portraits { position: relative; padding: 8px 0; }
.portraits-trait {
  position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 200px; overflow: visible; pointer-events: none;
}
.portraits-trait path { fill: none; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; }
.trait-aller { stroke: #D9C9B4; stroke-width: 1.5; animation: cemAller 14s ease-in-out infinite; }
.trait-retour { stroke: var(--turquoise); stroke-width: 1.3; animation: cemRetour 14s ease-in-out infinite; }
.trait-marcheur { opacity: 0; }
.portraits-grille {
  position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 88px), 1fr)); gap: 20px 16px;
}
.portrait {
  display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center;
  color: var(--encre-fonce); transition: transform .3s;
}
.portrait:hover { transform: translateY(-6px); color: var(--encre-fonce); }
.portrait-rond { position: relative; width: min(132px, 100%); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.portrait-anneau {
  position: absolute; inset: -13px; border-radius: 50%; opacity: 0; transition: opacity .3s;
  background: conic-gradient(var(--rose) 0 33%, var(--vert) 33% 66%, var(--turquoise) 66% 100%);
  animation: cemSpin 4s linear infinite;
}
.portrait:hover .portrait-anneau { opacity: 1; }
.portrait-rond img {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; display: block;
  border: 4px solid var(--bord); box-shadow: 0 0 0 8px var(--creme); pointer-events: none; background: #EFE6DA;
}
.portrait > span { font-size: 16px; font-weight: 600; }

/* Encadré « collaboration » */
.collaboration {
  position: relative; background: var(--creme-clair); border-radius: 20px;
  padding: 28px clamp(20px, 4vw, 36px) 28px clamp(24px, 4vw, 40px); box-shadow: 0 10px 30px rgba(80, 60, 40, .08);
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.collaboration::before {
  content: ""; position: absolute; left: 0; top: 24px; bottom: 24px; width: 5px; border-radius: 999px;
  background: linear-gradient(180deg, var(--rose), var(--vert), var(--turquoise));
}
.collaboration-icone {
  flex: none; width: 52px; height: 52px; border-radius: 50%; background: #5B5958;
  display: flex; align-items: center; justify-content: center;
}
.collaboration p { margin: 0; font-size: 16px; line-height: 1.7; text-wrap: pretty; flex: 1 1 240px; min-width: 0; }

/* ---------- Notre objectif et cartes « Nos plus » ---------- */

.objectif {
  max-width: 1040px; margin: 0 auto; padding: 72px 24px 96px;
  display: flex; flex-direction: column; gap: 40px; position: relative;
}
.objectif-dessin { position: absolute; opacity: .45; pointer-events: none; }
.objectif-dessin--gauche { left: 24px; top: 86px; width: 102px; height: 232px; transform: rotate(-6deg); }
.objectif-dessin--droite { right: 40px; top: 40px; width: 140px; transform: rotate(8deg); }
.objectif-titres { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }
.objectif h2 {
  margin: 0; font-family: Delius, sans-serif; font-weight: 700; font-size: clamp(28px, 7vw, 34px);
  line-height: 1.2; color: var(--encre); max-width: 720px;
}
.objectif-phrase { position: relative; display: inline-block; margin-top: 8px; }
.objectif-phrase p { margin: 0; font-family: Delius, sans-serif; font-size: clamp(20px, 5.5vw, 24px); color: var(--encre); padding-bottom: 14px; }
.objectif-phrase svg { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 14px; overflow: visible; }
.objectif-phrase path {
  fill: none; stroke: var(--turquoise); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100; animation: cemDrawLine 1.6s ease-out .3s forwards;
}

.cartes-plus { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; padding: 10px 0; }
.carte-plus {
  --on: 0; position: relative; display: flex; flex-direction: column; gap: 10px; background: #fff;
  padding: 10px 10px 14px; border-radius: 4px; box-shadow: 0 10px 24px rgba(80, 60, 40, .14); color: var(--encre);
  transform: rotate(var(--rot)); overflow: hidden; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), color .5s;
}
.carte-plus:hover { --on: 1; transform: rotate(0deg) translateY(-6px); color: #fff; }
.carte-plus-photo { position: relative; aspect-ratio: 1; overflow: hidden; background: #EFE6DA; pointer-events: none; }
.carte-plus-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.carte-plus-titre {
  position: relative; font-family: Delius, sans-serif; font-size: 15px; text-align: center;
  color: inherit; pointer-events: none; transition: color .4s;
}
/* L'eau qui monte dans la carte au survol */
.eau { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.eau-niveau {
  position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden;
  height: calc(var(--on) * 50%); transition: height .9s cubic-bezier(.4, 0, .2, 1);
}
.eau-vague {
  position: absolute; left: 0; right: 0; top: 0; height: 30px; background: var(--c); opacity: .45;
  -webkit-mask: url(../dessins/vague.svg) 0 0 / 200px 30px repeat-x; mask: url(../dessins/vague.svg) 0 0 / 200px 30px repeat-x;
  animation: eauGauche 4s linear infinite;
}
.eau-vague--2 { top: 8px; opacity: .7; animation: eauDroite 6s linear infinite; }
.eau-fond { position: absolute; inset: 36px 0 0 0; background: var(--c); }
.eau-bulles { position: absolute; inset: 0; opacity: var(--on); transition: opacity .4s; }
.eau-bulles span {
  position: absolute; bottom: -10px; border-radius: 50%; border: 1.5px solid var(--c); background: rgba(255, 255, 255, .35);
  animation-name: bubbleUp; animation-timing-function: ease-in; animation-iteration-count: infinite;
}

/* ---------- Actualités ---------- */

.actus-vague { position: relative; height: 80px; margin-top: -40px; }
.actus-vague svg { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 80px; display: block; }
.actus { padding: 40px 0 64px; overflow: hidden; background: #494747; }
.actus-haut {
  max-width: 1040px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.actus h2 { margin: 0; font-family: Delius, sans-serif; font-weight: 700; font-size: clamp(28px, 7vw, 34px); color: var(--creme); }
.actus-titre { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; }
/* Onglets « En cours » / « Déjà passé » : l'accueil montre ce qui est d'actualité, l'historique est à un clic */
.actus-onglets { display: flex; flex-wrap: wrap; gap: 8px; }
.actus-onglet {
  font: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--creme); border: 1.5px solid rgba(251, 247, 241, .45); transition: all .2s;
}
.actus-onglet:hover { border-color: var(--creme); }
.actus-onglet[aria-pressed="true"] { background: var(--creme); color: var(--encre-fonce); border-color: var(--creme); font-weight: 700; }
.actus-panneau[hidden], .actus-fleches[hidden] { display: none; }
.actus-fleches { display: flex; gap: 8px; margin-left: auto; }
.actus-fleche {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25); background: var(--creme);
  color: var(--encre-fonce); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s;
}
.actus-fleche:hover { background: var(--framboise); border-color: var(--framboise); color: #fff; }
.actus-defilement { margin-top: 32px; overflow: hidden; }
.actus-vide { max-width: 1040px; margin: 24px auto 0; padding: 0 24px; color: var(--creme); }
.actus-piste {
  display: flex; gap: 24px; width: max-content; will-change: transform;
  padding-left: max(24px, calc(50% - 520px + 24px));
}
/* Une carte : le bouton qui ouvre la fenêtre (photo et textes), puis les boutons « En savoir plus » et
   « S'inscrire », à part puisqu'un lien ne peut pas être dans un bouton */
.actu-case {
  width: min(320px, 78vw); flex: none; display: flex; flex-direction: column; background: var(--creme); border-radius: 18px;
  overflow: hidden; transition: all .25s;
}
.actu-case:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(80, 60, 40, .10); }
.actu {
  flex: 1; display: flex; flex-direction: column; color: var(--encre-fonce); cursor: pointer; background: none;
  border: 0; border-radius: 18px; padding: 0; margin: 0; font: inherit; text-align: left;
}
.actu:focus-visible { outline: 3px solid var(--framboise); outline-offset: -3px; }
.actu-boutons { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 20px; margin-top: -6px; }
/* Petit bouton à contour framboise (cartes des actualités, « S'inscrire » dans la fenêtre) */
.bouton-contour {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; line-height: 1.2;
  color: var(--framboise); background: var(--creme); border: 1.5px solid var(--framboise); border-radius: 999px;
  padding: 5px 12px; text-decoration: none; transition: all .2s;
}
.bouton-contour:hover { background: var(--framboise); color: #fff; }
.bouton-contour svg { flex-shrink: 0; }
/* Actualité passée : en retrait (photo en noir et blanc, étiquette « C'est passé ») */
.actu-case--passee { background: #E9E3DB; }
.actu-case--passee .actu-photo img { filter: grayscale(1); opacity: .75; }
.actu-case--passee .actu-date { color: #6E6864; }
.actu-case--passee .actu-titre { color: #5E5955; }
.actu-case--passee .bouton-contour { color: #5E5955; border-color: #8A8480; background: transparent; }
.actu-case--passee .bouton-contour:hover { background: #5E5955; border-color: #5E5955; color: #fff; }
.actu-passee {
  position: absolute; left: 12px; top: 12px; z-index: 1; font-size: 12px; font-weight: 700; color: var(--creme);
  background: #494747; border-radius: 999px; padding: 4px 11px;
}
.actu-photo { display: block; aspect-ratio: 3 / 2; background: #EFE6DA; position: relative; overflow: hidden; }
.actu-photo img, .fenetre-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.actu-corps { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.actu-date { font-size: 13px; color: var(--framboise); font-weight: 600; }
.actu-titre { font-size: 17px; font-weight: 600; line-height: 1.35; }
.actu-resume { font-size: 14px; line-height: 1.5; color: #6E6864; }

/* Fenêtre de détail d'une actualité (fond flouté) */
.fenetre {
  border: none; padding: 0; background: var(--creme); color: inherit; border-radius: 22px;
  width: calc(100% - 48px); max-width: 720px; max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.fenetre::backdrop { background: rgba(46, 42, 40, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.fenetre-fermer {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: none; z-index: 2;
  background: var(--creme); color: var(--encre-fonce); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); transition: all .2s;
}
.fenetre-fermer:hover { background: var(--framboise); color: #fff; }
.fenetre-photo { aspect-ratio: 16 / 9; background: #EFE6DA; position: relative; overflow: hidden; }
.fenetre-corps { padding: 28px 32px 36px; display: flex; flex-direction: column; gap: 12px; }
.fenetre-date { font-size: 14px; color: var(--framboise); font-weight: 600; }
.fenetre h3 {
  margin: 0; font-family: Delius, sans-serif; font-weight: 700; font-size: 28px; line-height: 1.2;
  color: var(--encre-fonce); text-wrap: balance;
}
.fenetre p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--texte); text-wrap: pretty; }
.fenetre-corps > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.fenetre .bouton-contour { font-size: 14px; gap: 7px; padding: 8.5px 16px; }
.fenetre .fenetre-adresse { font-size: 12.5px; color: #6E6864; }
.fenetre-adresse a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Téléphone et animations réduites ---------- */

@media (max-width: 760px) {
  .cartes-plus { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fenetre-corps { padding: 24px 22px 28px; }
  /* Boutons des actualités assez grands pour le doigt (44 px de haut) */
  .actu-boutons { gap: 8px; }
  .bouton-contour, .fenetre .bouton-contour, .fenetre .bouton-rose--petit {
    display: inline-flex; align-items: center; box-sizing: border-box; min-height: 44px; padding: 10px 16px; font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portraits-trait path { animation: none; stroke-dashoffset: 0; }
  .accroche-points span, .equipe-cercle > div > div, .portrait-anneau { animation: none; }
}
