:root {
  --color-50: #fff1e6;
  --color-100: #ffd8b8;
  --color-200: #ffbe8a;
  --color-300: #ffa55c;
  --color-400: #ff8c2e;
  --color-500: #ff7300;
  --color-600: #d15e00;
  --color-700: #a34900;
  --color-800: #753500;
  --color-900: #472000;
  --color-950: #1a0b00;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Avenir', 'Helvetica Neue', Arial, sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f6f3f0;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(230, 203, 177, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 1rem 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--color-900);
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--color-500);
}

/* Hero Section */
.hero {
  height: 100vh;
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 6rem 2rem 0;
  background-image: url('ressources/espondeilhan.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: relative;
}

.logo-container {
  position: relative;
}

.logo-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle,
    var(--color-500) 0%,
    rgba(255, 115, 0, 0.4) 40%,
    transparent 70%
  );
  opacity: 0.6;
  filter: blur(40px);
}

.logo-container img {
  position: relative;
  max-width: 250px;
  width: 40vw;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.4));
}

/* Scroll to Top Button */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--color-500);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 999;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top:hover {
  background: var(--color-600);
  transform: translateY(-5px);
}

/* Sections */
section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--color-900);
  text-align: center;
}

/* Images de transition */
.transition-image {
  width: 100%;
  max-width: 1200px;
  display: block;
  margin: 0 auto;
  padding: 0;
}

/* Section 1 & 3 - Same background */
#equipe,
#infos {
  background-color: var(--color-50);
}

/* Section 2 & 4 - Same background */
#programme,
#agenda {
  background-color: #fff7f0;
}

/* Team Section */
.team-images {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.team-images img {
  max-width: 400px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.team-description {
  font-size: 1.1rem;
  text-align: justify;
  line-height: 1.8;
  color: var(--color-900);
}

.team-description p {
  margin-bottom: 1.5rem;
}

.team-description p:last-child {
  margin-bottom: 0;
}

.team-description ul {
  margin-bottom: 0;
  padding-left: 3rem;
}

.team-description ul + p {
  margin-top: 1.5rem;
}

/* Programme Section */
.programme-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.programme-wrapper {
  position: relative;
}

.programme-item {
  position: relative;
  padding: 3.5rem 2rem 2rem 2rem;
  border-radius: 5px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.15),
    0 16px 24px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  line-height: 1.7;
  transition: all 0.3s ease;
  transform: translateZ(0);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 2em),
    calc(100% - 2em) 100%,
    0 100%
  );
}

.programme-wrapper:nth-child(6n + 1) .programme-item {
  background: var(--color-50);
  transform: rotate(-1deg);
}
.programme-wrapper:nth-child(6n + 2) .programme-item {
  background: var(--color-100);
  transform: rotate(0.5deg);
}
.programme-wrapper:nth-child(6n + 3) .programme-item {
  background: var(--color-200);
  transform: rotate(-0.5deg);
}
.programme-wrapper:nth-child(6n + 4) .programme-item {
  background: var(--color-300);
  transform: rotate(1deg);
}
.programme-wrapper:nth-child(6n + 5) .programme-item {
  background: var(--color-400);
  transform: rotate(-0.8deg);
}
.programme-wrapper:nth-child(6n) .programme-item {
  background: var(--color-50);
  transform: rotate(0.8deg);
}

/* Folded corner effect - curled paper */
.programme-item::before {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 2em;
  height: 2em;
  border-width: 1px 0 0 1px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* Colors for folded corner with gradient effect */
.programme-wrapper:nth-child(6n + 1) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d8c0a8,
    #fff1e6 40%,
    #c8b098 50%,
    #fff1e6 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}
.programme-wrapper:nth-child(6n + 2) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d8b088,
    #ffd8b8 40%,
    #c8a078 50%,
    #ffd8b8 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}
.programme-wrapper:nth-child(6n + 3) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d8985a,
    #ffbe8a 40%,
    #c8884a 50%,
    #ffbe8a 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}
.programme-wrapper:nth-child(6n + 4) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d88028,
    #ffa55c 40%,
    #c87018 50%,
    #ffa55c 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}
.programme-wrapper:nth-child(6n + 5) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d86800,
    #ff8c2e 40%,
    #c85800 50%,
    #ff8c2e 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}
.programme-wrapper:nth-child(6n) .programme-item::before {
  background: linear-gradient(
    135deg,
    #d8c0a8,
    #fff1e6 40%,
    #c8b098 50%,
    #fff1e6 50%
  );
  box-shadow: -3px -3px 3px rgba(0, 0, 0, 0.2);
}

/* Pushpin effect - realistic side view */
.pin {
  --pin-color: #d02627;
  --pin-dark: #9e0608;
  --pin-light: #fc7e7d;

  position: absolute;
  left: 15px;
  top: -5px;
  width: 60px;
  height: 50px;
  z-index: 20;
}

.metal {
  position: absolute;
  width: 5px;
  height: 20px;
  background: linear-gradient(
    to right,
    #808080 0%,
    #eae8e8 40%,
    #eae8e8 60%,
    #808080 100%
  );
  border-radius: 0 0 30% 30%;
  transform: rotate(50deg);
  transform-origin: bottom left;
  top: 20px;
  border-bottom: 1px solid #808080;
}

.bottom-circle {
  position: absolute;
  right: 15px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: var(--pin-color);
  background: radial-gradient(
    circle at bottom right,
    var(--pin-light) 0%,
    var(--pin-light) 25%,
    var(--pin-dark) 25%,
    var(--pin-dark) 90%,
    var(--pin-color) 90%
  );
}

/* Barrel */
.bottom-circle::before {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  width: 20px;
  height: 30px;
  transform: rotate(55deg);
  transform-origin: 100% 100%;
  border-radius: 0 0 40% 40%;
  background: linear-gradient(
    to right,
    var(--pin-dark) 0%,
    var(--pin-dark) 30%,
    var(--pin-color) 30%,
    var(--pin-color) 90%,
    var(--pin-light) 90%
  );
}

/* Top circle */
.bottom-circle::after {
  content: '';
  position: absolute;
  right: -10px;
  top: -5px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(
    circle at right,
    var(--pin-light) 0%,
    var(--pin-light) 30%,
    var(--pin-color) 30%,
    var(--pin-dark) 80%
  );
}

/* Remove old ::after pushpin */
.programme-item::after {
  content: none;
}

/* Informations pratiques */
.infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.info-box {
  background: var(--color-50);
  padding: 2rem;
  border-radius: 10px;
  border-left: 5px solid var(--color-500);
}

.info-box h3 {
  color: var(--color-700);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.info-box p {
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: var(--color-900);
}

.info-box p:last-child,
.info-box p:has(+ ul) {
  margin-bottom: 0;
}

.info-box ul {
  margin-bottom: 0;
  padding-left: 2rem;
  color: var(--color-900);
}

/* Bouton Procuration */
.btn-procuration {
  margin-top: 1.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--color-500);
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 10px rgba(255, 115, 0, 0.3);
}

.btn-procuration:hover {
  background: var(--color-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 115, 0, 0.4);
}

/* Modale Procuration */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 5px;
}

.modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 50px;
  height: 50px;
  transition: opacity 0.3s;
}

.modal-close:hover {
  opacity: 0.7;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  padding: 1rem 1.5rem;
  line-height: 1;
  transition: background 0.3s;
  border-radius: 5px;
}

.modal-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.modal-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.modal-prev {
  left: -80px;
}

.modal-next {
  right: -80px;
}

.modal-counter {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Agenda Section */
.agenda-content {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.agenda-main {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--color-500);
  color: white;
  border-radius: 10px;
}

.agenda-main h3 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.agenda-events {
  list-style: none;
}

.agenda-events li {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--color-100);
  border-radius: 5px;
  border-left: 5px solid var(--color-500);
  font-size: 1.1rem;
}

.agenda-events strong {
  color: var(--color-800);
}

/* Footer */
footer {
  background: var(--color-900);
  color: white;
  padding: 2rem;
  text-align: center;
}

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

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

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  nav ul {
    gap: 1rem;
    font-size: 0.9rem;
  }

  section {
    padding: 3rem 1rem;
  }

  section h2 {
    font-size: 2rem;
  }

  .scroll-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }

  .modal-nav {
    font-size: 2rem;
    padding: 0.5rem 1rem;
  }

  .modal-prev {
    left: 10px;
  }

  .modal-next {
    right: 10px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }

  .modal-counter {
    bottom: 10px;
  }
}
