/* Figtree (OFL) — voir /fonts/Figtree-OFL.txt.
   Sans-serif geometrique, dans l'esprit de l'Avenir du site d'origine. */
@font-face {
  font-family: 'Display';
  src: url('/fonts/display.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  font-style: normal;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Display';
  src: url('/fonts/display-ext.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
  font-style: normal;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------ tokens
   Palette reprise du site d'origine : fond sable, panneaux blancs,
   titres bleu ardoise (#3f5666), accents rouge brique (#a32b26).        */
:root {
  color-scheme: light;

  --paper: #f3ede1;
  --paper-2: #e8e0d0;
  --card: #ffffff;
  --ink: #2e4150;
  --ink-2: #44515b;
  --muted: #877f70;
  --line: #ded4c1;
  --accent: #a32b26;
  --accent-soft: #f7e6e3;
  --slate: #3f5666;
  --shadow-sm: 0 1px 2px rgb(60 48 28 / .07), 0 2px 8px rgb(60 48 28 / .05);
  --shadow-md: 0 2px 6px rgb(60 48 28 / .08), 0 14px 34px -12px rgb(60 48 28 / .2);
  --shadow-lg: 0 4px 10px rgb(60 48 28 / .09), 0 30px 60px -20px rgb(60 48 28 / .3);

  --wrap: 1180px;
  --read: 41rem;
  --radius: 12px;
  --radius-lg: 18px;

  --sans: 'Display', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: var(--sans);

  --step--1: clamp(.82rem, .79rem + .14vw, .9rem);
  --step-0: clamp(1rem, .96rem + .2vw, 1.07rem);
  --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.38rem);
  --step-2: clamp(1.4rem, 1.26rem + .68vw, 1.85rem);
  --step-3: clamp(1.7rem, 1.44rem + 1.3vw, 2.6rem);
  --step-4: clamp(2rem, 1.5rem + 2.5vw, 3.6rem);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

/* Le mode sombre n'est plus automatique : le site d'origine etait clair, et
   c'est cette ambiance qu'on garde par defaut. Il reste accessible au choix,
   via le bouton de l'en-tete. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #191d21;
  --paper-2: #222730;
  --card: #1f242a;
  --ink: #e8eef2;
  --ink-2: #c3ccd3;
  --muted: #8e9aa3;
  --line: #333b44;
  --accent: #e06a5e;
  --accent-soft: #33211f;
  --slate: #9fb4c4;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-md: 0 2px 6px rgb(0 0 0 / .4), 0 16px 36px -14px rgb(0 0 0 / .7);
  --shadow-lg: 0 4px 12px rgb(0 0 0 / .45), 0 34px 70px -22px rgb(0 0 0 / .85);
}

/* ------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.68 var(--sans);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: color-mix(in oklab, currentColor 35%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; color: var(--ink); }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: min(100% - 2rem, var(--wrap)); } }

.skip {
  position: fixed; top: .6rem; left: .6rem; z-index: 200;
  padding: .6rem 1rem; background: var(--accent); color: #fff;
  border-radius: 8px; transform: translateY(-160%); transition: transform .2s;
}
.skip:focus { transform: none; }

.eyebrow {
  font: 600 var(--step--1)/1 var(--sans);
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}

/* ------------------------------------------------------------ images */
.pic {
  display: block; position: relative; overflow: hidden;
  aspect-ratio: var(--ar, 3 / 2);
  background-repeat: no-repeat;
  border-radius: inherit;
}
.pic > img {
  width: 100%; height: 100%;
  opacity: 0; transition: opacity .5s var(--ease);
}
.pic.is-loaded > img { opacity: 1; }
.pic::after {
  content: ''; position: absolute; inset: 0;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: opacity .45s var(--ease); pointer-events: none;
}
.pic.is-loaded::after { opacity: 0; }
@supports not (backdrop-filter: blur(1px)) { .pic::after { display: none; } }

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.header-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; flex: 0 0 auto; }
/* la marque est une image monochrome : en masque, elle suit la couleur du
   theme, du mode sombre comme du mode clair */
.brand-mark {
  width: 38px; height: 26px; flex: 0 0 auto;
  background: var(--accent);
  -webkit-mask: url(/img/marque.png) center / contain no-repeat;
  mask: url(/img/marque.png) center / contain no-repeat;
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text b { font: 600 1.16rem/1 var(--display); letter-spacing: -.02em; }
.brand-text i { font-style: normal; font-size: .69rem; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 900px) { .brand-text i { display: none; } }

.nav { margin-inline-start: auto; }
.nav ul { display: flex; gap: .3rem; list-style: none; padding: 0; }
.nav a {
  display: block; padding: .5rem .8rem; border-radius: 999px;
  font-size: .94rem; text-decoration: none; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
@media (max-width: 860px) { .nav { display: none; } }

.header-actions { display: flex; gap: .25rem; margin-inline-start: auto; }
@media (max-width: 860px) { .nav + .header-actions { margin-inline-start: 0; } }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: none; border: 0; border-radius: 999px; cursor: pointer; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.i-moon { display: none; }
:root[data-theme='dark'] .i-sun { display: none; }
:root[data-theme='dark'] .i-moon { display: block; }


.burger { display: none; }
.burger .i-close, .burger[aria-expanded='true'] .i-menu { display: none; }
.burger[aria-expanded='true'] .i-close { display: block; }
@media (max-width: 860px) { .burger { display: grid; } }

.mobile-nav { border-top: 1px solid var(--line); background: var(--paper); }
.mobile-nav ul { list-style: none; padding: .6rem 0 1.1rem; margin: 0 auto; width: min(100% - 2rem, var(--wrap)); }
.mobile-nav a { display: block; padding: .72rem .2rem; font-size: 1.05rem; text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav li:last-child a { border-bottom: 0; }

/* ------------------------------------------------------------ hero accueil */
.hero { position: relative; margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.hero-media { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-media .pic { aspect-ratio: 16 / 9; }
@media (max-width: 720px) { .hero-media .pic { aspect-ratio: 4 / 5; } }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(185deg, rgb(22 28 33 / .04) 20%, rgb(22 28 33 / .34) 62%, rgb(22 28 33 / .76));
}
.hero-body {
  position: absolute; inset: auto 0 0 0; z-index: 1; color: #fff;
  padding: clamp(1.4rem, 4vw, 3.2rem);
  display: grid; gap: .7rem; max-width: 48rem;
}
.hero-body .eyebrow { color: #f6cdc8; }
.hero-body h1 { font-size: var(--step-4); color: #fff; }
.hero-body p { color: rgb(255 255 255 / .85); font-size: var(--step-1); max-width: 38rem; }
@media (max-width: 720px) { .hero-body p { display: none; } }
.hero-body .meta { color: rgb(255 255 255 / .7); }

/* Trois declinaisons, toutes dans la charte : plein rouge brique, blanc a
   texte brique (sur photo), et contour discret. */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  align-self: start; justify-self: start; width: fit-content;
  padding: .72rem 1.35rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-weight: 600; font-size: .95rem;
  text-decoration: none; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); background: color-mix(in oklab, var(--accent) 88%, #000); }

.btn-light { background: #fff; border-color: #fff; color: var(--accent); }
.btn-light:hover { background: #fff; border-color: #fff; color: color-mix(in oklab, var(--accent) 85%, #000); }

.btn-ghost { background: var(--card); border-color: var(--line); color: var(--accent); box-shadow: none; }
.btn-ghost:hover { background: var(--card); border-color: var(--accent); }

/* ------------------------------------------------------------ sections */
.section { margin-block: clamp(3rem, 7vw, 6rem); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; margin-bottom: clamp(1.4rem, 3vw, 2.4rem);
  padding-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: var(--step-2); }
.section-head p { color: var(--muted); font-size: var(--step--1); max-width: 34rem; margin-top: .35rem; }
.section-head a { font-size: .92rem; white-space: nowrap; color: var(--accent); font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ cartes article */
/* align-items: start : les cartes gardent leur hauteur propre et leurs
   photos partent toutes du haut de la rangee. */
.cards {
  display: grid; align-items: start;
  gap: clamp(1.4rem, 2.6vw, 2.2rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.card { display: grid; gap: .85rem; }
.card > a { text-decoration: none; display: grid; gap: .85rem; }
.card-body { display: grid; gap: .5rem; align-content: start; }
.card .pic { aspect-ratio: 3 / 2; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .3s var(--ease); }
.card .card-media { position: relative; border-radius: var(--radius); overflow: hidden; }
/* Une image absente ne doit pas desaligner la grille : l'emplacement garde
   sa proportion. */
.card .card-media:empty { aspect-ratio: 3 / 2; background: var(--paper-2); }
.country:has(.country-body:only-child) { aspect-ratio: 5 / 4; background: var(--paper-2); }
.card .card-media img { transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.045); }
.card:hover .pic { box-shadow: var(--shadow-md); }
.card h3 { font-size: var(--step-1); transition: color .2s; }
.card:hover h3 { color: var(--accent); }
.card .meta { display: flex; flex-wrap: wrap; gap: .45rem .7rem; align-items: center; font-size: var(--step--1); color: var(--muted); }
.card p { color: var(--ink-2); font-size: .95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.pill {
  display: inline-block; padding: .22rem .62rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font: 600 .72rem/1.5 var(--sans); letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}

/* ------------------------------------------------------------ filtres */
/* Bande de filtres : on fait defiler par des fleches plutot qu'avec une
   barre de defilement. Le glisser au doigt et au pave tactile reste possible. */
.defile { position: relative; margin-bottom: 2rem; }
.filters {
  display: flex; gap: .5rem; overflow-x: auto;
  scroll-behavior: smooth; scroll-snap-type: x proximity;
  scrollbar-width: none; overscroll-behavior-x: contain;
  padding-block: .15rem;
}
.filters::-webkit-scrollbar { display: none; }
.filters > .chip { scroll-snap-align: start; }

/* fondu sur les bords quand il reste du contenu a voir */
.defile.a-gauche .filters { -webkit-mask-image: linear-gradient(90deg, transparent, #000 4.5rem); mask-image: linear-gradient(90deg, transparent, #000 4.5rem); }
.defile.a-droite .filters { -webkit-mask-image: linear-gradient(270deg, transparent, #000 4.5rem); mask-image: linear-gradient(270deg, transparent, #000 4.5rem); }
.defile.a-gauche.a-droite .filters {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4.5rem, #000 calc(100% - 4.5rem), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4.5rem, #000 calc(100% - 4.5rem), transparent);
}

.defile-fleche {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); cursor: pointer; box-shadow: var(--shadow-md);
  transition: border-color .18s, color .18s, transform .18s var(--ease);
}
.defile-fleche[hidden] { display: none; }
.defile-fleche:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-50%) scale(1.06); }
.defile-fleche svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.defile-prec { left: -.4rem; }
.defile-suiv { right: -.4rem; }
@media (max-width: 640px) {
  .defile-fleche { width: 36px; height: 36px; }
  .defile-prec { left: -.2rem; }
  .defile-suiv { right: -.2rem; }
}
.chip {
  flex: 0 0 auto; padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: .88rem; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s, color .18s, border-color .18s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-on, .chip[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip small { opacity: .65; margin-inline-start: .3rem; }

/* ------------------------------------------------------------ page article */
/* Bande contenue plutot que plein ecran : au-dela de la largeur du contenu,
   on agrandirait des photos qui ne font que 1600 px de large. */
.article-hero {
  position: relative;
  width: min(100% - 2.5rem, var(--wrap));
  margin: clamp(1rem, 2vw, 1.6rem) auto clamp(2rem, 4vw, 3.2rem);
}
@media (max-width: 640px) { .article-hero { width: min(100% - 2rem, var(--wrap)); } }
.article-hero .pic { aspect-ratio: 5 / 2; max-height: 54vh; }
@media (max-width: 900px) { .article-hero .pic { aspect-ratio: 16 / 9; } }
@media (max-width: 620px) { .article-hero .pic { aspect-ratio: 4 / 3; } }
.article-hero-media { position: relative; overflow: hidden; border-radius: var(--radius-lg); }
.article-hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(22 28 33 / .1) 0%, rgb(22 28 33 / .26) 48%, rgb(22 28 33 / .76)); }
.article-hero-body {
  position: absolute; inset: auto 0 0 0; z-index: 1; color: #fff;
  padding: clamp(1.1rem, 3vw, 2.2rem); display: grid; gap: .5rem;
}
.article-hero-body h1 { font-size: var(--step-3); color: #fff; max-width: 24ch; }
.article-hero-body .sub { font-family: var(--display); font-size: var(--step-1); color: rgb(255 255 255 / .82); font-style: italic; }
.article-hero-body .meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; align-items: center; color: rgb(255 255 255 / .75); font-size: var(--step--1); margin-top: .3rem; }
.article-hero-body .pill { background: rgb(255 255 255 / .17); color: #fff; backdrop-filter: blur(6px); }

.reading { width: min(100% - 2.5rem, var(--read)); margin-inline: auto; }
.reading > * + * { margin-top: 1.35em; }
.reading p { color: var(--ink-2); line-height: 1.78; }
.reading h1, .reading h2 { font-size: var(--step-2); margin-top: 2.4em; }
.reading h3 { font-size: var(--step-1); margin-top: 2em; }
.reading h4, .reading h5, .reading h6 { font-size: var(--step-0); margin-top: 1.8em; color: var(--ink); font-family: var(--display); }
.reading h6 { color: var(--muted); font-style: italic; font-weight: 500; }
.reading strong, .reading b { color: var(--ink); font-weight: 650; }
.reading em, .reading i { font-style: italic; }
.reading a { color: var(--accent); }
.reading ul, .reading ol { padding-inline-start: 1.3rem; color: var(--ink-2); }
.reading li + li { margin-top: .4em; }
.reading blockquote {
  border-inline-start: 3px solid var(--accent); padding: .3rem 0 .3rem 1.3rem;
  font-family: var(--display); font-size: var(--step-1); font-style: italic; color: var(--ink);
}
.reading hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.6em; }
.reading .ta-center { text-align: center; }
.reading .ta-right { text-align: right; }

/* images dans le corps de texte : débordent légèrement la colonne */
.reading figure.body-img {
  margin-block: 2.6em;
  width: min(100vw - 2.5rem, calc(var(--read) + 9rem));
  margin-inline: calc(50% - min(100vw - 2.5rem, calc(var(--read) + 9rem)) / 2);
}
.reading figure.body-img .pic { border-radius: var(--radius); box-shadow: var(--shadow-md); cursor: zoom-in; margin-inline: auto; }
.reading figure.body-img figcaption { margin-top: .65rem; text-align: center; font-size: var(--step--1); color: var(--muted); }

.article-foot { margin-top: clamp(3rem, 6vw, 5rem); }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.tag { padding: .28rem .7rem; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: .78rem; text-decoration: none; }
.tag:hover { color: var(--accent); }

.share { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: var(--step--1); }
.share a, .share button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); cursor: pointer; color: var(--ink-2); text-decoration: none; }
.share a:hover, .share button:hover { border-color: var(--accent); color: var(--accent); }
.share svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ galerie / album */
.album { margin-block: clamp(3rem, 6vw, 5rem); }
.album-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.album-head h2 { font-size: var(--step-2); }
.album-head span { color: var(--muted); font-size: var(--step--1); }

/* planche-contact : 3 colonnes sur telephone, puis des vignettes plus grandes */
.grid-photos {
  display: grid; gap: .35rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 104px), 1fr));
}
@media (min-width: 560px) { .grid-photos { gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); } }
@media (min-width: 900px) { .grid-photos { gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

.ph {
  display: block; position: relative; border: 0; padding: 0; cursor: zoom-in;
  border-radius: 10px; overflow: hidden; background: var(--paper-2);
}
/* la proportion est portee par la tuile elle-meme : sa hauteur reste juste
   meme quand content-visibility suspend le rendu de son contenu */
.grid-photos > .ph { aspect-ratio: 1; }
.ph .pic { aspect-ratio: 1; border-radius: 10px; }
.ph img { transition: transform .5s var(--ease), filter .3s; }
.ph:hover img { transform: scale(1.06); }
.ph::after {
  content: ''; position: absolute; inset: 0; border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06);
  background: linear-gradient(180deg, transparent 55%, rgb(0 0 0 / .35));
  opacity: 0; transition: opacity .3s;
}
.ph:hover::after, .ph:focus-visible::after { opacity: 1; }
.ph figcaption {
  position: absolute; inset: auto .55rem .5rem; z-index: 1; color: #fff;
  font-size: .76rem; line-height: 1.35; text-shadow: 0 1px 4px rgb(0 0 0 / .6);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  pointer-events: none;
}
.ph:hover figcaption, .ph:focus-visible figcaption { opacity: 1; transform: none; }

/* n'engage le rendu que des rangées visibles */
.grid-photos.is-long > .ph { content-visibility: auto; }

/* ------------------------------------------------------------ carte */
.map-wrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); }
#map, .map-el { width: 100%; height: clamp(320px, 55vh, 560px); }
.map-poster { position: absolute; inset: 0; display: grid; place-items: center; gap: .8rem; background: var(--paper-2); cursor: pointer; text-align: center; padding: 2rem; }
.map-poster p { color: var(--muted); font-size: var(--step--1); max-width: 30ch; }
.leaflet-container { font: inherit; background: var(--paper-2); }
:root[data-theme='dark'] .leaflet-tile { filter: brightness(.72) contrast(1.06) saturate(.85) hue-rotate(180deg) invert(1); }


/* ------------------------------------------------------------ commentaires */
.comments { margin-top: clamp(3rem, 6vw, 4.5rem); }
.comments h2 { font-size: var(--step-2); margin-bottom: 1.6rem; }
.comment { display: grid; gap: .4rem; padding: 1.2rem 0; border-top: 1px solid var(--line); }
.comment-head { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.comment-head b { font-family: var(--display); font-size: 1.05rem; font-weight: 600; }
.comment-head time { color: var(--muted); font-size: var(--step--1); }
.comment p { color: var(--ink-2); white-space: pre-line; }

/* ------------------------------------------------------------ prev / next */
.updown { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: clamp(3rem, 6vw, 4.5rem); }
@media (max-width: 640px) { .updown { grid-template-columns: 1fr; } }
.updown a {
  display: grid; gap: .3rem; padding: 1.2rem 1.4rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.updown a:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.updown span { font-size: var(--step--1); color: var(--muted); }
.updown b { font-family: var(--display); font-size: var(--step-1); font-weight: 600; }
.updown .next { text-align: right; }

/* ------------------------------------------------------------ pages diverses */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.6rem, 3vw, 2.6rem); }
.page-head h1 { font-size: var(--step-3); }
.page-head p { color: var(--muted); margin-top: .6rem; max-width: 50ch; font-size: var(--step-1); }

.country-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.country {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: #fff; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.country:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.country .pic { aspect-ratio: 5 / 4; }
.country img { transition: transform .6s var(--ease); }
.country:hover img { transform: scale(1.06); }
.country-body { position: absolute; inset: auto 0 0 0; padding: 1rem 1.1rem; background: linear-gradient(transparent, rgb(6 4 2 / .78)); }
.country-body b { font-family: var(--display); font-size: var(--step-1); font-weight: 600; display: block; }
.country-body span { font-size: var(--step--1); opacity: .82; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 1rem; margin-block: 2rem; }
/* Chaque chiffre mene a la page qui le detaille. */
.stat {
  display: block; padding: 1.3rem; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); text-align: center;
  text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.stat:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.stat:hover span { color: var(--accent); }
.stat span { transition: color .2s; }
.stat b { display: block; font-family: var(--display); font-size: var(--step-3); color: var(--accent); line-height: 1; }
.stat span { font-size: var(--step--1); color: var(--muted); }

.timeline { display: grid; gap: 0; }
.tl-year { position: sticky; top: 68px; z-index: 2; padding: 1.2rem 0 .7rem; background: linear-gradient(var(--paper) 72%, transparent); }
.tl-year h2 { font-size: var(--step-2); color: var(--accent); }

/* ------------------------------------------------------------ recherche */
.search {
  width: min(100% - 2rem, 42rem); max-width: none; max-height: min(76vh, 40rem);
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow-lg); color: var(--ink);
  position: fixed; inset: 0; margin: clamp(3rem, 12vh, 9rem) auto auto; height: fit-content;
}
.search::backdrop { background: rgb(12 8 4 / .5); backdrop-filter: blur(4px); }
.search-in { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.search-in svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; }
.search-in input { flex: 1; border: 0; background: none; font: inherit; font-size: var(--step-1); color: inherit; outline: 0; min-width: 0; }
.search-in button { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; margin: -.4rem -.5rem -.4rem 0; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color .25s var(--ease-io), color .25s var(--ease-io), transform .25s var(--ease-io); }
.search-in button:hover, .search-in button:focus-visible { background: var(--paper-2); color: var(--accent); transform: rotate(90deg); }
.search-in button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; }
.search-results { max-height: min(60vh, 32rem); overflow-y: auto; padding: .5rem; }
.search-results:empty::after { content: 'Tapez pour chercher parmi les 79 récits.'; display: block; padding: 1.6rem 1rem; color: var(--muted); font-size: var(--step--1); text-align: center; }
.sr {
  display: grid; grid-template-columns: 62px 1fr; gap: .9rem; align-items: center;
  padding: .55rem .7rem; border-radius: 10px; text-decoration: none; color: inherit;
}
.sr:hover, .sr.is-active { background: var(--paper-2); }
.sr .pic { border-radius: 8px; aspect-ratio: 1; }
.sr b { font-family: var(--display); font-weight: 600; font-size: 1rem; display: block; }
.sr span { color: var(--muted); font-size: var(--step--1); }
.sr mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 .1em; }

/* ------------------------------------------------------------ lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 120;
  background: rgb(14 17 20 / .95);
  display: block;
  overflow: hidden;
  opacity: 0; transition: opacity .25s var(--ease);
  overscroll-behavior: contain;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }

/* La photo doit tenir dans l'ecran, quelle que soit sa proportion : chaque
   maillon de la chaine doit donc etre borne, y compris le <picture> qui porte
   les sources AVIF/WebP. */
/* La scene est posee en absolu sur tout le cadre : sa hauteur est donc
   definie, et le max-height: 100% de la photo peut s'y resoudre. Toute autre
   construction (grille, hauteur en pourcentage) redevient circulaire. */
.lb-stage {
  position: absolute; inset: 0; margin: 0;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(2.9rem, 6vh, 3.6rem) clamp(2.8rem, 7vw, 5rem);
}
/* display:contents efface la boite du <picture> : l'image devient un enfant
   direct de la scene, dont la hauteur est definie, et son max-height: 100%
   peut enfin se resoudre. */
.lb-stage picture { display: contents; }
.lb-stage img {
  display: block;
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 4px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .8);
  transition: opacity .2s; object-fit: contain;
}
.lightbox.is-loading .lb-stage img { opacity: .35; }
.lb-stage figcaption {
  position: absolute; inset: auto 0 clamp(.7rem, 2vh, 1.4rem) 0;
  text-align: center; color: rgb(255 255 255 / .86); font-size: var(--step--1);
  padding-inline: clamp(3rem, 8vw, 6rem); text-shadow: 0 1px 6px rgb(0 0 0 / .8);
}
.lb-stage figcaption[hidden] { display: none; }
.lightbox button {
  position: absolute; z-index: 1; border: 0; background: rgb(255 255 255 / .1);
  color: #fff; cursor: pointer; border-radius: 999px; backdrop-filter: blur(8px);
  display: grid; place-items: center; transition: background .2s, transform .2s;
}
.lightbox button:hover { background: rgb(255 255 255 / .22); }
.lb-close { top: 1rem; right: 1rem; width: 44px; height: 44px; font-size: 1.9rem; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 48px; height: 64px; font-size: 2.2rem; line-height: 1; }
.lb-prev { left: .6rem; }
.lb-next { right: .6rem; }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-count { position: absolute; top: 1.35rem; left: 1.4rem; color: rgb(255 255 255 / .7); font-size: var(--step--1); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .lb-prev, .lb-next { width: 38px; height: 48px; font-size: 1.7rem; }
  .lb-stage { padding: 3rem .35rem 3.2rem; }
}
@supports (height: 100dvh) { .lightbox { height: 100dvh; } }

/* ------------------------------------------------------------ pied de page */
.site-footer { margin-top: clamp(4rem, 9vw, 8rem); border-top: 1px solid var(--line); background: var(--paper-2); padding-top: clamp(2.5rem, 5vw, 4rem); }
.footer-in { display: grid; grid-template-columns: minmax(16rem, 1.2fr) 2fr; gap: clamp(2rem, 5vw, 4rem); padding-bottom: 2.5rem; }
@media (max-width: 760px) { .footer-in { grid-template-columns: 1fr; } }
.footer-brand b { font-family: var(--display); font-size: var(--step-1); font-weight: 600; }
.footer-brand p { color: var(--muted); font-size: var(--step--1); margin-top: .5rem; max-width: 34ch; }
.social { display: flex; gap: .5rem; margin-top: 1.1rem; }
.social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); transition: color .2s, border-color .2s, transform .2s; }
.social a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1.8rem; }
.footer-nav h4 { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); font-weight: 600; margin-bottom: .8rem; }
.footer-nav ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.footer-nav a { font-size: .92rem; color: var(--ink-2); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.footer-legal { border-top: 1px solid var(--line); padding-block: 1.4rem; }
.footer-legal p { color: var(--muted); font-size: .82rem; }

/* ------------------------------------------------------------ divers */
.prose-narrow { width: min(100% - 2.5rem, var(--read)); margin-inline: auto; }
.empty { color: var(--muted); padding: 3rem 0; text-align: center; }
.to-top {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 50;
  width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-sm);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  transform: translateY(10px); transition: opacity .25s, transform .25s var(--ease);
}
.to-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
.to-top svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.progress { position: fixed; top: 0; left: 0; height: 2px; background: var(--accent); z-index: 100; width: 0; transition: width .1s linear; }

body.no-scroll { overflow: hidden; }

/* marqueurs de carte */
.pin span { display: block; width: 14px; height: 14px; border-radius: 999px; background: var(--accent); border: 2px solid var(--card); box-shadow: 0 2px 6px rgb(0 0 0 / .35); }
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content { font: inherit; font-size: .88rem; margin: .7rem .9rem; }
.leaflet-popup-content a { color: var(--accent); text-decoration: none; }

/* bouton-image dans le corps de l'article */
.pic-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.reading figure.body-img .pic { max-height: 80vh; margin-inline: auto; }

/* ------------------------------------------------------------ tactile */
/* Sur telephone, tout ce qui se tape fait au moins 44 px de haut. */
@media (max-width: 700px) {
  .brand { padding-block: .45rem; }
  .section-head a, .album-head a, .page-head a { display: inline-flex; align-items: center; min-height: 44px; }
  .filters .chip { min-height: 40px; display: inline-flex; align-items: center; }
  .tag { min-height: 34px; display: inline-flex; align-items: center; }
}

/* ------------------------------------------------------------ videos */
/* Meme emprise que les photos du texte : centrees, un peu plus larges que la
   colonne de lecture, toujours au format 16:9. */
.reading figure.video {
  margin-block: 2.4em;
  width: min(100vw - 2.5rem, calc(var(--read) + 9rem));
  margin-inline: calc(50% - min(100vw - 2.5rem, calc(var(--read) + 9rem)) / 2);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden;
  background: #111; box-shadow: var(--shadow-md);
}
.reading figure.video iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) {
  .reading figure.video {
    width: min(100vw - 2rem, calc(var(--read) + 9rem));
    margin-inline: calc(50% - min(100vw - 2rem, calc(var(--read) + 9rem)) / 2);
  }
}

/* ------------------------------------------------------------ autour du carnet */
/* L'ancienne colonne de droite (populaires, commentaires, archives, réseaux),
   en bandeau au-dessus du pied de page. */
.autour { margin-top: clamp(4rem, 9vw, 7rem); padding-block: clamp(2.5rem, 5vw, 3.5rem) clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
main:has(.autour) + .site-footer { margin-top: 0; }
.autour-titre { font-family: var(--display); font-size: var(--step-2); font-weight: 600; color: var(--ink); margin-bottom: 1.6rem; }
.autour-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 4vw, 3rem); }
@media (max-width: 980px) { .autour-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } .autour-grille > :last-child { grid-column: 1 / -1; } }
@media (max-width: 640px) { .autour-grille { grid-template-columns: 1fr; } }
.autour-bloc h3 { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); padding-bottom: .6rem; margin-bottom: .9rem; border-bottom: 1px solid var(--line); }
.autour-bloc .autour-suivre { margin-top: 1.8rem; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.mini a { display: grid; grid-template-columns: 72px 1fr; gap: .9rem; align-items: start; color: inherit; text-decoration: none; border-radius: var(--radius); }
.mini .pic { width: 72px; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.mini b { display: block; font-weight: 600; line-height: 1.3; color: var(--ink); transition: color .2s; }
.mini small { display: block; color: var(--ink-2); font-size: .85rem; line-height: 1.35; margin-top: .15rem; }
.mini q { display: block; margin-top: .3rem; font-style: italic; font-size: .88rem; line-height: 1.45; color: var(--ink-2); }
.mini a:hover b, .mini a:focus-visible b { color: var(--accent); }
.annees { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.annees a { display: inline-flex; align-items: baseline; gap: .4rem; min-height: 44px; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; transition: border-color .2s, color .2s; }
.annees a small { font-weight: 400; color: var(--ink-2); font-size: .8rem; }
.annees a:hover { border-color: var(--accent); color: var(--accent); }
.autour .social { margin-top: 0; }
.autour .social a { width: 44px; height: 44px; }
.autour-note { margin-top: .8rem; font-size: .88rem; color: var(--ink-2); max-width: 36ch; }
.tl-year { scroll-margin-top: 72px; }

/* ------------------------------------------------------------ mouvements */
/* Tout ce qui apparaît ou change le fait en douceur (ease-in-out). */

/* changement de page : fondu enchaîné entre deux pages du site */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .28s var(--ease-io) both vt-sortie; }
::view-transition-new(root) { animation: .38s var(--ease-io) both vt-entree; }
@keyframes vt-sortie { to { opacity: 0; } }
@keyframes vt-entree { from { opacity: 0; transform: translateY(8px); } }
.site-header { view-transition-name: entete; }
/* navigateurs sans fondu enchaîné : la page apparaît simplement en fondu */
@supports not (view-transition-name: none) {
  main { animation: .45s var(--ease-io) both vt-entree; }
}

/* liens et boutons */
a, button, .chip, .btn, .card, .country { transition-timing-function: var(--ease-io); }
a { transition-property: color, background-color, border-color, opacity; transition-duration: .25s; }

/* recherche : apparition et disparition */
.search[open] { animation: .3s var(--ease-io) both apparait; }
.search[open]::backdrop { animation: .3s var(--ease-io) both fondu; }
.search.is-closing { animation: .2s var(--ease-io) both disparait; }
.search.is-closing::backdrop { animation: .2s var(--ease-io) both fondu-sortie; }
@keyframes apparait { from { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes disparait { to { opacity: 0; transform: translateY(-10px) scale(.98); } }
@keyframes fondu { from { opacity: 0; } }
@keyframes fondu-sortie { to { opacity: 0; } }
.search-results a, .search-results li { animation: .25s var(--ease-io) both fondu; }

/* menu mobile : se déplie en glissant */
.mobile-nav { opacity: 0; transform: translateY(-8px); transition: opacity .26s var(--ease-io), transform .26s var(--ease-io); }
.mobile-nav.is-open { opacity: 1; transform: none; }

/* photos : fondu depuis leur aperçu, un rien plus lent */
.pic > img { transition: opacity .6s var(--ease-io); }

/* bandes et blocs qui entrent dans l'écran */
.card, .country, .autour-bloc { animation: .5s var(--ease-io) both fondu; }

/* un element masque le reste, meme quand sa classe lui donne un display */
[hidden] { display: none !important; }
/* fond de carte adouci aux tons du site */
.leaflet-tile-pane { filter: saturate(.62) sepia(.12) brightness(1.03); }

/* ------------------------------------------------------------ blocs d'anciennes pages */
/* Pages « Philo », « Bons plans », « Reportages » : chaque encart renvoie a un
   recit. Le lien est sur le titre, plus sur tout le texte. */
.reading .bloc-lie { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 2rem); }
.reading .bloc-lie > :first-child { margin-top: 0; }
.reading .bloc-lie h2, .reading .bloc-lie h3, .reading .bloc-lie h4 { margin-top: .6em; }
.reading .bloc-lie h2 a, .reading .bloc-lie h3 a, .reading .bloc-lie h4 a { text-decoration: none; }
.reading .bloc-lie h2 a:hover, .reading .bloc-lie h3 a:hover, .reading .bloc-lie h4 a:hover { text-decoration: underline; }
.reading .lire a { font-weight: 600; text-decoration: none; }
.reading .lire a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ instagram */
.insta-invite { display: flex; align-items: center; gap: 1.1rem; padding: clamp(1.1rem, 3vw, 1.8rem); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); text-decoration: none; color: inherit; transition: border-color .25s var(--ease-io), transform .25s var(--ease-io); }
.insta-invite:hover { border-color: var(--accent); transform: translateY(-2px); }
.insta-invite svg { flex: 0 0 auto; width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.insta-invite b { display: block; font-size: var(--step-1); font-family: var(--display); }
.insta-invite small { display: block; margin-top: .25rem; color: var(--ink-2); font-size: var(--step--1); }
.reading .bloc-sur { margin: 0 0 .2rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.reading .bloc-lie h2 { font-size: var(--step-1); margin-top: 0; }
.reading .bloc-lie figure.body-img { margin-block: 1.2rem; }
.reading .bloc-texte > :first-child { margin-top: 0; }
/* dans un encart, la photo reste dans le cadre */
.reading .bloc-lie figure.body-img { width: 100%; margin-inline: 0; margin-block: 1.2rem; }
/* pays retenu dans le carnet */
.filtre-actif:empty { display: none; }
.filtre-actif { margin: .2rem 0 1.2rem; font-family: var(--display); font-size: var(--step-1); color: var(--ink); }
