/* Cap Aventure Nature : carnet de terrain
   Le site se lit comme une carte : courbes de niveau, profils altimétriques, panneaux et balises.
   Variables en tête de fichier : changer le thème revient à changer ces valeurs, les polices et les formes. */

@font-face {
    font-family: "Bricolage Grotesque";
    src: url("../fonts/bricolage-grotesque-latin-wdth-normal.woff2") format("woff2");
    font-weight: 200 800;
    font-stretch: 75% 100%;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Newsreader";
    src: url("../fonts/newsreader-latin-wght-normal.woff2") format("woff2");
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Newsreader";
    src: url("../fonts/newsreader-latin-wght-italic.woff2") format("woff2");
    font-weight: 200 800;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Neutres */
    --mist: #f2f4ee;
    --mist-deep: #e6ebe1;
    --ink: #15251f;
    --ink-soft: #46584f;
    --line: #c9d3c7;
    --forest: #12302a;
    --ground: #0c211c;

    /* Accents : les catégories utilisent les jetons a, b, c, d */
    --pine: #1f5c48;
    --glacier: #2b7a99;
    --blaze: #d8441c;
    --blaze-deep: #bf3a14;
    --lichen: #c5d24b;

    --tint-a: #d3e6db;
    --tint-b: #d0e8f1;
    --tint-c: #f9dccf;
    --tint-d: #e9efbd;

    --font-ui: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-read: "Newsreader", Georgia, "Times New Roman", serif;

    --width: 1180px;
    --corner: 34px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--mist);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--pine); text-underline-offset: 3px; }
a:hover { color: var(--blaze-deep); }
:focus-visible { outline: 3px solid var(--blaze); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--font-ui); margin: 0; }
/* Titres : version condensée de la police, comme sur un panneau de signalisation */
.display, .page-head h1, .section-head h2, .card__title, .brand { font-stretch: 75%; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* ---------- En-tête ---------- */
.site-header { position: relative; z-index: 5; background: var(--forest); color: var(--mist); }
.site-header__inner {
    max-width: var(--width); margin: 0 auto; padding: 1rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between; gap: .75rem 2rem; flex-wrap: wrap;
}
.brand {
    display: inline-flex; align-items: center; gap: .7rem;
    font-weight: 800; font-size: 1.55rem; line-height: 1; letter-spacing: -.005em; color: var(--mist); text-decoration: none;
}
.brand:hover { color: var(--lichen); }
.brand img { display: block; }
.nav { display: flex; gap: 1.75rem; }
.nav a {
    padding: .3rem 0; color: #d7e0d4; text-decoration: none; font-size: 1.02rem; font-weight: 500;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--lichen); }
.nav a.is-active { color: #fff; border-bottom-color: var(--blaze); }

/* ---------- Pied de page : la crête du profil ---------- */
.site-footer { position: relative; margin-top: 8rem; background: var(--forest); color: #d7e0d4; }
.site-footer__ridge { position: absolute; left: 0; top: -89px; width: 100%; height: 90px; display: block; fill: var(--forest); }
.site-footer__inner {
    max-width: var(--width); margin: 0 auto; padding: 1rem 1.25rem 1.5rem;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
}
.site-footer a { color: #f2f4ee; text-decoration: none; }
.site-footer a:hover { color: var(--lichen); text-decoration: underline; }
.brand--light, .brand--light:hover { color: #f2f4ee; }
.site-footer__brand p { margin: 1rem 0 0; max-width: 28rem; color: #b9c8be; }
.site-footer__nav, .site-footer__legal { display: flex; flex-direction: column; gap: .45rem; }
.site-footer__copy {
    max-width: var(--width); margin: 0 auto; padding: 1.1rem 1.25rem 1.75rem;
    border-top: 1px solid rgba(242, 244, 238, .18); font-size: .85rem; color: #a2b3a8;
}

/* ---------- Éléments communs ---------- */
.btn-main {
    display: inline-block; padding: .85rem 1.6rem; background: var(--blaze); color: #fff;
    border-radius: 3px; font-weight: 700; text-decoration: none; transition: background .15s, transform .15s;
}
.btn-main:hover { color: #fff; background: var(--blaze-deep); transform: translateY(-2px); }

.section { max-width: var(--width); margin: 6rem auto 0; padding: 0 1.25rem; }
.section--tight { margin-top: 2.5rem; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
    margin-bottom: 2.25rem; padding-bottom: .8rem; border-bottom: 1.5px solid var(--ink);
}
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; line-height: 1; letter-spacing: -.005em; }
.more-link { font-weight: 600; }

.empty {
    max-width: 34rem; margin: 0 auto; padding: 3rem 1.25rem; text-align: center;
    border: 2px dashed var(--ink-soft); border-radius: 3px; color: var(--ink-soft);
}
.empty svg { display: block; margin: 0 auto 1rem; color: var(--pine); }
.empty p { margin: 0; font-family: var(--font-read); font-size: 1.2rem; }

.page-head { max-width: var(--width); margin: 0 auto; padding: 4.5rem 1.25rem 1.5rem; }
.page-head--center { text-align: center; }
.page-head h1 { font-size: clamp(3.2rem, 9vw, 7rem); font-weight: 800; line-height: .92; letter-spacing: -.01em; }
.page-head__intro { max-width: 38rem; margin: 1.5rem 0 0; font-family: var(--font-read); font-size: 1.3rem; line-height: 1.55; color: var(--ink-soft); }
.page-head--center .page-head__intro { margin-left: auto; margin-right: auto; }

/* ---------- Fanion de catégorie ---------- */
.chip {
    display: inline-block; padding: .22rem 1.05rem .22rem .65rem; color: #fff; text-decoration: none;
    font-size: .82rem; font-weight: 700; line-height: 1.4;
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
}
a.chip:hover { color: #fff; filter: brightness(.92); }
.chip--a { background: var(--pine); }
.chip--b { background: var(--glacier); }
.chip--c { background: var(--blaze-deep); }
.chip--d { background: var(--lichen); color: var(--forest); }
a.chip--d:hover { color: var(--forest); }

/* ---------- Couvertures : photo, ou illustration aux couleurs de la catégorie ---------- */
.cover { position: relative; overflow: hidden; background: var(--cover-bg, var(--tint-a)); clip-path: polygon(0 0, calc(100% - var(--corner)) 0, 100% var(--corner), 100% 100%, 0 100%); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.cover--empty::before {
    content: ""; position: absolute; inset: 0; background: var(--scene) center bottom / cover no-repeat;
    transition: transform .5s ease;
}
.cover--flip::before { transform: scaleX(-1); }
.card:hover .cover--empty::before, .featured:hover .cover--empty::before { transform: scale(1.05); }
.card:hover .cover--flip::before, .featured:hover .cover--flip::before { transform: scale(-1.05, 1.05); }
.cover--a { --cover-bg: var(--tint-a); }
.cover--b { --cover-bg: var(--tint-b); }
.cover--c { --cover-bg: var(--tint-c); }
.cover--d { --cover-bg: var(--tint-d); }
.cover--a.cover--s0 { --scene: url("../img/scenes/a-0.svg"); }
.cover--a.cover--s1 { --scene: url("../img/scenes/a-1.svg"); }
.cover--a.cover--s2 { --scene: url("../img/scenes/a-2.svg"); }
.cover--b.cover--s0 { --scene: url("../img/scenes/b-0.svg"); }
.cover--b.cover--s1 { --scene: url("../img/scenes/b-1.svg"); }
.cover--b.cover--s2 { --scene: url("../img/scenes/b-2.svg"); }
.cover--c.cover--s0 { --scene: url("../img/scenes/c-0.svg"); }
.cover--c.cover--s1 { --scene: url("../img/scenes/c-1.svg"); }
.cover--c.cover--s2 { --scene: url("../img/scenes/c-2.svg"); }
.cover--d.cover--s0 { --scene: url("../img/scenes/d-0.svg"); }
.cover--d.cover--s1 { --scene: url("../img/scenes/d-1.svg"); }
.cover--d.cover--s2 { --scene: url("../img/scenes/d-2.svg"); }

/* ---------- Cartes d'articles : pas de boîte, la couverture porte la forme ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem 2rem; }
.grid--spaced { margin-top: 3rem; }

.card { position: relative; display: flex; flex-direction: column; }
.card__link { position: absolute; inset: 0; z-index: 2; }
.card__media { position: relative; }
.card__cover { aspect-ratio: 4 / 3; }
.card__media .chip { position: absolute; left: 0; top: 1rem; z-index: 1; }
.card:hover .cover img { transform: scale(1.05); }
.card__body { display: flex; flex-direction: column; flex: 1; padding-top: 1.1rem; }
.card__title { margin: 0 0 .55rem; font-size: 1.75rem; font-weight: 700; line-height: 1.04; text-wrap: balance; }
.card:hover .card__title { text-decoration: underline; text-decoration-color: var(--blaze); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.card__excerpt { margin: 0 0 1rem; color: var(--ink-soft); font-family: var(--font-read); font-size: 1.1rem; line-height: 1.55; }
.card__meta { display: flex; gap: .9rem; margin: auto 0 0; font-size: .88rem; color: var(--ink-soft); }
.card__meta span + span { padding-left: .9rem; border-left: 1.5px solid var(--line); }

/* ---------- Texte courant (pages de contenu) ---------- */
.prose { font-family: var(--font-read); font-size: 1.24rem; line-height: 1.75; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-family: var(--font-ui); font-size: 1.7rem; font-weight: 800; font-stretch: 85%; margin: 2em 0 .6em; }
.prose h3 { font-family: var(--font-ui); font-size: 1.3rem; font-weight: 800; margin: 1.6em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.25em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--pine); font-weight: 600; }
.prose a:hover { color: var(--blaze-deep); }

/* ---------- Adaptation ---------- */
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .site-footer__inner { grid-template-columns: 1fr 1fr; }
    .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    body { font-size: 1rem; }
    :root { --corner: 26px; }
    .grid { grid-template-columns: 1fr; }
    .nav { gap: 1.2rem; }
    .section { margin-top: 4rem; }
    .site-footer__inner { grid-template-columns: 1fr; }
    .site-footer { margin-top: 6rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .cover img, .cover--empty::before, .btn-main { transition: none; }
    .card:hover .cover img { transform: none; }
    .card:hover .cover--empty::before, .featured:hover .cover--empty::before { transform: none; }
    .card:hover .cover--flip::before, .featured:hover .cover--flip::before { transform: scaleX(-1); }
}
