/* ============================================================================
   LA CLIQUE — Souvenirs entre potes (Valais)
   Feuille de style partagée par toutes les pages.
   Style : "scrapbook moderne", dark mode, chaleureux.

   SOMMAIRE
   1.  Variables (couleurs, polices)        → :root
   2.  Couleur d'accent par catégorie       → body[data-category="..."]
   3.  Reset & base
   4.  Typographie
   5.  Conteneurs & utilitaires
   6.  Header / navigation fixe
   7.  Hero (accueil + bannière catégorie)
   8.  Boutons & liens
   9.  Cartes "catégorie" (accueil)
   10. Cartes "souvenir" (grille)
   11. Animations au scroll (.reveal)
   12. Footer
   13. Responsive (mobile)
   14. Préférence "réduire les animations"

   👉 POUR AJOUTER UNE NOUVELLE CATÉGORIE : voir la section 2 ci-dessous.
   ============================================================================ */


/* ============================================================================
   1. VARIABLES GLOBALES
   ============================================================================ */
:root {
  /* — Couleurs de fond (dark mode chaleureux, pas un noir froid) — */
  --bg:            #16120d;   /* fond général, presque noir mais chaud */
  --bg-soft:       #1e1812;   /* fonds de sections alternées */
  --surface:       #241d15;   /* fond des cartes */
  --surface-2:     #2c241a;   /* fond des cartes au survol */
  --border:        #3a2f22;   /* bordures discrètes */

  /* — Texte — */
  --text:          #f3e9da;   /* texte principal (blanc cassé chaud) */
  --text-muted:    #b3a48d;   /* texte secondaire / dates */

  /* — Accent par défaut (page d'accueil) : ambre chaleureux — */
  --accent:        #ff9b54;
  --accent-soft:   #ffb27a;

  /* — Polices (chargées via Google Fonts dans le <head> de chaque page) — */
  --font-display:  "Fraunces", Georgia, "Times New Roman", serif;  /* gros titres */
  --font-hand:     "Caveat", "Segoe Script", cursive;              /* touches manuscrites */
  --font-body:     "Space Grotesk", system-ui, sans-serif;         /* texte courant */

  /* — Mesures — */
  --radius:        14px;
  --radius-lg:     22px;
  --maxw:          1140px;
  --shadow:        0 18px 40px -18px rgba(0, 0, 0, .65);
  --shadow-hover:  0 26px 55px -16px rgba(0, 0, 0, .75);
}


/* ============================================================================
   2. COULEUR D'ACCENT PAR CATÉGORIE
   --------------------------------------------------------------------------
   Chaque page catégorie a, sur sa balise <body>, un attribut
   data-category="..." qui active la bonne couleur.

   ➕ POUR AJOUTER UNE CATÉGORIE (ex : "ski") :
      1. Copie une page existante (ex : peche.html) en ski.html
      2. Mets <body data-category="ski"> sur cette nouvelle page
      3. Ajoute une ligne ici avec sa couleur :
            body[data-category="ski"]  { --accent: #6ec1ff; --accent-soft: #9ad4ff; }
      4. Ajoute un lien vers ski.html dans le <header> de chaque page
   ============================================================================ */
body[data-category="peche"]        { --accent: #4ea8de; --accent-soft: #7ec4ee; } /* 🎣 bleu  */
body[data-category="bowling"]      { --accent: #ff5a5f; --accent-soft: #ff8488; } /* 🎳 rouge */
body[data-category="escape-game"]  { --accent: #3ddc97; --accent-soft: #74e9b8; } /* 🔓 vert  */


/* ============================================================================
   3. RESET & BASE
   ============================================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  /* Légère trame de points façon carnet de notes — discrète */
  background-image:
    radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.08rem);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #1a1208; }

/* Focus clavier visible (accessibilité) */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ============================================================================
   4. TYPOGRAPHIE
   ============================================================================ */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.01em;
}

p { text-wrap: pretty; }

/* Petit label manuscrit (dates, légendes, intitulés de section) */
.handwritten {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--accent-soft);
  font-size: 1.4rem;
  line-height: 1;
}


/* ============================================================================
   5. CONTENEURS & UTILITAIRES
   ============================================================================ */
.container {
  width: min(100% - 2.4rem, var(--maxw));
  margin-inline: auto;
}

.section { padding-block: clamp(3.5rem, 7vw, 6rem); }
.section--soft { background: var(--bg-soft); }

/* En-tête de section : petit label manuscrit + gros titre souligné */
.section__head { margin-bottom: 2.6rem; }
.section__kicker {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-soft);
  display: inline-block;
  transform: rotate(-2deg);
}
.section__title {
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem);
  margin-top: .2rem;
}
/* Petit trait d'accent dessiné à la main sous les titres */
.section__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 7px;
  margin-top: .7rem;
  border-radius: 999px;
  background: var(--accent);
  transform: rotate(-1.2deg);
}


/* ============================================================================
   6. HEADER / NAVIGATION FIXE
   ============================================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(22, 18, 13, .72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .8rem;
}

/* Logo / nom du site */
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.brand span { color: var(--accent); }
.brand small {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Liens de navigation */
.nav__links {
  display: flex;
  align-items: center;
  gap: .35rem;
  list-style: none;
  padding: 0;
}
.nav__links a {
  display: inline-block;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s, background .2s;
}
.nav__links a:hover { color: var(--text); background: var(--surface); }
/* Page courante mise en avant (via aria-current="page" dans le HTML) */
.nav__links a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Bouton hamburger (visible en mobile uniquement) */
.nav__toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
}


/* ============================================================================
   7. HERO (haut de la page d'accueil + bannière des catégories)
   ============================================================================ */
.hero {
  position: relative;
  padding-top: clamp(7rem, 12vw, 10rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  overflow: hidden;
}
/* Halo coloré flou en arrière-plan */
.hero::before {
  content: "";
  position: absolute;
  top: -20%; left: 50%;
  width: 120vw; height: 70vh;
  transform: translateX(-50%);
  background:
    radial-gradient(40% 60% at 30% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(40% 60% at 75% 40%, color-mix(in srgb, var(--accent-soft) 22%, transparent), transparent 70%);
  filter: blur(20px);
  z-index: -1;
  pointer-events: none;
}
.hero__inner { max-width: 760px; }
.hero h1 {
  font-size: clamp(2.6rem, 1.6rem + 6vw, 5.2rem);
}
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.hero__lead {
  margin-top: 1.2rem;
  font-size: clamp(1.05rem, 1rem + .5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 56ch;
}
.hero__tag {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent-soft);
  transform: rotate(-2deg);
}

/* Variante : bannière en tête des pages catégorie */
.hero--cat { padding-bottom: clamp(2rem, 4vw, 3rem); }
.hero--cat h1 { font-size: clamp(2.4rem, 1.6rem + 5vw, 4.4rem); }
.hero--cat .hero__lead { margin-top: .8rem; }


/* ============================================================================
   8. BOUTONS & LIENS
   ============================================================================ */
.btn {
  --b: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid var(--b);
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.btn--solid { background: var(--b); color: #17110a; }
.btn--ghost { background: transparent; color: var(--text); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }

.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

/* Lien "retour" en haut des pages catégorie */
.backlink {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 1rem;
}
.backlink:hover { color: var(--accent); }


/* ============================================================================
   9. CARTES "CATÉGORIE" (page d'accueil — résumé visuel)
   --------------------------------------------------------------------------
   Une grande carte par catégorie, façon polaroïd, qui mène à sa page.
   ============================================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.cat-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: .9rem .9rem 1.3rem;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
/* Légère rotation alternée façon photos collées */
.cat-grid > .cat-card:nth-child(odd)  { transform: rotate(-1.3deg); }
.cat-grid > .cat-card:nth-child(even) { transform: rotate(1.3deg); }
.cat-card:hover {
  transform: rotate(0) translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.cat-card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  /* Fond coloré (placeholder) à la couleur de la catégorie */
  background:
    radial-gradient(120% 120% at 30% 20%,
      color-mix(in srgb, var(--accent) 55%, #000) 0%,
      color-mix(in srgb, var(--accent) 16%, #14110d) 72%);
  display: grid;
  place-items: center;
}
/* Emoji affiché tant qu'aucune photo n'est présente (attribut data-icon) */
.cat-card__photo::before {
  content: attr(data-icon);
  font-size: clamp(2.6rem, 9vw, 3.6rem);
  z-index: 1;
}
.cat-card__photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;          /* la vraie photo recouvre le placeholder */
}
.cat-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: .9rem;
  padding-inline: .3rem;
}
.cat-card__label h3 { font-size: 1.7rem; }
.cat-card__count {
  font-family: var(--font-hand);
  font-weight: 700;
  color: var(--accent-soft);
  font-size: 1.25rem;
  white-space: nowrap;
}
.cat-card__go {
  margin-top: .3rem;
  padding-inline: .3rem;
  color: var(--accent);
  font-weight: 700;
  transition: gap .2s;
}


/* ============================================================================
   10. CARTES "SOUVENIR" (grille des pages catégorie + derniers souvenirs)
   --------------------------------------------------------------------------
   Composant réutilisable : copie-colle un bloc <article class="card"> pour
   ajouter un souvenir. Voir les commentaires dans les fichiers HTML.
   ============================================================================ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 2rem 1.8rem;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: .8rem .8rem 1.3rem;
  transition: transform .25s, box-shadow .25s, border-color .25s, background .25s;
}
/* Rotation légère alternée (effet photos collées) */
.cards > .card:nth-child(3n+1) { transform: rotate(-1.1deg); }
.cards > .card:nth-child(3n+2) { transform: rotate(.7deg); }
.cards > .card:nth-child(3n+3) { transform: rotate(1.4deg); }
.card:hover {
  transform: rotate(0) translateY(-6px);
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  z-index: 3;
}

/* — Bout de "scotch" en haut de la carte — */
.card::before {
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  width: 92px; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--accent) 38%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 3px;
  z-index: 4;
}

/* — Zone photo — */
.card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 30% 20%,
      color-mix(in srgb, var(--accent) 50%, #000) 0%,
      color-mix(in srgb, var(--accent) 14%, #14110d) 72%);
}
/* Emoji du placeholder (attribut data-icon sur .card__photo) */
.card__photo::before {
  content: attr(data-icon);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(2.4rem, 9vw, 3.4rem);
  z-index: 1;
}
/* Petite légende du placeholder, façon manuscrite */
.card__photo::after {
  content: "✎ photo à ajouter";
  position: absolute;
  left: 0; right: 0; bottom: .5rem;
  text-align: center;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-muted);
  z-index: 1;
}
.card__photo img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 2;          /* recouvre le placeholder dès qu'une photo existe */
}

/* — Texte de la carte — */
.card__body { padding: 1rem .5rem 0; }
.card__date {
  display: inline-block;
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-soft);
  transform: rotate(-1.5deg);
}
.card__title {
  font-size: 1.5rem;
  margin-top: .15rem;
}
.card__note {
  margin-top: .55rem;
  color: var(--text-muted);
  font-size: .98rem;
}
/* Petite étiquette de catégorie (utile sur la page d'accueil) */
.card__cat {
  display: inline-block;
  margin-top: .8rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}


/* ============================================================================
   11. ANIMATIONS AU SCROLL (.reveal)
   --------------------------------------------------------------------------
   Les éléments avec la classe .reveal apparaissent en fondu quand ils
   entrent dans l'écran (géré par script.js via IntersectionObserver).
   La classe "js" est ajoutée par script.js : sans JavaScript, tout
   reste visible (pas de contenu caché).
   ============================================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal.in-view {
  opacity: 1;
  transform: none;
}


/* ============================================================================
   12. FOOTER
   ============================================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding-block: 3rem;
  text-align: center;
}
.site-footer .handwritten { font-size: 1.7rem; display: block; margin-bottom: .4rem; }

/* Les 6 prénoms de la bande */
.crew {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem 1rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}
.crew li { display: inline-flex; align-items: center; }
.crew li::after {
  content: "•";
  margin-left: 1rem;
  color: var(--accent);
}
.crew li:last-child::after { content: ""; margin: 0; }

.site-footer__meta { color: var(--text-muted); font-size: .9rem; }
.site-footer__meta a { color: var(--accent); }


/* ============================================================================
   13. RESPONSIVE (mobile)
   ============================================================================ */
@media (max-width: 760px) {
  /* Menu replié derrière le bouton hamburger */
  .nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav__links {
    position: absolute;
    top: calc(100% + .4rem);
    right: 0; left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
    padding: .6rem;
    margin: 0 .6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    /* Caché par défaut, ouvert quand .nav__links--open est ajouté par le JS */
    display: none;
  }
  .nav__links--open { display: flex; }
  .nav__links a { padding: .7rem .9rem; }

  /* On désactive les rotations en mobile pour garder une grille bien nette */
  .cards > .card,
  .cat-grid > .cat-card { transform: none !important; }

  .hero__actions .btn { flex: 1 1 auto; justify-content: center; }
}


/* ============================================================================
   14. PRÉFÉRENCE "RÉDUIRE LES ANIMATIONS"
   On respecte les réglages d'accessibilité de l'appareil.
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
