/* Portail SO PRESS */

@font-face {
  font-family: 'Euclid';
  src: url(../fonts/euclid-bold.woff2) format('woff2');
  font-weight: bold;
  font-display: swap;
}
@font-face {
  font-family: 'Trade';
  src: url(../fonts/trade.woff2) format('woff2');
  font-weight: normal;
  font-display: swap;
}

:root {
  --bg: #000;
  --gouttiere: clamp(16px, 3vw, 32px);
  --euclid: 'Euclid', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --trade: 'Trade', 'Arial Narrow', Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: #222;
  color: #000;
  font-family: var(--euclid);
  font-weight: bold;
  -webkit-font-smoothing: antialiased;
}

/* Fond : deux calques fixes en fondu enchaîné (opacité seule = animation GPU, aucun repaint
   au scroll). Dégradé haut gauche -> bas droite autour de la couleur du slide (exacte au
   centre) : A plus clair, teinte décalée d'un côté ; B plus foncé, teinte décalée de l'autre.
   Sans support de oklch(from …), seule la couleur unie s'affiche. */
.fond {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-color: var(--c, #222);
  background-image: linear-gradient(to bottom right,
    oklch(from var(--c, #222) calc(l + .12) calc(c * 1.15) calc(h - 35)),
    var(--c, #222) 50%,
    oklch(from var(--c, #222) calc(l - .16) calc(c * 1.1) calc(h + 35)));
  opacity: 0;
  will-change: opacity;
}
.fond.dessus {
  z-index: -1;
  opacity: 1;
  transition: opacity 1s cubic-bezier(.42, 0, .58, 1);
}
.fond.dessous { opacity: 1; }

a { color: inherit; }
svg { fill: currentColor; }
p, h1, h2, ul { margin: 0; }

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

/* ---------- Slides ---------- */

.slide {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  padding: calc(var(--gouttiere) * 2.5) calc(var(--gouttiere) + 48px);
  text-align: center;
  overflow: hidden;
}

.slide-contenu {
  width: min(100%, 900px);
}
.slide-contenu, .contacts { position: relative; z-index: 1; }

/* Apparition du contenu quand le slide devient actif (seulement si JS) */
.js .slide .slide-contenu,
.js .slide .kiosque-texte {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s ease, transform .8s ease;
}
.js .slide.actif .slide-contenu,
.js .slide.actif .kiosque-texte {
  opacity: 1;
  transform: none;
}

/* Flèches fixes précédent / suivant (blanches sur les slides noirs) */
.fleche {
  position: fixed;
  z-index: 20;
  right: var(--gouttiere);
  width: 28px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #000;
  opacity: .8;
  transition: transform .3s ease, opacity .3s ease, color .6s ease;
}
.fleche[hidden] { display: none; }
.sombre .fleche { color: #fff; }
.fleche svg { width: 100%; height: 100%; }
.fleche:hover { opacity: 1; }
.fleche-haut { top: calc(var(--gouttiere) + 80px); }
.fleche-haut:hover { transform: translateY(-4px); }
.fleche-bas { bottom: var(--gouttiere); }
.fleche-bas:hover { transform: translateY(4px); }
/* Au-dessus de la flèche du haut : retour au premier slide, puis contact */
.raccourci { width: 28px; height: 24px; }
.raccourci:hover { transform: scale(1.12); }
.raccourci-accueil { top: var(--gouttiere); }
.raccourci-contact { top: calc(var(--gouttiere) + 40px); }

/* ---------- Slide 1 : SO PRESS ---------- */

.slide-sopress { color: #fff; }

.logo-sopress {
  width: min(100%, 560px);
  margin: 0 auto clamp(24px, 5vh, 48px);
}
.logo-sopress svg { display: block; width: 100%; height: auto; }

.titres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.1em;
  font-family: var(--trade);
  font-weight: normal;
  font-size: clamp(13px, 1.6vw, 20px);
  line-height: 1.6;
  text-transform: uppercase;
}
.titres a {
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease;
}
.titres a:hover { color: #0ff; }

.liens-portail {
  margin-top: clamp(24px, 5vh, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15em;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
}
.liens-portail a {
  text-decoration: none;
  transition: color .2s ease;
}
.liens-portail a:hover { color: #0ff; }
.lien-kiosque {
  margin-top: .5em;
  font-size: .75em;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lien-kiosque small {
  font-family: var(--trade);
  font-weight: normal;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .6;
}

.contacts {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--gouttiere);
  font-size: clamp(9px, 1vw, 12px);
  line-height: 1.6;
  opacity: .85;
}
.contacts .adresse { font-size: clamp(12px, 1.6vw, 20px); }
/* Premier slide : le pied reste dans le flux, sous le contenu, pour ne jamais le recouvrir
   sur un écran peu haut (le slide s'allonge alors) */
#sopress { grid-template-rows: 1fr auto; padding-bottom: var(--gouttiere); }
html:not([data-display]) #sopress { padding-bottom: calc(var(--gouttiere) + 64px); }
#sopress .contacts { position: static; margin-top: clamp(24px, 5vh, 48px); }
.contacts a { text-decoration: underline; text-underline-offset: 2px; }
.contacts a:hover { color: #0ff; }

/* ---------- Dernier slide : contact (logo et liens du premier slide en plus petit) ---------- */

.slide-contact .logo-sopress { width: min(70%, 300px); margin-bottom: clamp(16px, 3vh, 28px); }
.slide-contact .liens-portail {
  flex-direction: row;
  justify-content: center;
  gap: 1.2em;
  margin-top: clamp(16px, 3vh, 28px);
  font-size: clamp(17px, 1.6vw, 21px);
}
.coordonnees {
  margin-top: clamp(28px, 6vh, 56px);
  font-style: normal;
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.6;
}
.coordonnees .adresse { font-size: clamp(20px, 2.2vw, 28px); margin-bottom: .4em; }
.coordonnees span {
  font-family: var(--trade);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: .05em;
  opacity: .6;
  margin-right: .4em;
}
.coordonnees a { text-underline-offset: 3px; }
.coordonnees a:hover { color: #0ff; }
.coordonnees .mentions { margin-top: .6em; font-size: .85em; opacity: .75; }

/* ---------- Slides supports ---------- */

.logo-support {
  margin: 0 auto clamp(12px, 3vh, 32px);
  width: min(100%, 640px);
}
.logo-support svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 40vh;
}
.logo-texte {
  display: block;
  font-family: var(--trade);
  font-weight: normal;
  font-size: clamp(64px, 12vw, 160px);
  line-height: 1;
}

.description {
  font-size: clamp(22px, 3.2vw, 48px);
  line-height: 1.15;
  text-wrap: balance;
  transition-delay: .2s;
}

/* Liens réseaux : pastilles monochromes à gauche */
.reseaux {
  position: absolute;
  z-index: 2;
  top: var(--gouttiere);
  left: var(--gouttiere);
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.reseaux a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
}
.reseaux .icone { width: 18px; height: 18px; }
.reseaux .pilule {
  width: auto;
  border-radius: 22px;
  display: inline-flex;
  gap: 9px;
  padding: 0 18px 0 13px;
  font-size: 15px;
  white-space: nowrap;
  text-decoration: none;
}
.reseaux a:hover {
  background: #000;
  color: var(--bg);
  border-color: #000;
  transform: scale(1.06);
}
/* Fond foncé (classe posée côté PHP, cf. encreClaire) : texte, icônes et logo en blanc */
.encre-claire { color: #fff; }
.encre-claire .logo-support svg { filter: brightness(0) invert(1); }
.encre-claire .reseaux a:hover { background: #fff; border-color: #fff; }

.js .reseaux li {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .5s ease, transform .5s ease;
}
.js .actif .reseaux li { opacity: 1; transform: none; }
.js .actif .reseaux li:nth-child(1) { transition-delay: .4s; }
.js .actif .reseaux li:nth-child(2) { transition-delay: .47s; }
.js .actif .reseaux li:nth-child(3) { transition-delay: .54s; }
.js .actif .reseaux li:nth-child(4) { transition-delay: .61s; }
.js .actif .reseaux li:nth-child(5) { transition-delay: .68s; }
.js .actif .reseaux li:nth-child(6) { transition-delay: .75s; }
.js .actif .reseaux li:nth-child(7) { transition-delay: .82s; }

@media (max-width: 640px) {
  .slide { padding-inline: calc(var(--gouttiere) + 52px) var(--gouttiere); }
  .reseaux { gap: 10px; }
  .reseaux a { width: 38px; height: 38px; }
  .reseaux .pilule { border-radius: 19px; padding: 0 14px 0 11px; font-size: 13px; }
  .reseaux .icone { width: 16px; height: 16px; }
  .slide-sopress { padding-inline: var(--gouttiere); }
}

/* ---------- Slide 2 : Kiosque ---------- */

.slide-kiosque {
  text-align: left;
  padding: 0;
  place-items: stretch;
}

.kiosque {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  min-height: 100%;
}

.kiosque-texte {
  position: relative;
  z-index: 1;
  padding: calc(var(--gouttiere) * 2.5) var(--gouttiere) calc(var(--gouttiere) * 2.5) clamp(16px, 8vw, 140px);
  max-width: 640px;
}

.kiosque-surtitre {
  font-family: var(--trade);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
}
.kiosque-titre {
  font-size: clamp(38px, 5.2vw, 72px);
  line-height: .98;
  letter-spacing: -.01em;
  margin: .2em 0 .35em;
}
.kiosque-intro {
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.35;
  max-width: 34em;
}

/* Carte offre */
.kiosque-offre {
  margin: clamp(20px, 4vh, 36px) 0;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "libelle prix" "cta prix";
  align-items: center;
  gap: 4px 24px;
  padding: 20px 24px;
  background: #000;
  color: #fff;
  border-radius: 14px;
  text-decoration: none;
  max-width: 460px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.kiosque-offre:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.offre-libelle {
  grid-area: libelle;
  font-family: var(--trade);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: 17px;
}
.offre-prix {
  grid-area: prix;
  font-size: clamp(34px, 3.4vw, 44px);
  line-height: 1;
  white-space: nowrap;
}
.offre-prix small { font-size: .4em; margin-left: 2px; }
.offre-cta {
  grid-area: cta;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #F9C722;
  font-size: 17px;
}
.offre-cta .icone { width: 14px; height: 14px; transition: transform .25s ease; }
.kiosque-offre:hover .offre-cta .icone { transform: translateX(4px); }

/* Accès lecture */
.kiosque-acces-titre { font-size: 15px; margin-bottom: 10px; }
.kiosque-acces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bouton {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px 9px 13px;
  border: 1.5px solid #000;
  border-radius: 10px;
  text-decoration: none;
  line-height: 1.05;
  font-size: 16px;
  transition: background-color .2s ease, color .2s ease;
}
.bouton small {
  display: block;
  font-family: var(--trade);
  font-weight: normal;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bouton .icone { width: 22px; height: 22px; flex: none; }
.bouton:hover { background: #000; color: #F9C722; }

.kiosque-aide {
  margin-top: clamp(18px, 3vh, 28px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  font-size: 14px;
}
.kiosque-aide a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-underline-offset: 3px;
}
.kiosque-aide a:hover { text-decoration: none; }
.kiosque-aide .icone { width: 14px; height: 14px; }

.kiosque-visuel {
  position: absolute;
  inset: 0 0 0 46%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 30%);
  mask-image: linear-gradient(to right, transparent 0, #000 30%);
}
.kiosque-visuel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% center;
}
/* Le visuel apparaît en fondu 1 s après le calage du slide (classe .cale posée en JS) ;
   il disparaît sans transition pour rejouer l'apparition à chaque retour sur le slide */
.js .kiosque-visuel img { opacity: 0; }
.js .slide.cale .kiosque-visuel img { opacity: 1; transition: opacity 1s ease 1s; }

@media (max-width: 900px) {
  .kiosque { grid-template-columns: 1fr; }
  .kiosque-texte { padding: calc(var(--gouttiere) * 3) var(--gouttiere); max-width: none; }
  .kiosque-visuel {
    inset: 0;
    opacity: .1;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- Recherche : barre fixe en bas à gauche, alignée sur les boutons, qui s'élargit
   au focus ; résultats flottants au-dessus ---------- */

.recherche {
  position: fixed;
  z-index: 20;
  left: var(--gouttiere);
  bottom: var(--gouttiere);
  width: min(160px, calc(100% - 2 * var(--gouttiere) - 44px));
  transition: width .3s ease;
}
.recherche:focus-within { width: min(400px, calc(100% - 2 * var(--gouttiere) - 44px)); }
.recherche input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 18px;
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #000;
  font: inherit;
  font-size: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.recherche input::placeholder { color: #8a8a8a; }
.recherche input::-webkit-search-cancel-button { display: none; }
.recherche input:focus-visible { box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 0 0 3px rgba(0, 0, 0, .25); }
.recherche > .icone {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #000;
  pointer-events: none;
}

.recherche-resultats {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  max-height: min(60vh, 420px);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  color: #000;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .22);
  text-align: left;
}
.recherche-resultats li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
}
.recherche-resultats li[aria-selected="true"] { background: #f0f0f0; }
.recherche-resultats .pastille {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}
.recherche-resultats li > span:last-child { min-width: 0; } /* permet l'ellipse du sous-titre */
.recherche-resultats strong { display: block; font-size: 16px; line-height: 1.2; }
.recherche-resultats small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.25;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recherche-resultats .vide { cursor: default; color: #666; }

@media (max-width: 640px) {
  .recherche input { height: 38px; border-radius: 19px; padding: 0 40px 0 15px; }
  .recherche > .icone { right: 14px; width: 16px; height: 16px; }
}

/* La barre de recherche occupe le bas de l'écran : on remonte ce qui s'y trouvait */
html:not([data-display]) .contacts { bottom: calc(var(--gouttiere) + 64px); }
html:not([data-display]) .slide:not(.slide-kiosque) { padding-bottom: calc(var(--gouttiere) * 2.5 + 40px); }

/* ---------- Mode affichage (écran d'accueil : ?display) ---------- */

[data-display] { overflow: hidden; }
[data-display] .cache-display { display: none !important; }
