/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body { 
  height: 100%; 
  margin: 0;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  background-color: rgb(246, 255, 255);
  /* Secondary color */
  color: #333;
  line-height: 1.6;
}

p {
  text-align: justify;
}

/* Main Content */

main {
  padding: 2rem 0;
}

main h2 {
  color: rgb(0, 136, 132);
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: xx-large;
}

main p {
  margin-bottom: 1.5rem;
}

.presentation-text {
  text-align: justify;
}


/* Container for centered content */
.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding-inline: 2rem;
}

@media (max-width: 970px) {
  .container {
  padding-inline: 1rem;
}
}

/* Header */

header {
  background-color: #008884;
  font-size: large;
  color: white;
  padding: 0.7rem 0;
  /* Header largeur*/
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
}

header h1 {
  margin-bottom: 0.3rem;
}

/* Navigation */

.nav-toggle {
  display: none;
}

nav {
  flex: 1;
  /* Navigation takes remaining space */
  display: flex;
  justify-content: center;
  /* Center nav horizontally */
}

nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2rem;
  /* Add horizontal space between items */
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 0.5rem;
  transition: background-color 0.3s ease;
}

nav a:hover {
  color: #88f3ea;
  background-color: transparent;
  /* Remove background on hover */
  border-radius: 0;
  text-decoration: none;
  /* Remove underline on hover */
  box-shadow: none;
}

.header-spacer {
  width: 100px;
  /* ou la même largeur que le logo */
  height: 1px;
  /* invisible, juste pour l'espace */
  flex-shrink: 0;
  margin-right: 2rem;
}

.logo-link {
  /* margin-left: 5rem; */
  margin-left: 5vw;
  margin-top: 1vw;
  margin-bottom: 1vw;

  display: flex;
  align-items: center;
}

.logo-img {
  max-width: 100px;
  /* Scales down on small screens  ///   je pose ça là: max-width: 20vw;*/
  width: 100%;
  height: auto;
  display: block;
}

/* Burger menu */

@media (max-width: 970px) {
  nav {
    position: relative;
  }

  nav ul {
    gap: 0;
  }

  .nav-toggle {
    display: block;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
    background: none;
    border: none;
    cursor: pointer;
  }

  header {
    position: relative;
  }

  nav ul.container {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 320px;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px #0003;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    transform: translate(-50%, -10px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  nav ul.container.open {
    display: flex;
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }

  nav li {
    width: 100%;
    display: flex;
    align-items: center;
    /* Vertically center the child */
    justify-content: flex-start;
    /* Align items to the left */
    border-bottom: 1px solid #e0e0e0;
  }

  nav li:last-child {
    border-bottom: none;
  }

  nav a {
    flex: 1;
    /* Fills the li */
    display: flex;
    align-items: center;
    /* Vertically center the text */
    padding: 1rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #333 !important;
    text-align: left;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
  }

  nav a:hover {
    background: #e0f7f6;
    color: #008884;
  }
}

/* Hero Image /// ELle est designé pour avoir un parallax mais j'ai give up de la faire marcher sur mobile */

.hero {
  height: 100vh !important; /* full screen height en théorie */
  min-height: 100vh;
  background-image: url('assets/course_de_chevaux.jpg'); 
  background-attachment: fixed; /* key for parallax */ 
  background-position: center 50%; /* Base center image */
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
  font-size: 3rem;
  z-index: 2;
}

/* Base image avec le fade bleu */

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%; /* bigger than container for movement */
  background: linear-gradient(
    to bottom,
    rgba(14, 216, 206, 0.089) 0%,    /* fully transparent at top */
    rgba(11, 188, 201, 0.514) 100%  /* soft teal fade at bottom */
  );
  opacity: var(--before-opacity, 1); /* <= contrôlée en JS */
  pointer-events: none; /* keeps it unclickable */
  z-index: 1;  /* Keep la priorité du burger sur la hero image*/
}

/* On touch devices: no parallax, no white fade, keep gradient static */
@media (hover: none) and (pointer: coarse) {
  .hero { 
    background-attachment: scroll; 
    background-position: center center; 
  }
  .fade { display: none; }                /* remove the white fade */
  .hero::before { opacity: 1 !important; }/* keep the teal overlay visible */
}

/* Fade animation */

.fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, white 100%);
  opacity: 0; /* invisible au top */
  pointer-events: none;
  z-index: 1;
}


/* Regular content sections */

.content {
    padding: 4rem;
    background: white;
    color: #333;
}
  .content:nth-child(even) {
    background: #f5f5f5;
}


/* Hero Text */

#hero-text {
  order: -1;  /* le force au dessus du divider */
  text-align: center;
  align-self: center;
  font-size: 2rem;
  font-weight: bold;
  z-index: 2;
  position: relative;
  margin-top: 30vh; /* Push le text eu milieu */
}

.hero hr {
  width: 10%;
  margin: 1rem 0;
}

/* Divider */

hr {
  color: rgb(0, 136, 132);
  width: 30%;
  margin: auto;
  margin-block: 2.5rem;
}

/* Container des cours */

.dual-cours-box {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  /* espace entre les lignes de cours */
}

.single-cours-box {
  flex: 1 1 300px;
  max-width: 400px;
  min-width: 180px;
  background: #f7ffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Container des cours */
/* sur mobile          */
@media (max-width: 800px) {
  .dual-cours-box {
    flex-direction: column;
    align-items: center;
  }

  .single-cours-box {
    width: 90%;
    max-width: 400px;
    padding: 1rem;
  }
}

.cours-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.single-cours-box .image {
  width: 100%;
  /* Image aussi large que le contenu */
  max-width: 100%;
  /* Ne dépasse pas la box */
  height: auto;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.single-cours-box .description {
  margin: 0.7rem 0 0.5rem;
  text-align: justify;
  flex: 1;
  width: 100%;
}

.single-cours-box .button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 24px;
  /* Arrondi des boutons*/
  background-color: #008884;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-family: sans-serif;
  transition: background-color 0.3s ease, text-decoration 0.3s ease;
}

.single-cours-box .button:hover {
  background-color: #1eccc6;
}

/*Divider styling*/
hr {
  border: none;
  height: 4px;
  width: 60px;
  background-color: rgb(0, 136, 132);
  margin: 0.5rem auto 2rem auto;
  /* 0.5rem above, 2rem below */
  border-radius: 2px;
}

/*Cours styling*/
.cours {
  display: flex;
  align-items: center;
  /* Center image and text vertically */
  gap: 2rem;
  margin-bottom: 2rem;
}

.cours .image {
  max-width: 50%;
  width: 100%;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
}

#description {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#description p {
  width: 100%;
}

#description .button {
  margin: 1.5rem auto 0 auto;
  /* Top margin, auto left/right centers it */
  display: inline-block;
  padding: 12px 24px;
  border-radius: 24px;
  /* Arrondi des boutons*/
  background-color: #008884;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-family: sans-serif;
  transition: background-color 0.3s ease, text-decoration 0.3s ease;
}

#description .button:hover {
  background-color: #1eccc6;
}

/*Mobile responsive*/
@media (max-width: 1000px) {
  .cours {
    flex-direction: column;
    align-items: center;
  }

  .cours .image {
    max-width: 90vw;
    margin-bottom: 1rem;
  }
}

/* Content card - Genre Page FIX*/

.large-card {
  flex: 1 1 100vw;
  max-width: 100vw;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

/* Infos cards */

.info-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #0002;
  margin: 2rem 0;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  padding: 2rem;
  box-sizing: border-box;
  cursor: pointer; /* gueule d'un truc clickable */
}

.info-content {
  flex: 1;
  min-width: 0;
}

.info-title {
  text-align: left;
  font-size: 1.7rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: #008884;
}

.info-date {
  display: block;
  font-size: 0.95rem;
  color: #888;
  font-style: italic;
  margin-bottom: 1rem;
  margin-top: -0.5rem;
  text-align: left;
}

.info-text {
  font-size: 1.1rem;
  color: #333;
  text-align: justify;
}

.info-image {
  max-width: 300px;
  width: 100%;
  border-radius: 8px;
  margin-left: 2rem;
  object-fit: cover;
}

/* Responsive: stack l'image sous le texte on mobile */
@media (max-width: 800px) {
  .info-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }
  .info-image {
    margin: 1.5rem auto 0 auto;
    max-width: 90vw;
  }
}

/* Infos Cards Button*/

.info-text-wrapper {
  position: relative;
  overflow: hidden;
  transition: max-height ease;
}

/* 
.info-text-wrapper.collapsed {
  max-height: 15em;   Ligne max avant de collapse // Testing srry
}
*/

.info-text-wrapper.expanded {
  max-height: 1000em;
}

.info-text-wrapper::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3em;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 80%);
  pointer-events: none;
  transition: opacity 0.4s;
}

.info-text-wrapper.expanded::after {
  opacity: 0;
}

.info-content .button {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 24px;
  /* Arrondi des boutons*/
  background-color: #008884;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-family: sans-serif;
  transition: background-color 0.3s ease, text-decoration 0.3s ease;
}

.info-content .button:hover {
  background-color: #1eccc6;
}

/*Accordéon de la page insriptions*/
table.accordeon-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
}

.accordeon-table td {
  border: 1px solid #ccc;
  padding: 0;
}


.accordeon-table tr:first-child td {
  background-color: #fff;
  text-align: left;
}

details {
  width: 100%;
  padding: 10px 15px;
  cursor: pointer;
  text-align: left;
  font-weight: normal;
}

summary {
  font-weight: bold;
  color: rgb(0, 136, 132);
  font-size: 16px;
  text-align: left;
  display: block;
  font-weight: normal;
}

summary::marker {
  text-align: left;
}

details[open] {
  background-color: #f0fdfa;
}

details p {
  margin-top: 10px;
  font-size: 14px;
}

/*Tableau des documents*/
table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

th,
td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: justify;
  vertical-align: top;
  background-color: #fff;
}

tr:first-child td {
  background-color: rgb(0, 136, 132);
  font-weight: bold;
  text-align: center;
}

a {
  color: rgb(0, 136, 132);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

td {
  text-align: left;
}

/*Lieux*/
.lieux-box {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.lieu {
  background: #f7ffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  padding: 1rem;
  max-width: 400px;
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 2rem;
}

/* Maximum 2 lieux per line */
@media (min-width: 800px) {
  .lieux-box {
    flex-direction: row;
  }

  .lieu {
    flex-basis: calc(50% - 2rem);
    max-width: calc(50% - 2rem);
  }
}

/* Sur mobile, 1 lieu par ligne */
@media (max-width: 800px) {
  .lieu {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Adresse justifiée */
.lieu p {
  margin-bottom: 1rem;
}

.lieu h3 {
  text-align: center;
  margin-bottom: 0.5rem;
}

.lieu iframe {
  border-radius: 6px;
  width: 100%;
  height: 250px;
  margin-bottom: 0;
}

/*Iframe HelloAsso*/
#haWidget {
  display: block;
  width: 100%;
  max-width: 1100px;
  /* Same as .container */
  margin: 2rem auto;
  /* Center and add space above/below */
  border: none;
  height: 3000px;
  /* Adjust this value until no scroll bar appears */
  box-sizing: border-box;
  background: #f7ffff;
  /* Optional: match your page background */
  border-radius: 8px;
  /* Optional: match your box style */
  box-shadow: 0 2px 8px #0001;
  /* Optional: subtle shadow */
}

/*Page Titles*/
.title {
  margin: auto;
  text-align: center;
  justify-content: center;
  padding-top: 3rem;
}

/* Liens réseaux sociaux */

.social-header{
  margin-right: 2rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.social-links a {
  display: flex;
  width: 32px;
  height: 32px;
  color: inherit;
}

.social-links svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  transition: color 0.3s, fill 0.3s;
}

/* Variante en colonne */
.social-column {
  flex-direction: column;   /* aligne en vertical */
  justify-content: flex-start; /* colle en haut */
  align-items: flex-start;  /* aligne à gauche */
}

/* Variante empilée avec texte pour les liens du fix */
.social-links.social-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
}

.social-links.social-column a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  font-size: inherit;
  width: auto; /* pas de largeur forcée */
}

.social-links.social-column svg {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Hover couleurs */
.social-links a[aria-label="Facebook"]:hover { color: rgb(49, 214, 200); }
.social-links a[aria-label="Instagram"]:hover { color: rgb(49, 214, 200); }
.social-links a[aria-label="Email"]:hover { color: rgb(49, 214, 200); }

@media (max-width: 970px) {
  .social-header{
    display: none;
  }
}

/* Gallery Page */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
}
.gallery img {
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s;
}
.gallery img:hover {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.9);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

/* Visible state */
.lightbox.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Image animation */
.lightbox-content {
  max-width: 80%;
  max-height: 70vh;
  border-radius: 12px;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.lightbox.show .lightbox-content {
  transform: scale(1);
  opacity: 1;
}

#caption {
  margin: 1rem auto;
  text-align: center;
  color: #fff;
  font-size: 1.1rem;
}

.close {
  position: absolute;
  top: 20px; right: 40px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}

/* Palmares Page */

.palmares-section {
  padding: 2rem 0;
}
.year-block {
  background: #f7ffff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.year-block h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: rgb(0, 136, 132);
}
.entries {
  display: grid;
  flex-direction: column;
  gap: 1rem;
}
.card {
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.card .name {
  font-weight: bold;
  margin-bottom: .5rem;
  color: #008884;
}
.card ul { margin: 0; padding-left: 1.2rem; }
.card li { margin: .3rem 0; }

/* Test pour les palmares */

/* .card .badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: bold;
  margin-right: 0.5rem;
}
.badge.gold { background: #ffd700; color: #000; }
.badge.silver { background: #c0c0c0; color: #000; }
.badge.bronze { background: #cd7f32; color: #fff; } */
    
/* Footer */
footer {
  background-color: rgb(0, 136, 132);
  color: white;
  text-align: center;
  padding: 1rem 0;
  margin-top: auto;
}

footer p {
  text-align: center ;
}