/* ==========================================================================
   Dragon Team Moreira — ajustements pour téléphone
   Chargé en dernier sur toutes les pages. Les règles de mise en page ne
   s'appliquent qu'aux petits écrans : l'affichage sur ordinateur ne change pas.
   ========================================================================== */

/* ---------- Défilement : « clip » au lieu de « hidden » ----------
   « overflow-x: hidden » sur html/body transformait la page en zone de défilement
   interne, ce qui empêchait les éléments « collants » (barre des saisons) de rester visibles.
   « clip » coupe pareil les débordements horizontaux sans ce défaut. */
html,
body,
body.overflow-x-hidden {
  overflow-x: clip;
}

/* ---------- Visionneuse photo des galeries de stages (tous écrans) ---------- */
.photo-viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(3, 5, 6, 0.96);
  color: #fff;
  overflow: hidden;
}
.photo-viewer::backdrop {
  background: rgba(0, 0, 0, 0.94);
}
.photo-viewer[open] {
  display: grid;
  grid-template-rows: auto 1fr auto;
  animation: photo-viewer-in 0.18s ease-out;
}
.photo-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0.5rem 1.1rem;
  font-family: Inter, Arial, sans-serif;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}
.photo-viewer__stage {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0 0.5rem;
  touch-action: pan-y pinch-zoom;
}
.photo-viewer__stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-viewer__nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 1rem max(1rem, env(safe-area-inset-bottom));
}
.photo-viewer button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-viewer button:hover,
.photo-viewer button:focus-visible {
  border-color: #00d2ff;
  outline: none;
}
.photo-viewer button svg {
  width: 1.25rem;
  height: 1.25rem;
}
.photo-viewer button[disabled] {
  opacity: 0.3;
  cursor: default;
}
@keyframes photo-viewer-in {
  from {
    opacity: 0;
  }
}
.stage-gallery img {
  cursor: zoom-in;
}

/* ---------- Réglementation : carte sur toute la largeur, texte à longueur de ligne confortable ---------- */
.reg-card h2 + div,
.reg-card ul {
  max-width: 75ch;
}

/* ---------- Écrans tactiles : zones faciles à toucher (44 px) ---------- */
@media (pointer: coarse) {
  .btn--sm {
    min-height: 44px;
  }
  .back-link,
  .site-footer__legal {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .ev-seasons a {
    padding-block: 0.7rem;
  }
  .ev-card__link,
  .map-consent__link {
    padding-block: 0.65rem;
  }
  .map-consent__remember {
    min-height: 44px;
  }
  .map-consent__remember input {
    width: 1.25rem;
    height: 1.25rem;
  }
  .gb-dialog__close,
  .club-info-close {
    width: 44px;
    height: 44px;
  }
}

/* Sur écran tactile (pas de survol), on montre directement l'icône « agrandir » des photos */
@media (hover: none) {
  .ev-card__zoom {
    opacity: 1;
  }
}

/* ---------- Téléphones ---------- */
@media (max-width: 767px) {
  /* 16 px minimum dans les champs : évite le zoom automatique de l'iPhone */
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  textarea {
    font-size: 16px;
  }

  /* Petits textes trop fins */
  .site-footer__credit {
    font-size: 10.5px;
  }
  .site-footer__bottom > p {
    font-size: 11.5px;
  }
  #tarifs .section-head .eyebrow {
    font-size: 10.5px;
    letter-spacing: 0.16em;
  }

  /* Accueil — cartes des stages : titre lisible par-dessus l'affiche */
  .gallery-item-card > div {
    padding: 1.1rem 1.1rem 1.2rem;
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.9) 55%, rgba(0, 0, 0, 0) 100%);
    transform: none;
  }

  /* Réglementation — moins de retraits, plus de place pour le texte */
  .reg-card {
    padding: 1.4rem 1.15rem;
    border-radius: 1.25rem;
  }
  .reg-card h2 {
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 1.35rem;
    line-height: 1.15;
  }
  .reg-card h2 > span:first-child {
    flex: none;
    width: 1rem;
    margin-top: 0.7rem;
  }
  .reg-card .pl-11 {
    padding-left: 0;
  }
  .reg-card .text-base {
    font-size: 0.97rem;
  }

  /* Livre d'or — citations plus compactes */
  #guestbook-list > .relative {
    padding-left: 2.35rem;
  }
  #guestbook-list > .relative > svg {
    left: 0;
    width: 1.7rem;
    height: 1.7rem;
    transform: none;
  }
  #guestbook-list blockquote {
    margin-bottom: 1rem;
    font-size: 1.12rem;
    line-height: 1.6;
    letter-spacing: 0;
  }
  #guestbook-list > .justify-center {
    padding-block: 1.75rem;
  }
  #guestbook-list .font-impact {
    font-size: 1.35rem;
  }
}

/* ---------- Galeries des stages : 2 colonnes sur téléphone ---------- */
@media (max-width: 639px) {
  .stage-gallery {
    column-count: 2;
    column-gap: 0.6rem;
  }
  .stage-gallery > * {
    margin-block: 0 0.6rem;
    border-radius: 0.85rem;
  }
  .stage-gallery > :first-child {
    column-span: all;
  }
}

/* ---------- Accueil : hero (téléphone et tablette) ----------
   Le hero prend la hauteur de son contenu (plus de grand vide sous la photo),
   titre plus grand, deux boutons d'action, photo toujours affichée en entier. */
@media (max-width: 1023px) {
  #accueil {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding-top: calc(max(0.62rem, env(safe-area-inset-top)) + var(--nav-bar-h, 4.15rem) + 2rem) !important;
    padding-bottom: 2.75rem !important;
  }
  #accueil .hero-clean-grid {
    gap: 1.75rem;
  }
  /* texte et photo alignés sur la même largeur */
  #accueil .hero-clean-copy,
  #accueil .hero-clean-media {
    width: 100%;
    max-width: 44rem;
    margin-inline: auto;
  }
}
@media (max-width: 767px) {
  #accueil .hero-clean-title > span:first-child {
    font-size: clamp(3rem, 15.5vw, 5rem);
  }
  #accueil .hero-clean-title > span:last-child {
    font-size: clamp(2.7rem, 13.5vw, 4.4rem);
  }
  #accueil .hero-clean-media {
    max-width: none;
  }
  .hero-clean-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-top: 1.5rem;
  }
  #accueil .hero-clean-actions .btn {
    justify-content: center;
    gap: 0.45rem;
    min-height: 3.1rem;
    padding-inline: 0.5rem !important;
    font-size: 0.8rem !important;
    letter-spacing: 0.06em !important;
    text-align: center;
    white-space: nowrap;
  }
  .hero-clean-actions .btn svg {
    width: 1rem;
    height: 1rem;
  }
}
@media (max-width: 359px) {
  .hero-clean-actions {
    grid-template-columns: 1fr;
  }
}

/* ---------- Accueil : titres de section identiques sur téléphone ---------- */
@media (max-width: 767px) {
  section#cours div.section-head.section-head,
  section#planning div.section-head.section-head,
  section#tarifs div.section-head.section-head,
  section#club div.section-head.section-head,
  section#galerie div.section-head.section-head,
  section#equipe div.section-head.section-head,
  section#contact div.section-head.section-head {
    text-align: center !important;
    margin-bottom: 2.25rem !important;
  }
  section#cours div.section-head.section-head h2,
  section#planning div.section-head.section-head h2,
  section#tarifs div.section-head.section-head h2,
  section#club div.section-head.section-head h2,
  section#galerie div.section-head.section-head h2,
  section#equipe div.section-head.section-head h2,
  section#contact div.section-head.section-head h2 {
    text-align: center !important;
    font-size: 2.6rem !important;
    line-height: 1 !important;
  }
  section#cours div.section-head.section-head > p,
  section#planning div.section-head.section-head > p,
  section#tarifs div.section-head.section-head > p,
  section#club div.section-head.section-head > p,
  section#galerie div.section-head.section-head > p,
  section#equipe div.section-head.section-head > p,
  section#contact div.section-head.section-head > p {
    margin-inline: auto !important;
    text-align: center !important;
  }
}

/* ---------- Accueil : mêmes tailles partout sur téléphone ---------- */
@media (max-width: 767px) {
  /* « Le Coach » centré comme les autres titres */
  section#equipe div.section-head.section-head {
    align-items: center !important;
  }
  /* petits textes bleus au-dessus des titres : tous identiques */
  section#cours div.section-head.section-head .eyebrow,
  section#planning div.section-head.section-head .eyebrow,
  section#tarifs div.section-head.section-head .eyebrow,
  section#club div.section-head.section-head .eyebrow,
  section#galerie div.section-head.section-head .eyebrow,
  section#equipe div.section-head.section-head .eyebrow,
  section#contact div.section-head.section-head .eyebrow {
    font-size: 10.5px !important;
    letter-spacing: 0.15em !important;
    line-height: 1.5 !important;
    text-align: center !important;
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    margin-inline: auto !important;
  }
  /* titres des cartes : une seule taille */
  #tarifs .price-card__name,
  #tarifs .price-box__title,
  #equipe h3,
  #contact .contact-card__title {
    font-size: 1.6rem !important;
    line-height: 1.05 !important;
  }
  #cours h3 {
    font-size: 2.1rem !important;
    line-height: 1 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-viewer[open] {
    animation: none;
  }
}

/* ---------- Page Confidentialité ---------- */
.privacy-list {
  display: grid;
  gap: 0.6rem;
  margin: 0;
  padding-left: 1.2rem;
  list-style: disc;
}
.privacy-list li::marker {
  color: #00d2ff;
}
.privacy-link {
  color: #00d2ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy-link:hover {
  color: #74e9ff;
}
.privacy-optout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 1rem;
  background: rgba(0, 210, 255, 0.05);
}
.privacy-optout.is-off {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
}
.privacy-optout__status {
  margin: 0;
  color: #fff;
  font-weight: 600;
}
.privacy-optout__btn {
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 1px solid #00d2ff;
  border-radius: 999px;
  background: transparent;
  color: #00d2ff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.privacy-optout__btn:hover,
.privacy-optout__btn:focus-visible {
  background: #00d2ff;
  color: #001014;
  outline: none;
}
.privacy-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}
.site-footer__links .site-footer__legal + .site-footer__legal {
  margin-left: 0;
}
