/* ============================================
   MT2A - MajoTwirl Azur Académie
   Feuille de style partagée
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700;800&family=Nunito+Sans:ital,wght@0,400;0,600;0,700;1,600&display=swap');

:root {
  --bleu-fonce: #1b4965;
  --bleu-principal: #2f7fc4;
  --bleu-clair: #a9d9ea;
  --bleu-clair-2: #d6eef7;
  --bleu-tres-clair: #eef8fc;
  --blanc: #ffffff;
  --texte: #1b3a4b;
  --corail: #ff8c69;
  --ombre: 0 10px 30px rgba(27, 73, 101, 0.12);
  --rayon: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Nunito Sans', sans-serif;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Baloo 2', sans-serif;
  margin: 0;
  color: var(--bleu-fonce);
}

a {
  color: var(--bleu-principal);
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Bandeau d'annonce ---------- */
.bandeau {
  background: var(--bleu-clair);
  color: var(--bleu-fonce);
  position: relative;
  height: 42px;
  overflow: hidden;
}

.bandeau-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2px;
  padding: 0 16px;
  text-align: center;
  opacity: 0;
  transform: translateX(50px);
  animation: glisserBandeau 8s infinite;
}

.bandeau-item:nth-child(2) {
  animation-delay: 4s;
}

@keyframes glisserBandeau {
  0% { opacity: 0; transform: translateX(50px); }
  6% { opacity: 1; transform: translateX(0); }
  44% { opacity: 1; transform: translateX(0); }
  50% { opacity: 0; transform: translateX(-50px); }
  100% { opacity: 0; transform: translateX(-50px); }
}

@media (prefers-reduced-motion: reduce) {
  .bandeau-item {
    animation: none;
    position: static;
    opacity: 1;
    transform: none;
  }
  .bandeau {
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
  }
}

/* ---------- Navigation ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--blanc);
  box-shadow: 0 2px 10px rgba(27, 73, 101, 0.06);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--bleu-principal);
}

.logo img {
  height: 80px;
  width: auto;
  flex-shrink: 0;
}

.logo-sub {
  display: block;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  color: var(--texte);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  opacity: 0.7;
}

.menu {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu a {
  font-weight: 700;
  color: var(--bleu-fonce);
  font-size: 0.98rem;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.menu a:hover,
.menu a.actif {
  color: var(--bleu-principal);
  border-bottom-color: var(--bleu-principal);
}

.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.burger span {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
  background: var(--bleu-fonce);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: center;
  color: white;
  overflow: hidden;
  background: linear-gradient(120deg, var(--bleu-fonce), var(--bleu-principal));
}

.hero-photo-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.06) 0 40px,
    rgba(255,255,255,0) 40px 80px
  );
}

.hero-accueil {
  background-image: url('images/banniere-accueil.png');
  background-size: cover;
  background-position: center 30%;
  min-height: 420px;
}

.hero-calendrier {
  background-image: url('images/banniere-calendrier.png');
  background-size: cover;
  background-position: center center;
}

.hero-adhesion {
  background-image: url('images/banniere-adhesion.png');
  background-size: cover;
  background-position: center 40%;
}

.hero-galerie {
  background-image: url('images/banniere-galerie.png');
  background-size: cover;
  background-position: center 35%;
}

.hero-overlay-uniforme {
  position: absolute;
  inset: 0;
  background: rgba(20, 35, 48, 0.58);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(27,58,75,0.1) 0%, rgba(27,58,75,0.4) 55%, rgba(27,58,75,0.8) 100%);
}

.hero-contenu {
  position: relative;
  z-index: 2;
  padding: 60px 24px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 6px;
}

.hero p.souslegende {
  font-family: 'Nunito Sans', sans-serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--bleu-clair-2);
  margin: 0;
}

.hero .photo-manquante-tag {
  position: absolute;
  bottom: 14px;
  right: 18px;
  z-index: 3;
  background: rgba(255,255,255,0.9);
  color: var(--bleu-fonce);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
}

/* ---------- Valeurs / pictogrammes ---------- */
.valeurs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 40px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.valeur {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.valeur-icone {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--bleu-tres-clair);
  border: 2px solid var(--bleu-clair);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bleu-principal);
  transition: transform 0.2s ease, background 0.2s ease;
}

.valeur:hover .valeur-icone {
  transform: translateY(-4px);
  background: var(--bleu-clair);
}

.valeur-icone svg {
  width: 32px;
  height: 32px;
}

.valeur span.nom {
  font-weight: 700;
  color: var(--bleu-principal);
  font-size: 1rem;
}

/* ---------- Sections génériques ---------- */
.section {
  padding: 60px 24px;
}

.section.fond-clair {
  background: var(--bleu-clair);
}

.section.fond-tres-clair {
  background: var(--bleu-tres-clair);
}

.section-titre {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
}

.section-titre.blanc {
  color: white;
}

.grille-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.grille-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.carte-discipline {
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--bleu-fonce);
  color: white;
  box-shadow: var(--ombre);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.carte-discipline .carte-photo {
  height: 160px;
  background: linear-gradient(135deg, #2c5f7c, #1b3a4b);
}

.carte-discipline .carte-corps {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.carte-date {
  padding-top: 18px;
}

.carte-discipline h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.carte-discipline p {
  font-size: 0.95rem;
  line-height: 1.55;
  opacity: 0.92;
  margin: 0;
}

/* ---------- Placeholder photo manquante ---------- */
.placeholder-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--rayon);
  background: linear-gradient(180deg, #cfe9f5 0%, #cfe9f5 55%, #9fcf8e 55%, #8fc47d 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14%;
}

.placeholder-photo svg.nuage {
  width: 40%;
  color: white;
  opacity: 0.95;
}

.placeholder-photo .etiquette {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(27, 58, 75, 0.82);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

/* ---------- Histoire ---------- */
.histoire-conteneur {
  max-width: 760px;
}

.histoire-logo {
  display: block;
  width: 130px;
  margin: 0 auto 34px;
}

.histoire-texte-long p {
  color: var(--texte);
  font-size: 1.02rem;
  line-height: 1.85;
  margin: 0 0 22px;
}

.histoire-texte-long p:first-child {
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.2rem;
  color: var(--bleu-principal);
  font-weight: 600;
  line-height: 1.6;
}

.histoire-conclusion {
  font-style: italic;
  font-weight: 700;
  color: var(--bleu-fonce) !important;
  margin-bottom: 0 !important;
}

/* ---------- Coachs ---------- */
.photo-coach {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-size: cover;
}

.badge-federation {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: white;
  padding: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  object-fit: contain;
}

.coach-carte {
  text-align: left;
}

.coach-carte h3 {
  color: white;
  font-size: 1.3rem;
}

.coach-carte .role {
  color: var(--bleu-clair-2);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

/* ---------- Avatar générique (en attente de photo) ---------- */
.avatar-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #5a9bd4, var(--bleu-fonce));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

.avatar-icone {
  width: 62%;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Albums galerie (en attente de photos) ---------- */
.album-carte {
  text-align: center;
}

.image-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--rayon);
  background: linear-gradient(160deg, #5a9bd4, var(--bleu-fonce));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--ombre);
}

.icone-photo {
  width: 30%;
  color: rgba(255, 255, 255, 0.85);
}

.album-titre {
  display: block;
  margin-top: 16px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--bleu-fonce);
}

.album-a-venir {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bleu-principal);
  background: var(--bleu-tres-clair);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-block;
  background: var(--bleu-principal);
  color: white;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: 12px;
  box-shadow: var(--ombre);
  transition: transform 0.15s ease, background 0.15s ease;
}

.bouton:hover {
  background: var(--bleu-fonce);
  color: white;
  transform: translateY(-2px);
}

/* ---------- Footer ---------- */
footer {
  background: var(--bleu-fonce);
  color: var(--bleu-clair-2);
  text-align: center;
  padding: 30px 24px;
  font-size: 0.85rem;
}

footer a {
  color: white;
  font-weight: 700;
}

/* ---------- Créneaux horaires ---------- */
.creneaux {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.creneau {
  background: var(--bleu-principal);
  color: white;
  border-radius: var(--rayon);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--ombre);
}

.creneau-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.creneau-jour {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.creneau-horaire {
  font-weight: 700;
  font-size: 1rem;
  background: rgba(255,255,255,0.18);
  padding: 6px 12px;
  border-radius: 8px;
}

.creneau-lieu {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.95;
}

.creneaux-note {
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--texte);
  opacity: 0.75;
  margin: -8px 0 28px;
}

@media (max-width: 560px) {
  .creneaux {
    grid-template-columns: 1fr;
  }
}

/* ---------- Calendrier interactif ---------- */
.calendrier-widget {
  background: white;
  border: 1px solid var(--bleu-clair);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 24px;
}

.cal-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-entete h3 {
  font-size: 1.3rem;
  text-transform: capitalize;
}

.cal-nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bleu-tres-clair);
  color: var(--bleu-principal);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cal-nav-btn:hover {
  background: var(--bleu-clair);
}

.cal-jours-semaine {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--bleu-principal);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.cal-grille {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-case {
  position: relative;
  min-height: 68px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--bleu-tres-clair);
  background: white;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-family: 'Nunito Sans', sans-serif;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cal-case:hover {
  background: var(--bleu-tres-clair);
  transform: translateY(-1px);
}

.cal-case-vide {
  border: none;
  cursor: default;
  background: transparent;
}

.cal-case-vide:hover {
  background: transparent;
  transform: none;
}

.cal-case-sans-evt {
  cursor: default;
}

.cal-case-sans-evt:hover {
  background: white;
  transform: none;
}

.cal-numero {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--texte);
}

.cal-aujourdhui {
  border: 2px solid var(--bleu-principal);
}

.cal-aujourdhui .cal-numero {
  color: var(--bleu-principal);
}

.cal-a-evenement {
  background: var(--bleu-tres-clair);
}

.cal-pastille {
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
  background: var(--bleu-principal);
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-aide {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: 16px;
}

/* ---------- Modale du calendrier ---------- */
.cal-modale {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cal-modale[hidden] {
  display: none;
}

.cal-modale-fond {
  position: absolute;
  inset: 0;
  background: rgba(27, 58, 75, 0.55);
}

.cal-modale-contenu {
  position: relative;
  background: white;
  border-radius: var(--rayon);
  padding: 28px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.cal-modale-fermer {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--texte);
  opacity: 0.5;
  cursor: pointer;
}

.cal-modale-fermer:hover {
  opacity: 1;
}

#cal-modale-date {
  font-size: 1.2rem;
  margin-bottom: 14px;
  padding-right: 24px;
  text-transform: capitalize;
}

.cal-liste-evenements {
  margin-bottom: 18px;
  max-height: 180px;
  overflow-y: auto;
}

.cal-liste-vide {
  font-size: 0.9rem;
  opacity: 0.6;
  margin: 0;
}

.cal-ligne-evenement {
  background: var(--bleu-tres-clair);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bleu-fonce);
}

@media (max-width: 560px) {
  .cal-case {
    min-height: 52px;
    padding: 4px;
  }
  .cal-numero {
    font-size: 0.72rem;
  }
  .cal-pastille {
    font-size: 0.58rem;
  }
}
@media (max-width: 900px) {
  .valeurs {
    grid-template-columns: repeat(2, 1fr);
  }
  .grille-2, .grille-3 {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 720px) {
  .menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .menu.ouvert {
    max-height: 400px;
  }
  .menu li {
    border-top: 1px solid var(--bleu-tres-clair);
  }
  .menu a {
    display: block;
    padding: 14px 24px;
    border-bottom: none;
  }
  .burger {
    display: block;
  }
  .valeurs {
    grid-template-columns: 1fr 1fr;
  }
  .logo img {
    height: 60px;
  }

  .hero-title-seo h1 {
    font-size: 1.3rem;
  }

  .hero-accueil .hero-content {
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    text-align: center;
  }

  .hero-accueil .hero-content h2 {
    font-size: 2.4rem;
  }

  .hero-accueil .hero-content .souslegende {
    font-size: 1.1rem;
  }
}

/* ---------- Page d'accueil : titre SEO + bannière ---------- */
.hero-title-seo {
  background: white;
  text-align: center;
  padding: 26px 20px 20px;
}

.hero-title-seo h1 {
  margin: 0 auto;
  max-width: 720px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--bleu-fonce);
}

.hero-accueil {
  position: relative;
}

.hero-accueil .hero-content {
  position: absolute;
  z-index: 2;
  right: 8%;
  top: 50%;
  transform: translateY(-50%);
  width: 42%;
  text-align: center;
}

.hero-accueil .hero-content h2 {
  margin: 0;
  color: white;
  font-family: 'Baloo 2', sans-serif;
  font-size: 3.6rem;
  line-height: 1.02;
  font-weight: 700;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.hero-accueil .hero-content .souslegende {
  margin: 10px 0 0;
  color: white;
  font-family: 'Nunito Sans', sans-serif;
  font-style: italic;
  font-size: 1.5rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}

/* ---------- Titre de page autonome (ex : Contact, Dons) ---------- */
.page-titre {
  text-align: center;
  font-size: 2.6rem;
  color: var(--bleu-fonce);
  position: relative;
  padding-bottom: 16px;
  margin: 0 auto;
}

.page-titre::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 4px;
  border-radius: 4px;
  background: var(--bleu-principal);
}

@media (max-width: 560px) {
  .page-titre {
    font-size: 2rem;
  }
}
