/* ==========================================================================
   Salvagny Trail Tour — styles partagés
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Couleurs */
  --color-yellow: #f2e879;
  --color-green: #304034;
  --color-green-translucent: rgba(48, 64, 52, 0.8);
  --color-green-light: #e7f3e4;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-overlay: rgba(0, 0, 0, 0.55);
  --color-green-dark: #222d25;
  --color-text-on-dark: rgba(231, 243, 228, 0.82);
  --color-text-on-dark-muted: rgba(231, 243, 228, 0.55);
  --color-border-on-dark: rgba(231, 243, 228, 0.16);

  /* Typographie */
  --font-display: Asap, Arial, sans-serif;
  --font-body: "Wix Madefor Text", Arial, sans-serif;

  --fs-body: clamp(16px, 1.24vw, 24px);
  --fs-small: clamp(14px, 1.08vw, 21px);
  --fs-h3: clamp(26px, 2.33vw, 45px);
  --fs-h2: clamp(30px, 2.33vw, 45px);
  --fs-h2-xl: clamp(40px, 4.65vw, 90px);
  --fs-hero: clamp(60px, 11vw, 210px);
  --fs-page-title: clamp(56px, 7.5vw, 144px);

  /* Mise en page */
  --header-height: 91px;
  --gutter: clamp(16px, 1.6vw, 30px);
  --radius-pill: 999px;
}

/* ---------- Base ---------- */
html, body { margin: 0; padding: 0; background: var(--color-green); }
* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.page {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.25;
  color: var(--color-green);
  background: var(--color-green);
  overflow-x: hidden;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2em;
  padding: 0.35em 1.6em;
  border-radius: var(--radius-pill);
  border: 1px solid currentColor;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* Primary : pilule pleine jaune, texte vert */
.btn-primary {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-green);
}
.btn-primary:hover {
  background: var(--color-green);
  color: var(--color-yellow);
}

/* Secondary : pilule en contour, prend la couleur du contexte */
.btn-secondary {
  background: transparent;
  color: var(--color-yellow);
}
.btn-secondary:hover {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: var(--color-green);
}
.btn-secondary--dark { color: var(--color-green); }
.btn-secondary--dark:hover {
  background: var(--color-green);
  border-color: var(--color-green);
  color: var(--color-green-light);
}

/* Tailles */
.btn-lg { min-width: min(100%, 15em); }
.btn-block { display: flex; width: 100%; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--gutter) 0 calc(var(--gutter) * 2.5);
  background: var(--color-green-translucent);
}
.site-header__logo img { height: 43px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 60px);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--color-yellow);
}
.nav-link { color: var(--color-yellow); }
.nav-link:hover,
.nav-link.is-active { text-decoration: underline; text-underline-offset: 4px; }

.nav-dropdown { position: relative; }
.nav-dropdown__toggle {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.9em;
}
.nav-dropdown__toggle.is-active { text-decoration: underline; text-underline-offset: 4px; }
.nav-dropdown__caret {
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.nav-dropdown__panel {
  position: absolute;
  top: 100%;
  left: -20px;
  padding-top: 22px;
  min-width: 240px;
}
.nav-dropdown__menu {
  background: var(--color-green);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}
.nav-dropdown__item {
  padding: 10px 20px;
  color: var(--color-yellow);
}
.nav-dropdown__item:hover,
.nav-dropdown__item.is-active { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Accueil : hero ---------- */
.home-hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--color-black);
}
.home-hero__img {
  background-size: cover;
  background-position: center;
}
.home-hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--header-height) var(--gutter) 0;
  text-align: center;
  color: var(--color-yellow);
}
.title-hero {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-hero);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}
.home-hero__date { margin: 0 0 2.2em; }

/* ---------- Accueil : intro ---------- */
.intro {
  background: var(--color-green-light);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  padding: 90px var(--gutter);
}
.intro__images {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: var(--gutter);
  padding-bottom: 60px;
}
.intro__img-main { width: 47%; aspect-ratio: 452 / 603; object-fit: cover; }
.intro__img-small { width: 35%; aspect-ratio: 336 / 251; object-fit: cover; }
.intro__text { max-width: 820px; padding-right: var(--gutter); }
.title-section {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
}
.intro__text .title-section { margin-bottom: 4.5em; font-size: var(--fs-h2); }
.intro__text p { margin: 0 0 1.4em; max-width: 34em; }

/* ---------- Accueil : courses ---------- */
.races {
  background: var(--color-green);
  padding: 50px var(--gutter) 60px;
}
.title-xl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2-xl);
  line-height: 1;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-yellow);
  margin: 0 0 1em;
}
.race-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 1.7vw, 32px);
}
.race-card {
  border: 1px solid var(--color-yellow);
  background: rgba(255, 255, 255, 0.05);
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.race-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin: 0 0 0.35em;
}
.race-card__meta { margin: 0 0 1.4em; color: var(--color-white); }
.race-card .btn { margin-top: auto; }

/* ---------- Accueil : format 24h ---------- */
.feature {
  position: relative;
  min-height: 100vh;
  padding: 70px var(--gutter) 90px;
  background-size: cover;
  background-position: center;
  color: var(--color-yellow);
  display: flex;
  flex-direction: column;
}
.feature::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
}
.feature > * { position: relative; }
.title-feature {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-page-title);
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  max-width: 9em;
  margin: 0 0 0.6em;
}
.feature__text { font-weight: 600; max-width: 34em; margin: 0 0 1.2em; }
.feature__cta { align-self: flex-end; margin-top: auto; }

/* ---------- Pages épreuves ---------- */
.page-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--gutter);
  padding: var(--header-height) var(--gutter) 40px;
  background-size: cover;
  background-position: center;
  color: var(--color-yellow);
}
.title-page {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-page-title);
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin: 0;
}
.subtitle { margin: 0 0 0.8em; font-size: var(--fs-body); }

.info {
  background: var(--color-green-light);
  padding: 60px var(--gutter) 70px;
}
.info__inner { max-width: 1400px; margin: 0 auto; }
.info .title-xl {
  color: var(--color-green);
  text-transform: none;
  font-size: var(--fs-h2-xl);
  margin-bottom: 0.4em;
}
.info__lead {
  max-width: 1160px;
  margin: 0 auto 1.4em;
  line-height: 1.75;
}
.info__lead p { margin: 0 0 1.5em; }
.info__lead p:last-child { margin-bottom: 0; }
.info__columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(24px, 4vw, 80px);
}
.title-card {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: -0.01em;
  margin: 0.6em 0 0.5em;
}
.card-list {
  margin: 0 0 1em;
  padding-left: 1.6em;
  line-height: 1.75;
}
.card-list strong { font-weight: 700; }

.cta {
  position: relative;
  padding: clamp(80px, 12vw, 220px) var(--gutter);
  background-size: cover;
  background-position: center;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.btn-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.btn-group .btn { min-width: min(100%, 15em); }

/* ---------- Contact ---------- */
.contact {
  background: var(--color-black);
  min-height: 100vh;
  padding: calc(var(--header-height) + 30px) var(--gutter) 90px;
}
.contact .title-section { color: var(--color-yellow); font-size: var(--fs-h2); margin-bottom: 0.5em; }
.contact-form {
  max-width: 750px;
  margin: 0 auto;
  background: var(--color-green);
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: var(--color-yellow);
}
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.field input,
.field textarea {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-yellow);
  color: var(--color-white);
  font: inherit;
  font-size: 16px;
  padding: 8px 0;
  outline: none;
  resize: vertical;
}
.field textarea { min-height: 80px; }
.field input:focus,
.field textarea:focus { border-bottom-width: 2px; }
.contact-form .btn { font-size: 15px; min-height: 36px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-green-dark);
  color: var(--color-text-on-dark);
  font-size: 15px;
  line-height: 1.6;
  border-top: 3px solid var(--color-yellow);
}
.site-footer a { transition: color 0.2s; }
.site-footer a:hover { color: var(--color-yellow); }
.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px var(--gutter) 48px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.3fr 1fr;
  gap: 40px;
}
.site-footer__logo { width: 130px; height: auto; margin-bottom: 20px; }
.site-footer__tagline { margin: 0 0 24px; max-width: 30ch; }
.site-footer__brand .btn { font-size: 15px; min-height: 40px; padding: 0 28px; }
.site-footer__brand .btn:hover { color: var(--color-yellow); border-color: var(--color-yellow); background: transparent; }
.site-footer__title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-yellow);
  margin: 0 0 18px;
}
.site-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.site-footer__social { display: flex; gap: 12px; }
.site-footer__social a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border-on-dark);
  border-radius: 50%;
  transition: border-color 0.2s, color 0.2s;
}
.site-footer__social a:hover { border-color: var(--color-yellow); }
.site-footer__social svg { width: 20px; height: 20px; fill: currentColor; }
.site-footer__bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--color-border-on-dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  font-size: 13px;
  color: var(--color-text-on-dark-muted);
}
.site-footer__bottom p { margin: 0; }
.site-footer__legal { display: flex; gap: 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .race-grid { grid-template-columns: repeat(2, 1fr); }
  .intro { grid-template-columns: 1fr; min-height: 0; }
  .intro__text { order: -1; margin-bottom: 40px; }
  .intro__text .title-section { margin-bottom: 1em; }
}

@media (max-width: 760px) {
  :root { --header-height: 70px; }
  .site-header { padding: 0 var(--gutter); }
  .site-header__logo img { height: 32px; }
  .nav { gap: 14px; font-size: 14px; }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero__img + .home-hero__img { display: none; }
  .race-grid,
  .info__columns { grid-template-columns: 1fr; }
  .page-hero { flex-direction: column; align-items: flex-start; justify-content: flex-end; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Version statique : menu déroulant en CSS ---------- */
.nav-dropdown__panel { display: none; }
.nav-dropdown:hover .nav-dropdown__panel,
.nav-dropdown:focus-within .nav-dropdown__panel { display: block; }
