/* Variables de couleurs */
:root {
  --primary-color: #8B4513; /* Marron foncé pour le mode clair */
  --primary-gradient: linear-gradient(90deg, #8B4513, #A0522D);
  --primary-hover: #A0522D;
  --link-color: #8B4513; /* Couleur des liens en mode clair */
}

body.dark-mode {
  --primary-color: #FFD700; /* Jaune d'or pour le mode sombre */
  --primary-gradient: linear-gradient(90deg, #FFD700, #FFA500);
  --primary-hover: #FFA500;
  --link-color: #FFD700; /* Couleur des liens en mode sombre */
}

/* Structure principale */
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: #f8f9fa;
  color: #2c3e50;
  transition: background-color 0.3s, color 0.3s;
  line-height: 1.6;
}

/* Mode sombre */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

.container {
  width: 100%;
  min-height: 100vh;
}

/* Limitation de la largeur du contenu */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 20px 40px;
  box-sizing: border-box;
}

/* Header fixe et menu en haut */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  padding: 10px 20px;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.fixed-header .top-menu {
  max-width: 1440px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

body.dark-mode .fixed-header {
  background-color: #111;
}

.top-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo img {
  height: 120px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* Menu de navigation */
.menu {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  font-size: 1.1rem;
}

.menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.menu a:hover::after,
.menu a.active::after {
  width: 80%;
}

/* Menu hamburger pour mobile */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  z-index: 100;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(184, 134, 11, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(184, 134, 11, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.menu-toggle:hover {
  background: rgba(184, 134, 11, 0.2);
  transform: translateY(-1px);
}

.menu-toggle .menu-text {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
}

/* Section Hero avec carrousel */
.hero {
  position: relative;
  height: 35vh;
  min-height: 250px;
  max-width: 1000px;
  border-radius: 20px;
  overflow: hidden;
  margin: 0 auto 3rem auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #000;
}

.carousel img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel img.active {
  opacity: 1;
}

.hero-content {
  position: absolute;
  right: 1.4rem;
  top: 1.4rem;
  left: auto;
  transform: none;
  z-index: 2;
  padding: 1.4rem;
  max-width: 280px;
  width: auto;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: 0 7px 21px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.hero-content.collapsed {
  max-width: 50px;
  padding: 0.7rem;
  cursor: pointer;
}

.hero-content.collapsed h1,
.hero-content.collapsed p,
.hero-content.collapsed .btn {
  display: none;
}

.hero-content.collapsed::before {
  content: '+';
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
  display: block;
  text-align: center;
}

.hero-content:not(.collapsed)::before {
  content: '−';
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: bold;
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.hero-content:not(.collapsed)::before:hover {
  transform: scale(1.1);
}

.hero h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.7rem;
  color: var(--primary-color);
  text-shadow: 0 1.4px 2.8px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.hero p {
  font-size: 0.7rem;
  margin-bottom: 1rem;
  color: #fff;
  text-shadow: 0 0.7px 1.4px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

/* Sections */
.section {
  max-width: 1000px;
  margin: 0 auto 2rem auto;
  background: #fff;
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  height: fit-content;
}

body.dark-mode .section {
  background: #2d2d2d;
}

.section h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
  font-weight: 600;
}

.section h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* Articles */
.news-article {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 15px;
  background: #f8f9fa;
  border: 1px solid #eee;
  transition: all 0.3s ease;
}

body.dark-mode .news-article {
  background: #333;
  border-color: #444;
}

.news-article:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.news-article h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.news-article .date {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  display: inline-block;
  padding: 4px 12px;
  background: rgba(139, 69, 19, 0.1);
  border-radius: 20px;
}

body.dark-mode .news-article .date {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  color: #fff;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

/* Ajustements pour les boutons en mode sombre */
body.dark-mode .btn-primary {
  background: var(--primary-gradient);
  color: #000;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.dark-mode .btn-primary:hover {
  background: var(--primary-hover);
  color: #000;
}

.text-center {
  text-align: center;
  margin-top: 2rem;
}

/* Conteneurs spéciaux */
.container {
  background: #fff;
  border-radius: 15px;
  padding: 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
  height: fit-content;
}

body.dark-mode .container {
  background: #2d2d2d;
}

/* Strava */
.strava-logo {
  text-align: left;
  margin: 0.5rem 0 0.5rem 1rem;
}

.strava-logo img {
  height: 30px;
  width: auto;
  transition: transform 0.3s ease;
  object-fit: contain;
}

.strava-logo img:hover {
  transform: scale(1.1);
}

/* Footer */
.footer {
  background: #fff;
  padding: 2rem;
  text-align: center;
  color: #666;
  border-top: 1px solid #eee;
  margin-top: 4rem;
}

body.dark-mode .footer {
  background: #2d2d2d;
  border-top-color: #444;
  color: #999;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: var(--primary-hover);
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    height: 30vh;
    margin: 0 1rem 2rem 1rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.77rem;
  }

  .section {
    margin: 0 1rem 2rem 1rem;
  }

  .menu-toggle {
    display: flex;
  }

  .menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 99;
    backdrop-filter: blur(10px);
  }

  .menu.active {
    display: flex;
  }

  .menu a {
    font-size: 1.4rem;
    padding: 1rem 2rem;
    color: #fff;
  }

  /* Animation du menu hamburger */
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .top-menu {
    padding: 0 10px;
  }
}

/* Logo Strava */
.strava-logo {
  text-align: left;
  margin-bottom: 15px;
}

.strava-logo img {
  max-width: 70px;
  height: auto;
  opacity: 0.9;
}

/* Mode sombre - ajustements supplémentaires */
body.dark-mode .news-article h3 {
  color: var(--primary-color);
}

body.dark-mode .presentation-header h1,
body.dark-mode .adhesion-header h1,
body.dark-mode .content h2 {
  color: var(--primary-color);
}

body.dark-mode .news-article .date {
  color: #ccc;
}

body.dark-mode .presentation-text {
  color: #fff;
}

body.dark-mode .adhesion-table {
  border-color: #444;
}

body.dark-mode .adhesion-table th {
  background-color: #333;
}

body.dark-mode .adhesion-table td {
  background-color: #222;
}

/* Styles pour les titres */
.content h2 {
  color: var(--primary-color);
}

/* Ajustement des couleurs pour le mode clair */
.news-article h3,
.presentation-header h1,
.adhesion-header h1 {
  color: var(--primary-color);
}

.news-article .date {
  color: #666;
  background: rgba(139, 69, 19, 0.1);
}

body.dark-mode .news-article .date {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

/* Albums */
.albums-container {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* Articles */
.articles-container {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* Contact */
.contact-container {
  max-width: 1440px !important; /* Important pour écraser d'éventuelles règles existantes */
  margin-left: auto;
  margin-right: auto;
}

/* Style du bouton de thème */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  position: relative;
  width: 60px;
  height: 30px;
  border-radius: 15px;
  background-color: #333;
  transition: background-color 0.3s ease;
}

.theme-toggle::before {
  content: '☀️';
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  transition: opacity 0.3s ease;
  opacity: 1;
  z-index: 2;
}

.theme-toggle::after {
  content: '🌙';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  transition: opacity 0.3s ease;
  opacity: 0.5;
  z-index: 2;
}

.theme-toggle .slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background-color: #FFD700;
  border-radius: 50%;
  transition: transform 0.3s ease;
  z-index: 1;
}

body.dark-mode .theme-toggle {
  background-color: #FFD700;
}

body.dark-mode .theme-toggle::before {
  opacity: 0.5;
}

body.dark-mode .theme-toggle::after {
  opacity: 1;
}

body.dark-mode .theme-toggle .slider {
  transform: translateX(30px);
  background-color: #333;
}

/* Sections calendrier et Strava */
.section.calendar-section,
.section.strava-section {
  max-width: 1000px;
  margin: 0 auto 2rem auto;
  background: none;
  box-shadow: none;
}

.section.calendar-section h2,
.section.strava-section h2 {
  color: var(--primary-color);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  padding: 0;
}

.section.calendar-section h2::after,
.section.strava-section h2::after {
  display: none;
}

.calendar-wrapper,
.strava-wrapper {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

body.dark-mode .calendar-wrapper,
body.dark-mode .strava-wrapper {
  background: #2d2d2d;
}

.calendar-wrapper iframe,
.strava-wrapper iframe {
  display: block;
  width: 100%;
  border: none;
  margin: 0;
  padding: 0;
}

.calendar-footer {
  background: #f8f9fa;
  padding: 0.75rem;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
}

body.dark-mode .calendar-footer {
  background: #333;
  border-top-color: #444;
}

.strava-header {
  background: #f8f9fa;
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
}

body.dark-mode .strava-header {
  background: #333;
  border-bottom-color: #444;
}

.strava-logo {
  margin: 0;
}

.strava-logo img {
  height: 30px;
  width: auto;
  display: block;
}

@media (max-width: 1024px) {
  .section.calendar-section,
  .section.strava-section {
    margin: 0 1rem 2rem 1rem;
  }
  
  .section.calendar-section h2,
  .section.strava-section h2 {
    font-size: 1.5rem;
  }
}

/* Styles pour les titres */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color) !important;
}

/* Ajustement des couleurs pour le mode clair */
.news-article h3,
.presentation-header h1,
.adhesion-header h1,
.content h2 {
  color: var(--primary-color) !important;
}

/* Ajustements pour le mode sombre */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: var(--primary-color) !important;
}

body.dark-mode .news-article h3,
body.dark-mode .presentation-header h1,
body.dark-mode .adhesion-header h1,
body.dark-mode .content h2 {
  color: var(--primary-color) !important;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Ajustements spécifiques pour les sections */
.presentation-header h1,
.adhesion-header h1,
.albums-header h1,
.articles-header h1,
.calendar-header h1,
.contact-header h1 {
  color: var(--primary-color);
}

/* Ajustements pour les liens dans les sections */
.presentation-text a,
.adhesion-text a,
.albums-text a,
.articles-text a,
.calendar-text a,
.contact-text a {
  color: var(--link-color);
}

/* Ajustements pour les tableaux */
.adhesion-table th {
  background-color: var(--primary-color);
  color: #fff;
}

.adhesion-table td a {
  color: var(--link-color);
}

/* Ajustements pour les boutons */
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
}

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

/* Ajustements pour les dates */
.news-article .date {
  color: #666;
  background: rgba(139, 69, 19, 0.1);
}

body.dark-mode .news-article .date {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}

.adhesion-text {
  color: var(--primary-color);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

body.dark-mode .adhesion-text {
  color: #fff;
}

/* Styles pour le texte de la section adhésion */
.adhesion-text,
.adhesion-text p,
.adhesion-text span,
.adhesion-section p em {
  color: var(--primary-color) !important;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-style: normal;
  font-weight: 500;
}

/* Ajustements pour le texte de la section adhésion en mode sombre */
body.dark-mode .adhesion-text,
body.dark-mode .adhesion-text p,
body.dark-mode .adhesion-text span,
body.dark-mode .adhesion-section p em {
  color: #fff !important;
}

/* Styles pour les liens de documents */
.document-link {
  display: inline-block;
  margin-right: 20px;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.document-link:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Ajustements pour les liens de documents en mode sombre */
body.dark-mode .document-link {
  background-color: var(--primary-color);
  color: #000;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.dark-mode .document-link:hover {
  background-color: var(--primary-hover);
  color: #000;
}

/* Styles pour les liens sociaux */
.social-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.social-link:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Ajustements pour les liens sociaux en mode sombre */
body.dark-mode .social-link {
  background-color: var(--primary-color);
  color: #000;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.dark-mode .social-link:hover {
  background-color: var(--primary-hover);
  color: #000;
}