/* =========================================================
   styles.css
   Thème : moderne, dynamique et sportif
   Objectif : site de club de handball amateur
   ========================================================= */


/* =======================
   Variables globales
   ======================= */
:root {
  --primary: #006400;      /* Couleur principale du club */
  --dark: #ffd700;         /* Couleur sombre (header/footer) */
  --light: #f9f9f9;        /* Fond clair */
  --accent: #457b9d;       /* Couleur secondaire */
  --text: #222;            /* Couleur du texte principal */
  --radius: 1rem;          /* Rayon d’arrondi standard */
}


/* =======================
   Reset & base
   ======================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background: var(--light);
  line-height: 1.6;
}


/* =======================
   Conteneur global
   ======================= */
.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
}


/* =======================
   Header & navigation
   ======================= */
header {
  background: var(--dark);
  color: white;
  padding: 1rem 0;
  position: sticky;       /* Header toujours visible */
  top: 0;
  z-index: 10;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Liens du menu */
nav a {
  color: black;
  text-decoration: none;
  margin-left: 1.2rem;
  font-weight: 500;
}

/* État hover + page active */
nav a:hover,
nav a.active {
  color: var(--primary);
}


/* =======================
   Logo / Branding
   ======================= */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: black;
  text-decoration: none;
}

.brand-logo {
  background: var(--primary);
  border-radius: 50%;
  color: white;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}


/* =======================
   Boutons & CTA
   ======================= */
.cta {
  background: var(--primary);
  color: white !important;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: 0.2s;
}

.cta:hover {
  background: #ffd700;
}


/* =======================
   Section HERO (page accueil)
   ======================= */
.hero {
  /* Image de fond + dégradé sombre pour la lisibilité */
  background:
    linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.1)),
    url('./images/Seniors.JPG') center / cover;

  color: white;
  padding: 6rem 0;
}

.hero .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero .actions {
  display: flex;
  gap: 1rem;
}

/* Badge type “pilule” */
.pill {
  background: rgba(255,255,255,0.15);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  color: white;
  font-size: 0.9rem;
}


/* =======================
   Sections génériques
   ======================= */
section {
  padding: 4rem 0;
}

section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--dark);
}


/* =======================
   Prochains matchs
   ======================= */
.matches .match-list {
  display: grid;
  gap: 1rem;
  justify-content: center;
}

.match {
  background: green;
  border-left: 5px solid var(--primary);
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}


/* =======================
   Page Équipe – joueurs
   ======================= */
.players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.player img {
  width: 100%;
  border-radius: var(--radius);
}

.player h3 {
  margin-top: 0.8rem;
}


/* =======================
   Cartes (coachs, boutique, infos)
   ======================= */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
}


/* =======================
   Formulaires
   ======================= */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 2rem;
}

input,
textarea,
select,
button {
  padding: 0.8rem;
  border-radius: var(--radius);
  border: 1px solid #ddd;
  font-size: 1rem;
}

button {
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
}

button:hover {
  background: #d62828;
}


/* =======================
   Footer
   ======================= */
footer {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
}

.center {
  text-align: center;
}


/* =======================
   Responsive (mobile)
   ======================= */
@media (max-width: 768px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
  }

  nav a {
    margin: 0 0.5rem;
  }
}

/* =======================
   Sponsors
   ======================= */

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  align-items: center;
  margin-top: 2rem;
}

.sponsors-grid img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  filter: grayscale(100%);
  transition: 0.3s;
}

.sponsors-grid img:hover {
  filter: grayscale(0);
  transform: scale(1.05);
}

.sponsor-logo-lg {
  max-width: 220px;
  margin-bottom: 1rem;
}

/* =======================
   Mise en avant sponsor accueil
   ======================= */

.sponsor-highlight {
  background: white;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 2rem 0;
}

.sponsor-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
}

.sponsor-label {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #777;
}

.sponsor-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.sponsor-content img {
  max-height: 60px;
  object-fit: contain;
}

.sponsor-content strong {
  font-size: 1.1rem;
}
/* =======================
   Carousel sponsors
   ======================= */

.sponsor-carousel {
  background: white;
  padding: 3rem 0;
  border-top: 1px solid #eee;
}

.sponsor-label {
  text-align: center;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: #777;
  margin-bottom: 1.5rem;
}

.carousel-wrapper {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 3rem;
  animation: scrollSponsors 25s linear infinite;
  align-items: center;
}

.carousel-item img {
  max-height: 200px;
  object-fit: contain;
  filter: grayscale(100%);
  transition: 0.3s;
}

.carousel-item img:hover {
  filter: grayscale(0);
  transform: scale(1.05);
}

/* Animation automatique */
@keyframes scrollSponsors {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .carousel-track {
    gap: 2rem;
  }

  .carousel-item img {
    max-height: 45px;
  }
}

/* =======================
   Menu avec sous-menu
   ======================= */

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: black;
  cursor: pointer;
  font-weight: 500;
}


/* =======================
   Sous-menu animé
   ======================= */

.sub-menu {
  position: absolute;
  top: 130%;
  left: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);

  /* État caché */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;

  display: flex;
  flex-direction: column;
  min-width: 180px;
  z-index: 100;
}

/* Apparition au survol */
.nav-item:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Liens */
.sub-menu a {
  color: #222;
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.sub-menu a:hover {
  background: #ffd700;
}

/* =======================
   Galerie photos
   ======================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

/* =======================
   Carousel galerie avancé
   ======================= */

.carousel {
  position: relative;
  margin: 2rem 0 4rem;
}

.carousel-viewport {
  overflow: hidden;
}

.carousel-track {
  display: flex;
  gap: 1.2rem;
  scroll-behavior: smooth;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.carousel-track::-webkit-scrollbar {
  display: none; /* Chrome */
}

.carousel-track img {
  flex: 0 0 auto;
  width: 360px;
  height: 240px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.3s;
}

.carousel-track img:hover {
  transform: scale(1.04);
}

/* Flèches */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
}

.carousel-btn.left {
  left: -20px;
}

.carousel-btn.right {
  right: -20px;
}

.carousel-btn:hover {
  background: rgba(0,0,0,0.85);
}

/* Mobile */
@media (max-width: 768px) {
  .carousel-track img {
    width: 260px;
    height: 180px;
  }

  .carousel-btn {
    display: none; /* Swipe prioritaire */
  }
}


/* =======================
   Lightbox
   ======================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.lightbox img {
  max-width: 90%;
  max-height: 85%;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Bouton fermer */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 2.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* Navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 2.2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.3);
}

/* Mobile */
@media (max-width: 768px) {
  .lightbox-nav {
    display: none; /* swipe prioritaire */
  }
}


