/* =================================================================
   HERO REFRESH 2026 — feuille de styles du hero de la home
   Chargée par index.php (et index-refresh-2026.php, la maquette client).

   Les polices (Sora / Geist) et la bascule typographique du site ne
   sont PLUS ici : elles sont passées en global dans css/typo-2026.css,
   chargée par includes/head.php sur toutes les pages.
   ================================================================= */

/* =================================================================
   HERO
   ================================================================= */
.rf-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 640px;
  max-height: 940px;
  background-color: #001924;
}
/* zone média clippée (le zoom Ken Burns ne déborde pas ; le dropdown, lui, peut déborder le hero) */
.rf-hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.rf-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  z-index: 1;
  transform-origin: center;
  animation: rfKenburns 26s ease-in-out infinite alternate;
}
/* calques révélés au survol des catégories */
.rf-hero__layers { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.rf-hero__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  clip-path: inset(0 0 0 100%);           /* caché : clippé à droite */
  transform: scale(1);
  transition: clip-path .6s cubic-bezier(.76,0,.24,1), transform 6.5s ease;
}
/* on ne promeut les 6 calques en couche GPU que là où le survol existe
   (sur mobile ils ne servent à rien : ni image chargée, ni survol possible) */
@media (hover: hover) and (pointer: fine) {
  .rf-hero__layer { will-change: clip-path, transform; }
}
.rf-hero__layer.is-active {
  clip-path: inset(0 0 0 0);              /* balayage gauche -> droite */
  transform: scale(1.09);                 /* ken burns lent pendant l'affichage */
}
/* Dégradé sombre bas -> haut, au-dessus des calques */
.rf-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(to top, rgba(0,25,36,0.85) 0%, rgba(0,25,36,0.28) 45%, rgba(0,25,36,0) 72%);
  pointer-events: none;
}
.rf-hero__inner {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 0;
}

/* ---------- Titre (révélation 3D caractère par caractère) ---------- */
.rf-hero__title {
  margin: 0;
  text-align: center;
  text-transform: uppercase;
  color: #fff;
  font-family: 'Sora', 'Metropolis', Arial, sans-serif;
  font-size: 50px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.25);
  margin-top: 20vh;
  perspective: 800px;          /* scène 3D pour le flip des caractères */
}
/* seules les 2 lignes sont en block (pas les spans de mots/caractères) */
.rf-hero__title > span { display: block; transform-style: preserve-3d; }
.rf-hero__title-strong { font-weight: 700; line-height: 1; }
.rf-hero__title-light  { font-weight: 200; line-height: 1; }

/* mot insécable : le titre revient à la ligne entre les mots, jamais au milieu */
.rf-word { display: inline-block; white-space: nowrap; }

.rf-char {
  display: inline-block;
  opacity: 0;
  transform: rotateX(-90deg) translateY(40px);
  transform-origin: bottom center;   /* charnière en bas */
  animation: rfFlipUp .8s cubic-bezier(.175, .885, .32, 1.275) forwards;
  animation-delay: calc(.15s + .06s * var(--i, 0));  /* cascade */
  will-change: transform, opacity;
}
@keyframes rfFlipUp {
  0%   { opacity: 0; transform: rotateX(-90deg) translateY(40px); }
  100% { opacity: 1; transform: rotateX(0deg) translateY(0); }
}

/* =================================================================
   BARRE DE RECHERCHE (dimensions réduites)
   ================================================================= */
.rf-search {
  position: relative;
  z-index: 30;            /* le dropdown passe au-dessus du titre et de l'encart avis */
  width: 100%;
  max-width: 1040px;
  margin-top: clamp(36px, 7vh, 96px);
}
.rf-search__bar {
  display: flex;
  align-items: stretch;
  height: 66px;
  box-shadow: 0 12px 22px rgba(0,0,0,0.38);
}
.rf-search__field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  height: 100%;
  padding: 0 18px 0 38px;
  border: 0;
  border-left: 8px solid #fff;
  background: rgba(255,255,255,0.4);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  cursor: pointer;
  text-align: left;
}
.rf-search__loupe { flex: 0 0 auto; width: 28px; height: 28px; }
.rf-search__placeholder {
  display: inline-flex;
  align-items: center;
  font-family: 'Sora', 'Metropolis', Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #00496b;
  white-space: nowrap;
  overflow: hidden;
}
.rf-type { white-space: nowrap; overflow: hidden; }
/* curseur "machine à écrire" */
.rf-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 3px;
  background: #00496b;
  vertical-align: middle;
  animation: rfBlink 1s step-end infinite;
}
.rf-caret--done { animation: none; opacity: 0; }

.rf-search__submit {
  flex: 0 0 224px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  padding: 0 26px;
  border: 0;
  background: #34a7d5;
  color: #fff;
  cursor: pointer;
  transition: background 0.3s ease;
}
.rf-search__submit:hover { background: #2b93bd; }
.rf-search__chevron { display: inline-flex; transition: transform 0.3s ease; }
.rf-search__chevron svg { width: 20px; height: 20px; }
.rf-search__submit-txt {
  font-family: 'Sora', 'Metropolis', Arial, sans-serif;
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  line-height: 1.4;
}
.rf-search.is-open .rf-search__chevron { transform: rotate(180deg); }

/* =================================================================
   PANNEAU DÉROULANT (ancré sous la barre)
   La barre étant en haut du hero, le panneau s'ouvre vers le bas
   sans jamais forcer à scroller, et le fond reste visible.
   ================================================================= */
.rf-search__panel {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  width: 100%;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 5vw, 120px);
  row-gap: 8px;
  padding: 26px 30px;
  border-left: 8px solid #fff;
  background: #00608a;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
@supports ((backdrop-filter: blur(10px)) or (-webkit-backdrop-filter: blur(10px))) {
  .rf-search__panel { background: rgba(0,96,138,0.82); }
}
.rf-search__panel[hidden] { display: none; }
.rf-search.is-open .rf-search__panel { opacity: 1; transform: translateY(0); }

/* ---------- Cellule catégorie + HOVER (balayage, accent, flèche) ---------- */
.rf-cat {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 16px;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0);
  box-shadow: inset 0 0 0 rgba(52,167,213,0);
  transition: background .25s ease, box-shadow .25s ease;
}
.rf-cat:hover, .rf-cat:focus, .rf-cat:visited, .rf-cat:active { color: #fff; }
/* shimmer de balayage qui traverse la cellule une fois */
.rf-cat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.18) 52%, rgba(255,255,255,0) 100%);
  transform: translateX(-120%);
  transition: transform .6s cubic-bezier(.76,0,.24,1);
}
.rf-cat:hover {
  background: rgba(255,255,255,0.10);
  box-shadow: inset 4px 0 0 #34a7d5;      /* accent bleu à gauche */
}
.rf-cat:hover::before { transform: translateX(120%); }
.rf-cat > * { position: relative; z-index: 1; }
.rf-cat__ico { flex: 0 0 auto; width: 56px; height: 56px; transition: transform .3s ease; }
.rf-cat:hover .rf-cat__ico { transform: translateY(-3px) scale(1.04); }
.rf-cat__txt { display: flex; flex-direction: column; font-family: 'Sora', Arial, sans-serif; transition: transform .3s ease; }
.rf-cat:hover .rf-cat__txt { transform: translateX(5px); }
.rf-cat__txt strong { font-weight: 700; font-size: 22px; line-height: 1.15; text-transform: uppercase; }
.rf-cat__txt em { font-style: normal; font-weight: 400; font-size: 15px; line-height: 1.5; margin-top: 3px; }
/* flèche qui apparaît au survol */
.rf-cat__arrow {
  margin-left: auto;
  display: inline-flex;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .3s ease, transform .3s ease;
}
.rf-cat:hover .rf-cat__arrow { opacity: 1; transform: translateX(0); }

/* =================================================================
   BADGE AVIS
   ================================================================= */
.rf-avis {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: clamp(28px, 5vh, 64px);
  padding: 8px 18px;
  background: #FFF;
  cursor: pointer;
  border-radius:6px;
}
.rf-avis__stars { display: inline-flex; gap: 2px; }
.rf-avis__stars svg { display: block; width: 26px; height: 26px; }
.rf-avis__txt {
  font-family: 'Sora', 'Metropolis', Arial, sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.34;
  color: #00608a;
}
.rf-avis__txt u { text-decoration: underline; }

/* =================================================================
   ANIMATIONS
   ================================================================= */
@keyframes rfKenburns {
  0%   { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}
@keyframes rfRise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rfBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.rf-anim {
  opacity: 0;
  animation: rfRise .85s cubic-bezier(.2,.75,.25,1) both;
  animation-delay: var(--rf-delay, 0s);
}

/* Accessibilité : on coupe tout mouvement si l'utilisateur le demande */
@media (prefers-reduced-motion: reduce) {
  .rf-anim { animation: none; opacity: 1; transform: none; }
  .rf-char { animation: none !important; opacity: 1 !important; transform: none !important; }
  .rf-hero__bg { animation: none; }
  .rf-hero__layer { transition: none; }
  .rf-caret { animation: none; opacity: 0; }
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 1299px) {
  .rf-hero { height: calc(100vh - 80px); min-height: 560px; }
}
@media (max-width: 1199px) {
  .rf-hero__title { font-size: 40px; }
  .rf-search__placeholder { font-size: 18px; }
  .rf-cat__txt strong { font-size: 20px; }
}
@media (max-width: 991px) {
  .rf-hero__inner { padding: 40px 20px 0; }
  .rf-hero__title { font-size: 32px; }
  .rf-search__bar { height: 68px; }
  .rf-search__field { padding: 0 14px 0 22px; gap: 12px; border-left-width: 6px; }
  .rf-search__loupe { width: 26px; height: 26px; }
  .rf-search__placeholder { font-size: 16px; }
  .rf-search__submit { flex: 0 0 auto; width: auto; padding: 0 20px; }
  .rf-search__submit-txt { font-size: 16px; }
  .rf-search__panel {
    grid-template-columns: 1fr;
    row-gap: 4px;
    padding: 18px;
    border-left-width: 6px;
  }
  .rf-cat { gap: 16px; padding: 12px 12px; }
  .rf-cat__ico { width: 46px; height: 46px; }
  .rf-cat__txt strong { font-size: 18px; }
  .rf-cat__txt em { font-size: 13px; }
  .rf-cat__arrow { display: none; }
}
@media (max-width: 575px) {
  .rf-hero__title { font-size: 26px; }
  .rf-search__submit-txt { display: none; }
  .rf-search__submit { gap: 0; padding: 0 14px; }
  /* on resserre la barre pour que la phrase (version courte) tienne sans être coupée */
  .rf-search__bar { height: 62px; }
  .rf-search__field { padding: 0 10px 0 16px; gap: 10px; border-left-width: 4px; }
  .rf-search__loupe { width: 22px; height: 22px; }
  .rf-search__placeholder { font-size: 14px; flex: 1 1 auto; min-width: 0; }
}
/* très petits écrans (320-400px) : on resserre encore pour ne rien tronquer */
@media (max-width: 400px) {
  .rf-search__bar { height: 58px; }
  .rf-search__field { padding: 0 8px 0 12px; gap: 8px; }
  .rf-search__loupe { width: 20px; height: 20px; }
  .rf-search__submit { padding: 0 12px; }
  .rf-search__placeholder { font-size: 13px; }
}
