/* ============================================================
   GLOBAL VARIABLES & RESET
   ============================================================ */
:root {
  --color-bg: #11182b;
  --color-bg-alt: #0d1320;
  --color-card: #14213d;
  --color-text: #cfd8e4;
  --color-muted: #cfd8e4;
  --color-primary: #1e3a8a;
  --color-accent: #ad9924;
  --color-topbar: #070c16;
  --color-separator: #444;
  --color-hero: #0d1421;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

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

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  background: var(--color-topbar);
  border-bottom: 1px solid var(--color-separator);
  background-image: url('../img/fin.png');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  padding: 0 5%;
}

.nav {
  display: grid;
  grid-template-columns: 33% 33% 33%;
  align-items: center;
  text-align: center;
  padding: 15px 0;
}

/* ============================================================
   LOGO
   ============================================================ */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.logo-img { width: 100px; }

.logo-text {
  display: flex;
  flex-direction: column;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
}

.logo-text .line1 { font-size: 1.3rem; }
.logo-text .line2 { font-size: 0.8rem; }

/* ============================================================
   SUBTITLE
   ============================================================ */
.subtitle {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-muted);
  font-size: 1rem;
  font-style: italic;
  gap: 2px;
}

.subtitle .line1 { margin-left: -20px; }
.subtitle .line2 { margin-left: 55px; }

/* ============================================================
   HERO MENU
   ============================================================ */
.hero {
  width: 100%;
  background: var(--color-hero);
  border-bottom: 1px solid var(--color-separator);
  padding: 20px;
  display: flex;
  justify-content: center;
}

.hero .menu {
  list-style: none;
  display: flex;
  gap: 30px;
}

.hero .menu a {
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 500;
}

.hero .menu a:hover { color: #FFD700; }

/* Compact hero button */
.hero-content .btn {
  display: inline-block;
  width: auto;
  padding: 8px 16px;
  font-size: 0.8rem;
  margin: 10px auto 0;
}

/* ============================================================
   SECTIONS
   ============================================================ */
section {
  padding: 30px 20px;
  border-bottom: 1px solid var(--color-separator);
}

section h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  text-align: center;
}

h2 .icon { margin-right: 8px; }

/* ============================================================
   GRID SYSTEM
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px,1fr));
  gap: 50px;
  margin: 0 10%;
}

.past-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--color-card);
  padding: 20px;
  border-radius: 8px;
}

.card img:not(.flag),
.card img.event-poster {
  width: 100%;
  border-radius: 8px;
  margin-top: 10px;
}

.card h3 { text-align: center; }

.flag {
  width: 24px;
  margin-left: 6px;
  border-radius: 3px;
}

.event-info {
  display: grid;
  grid-template-columns: 85px 1fr;
}

.event-info .label { font-weight: bold; }
.event-info .value { text-align: left; }

/* Small cards */
.small-card { font-size: 0.7em; }
.small-card h3 { font-size: 1.2em; margin-bottom: 6px; }
.small-card .event-info { font-size: 0.9em; grid-template-columns: 50px 1fr; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: block;
  padding: 10px 20px;
  background: var(--color-primary);
  color: var(--color-text);
  margin: 0 auto 5px;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  text-align: center;
  transition: 0.2s ease;
}

.btn:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.small-btn {
  font-size: 1em;
  padding: 5px;
  margin-top: 2px;
}

/* ============================================================
   SECTION GALLERY — VERSION FINALE
   ============================================================ */

#gallery {
  padding: 40px 0;
}

#gallery h2 {
  text-align: center;
  margin-bottom: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 375px);
  justify-content: center;
  column-gap: 5px;
  row-gap: 10px;

  max-width: 1600px; /* assez large pour 4 cards + gaps */
  margin: 0 auto;
  width: 100%;
  
  grid-auto-rows: minmax(0, auto);
}

/* ============================================================
   CARD
   ============================================================ */

.gallery-card {
  background: var(--color-card);
  padding: 12px;
  border-radius: 8px;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 250px;
  margin: 0 25px;
}

/* ============================================================
   CONTENEUR IMAGE — CENTRAGE VERTICAL GARANTI
   ============================================================ */

.gallery-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border: none;
  border-radius: 8px;
  box-shadow: none;
  margin-bottom: 10px;
  background: transparent;
}

.gallery-image-container.horizontal {
  width: 300px;
  height: 170px;
}

.gallery-image-container.vertical {
  width: 170px;
  height: 300px;
}

.gallery-image-container.horizontal img,
.gallery-image-container.vertical img {
  border-radius: 8px;
}

.gallery-card .gallery-image-container img {
    cursor: pointer;
}

/* ============================================================
   IMAGE
   ============================================================ */

.gallery-image-container img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 8;
  box-shadow: none;
}

/* ============================================================
   VIDEO
   ============================================================ */

.gallery-card.is-video .gallery-image-container {
  position: relative;
  cursor: pointer;
}

.gallery-card.is-video .play-icon {
  position: absolute;
  width: 60px;
  height: 60px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.gallery-card.is-video .play-icon::before {
  content: '';
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent white;
  margin-left: 4px;
}

/* ============================================================
   POPUP VIDEOS
   ============================================================ */

#video-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.video-popup-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

#video-player {
    width: 100%;
    height: auto;
    max-height: 90vh;
}

#video-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
}

/* ============================================================
   POPUP PHOTOS
   ============================================================ */

#image-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.image-popup-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

#image-viewer {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 10px;
}

#image-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
}


/* ============================================================
   TEXTES
   ============================================================ */

.gallery-texts {
  margin-top: auto;
  text-align: center;
}

.gallery-comment,
.gallery-date {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0;
}

/* ============================================================
   ABOUT US
   ============================================================ */

#about {
  width: 100%;
  text-align: center;
  background-image: url('../img/fond-about.png');
  background-size: cover;
  background-position: center;
}

.about-wrapper {
  display: grid;
  grid-template-columns: 10% 80% 10%;
  gap: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  justify-items: center;
  align-items: center;
}

.about-side {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 200px;
}

.about-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.about-side img.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  box-shadow: 0 0 3px 1px rgba(215,213,213,0.75);
}

#about h2 {
  color: #fff;
  text-shadow:
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 0 20px rgba(0,0,0,1),
    0 0 40px rgba(0,0,0,1),
    0 0 80px rgba(0,0,0,0.95),
    0 0 120px rgba(0,0,0,0.90),
    0 0 180px rgba(0,0,0,0.85),
    0 0 240px rgba(0,0,0,0.80);
}

#about p {
  color: #fff;
  text-shadow:
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    2px 2px 0 #000,
    0 0 15px rgba(0,0,0,1),
    0 0 30px rgba(0,0,0,1),
    0 0 60px rgba(0,0,0,0.95),
    0 0 100px rgba(0,0,0,0.90),
    0 0 150px rgba(0,0,0,0.85),
    0 0 200px rgba(0,0,0,0.80);
}

/* ============================================================
   MEDIA BAR
   ============================================================ */

.media-bar {
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--color-separator);
}

.media-icons {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.media-icon {
  width: 48px;
  height: 48px;
  background: var(--color-card);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-muted);
  font-size: 1.4rem;
  text-decoration: none;
  transition: 0.25s ease;
}

.media-icon.x:hover { background:#1DA1F2; color:white; transform:scale(1.15); }
.media-icon.facebook:hover { background:#1877F2; color:white; transform:scale(1.15); }
.media-icon.instagram:hover { background:#E1306C; color:white; transform:scale(1.15); }
.media-icon.tiktok:hover { background:#000; color:white; transform:scale(1.15); }
.media-icon.whatsapp:hover { background:#25D366; color:white; transform:scale(1.15); }
.media-icon.mail:hover { background:var(--color-accent); color:var(--color-primary); transform:scale(1.15); }

/* ============================================================
   CONTACT FIX
   ============================================================ */

#contact {
  border-bottom: none;
  padding-bottom: 0;
}

#contact .media-bar {
  border-top: none;
  padding-top: 10px;
}

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background: var(--color-bg-alt);
  text-align: center;
  padding: 20px;
  color: var(--color-muted);
  border-top: 1px solid var(--color-separator);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1400px) {
  .grid {
    margin: 0 8%;
    gap: 40px;
  }
}

@media (max-width: 1200px) {
  .grid {
    margin: 0 6%;
    gap: 35px;
  }

  .past-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
}

@media (max-width: 1024px) {

  .grid {
    margin: 0 5%;
    gap: 30px;
  }

  .past-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-wrapper {
    grid-template-columns: 1fr 2fr 1fr;
  }
}

@media (max-width: 900px) {

  .about-wrapper {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .about-side {
    display: none;
  }

  .about-center {
    width: 90%;
    margin: 0 auto;
  }

  .grid {
    grid-template-columns: 1fr;
    margin: 0 5%;
  }

  .past-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero .menu {
    gap: 20px;
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {

  .nav {
    grid-template-columns: 1fr;
    row-gap: 10px;
  }

  .logo-container {
    justify-content: center;
  }

  .subtitle .line1,
  .subtitle .line2 {
    margin-left: 0;
  }

  .hero .menu {
    gap: 14px;
    flex-wrap: wrap;
  }

  .about-center {
    width: 95%;
  }
}

@media (max-width: 600px) {

  .btn {
    padding: 8px 14px;
    font-size: 0.75rem;
  }

  .media-icon {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {

  .about-center {
    width: 100%;
  }

  .hero .menu {
    gap: 12px;
  }

  .media-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}

.gallery-card.is-video .gallery-image-container {
    position: relative;
    cursor: pointer;
}

.gallery-card.is-video .play-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.gallery-card.is-video .play-icon::before {
    content: '';
    border-style: solid;
    border-width: 12px 0 12px 20px;
    border-color: transparent transparent transparent white;
    margin-left: 4px;
}

.gallery-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 25px;
}

.gallery-nav button {
  background: var(--color-primary);
  color: var(--color-text);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.gallery-nav button:hover {
  background: var(--color-accent);
  color: var(--color-primary);
}

.gallery-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.gallery-nav .btn {
    display: inline-block !important;
    margin: 0 !important;
}

.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 25px;
}

/* Les 3 boutons doivent être identiques */
.gallery-nav .gallery-btn {
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    width: 180px; /* même taille pour les 3 */
    padding: 10px 0;
    margin: 0 !important;
    text-align: center;
}

/* Bouton désactivé */
.gallery-nav .gallery-btn.disabled {
    pointer-events: none;
    opacity: 0.4;
}

.gallery-nav .gallery-btn {
    transition: background-color 0.2s ease, color 0.2s ease !important;
}
