/* =====================================================================
   MAISON SÉQUANE · PAGE FRELOCK
   ---------------------------------------------------------------------
   Univers FRELOCK sombre (noir, jaune, blanc). « Sachez le reconnaître »
   et « Nos tests » passent en FRELOCK clair : les couleurs des insectes
   se lisent mieux sur blanc. Un seul moment fort : la section phare,
   figée pendant le défilement. La 3D n'apparaît que dans la visionneuse.
   Les valeurs viennent de tokens.css.
   ===================================================================== */

.page-frelock { padding-top: 96px; }                 /* hauteur de l'en-tête fixe */
.page-frelock .fl-titre { max-width: 20ch; }
.page-frelock .fl-accroche { color: var(--accent); }

/* ── Haut de page ─────────────────────────────────────────────────── */
.fl-haut {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--espace-3) var(--espace-4);
  align-items: center;
  padding-block: var(--espace-4) var(--espace-section);
}
.fl-haut__texte { display: grid; gap: var(--espace-3); align-content: start; }
.fl-haut__logo { width: clamp(180px, 20vw, 280px); height: auto; }
/* 140 px au minimum (charte). Sous 945 px de fenêtre, le logo mesure moins de 189 px, soit 50 mm :
   frelock/index.html sert alors la version sans slogan (<picture>), comme le demande la charte. */
.fl-haut__titre { font-size: clamp(2.375rem, 1.7rem + 2.6vw, 4.25rem); max-width: 15ch; text-wrap: balance; }
.fl-haut__intro { max-width: 50ch; font-size: 1.125rem; line-height: 1.6; color: var(--texte-doux); }
.fl-haut__actions { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.fl-haut__visuel { display: grid; place-items: center; }
.fl-haut__photo { width: min(100%, 520px); aspect-ratio: 900 / 1146; }
.fl-haut__photo img { object-fit: contain; }

/* ── En trois gestes ──────────────────────────────────────────────── */
.gestes { border-top: 1px solid var(--filet-couleur); }
.gestes__surtitre { margin-bottom: var(--espace-1); }
.gestes__liste {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--espace-3);
  margin-top: var(--espace-4);
  list-style: none;
}
.gestes__illu { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--angle-carte); box-shadow: inset 0 0 0 1px var(--filet-couleur); }
.gestes__liste h3 { margin-top: var(--espace-2); font-size: var(--taille-titre-3); }
.gestes__liste p { margin-top: var(--espace-1); color: var(--texte-doux); }
.gestes__lien { margin-top: var(--espace-3); color: var(--fl-jaune); }

/* ── Les atouts (bento) ───────────────────────────────────────────── */
/* Chaque case épouse son contenu : titre et texte groupés, pas de hauteur minimale.
   Jusqu'à 1439 px : deux colonnes, la case jaune en bandeau.
   À partir de 1440 px : quatre colonnes ; la case jaune et les deux cases du bas
   prennent deux colonnes, ces dernières avec le titre à gauche et le texte à droite.
   L'ordre des cases met côte à côte des textes de longueur voisine ;
   les deux cases du bas finissent chacune par un lien. */
.atouts__grille {
  margin-top: var(--espace-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: auto;
}
.atouts .tuile { justify-content: flex-start; gap: 10px; padding: 28px; }
.atouts .tuile p { max-width: 60ch; color: var(--texte-doux); }
.atouts .tuile--jaune p { color: var(--fl-noir); }
.atouts .atouts__reglage {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: flex-end;
  gap: var(--espace-3);
  container-type: inline-size;
}
.atouts__reglage .tuile__cote {
  display: flex; flex: none; gap: 0 0.16em;
  font-size: clamp(4rem, 9vw, 10rem);
  font-size: clamp(4rem, 12cqi, 10rem);
}
.atouts__reglage > div { display: grid; gap: 10px; flex: 1 1 auto; min-width: 0; max-width: 95ch; }
.atouts .atouts__reglage p { max-width: 95ch; }
.atouts .tuile .lien-fleche { align-self: flex-start; justify-self: start; padding-top: 6px; color: var(--fl-jaune); }
@media (min-width: 1440px) {
  .atouts__grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .atouts .atouts__reglage { grid-column: span 2; }
  .atouts .atouts__duo {
    grid-column: span 2;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto 1fr;
    align-content: start;
    gap: 8px var(--espace-3);
  }
  .atouts__duo > p { grid-column: 2; grid-row: 1 / span 2; }
  .atouts__duo > .lien-fleche { grid-column: 1; grid-row: 2; align-self: start; padding-top: 0; }
}
@media (max-width: 679px) {
  .atouts__grille { grid-template-columns: 1fr; }
  .atouts .tuile { padding: 24px; }
  .atouts .atouts__reglage { flex-direction: column; align-items: flex-start; gap: var(--espace-2); }
}


/* ── Visionneuse 3D ───────────────────────────────────────────────── */
.visionneuse-bloc { border-top: 1px solid var(--filet-couleur); }
.visionneuse-bloc__grille {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--espace-3) var(--espace-4);
  align-items: center;
}
.visionneuse-bloc__texte { display: grid; gap: var(--espace-2); align-content: start; }
.visionneuse-bloc__texte > p:not(.fl-accroche):not(.vues__legende) { max-width: 44ch; color: var(--texte-doux); }
.visionneuse {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--angle-carte);
  overflow: hidden;
  background: var(--fl-noir);
  box-shadow: inset 0 0 0 1px var(--filet-couleur);
}
.visionneuse canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity var(--duree-apparition-frelock) var(--courbe-signature); }
.visionneuse__affiche {
  position: absolute;
  inset: 10%;
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: opacity var(--duree-apparition-frelock) var(--courbe-signature);
}
.visionneuse.est-3d canvas { opacity: 1; }
.visionneuse.est-3d .visionneuse__affiche { opacity: 0; pointer-events: none; }

.vues { display: flex; flex-wrap: wrap; gap: var(--espace-1); }
.vues[hidden] { display: none; }
.vues button,
.vues__rejouer {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--fl-blanc);
  border-radius: var(--angle-controle);
  background: transparent;
  color: var(--fl-blanc);
  font-weight: 600;
  font-size: var(--taille-bouton);
  line-height: 1;
  overflow: hidden;
  isolation: isolate;
  transition: color var(--duree-micro) var(--courbe-signature);
}
.vues button::before {                              /* le jaune monte : une échelle, pas une couleur animée */
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  background: var(--fl-jaune);
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform var(--duree-micro-longue) var(--courbe-signature);
}
.vues button:hover::before { transform: scaleY(0.12); }
.vues button[aria-pressed="true"] { color: var(--fl-noir); border-color: var(--fl-jaune); }
.vues button[aria-pressed="true"]::before { transform: scaleY(1); }
.vues__rejouer { justify-self: start; border-color: transparent; padding-left: 0; color: var(--fl-jaune); }
.vues__rejouer[hidden] { display: none; }
.vues__rejouer svg { width: 18px; height: 18px; }
.vues__legende { min-height: 3.2em; font-size: 1rem; color: var(--texte-doux); }

/* ── Section phare : planches en coupe ────────────────────────────── */
.phare { border-top: 1px solid var(--filet-couleur); }
.phare__entete { max-width: 760px; }
.phare__entete .fl-titre { max-width: 18ch; margin-top: var(--espace-1); }
.phare__scenes { display: grid; gap: var(--espace-4); margin-top: var(--espace-4); }
.phare__bloc {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--espace-3) var(--espace-4);
  align-items: center;
}
.phare__texte h3 { font-size: var(--taille-titre-3); }
.phare__etapes { display: grid; gap: 14px; margin-top: 20px; list-style: none; counter-reset: etape-phare; }
.phare__etapes li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; align-items: start; counter-increment: etape-phare; }
.phare__etapes li::before {
  content: counter(etape-phare);
  content: counter(etape-phare) / "";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--fl-jaune);
  color: var(--fl-noir);
  font-family: var(--police-display);
  font-weight: 900;
  font-size: 0.9375rem;
  line-height: 1;
}
.phare__note { margin-top: 20px; color: var(--texte-doux); }
.phare__reglages { display: grid; gap: 10px; margin-top: var(--espace-2); }
.phare__reglages div { display: grid; grid-template-columns: 3em minmax(0, 1fr); gap: 12px; align-items: baseline; }
.phare__reglages dt { font-family: var(--police-display); font-weight: 900; font-size: 1.5rem; line-height: 1; color: var(--fl-jaune); }
.phare__reglages dd { margin: 0; }
.phare__planche { border-radius: var(--angle-carte); overflow: hidden; background: var(--fl-blanc); }
.phare__scene { display: block; width: 100%; height: auto; }
.phare__chiffre { font-family: var(--police-display); font-weight: 900; font-size: 15px; fill: var(--fl-jaune); }
.phare__texte-cote { font-family: var(--police-display); font-weight: 700; font-size: 22px; fill: var(--fl-noir); }

/* Animation (frelock.js pose data-anime) : les deux planches occupent la même place ;
   les traits pointillés de la version fixe disparaissent, les insectes bougent. */
.phare[data-anime] { padding-block: var(--espace-3); }   /* figée : tout doit tenir dans l'écran */
.phare[data-anime] .phare__scenes { grid-template-areas: "scene"; margin-top: var(--espace-3); }
.phare[data-anime] .phare__bloc { grid-area: scene; align-content: start; }
.phare[data-anime] .phare__trace { opacity: 0; }

/* ── Sachez le reconnaître ────────────────────────────────────────── */
.reconnaitre__intro { max-width: 58ch; margin-top: var(--espace-2); }
.insectes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--espace-2);
  margin-top: var(--espace-4);
  list-style: none;
}
.insecte {
  display: grid;
  align-content: start;
  gap: var(--espace-1);
  padding: var(--espace-2) var(--espace-2) 20px;
  border: 1px solid var(--filet-couleur);
  border-radius: var(--angle-carte);
}
.insecte--cible { box-shadow: inset 0 0 0 1px var(--fl-noir); border-color: var(--fl-noir); }
.insecte__photo {
  display: block; width: 100%; height: auto; margin: 0; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--angle-controle); background: var(--filet-couleur);
}
.insecte__photo.photo-vide { padding: var(--espace-2); }
.reconnaitre__credits { max-width: 90ch; margin-top: var(--espace-2); font-size: 0.75rem; line-height: 1.5; color: var(--texte-doux); }
.reconnaitre__credits a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.reconnaitre__credits a:hover { color: var(--titre); }
.insecte__dessin { width: 100%; height: auto; }
.insecte__etiquette {
  justify-self: start;
  padding: 4px 8px;
  border-radius: var(--angle-controle);
  background: var(--fl-jaune);
  font-family: var(--police-display);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: var(--approche-fl);
  text-transform: uppercase;
}
.insecte__nom { font-size: 1.25rem; }
.insecte p:not(.insecte__etiquette) { font-size: 1rem; line-height: 1.5; }
.reconnaitre__nid { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: var(--espace-3); }
.reconnaitre__nid .lien-fleche { color: var(--fl-noir); }
.insecte__echelle { font-family: var(--police-texte); font-weight: 600; font-size: 13px; fill: #4D4D4D; }

/* ── Nos tests (masquée tant que le tableau est vide) ─────────────── */
.tests__intro { margin-top: var(--espace-2); }
.tests__tableau { margin-top: var(--espace-3); overflow-x: auto; }
.tests table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.tests th, .tests td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--filet-couleur); text-align: left; vertical-align: top; }
.tests th { font-family: var(--police-display); font-weight: 700; font-size: var(--taille-fl-accroche); letter-spacing: var(--approche-fl); text-transform: uppercase; }

/* ── Achat à venir ────────────────────────────────────────────────── */
.achat { border-top: 1px solid var(--filet-couleur); }
.achat__grille {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--espace-3) var(--espace-4);
  align-items: center;
}
.achat__texte > p:not(.fl-accroche) { max-width: 54ch; margin-top: var(--espace-2); color: var(--texte-doux); }
.achat__actions { display: flex; flex-wrap: wrap; gap: var(--espace-2); margin-top: var(--espace-3); }
.achat__liens { display: grid; gap: 4px; margin-top: var(--espace-3); list-style: none; }
.achat__liens .lien-fleche { color: var(--fl-jaune); }

/* Cadre de remplacement d'une photo à venir : discret, à la bonne taille. */
.photo-vide {
  display: grid;
  place-items: center;
  aspect-ratio: var(--ratio, 4 / 5);
  padding: var(--espace-3);
  border: 1px dashed var(--filet-couleur);
  border-radius: var(--angle-carte);
  font-size: var(--taille-petit);
  text-align: center;
  color: var(--texte-doux);
}

/* ── Écrans moyens et petits ──────────────────────────────────────── */
@media (max-width: 899px) {
  .fl-haut, .visionneuse-bloc__grille, .achat__grille { grid-template-columns: 1fr; }
  .fl-haut { padding-top: var(--espace-3); }
  .fl-haut__photo { width: min(78%, 360px); }
  .gestes__liste { grid-template-columns: 1fr; gap: var(--espace-3); }
  .gestes__liste li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px var(--espace-2); align-items: start; }
  .gestes__illu { grid-row: span 2; }
  .gestes__liste h3 { margin-top: 0; }
  .gestes__liste p { margin-top: 0; font-size: var(--taille-petit); line-height: 1.55; }
  .phare__bloc { grid-template-columns: 1fr; gap: var(--espace-2); }
  .phare__planche { order: -1; }
  .insectes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achat .photo-vide { --ratio: 16 / 9; }
}
@media (max-width: 599px) {
  .page-frelock { padding-top: 72px; }
  .insecte { padding: 12px 12px 16px; }
  .insecte__nom { font-size: 1.0625rem; }
  .insecte p:not(.insecte__etiquette) { font-size: 0.875rem; }
  .fl-haut__actions .bouton { width: 100%; }
}
