/* Base: bettermotherfuckingwebsite — 7 déclarations étendues, style épuré */
/* ponytail: pas de framework, tokens natifs, ~150 lignes suffisent. */

:root {
  --bg: #fafaf7;
  --ink: #333;
  --muted: #666;
  --line: #e5e0d5;
  --accent: #14649c;
  --accent-ink: #fff;
  --max-prose: 90ch;
  --max-wide: 960px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0 auto;
  max-width: var(--max-prose);
  line-height: 1.6;
  font-size: 18px;
  color: var(--ink);
  background: var(--bg);
  padding: 0 1rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 1.5em 0 0.5em; }
p, ul, figure { margin: 1em 0; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; border-radius: 8px; }
code { background: #eee; padding: 0.1em 0.3em; border-radius: 4px; }

/* Header persistant pleine largeur */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  /* compense body centré : étend bandeau */
  margin: 0 calc(50% - 50vw);
  padding: 0 calc(50vw - 50%);
}
.header-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo img { width: 32px; height: 32px; }
.main-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.main-nav a { text-decoration: none; color: var(--ink); font-size: 0.95rem; }
.main-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.main-nav a:hover { color: var(--accent); }
.social { display: flex; gap: 0.4rem; }
.social a {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 50%;
  text-decoration: none; /* tue souligné global sous icones */
}
.social svg { display: block; fill: currentColor; }
.btn, .btn-contact {
  background: var(--accent);
  color: var(--accent-ink) !important;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none; /* tue souligné global, manquait à btn-contact hors nav */
}
.center { text-align: center; }

/* Sections accueil */
.hero { padding: 2.5rem 0 1rem; border-bottom: 1px solid var(--line); }
.hero p.lead { font-size: 1.2rem; color: var(--muted); }
section.block { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.meta { color: var(--muted); font-size: 0.95rem; }
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.card, figure.velo, figure.photo {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}
.card h3 { margin-top: 0; }
figure.velo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover; /* recadre, même dimension apparente */
}
figure.photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.ph {
  aspect-ratio: 4 / 3;
  background: #eee;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
  margin-bottom: 0.6rem;
}

/* Grilles larges : sortent contrainte prose */
.wide {
  margin-left: 50%;
  transform: translateX(-50%);
  width: min(var(--max-wide), 94vw);
}
.grid-velos, .grid-galerie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

/* Footer colonnes */
.site-footer {
  margin: 0 calc(50% - 50vw);
  padding: 0 calc(50vw - 50%);
  border-top: 1px solid var(--line);
  margin-top: 2rem;
}
.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  font-size: 0.95rem;
}
.site-footer h2 { font-size: 1rem; margin-top: 0; }
.map iframe { width: 100%; height: 180px; border: 1px solid var(--line); border-radius: 8px; }
.bottom { text-align: center; color: var(--muted); font-size: 0.85rem; padding-bottom: 1rem; }

/* Fond image section : overlay sombre garantit contraste (règle or) */
.section-bg {
  position: relative;
  isolation: isolate;
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* fond fixe pendant scroll */
  background-color: #222; /* fallback si image absente */
  color: #fff;
  border-radius: 12px;
  padding: 3rem 1.5rem;
  margin: 1.5rem 0;
  border-bottom: none;
}
.section-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.6);
}
.section-bg .meta { color: #ddd; }
.section-bg .lead { color: #eee; }
.section-bg a { color: #fff; }
/* Variante pleine largeur : sort contrainte prose, même pattern que header/footer */
.section-bg.full-bleed {
  margin: 0 calc(50% - 50vw);
  padding: 4rem calc(50vw - 50% + 1rem);
  border-radius: 0;
}

/* Accessibilité + mobile */
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .header-inner { flex-wrap: wrap; }
  .main-nav { justify-content: flex-start; }
  .section-bg { background-attachment: scroll; } /* iOS ignore fixed + saccades */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .section-bg { background-attachment: scroll; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #111; --ink: #ddd; --muted: #aaa; --line: #333; --accent: #5cc693; --accent-ink: #111; }
  .card, figure.velo, figure.photo { background: #1a1a1a; }
  code { background: #222; }
}
