/*
Theme Name: Francis Sports
Description: Thème léger du magasin Francis Sports (Briançon). Couleurs selon la saison Hiver / Été.
Version: 1.1.0
Requires PHP: 8.1
Requires at least: 6.4
Text Domain: francis-sports
*/

/* ---------- Couleur de saison ---------- */
body.saison-hiver { --wp--preset--color--accent: #0f3d5e; }
body.saison-ete   { --wp--preset--color--accent: #2f6b3a; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; height: auto; }

.screen-reader-text,
.skip-link:not(:focus) {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 100; background: #fff; padding: .5rem 1rem; }

/* ---------- En-tête (blanc, comme le fond du logo) ---------- */
.site-header {
  background: #fff;
  color: var(--wp--preset--color--ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  position: sticky;
  top: 0;
  z-index: 50;
}
.admin-bar .site-header { top: 32px; }
.site-header__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: .5rem 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-title { color: var(--wp--preset--color--accent); font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.custom-logo { max-height: 52px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav .menu, .site-nav .sub-menu { list-style: none; margin: 0; padding: 0; }
.site-nav .menu { display: flex; gap: .25rem; }
.site-nav .menu > li { position: relative; }
.site-nav a { color: var(--wp--preset--color--accent); text-decoration: none; font-weight: 700; }
.site-nav .menu > li > a {
  display: block;
  padding: .6rem .7rem;
  font-size: .92rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 3px solid transparent;
}
.site-nav .menu > li > a:hover,
.site-nav .menu > .current-menu-item > a,
.site-nav .menu > .current-menu-ancestor > a { border-bottom-color: var(--wp--preset--color--highlight); }
/* Petite flèche des entrées à liste déroulante */
.site-nav .menu-item-has-children > a::after {
  content: ""; display: inline-block; margin-left: .4em; vertical-align: .2em;
  border: .3em solid transparent; border-top-color: currentColor; border-bottom: 0;
}
.site-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: #fff;
  border-top: 3px solid var(--wp--preset--color--accent);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  padding: .4rem 0;
}
.site-nav .sub-menu a { color: var(--wp--preset--color--ink); font-weight: 600; display: block; padding: .5rem 1rem; }
.site-nav .sub-menu a:hover, .site-nav .sub-menu .current-menu-item > a { background: var(--wp--preset--color--soft); color: var(--wp--preset--color--accent); }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }

.site-nav__cta { display: flex; align-items: center; gap: .9rem; }
.header-phone { white-space: nowrap; font-size: .95rem; }
.header-book {
  background: var(--wp--preset--color--highlight);
  color: #fff !important;
  padding: .55rem 1.1rem;
  border-radius: 6px;
  text-transform: uppercase;
  font-size: .9rem;
  letter-spacing: .04em;
}
.header-book:hover { filter: brightness(1.08); }

.nav-toggle { display: none; background: none; border: 0; padding: .75rem .5rem; cursor: pointer; }
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  display: block; width: 26px; height: 3px; background: var(--wp--preset--color--accent); border-radius: 2px; position: relative; content: "";
}
.nav-toggle__bar::before { position: absolute; top: -8px; }
.nav-toggle__bar::after { position: absolute; top: 8px; }

/* Écrans moyens : le numéro reste dans le pied de page et sur la page Contact. */
@media (max-width: 1180px) and (min-width: 961px) { .header-phone { display: none; } }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 12px 24px rgba(0,0,0,.12);
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: .5rem 16px 1.5rem;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .site-nav.is-open { display: flex; }
  .site-nav .menu { flex-direction: column; gap: 0; }
  .site-nav .menu > li { border-bottom: 1px solid #e3e8ee; }
  .site-nav .menu > li > a { padding: .8rem 0; border-bottom: 0; }
  .site-nav .menu-item-has-children > a::after { display: none; }
  .site-nav .sub-menu { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 .6rem .9rem; }
  .site-nav .sub-menu a { padding: .4rem 0; }
  .site-nav .sub-menu a:hover { background: none; }
  .site-nav__cta { flex-direction: column; align-items: stretch; text-align: center; }
  .header-book { padding: .8rem 1rem; }
}
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ---------- Contenu ---------- */
.site-main { min-height: 60vh; }
.entry { padding: 2rem 16px 3rem; }
.entry-header, .entry-content > * { max-width: var(--wp--style--global--content-size, 880px); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: var(--wp--style--global--wide-size, 1240px); }
.entry-content > .alignfull { max-width: none; margin-left: -16px; margin-right: -16px; }
.entry-title { margin-top: 0; }

.wp-block-image img, .wp-block-media-text img { border-radius: 8px; }
.wp-block-cover { border-radius: 0; }

/* ---------- Diaporama (galerie « fs-slider » des accueils) ---------- */
/* Chaque image de la galerie est une diapo ; sa légende en est le titre. */
.wp-block-gallery.has-nested-images.fs-slider {
  display: block;
  position: relative;
  height: clamp(340px, 44vw, 640px);
  overflow: hidden;
  background: var(--wp--preset--color--accent);
}
.entry-content > .fs-slider:first-child { margin-top: -2rem; }
.wp-block-gallery.has-nested-images.fs-slider figure.wp-block-image {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100%;
  margin: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.wp-block-gallery.has-nested-images.fs-slider figure.wp-block-image.is-active,
.fs-slider:not(.is-ready) figure.wp-block-image:first-of-type { opacity: 1; z-index: 1; }
.wp-block-gallery.has-nested-images.fs-slider figure.wp-block-image img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
.wp-block-gallery.has-nested-images.fs-slider figure.wp-block-image figcaption {
  position: absolute;
  inset: 0;
  max-height: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 10% 3rem;
  background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.45));
  backdrop-filter: none;
  color: #fff;
  font-size: clamp(1.6rem, 4.2vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0,0,0,.45);
}
.wp-block-gallery.has-nested-images.fs-slider figure.wp-block-image figcaption::before {
  content: "Francis Sports";
  font-size: .38em;
  letter-spacing: .25em;
  margin-bottom: .6em;
  padding-bottom: .5em;
  border-bottom: 2px solid var(--wp--preset--color--highlight);
}
.fs-slider__nav {
  position: absolute; z-index: 2; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font-size: 1.6rem; line-height: 1;
}
.fs-slider__nav:hover, .fs-slider__nav:focus-visible { background: rgba(255,255,255,.35); }
.fs-slider__nav--prev { left: 16px; }
.fs-slider__nav--next { right: 16px; }
.fs-slider__dots { position: absolute; z-index: 2; left: 0; right: 0; bottom: 3.5rem; display: flex; justify-content: center; gap: .5rem; }
.fs-slider__dots button {
  width: 12px; height: 12px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid #fff; background: transparent;
}
.fs-slider__dots button[aria-current="true"] { background: #fff; }
@media (max-width: 600px) { .fs-slider__nav { display: none; } }

/* Bandeau de dates sous le diaporama ([fs_reservation_rapide]) */
.fs-quick {
  position: relative; z-index: 3;
  margin-top: -2.5rem !important;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--wp--preset--color--accent);
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  font-weight: 600;
}
.fs-quick label { display: flex; align-items: center; gap: .6rem; }
.fs-quick input {
  font: inherit; font-weight: 500; color: var(--wp--preset--color--ink);
  padding: .5rem .6rem; border: 0; border-radius: 6px; background: #fff;
}
.fs-quick button {
  font: inherit; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .6rem 1.6rem; border: 0; border-radius: 6px; cursor: pointer;
  background: var(--wp--preset--color--highlight); color: #fff;
}
.fs-quick button:hover { filter: brightness(1.08); }
@media (max-width: 600px) {
  .fs-quick { flex-direction: column; align-items: stretch; }
  .fs-quick label { flex-direction: column; align-items: stretch; gap: .3rem; }
  .fs-quick input { width: 100%; }
}

/* ---------- Vignettes rondes (galerie « fs-tuiles ») ---------- */
.wp-block-gallery.has-nested-images.fs-tuiles { gap: 1.5rem; margin-top: 2.5rem; margin-bottom: 3rem; justify-content: center; }
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image {
  aspect-ratio: 1;
  flex: 1 1 130px;
  width: auto !important;
  max-width: 230px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image a { display: block; width: 100%; height: 100%; }
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .4s ease;
}
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image:hover img { transform: scale(1.07); }
/* Titre par-dessus la photo ; le clic traverse jusqu'au lien de l'image. */
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image figcaption {
  position: absolute; inset: 0; max-height: none; overflow: visible;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; pointer-events: none;
  background: rgba(10,25,40,.38); backdrop-filter: none;
  color: #fff; font-size: 1.15rem; font-weight: 800; line-height: 1.2;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  transition: background .3s ease;
}
.wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image:hover figcaption { background: rgba(10,25,40,.2); }
@media (max-width: 600px) {
  .wp-block-gallery.has-nested-images.fs-tuiles figure.wp-block-image figcaption { font-size: 1rem; }
}

/* Texte d'accueil et avantages côte à côte */
.fs-intro { gap: 3rem; margin-top: 1rem; margin-bottom: 2rem; }
.fs-intro h2:first-child { margin-top: 0; }
.fs-intro .fs-avantages { margin: 0; }
.fs-chapo { font-size: 1.2rem; font-weight: 600; color: var(--wp--preset--color--accent); }

/* Bandeau photo (image mise en avant) */
.page-hero {
  position: relative;
  margin: -2rem -16px 2rem;
  min-height: clamp(220px, 38vw, 460px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--wp--preset--color--accent);
}
.home .page-hero { margin-top: 0; }
.page-hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 60%);
}
.page-hero__title {
  position: relative; z-index: 1;
  width: 100%; max-width: 1240px;
  margin: 0 auto; padding: 1.5rem 16px;
  color: #fff;
  font-size: var(--wp--preset--font-size--x-large);
  line-height: 1.15;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Sélecteur de langue */
.lang-switch { list-style: none; margin: 0; padding: 0; display: flex; gap: .15rem; }
.lang-switch a {
  display: block; padding: .3rem .45rem; border-radius: 4px;
  font-size: .8rem; letter-spacing: .03em; color: #5b6775 !important; font-weight: 600 !important;
}
.lang-switch a[aria-current] { color: var(--wp--preset--color--accent) !important; background: var(--wp--preset--color--soft); }
.lang-switch a:hover { color: var(--wp--preset--color--accent) !important; }
@media (max-width: 960px) { .lang-switch { justify-content: center; } }

/* Galeries : légendes lisibles sur les vignettes-liens */
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption { font-weight: 700; font-size: 1rem; }

/* Tableau des tarifs */
.fs-tarifs table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.fs-tarifs th { background: var(--wp--preset--color--accent); color: #fff; text-align: left; }
.fs-tarifs th, .fs-tarifs td { padding: .55rem .7rem; border-bottom: 1px solid #d5dde5; vertical-align: top; }
.fs-tarifs td:nth-child(n+2), .fs-tarifs th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.fs-tarifs td:last-child { color: var(--wp--preset--color--accent); }
.fs-tarifs tbody tr:nth-child(even) { background: #f2f5f8; }
.fs-tarifs s { color: #5b6775; }

/* Compositions */
.fs-fiche { border: 1px solid #d5dde5; border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.fs-fiche h3 { margin-top: .5rem; }
.fs-prix { color: var(--wp--preset--color--accent); font-size: 1.1rem; }
.fs-bandeau, .fs-avantages { padding: 2rem 1.5rem; border-radius: 10px; margin: 2rem auto; }
.fs-avantages ul { padding-left: 1.2rem; }
.fs-avantages li { margin: .4rem 0; }

/* ---------- Pied de page ---------- */
.site-footer { background: #13202d; color: #cbd5df; margin-top: 3rem; }
.site-footer a { color: #fff; }
.site-footer__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2.5rem 16px 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}
.site-footer__name { color: #fff; font-weight: 700; margin-bottom: .25rem; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { margin: .35rem 0; }
.site-footer__copy { text-align: center; font-size: .85rem; padding: 1rem 16px 1.5rem; margin: 0; border-top: 1px solid #22344a; }
@media (max-width: 600px) {
  .fs-tarifs table { font-size: .85rem; }
  .fs-tarifs th, .fs-tarifs td { padding: .45rem .4rem; }
}
