/* UBAC ALP — feuille de style commune
   Direction : carnet de terrain / topo. Papier, encre, ardoise, un seul accent orange balise. */

:root {
  --paper: #efede6;
  --paper-2: #e4e1d7;
  --ink: #15181b;
  --ink-2: #3c434a;
  --mute: #6f767c;
  --line: #c9c5b9;
  --slate: #26303a;
  --glacier: #8fb4c4;
  --flag: #e0531f;      /* orange balise / piquet */
  --flag-ink: #b8400f;
  --ok: #3f6b4f;
  --night: #101418;

  --f-title: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --f-story: "Source Serif 4", Georgia, serif;

  --w: 1180px;
  --gut: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--flag); text-underline-offset: 3px; }
a:hover { color: var(--flag-ink); }
:focus-visible { outline: 2px solid var(--flag); outline-offset: 2px; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--gut); }

/* ---------- typo ---------- */
h1, h2, h3, h4 { font-family: var(--f-title); font-weight: 700; line-height: 1; margin: 0; text-transform: uppercase; letter-spacing: .01em; }
h1 { font-size: clamp(48px, 9vw, 120px); }
h2 { font-size: clamp(34px, 5vw, 60px); }
h3 { font-size: clamp(22px, 2.4vw, 28px); }
.kicker, .mono {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute);
}
.kicker::before { content: ""; display: inline-block; width: 18px; height: 2px; background: var(--flag); vertical-align: middle; margin-right: 10px; }
.lead { font-size: clamp(18px, 1.6vw, 21px); color: var(--ink-2); max-width: 62ch; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { font: 700 24px/1 var(--f-title); letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--flag); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: block; /* aligne « Sports » (dans .dd) sur les autres liens */
  font: 600 15px/1 var(--f-title); text-transform: uppercase; letter-spacing: .06em;
  text-decoration: none; padding: 10px 10px; white-space: nowrap; color: var(--ink-2);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--flag); }
.nav .give { color: var(--ink); border: 1.5px solid var(--ink); margin-left: 6px; }
.nav .give:hover { background: var(--ink); color: var(--paper); box-shadow: none; }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--ink); font: 600 14px var(--f-title); text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; cursor: pointer; color: var(--ink); }
@media (max-width: 900px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px var(--gut) 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; font-size: 20px; border-bottom: 1px solid var(--line); }
}

/* ---------- hero photo ---------- */
.hero {
  position: relative; min-height: min(88vh, 820px); display: flex; align-items: flex-end;
  color: #f4f2ec; background: var(--night) center/cover no-repeat;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,14,.15) 0%, rgba(10,12,14,.1) 45%, rgba(10,12,14,.78) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero .wrap { width: 100%; padding-bottom: clamp(32px, 6vw, 72px); }
.hero .kicker { color: #d6d3cb; }
.hero h1 { margin: 14px 0 18px; max-width: 12ch; }
.hero .lead { color: #e2dfd8; }
.hero .coords { position: absolute; top: 18px; right: var(--gut); font: 12px var(--f-mono); letter-spacing: .1em; color: #cfccc4; z-index: 1; }
.hero.short { min-height: min(60vh, 560px); }

/* ---------- sections ---------- */
section { padding: clamp(56px, 8vw, 110px) 0; }
section.tight { padding: clamp(36px, 5vw, 64px) 0; }
.sec-head { display: grid; gap: 14px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 760px; }
.dark { background: var(--slate); color: #ebe8e1; }
.dark .lead, .dark .kicker { color: #b9bec2; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* topo contour texture */
.topo-bg { background-image: url("../img/topo.svg"); background-size: 900px; background-repeat: repeat; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px/1 var(--f-title); text-transform: uppercase; letter-spacing: .08em; text-decoration: none;
  padding: 14px 20px; border: 1.5px solid currentColor; color: inherit; background: transparent; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.flag { background: var(--flag); border-color: var(--flag); color: #fff; }
.btn.flag:hover { background: var(--flag-ink); border-color: var(--flag-ink); color: #fff; }
.btn .arr { transition: transform .2s; }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- liens ressources (remplace les grosses cartes) ---------- */
.res { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.res li { border-bottom: 1px solid var(--line); }
.res a { display: grid; grid-template-columns: 1fr auto; gap: 4px 20px; padding: 16px 0; text-decoration: none; }
.res b { font: 600 19px/1.2 var(--f-title); text-transform: uppercase; letter-spacing: .02em; }
.res span { grid-column: 1; color: var(--ink-2); font-size: 15px; }
.res i { grid-row: 1 / span 2; grid-column: 2; align-self: center; font: normal 12px var(--f-mono); color: var(--mute); }
.res a:hover b { color: var(--flag-ink); }
.res a:hover i { color: var(--flag); }

/* ---------- note / avertissement sobre ---------- */
.note { border-left: 3px solid var(--flag); padding: 6px 0 6px 18px; max-width: 70ch; color: var(--ink-2); }
.note strong { color: var(--ink); }

/* ---------- grille activités photo ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 3px; }
.tile { position: relative; aspect-ratio: 4/5; overflow: hidden; color: #f4f2ec; text-decoration: none; background: var(--night); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, opacity .3s; opacity: .9; }
.tile:hover img { transform: scale(1.04); opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(8,10,12,.75)); }
.tile .lbl { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; }
.tile .lbl b { display: block; font: 700 32px/1 var(--f-title); text-transform: uppercase; }
.tile .lbl small { font: 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #cfccc4; }
.tile:hover { color: #fff; }

/* ---------- récit ---------- */
.story { font: 400 20px/1.7 var(--f-story); max-width: 680px; margin: 0 auto; }
.story p { margin: 0 0 1.2em; }
.story h3 { font-size: 30px; margin: 2.2em 0 .7em; }
.story .num { display: block; font: 12px var(--f-mono); letter-spacing: .12em; color: var(--flag-ink); margin-bottom: 8px; }
.pull { font: 700 clamp(30px, 4vw, 46px)/1.05 var(--f-title); text-transform: uppercase; margin: 1.4em 0; padding-left: 20px; border-left: 4px solid var(--flag); }
figure { margin: 2em 0; }
figcaption { font: 12px var(--f-mono); color: var(--mute); margin-top: 8px; letter-spacing: .05em; }

/* ---------- footer ---------- */
.foot { background: var(--night); color: #a9aeb2; padding: 56px 0 40px; font-size: 15px; }
.foot .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot h4 { color: #ebe8e1; font-size: 18px; margin-bottom: 12px; }
.foot a { color: #d6d3cb; text-decoration: none; display: block; padding: 3px 0; }
.foot a:hover { color: var(--flag); }
.foot .legal { margin-top: 40px; padding-top: 18px; border-top: 1px solid #262c31; font: 12px var(--f-mono); letter-spacing: .05em; }
@media (max-width: 760px) { .foot .cols { grid-template-columns: 1fr; } }

/* ---------- soutien ---------- */
.support { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
@media (max-width: 800px) { .support { grid-template-columns: 1fr; } }

/* utilitaires */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
.mt { margin-top: 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Fond montagne (repris de l'ancien site) sur les blocs sombres */
.hero { background-color: var(--night); background-position: center 40%; }
.hero::after { background: linear-gradient(180deg, rgba(10,14,18,.35) 0%, rgba(10,14,18,.35) 40%, rgba(10,14,18,.86) 100%); }
.dark {
  position: relative; isolation: isolate;
  background: var(--slate) url("../img/photos/fond-montagne.webp") center 45% / cover no-repeat;
}
.dark::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(16,22,28,.84); }
@media (max-width: 700px) { .dark { background-image: url("../img/photos/fond-montagne-900.webp"); } }

/* menus déroulants Préparer / Pratiquer */
.nav { overflow: visible; }
.dd { position: relative; }
.dd-t { display: block; background: none; border: 0; cursor: pointer; font: 600 15px/1 var(--f-title); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px; white-space: nowrap; color: var(--ink-2); }
.dd-t:hover, .dd.cur .dd-t { color: var(--ink); box-shadow: inset 0 -2px 0 var(--flag); }
.dd-m { display: none; position: absolute; top: 100%; left: 0; min-width: 210px; background: var(--paper); border: 1.5px solid var(--ink); padding: 6px 0; z-index: 60; box-shadow: 6px 6px 0 rgba(21,24,27,.15); }
.dd:hover .dd-m, .dd:focus-within .dd-m { display: block; }
.dd-m a { display: block; padding: 10px 16px !important; box-shadow: none !important; }
.dd-m a:hover { background: var(--ink); color: var(--paper) !important; }
@media (max-width: 900px) {
  .dd:hover .dd-m, .dd:focus-within .dd-m { display: none; }
  .dd.open .dd-m { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 6px 16px; background: none; }
  .dd-t { width: 100%; text-align: left; padding: 12px 0; font-size: 20px; border-bottom: 1px solid var(--line); box-shadow: none !important; }
  .dd-m a { font-size: 18px !important; }
  .nav .give { margin: 12px 0 0; text-align: center; }
}

/* Boutons de don : noir. L'orange est réservé aux portes de décision et au danger. */
.btn.give { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.give:hover { background: var(--slate); border-color: var(--slate); color: #fff; }
.dark .btn.give, .foot .btn.give { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.foot .btn.give:hover { background: #fff; color: var(--ink); }

/* Bulles d'aide sur le vocabulaire technique */
abbr[title] { position: relative; text-decoration: underline dotted; text-decoration-color: var(--mute); text-underline-offset: 3px; cursor: help; }
@media (hover: hover) {
  abbr[title]:hover::after { content: attr(title); position: absolute; left: 0; top: calc(100% + 6px); z-index: 70; width: max-content; max-width: 260px; padding: 8px 10px; background: var(--ink); color: var(--paper); font: 400 13px/1.4 var(--f-body); letter-spacing: 0; text-transform: none; white-space: normal; }
}

/* Accueil : promesse + deux boutons dans le haut de page */
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero .btn { color: #f4f2ec; }
.hero .btn.primary { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.hero .btn.primary:hover { background: #fff; border-color: #fff; color: var(--ink); }
.hero .btn:not(.primary):hover { background: rgba(244,242,236,.14); color: #fff; border-color: #f4f2ec; }
.hero-story { margin-top: 22px; padding-left: 14px; border-left: 3px solid var(--flag); font: italic 400 18px/1.5 var(--f-story); color: #e2dfd8; max-width: 56ch; }
.hero-story a { color: #fff; }

/* grille activités : 3 x 3 */
.tiles { grid-template-columns: repeat(3, 1fr); }
.tile { aspect-ratio: 16 / 11; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } .tile { aspect-ratio: 4 / 5; } }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr; } .tile { aspect-ratio: 16 / 10; } }
