/* Trail du Verdier — v2
   Palette : papier, encre, vert forêt, rouge du logo. */

:root {
    --paper: #f2eee5;
    --paper-2: #e8e2d5;
    --ink: #1c1b18;
    --ink-2: #5b574e;
    --rule: #cdc5b4;
    --forest: #213628;
    --red: #d4251c;

    --display: "Archivo", "Arial Narrow", sans-serif;
    --text: "Source Serif 4", Georgia, serif;

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

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

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

a { color: inherit; text-decoration-color: var(--red); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }

h1, h2, h3 {
    font-family: var(--display);
    font-stretch: 75%;
    font-weight: 800;
    line-height: 0.95;
    text-transform: uppercase;
    margin: 0;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--ink-2); }
.small { font-size: 0.9rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- En-tête ---------- */
.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
}
.top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    height: 64px;
}
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 28px; }
.nav a {
    font-family: var(--display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
}
.nav a:hover { color: var(--red); }

/* ---------- Accueil ---------- */
.hero {
    position: relative;
    min-height: min(88vh, 820px);
    color: #fff;
    background: var(--forest);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}
.hero-photos, .hero-photo { position: absolute; inset: 0; }
.hero-photo {
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.6s ease;
}
.hero-photo.is-on { opacity: 1; }
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(14, 20, 15, 0.82) 0%, rgba(14, 20, 15, 0.35) 45%, rgba(14, 20, 15, 0.1) 100%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    padding-top: 120px;
    padding-bottom: clamp(40px, 7vw, 80px);
}
.hero-where {
    font-family: var(--display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 18px;
    opacity: 0.85;
}
.hero h1 {
    font-size: clamp(3.6rem, 12vw, 9.5rem);
    font-weight: 900;
    font-stretch: 68%;
    line-height: 0.86;
    letter-spacing: -0.01em;
}
.hero-date {
    font-family: var(--display);
    font-stretch: 85%;
    font-size: clamp(1.25rem, 2.6vw, 1.75rem);
    font-weight: 700;
    margin: 22px 0 4px;
}
.hero-countdown {
    font-weight: 400;
    font-size: 0.7em;
    opacity: 0.75;
    margin-left: 8px;
}
.hero-formats {
    font-family: var(--display);
    font-size: 1.05rem;
    margin: 0;
}
.hero-formats i { font-style: normal; color: var(--red); padding: 0 4px; }
.hero-start { margin: 6px 0 28px; opacity: 0.8; font-size: 0.98rem; }

/* Dossard */
.bib {
    flex: none;
    position: relative;
    width: 230px;
    padding: 18px 20px 16px;
    /* fond papier + 4 trous d'épingles dans les coins */
    --hole: radial-gradient(circle, #2a3a2f 0 4px, transparent 4.5px);
    background:
        var(--hole) left 6px top 6px / 16px 16px no-repeat,
        var(--hole) right 6px top 6px / 16px 16px no-repeat,
        var(--hole) left 6px bottom 6px / 16px 16px no-repeat,
        var(--hole) right 6px bottom 6px / 16px 16px no-repeat,
        #fbfaf6;
    color: var(--ink);
    text-align: center;
    transform: rotate(-3deg);
    margin-bottom: 8px;
}
.bib-top, .bib-bottom {
    display: block;
    font-family: var(--display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.bib-top { color: var(--red); border-bottom: 2px solid var(--red); padding-bottom: 6px; margin: 0 6px; }
.bib-num {
    display: block;
    font-family: var(--display);
    font-stretch: 62%;
    font-weight: 900;
    font-size: 4.6rem;
    line-height: 1;
    padding: 6px 0 2px;
    font-variant-numeric: tabular-nums;
}
.bib-bottom { font-weight: 600; letter-spacing: 0.08em; }

/* ---------- Boutons, liens ---------- */
.btn {
    display: inline-block;
    font-family: var(--display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 13px 22px;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
}
.btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.btn-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.7); }
.btn-light:hover { background: #fff; color: var(--ink); border-color: #fff; }

.link-arrow {
    font-family: var(--display);
    font-size: 0.88rem;
    font-weight: 600;
}
.link-arrow::after { content: " \2192"; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tint { background: var(--paper-2); }

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 16px 48px;
    align-items: end;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 3px solid var(--ink);
}
.section-head h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.section-head p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.section-head h2:only-child { grid-column: 1 / -1; }

/* ---------- Parcours ---------- */
.course {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 32px;
    padding: 40px 0;
    border-bottom: 1px solid var(--rule);
}
.course:last-child { border-bottom: 0; }
.course-time .time {
    display: block;
    font-family: var(--display);
    font-stretch: 70%;
    font-weight: 800;
    font-size: 3rem;
    line-height: 1;
    color: var(--red);
    font-variant-numeric: tabular-nums;
}
.course-time .label {
    font-family: var(--display);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.course h3 { font-size: 2rem; margin-bottom: 16px; }
.course p { margin: 16px 0 14px; max-width: 60ch; }

.facts {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
}
.facts > div { padding: 8px 20px 8px 0; margin-right: 20px; }
.facts > div + div { padding-left: 20px; border-left: 1px solid var(--rule); }
.facts dt {
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.facts dd {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
}

.course-map { margin: 0; align-self: start; }
.course-map img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid var(--ink);
    filter: saturate(0.85);
}
.course-rando .course-main { grid-column: 2 / 4; }

/* ---------- Infos ---------- */
.infos-list { margin: 0; }
.infos-list > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 8px 48px;
    padding: 22px 0;
    border-bottom: 1px solid var(--rule);
}
.infos-list dt {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
}
.infos-list dd { margin: 0; }

/* ---------- Résultats ---------- */
.years { display: flex; gap: 4px; margin: 28px 0 28px; flex-wrap: wrap; }
.year {
    font-family: var(--display);
    font-stretch: 75%;
    font-weight: 800;
    font-size: 1.5rem;
    background: none;
    border: 1px solid transparent;
    color: var(--ink-2);
    padding: 4px 14px;
    cursor: pointer;
}
.year:hover { color: var(--ink); }
.year.is-on { color: var(--paper); background: var(--ink); }

.year-summary { font-family: var(--display); font-size: 1.1rem; margin: 0 0 20px; }
.year-summary strong { font-weight: 800; }

.table-scroll { overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); }
.results {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 0.97rem;
}
.results th, .results td {
    text-align: left;
    padding: 14px 16px 14px 0;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}
.results thead th {
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
    border-bottom: 1px solid var(--ink);
}
.results tbody th {
    font-family: var(--display);
    font-stretch: 75%;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.1;
}
.results .num { font-family: var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-cell {
    display: block;
    font-family: var(--display);
    font-variant-numeric: tabular-nums;
    color: var(--ink-2);
    font-size: 0.9rem;
}
.split {
    display: block;
    width: 120px;
    height: 6px;
    background: var(--red);
    margin: 8px 0 6px;
}
.split span { display: block; height: 100%; width: calc(var(--h) * 1%); background: var(--forest); }
.split-label { font-family: var(--display); font-size: 0.85rem; color: var(--ink-2); }
.results a { font-family: var(--display); font-weight: 600; font-size: 0.88rem; white-space: nowrap; }

.doc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.doc-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 20px;
    padding: 13px 0;
    border-bottom: 1px solid var(--rule);
}
.doc-list span { flex: 1 1 280px; }
.doc-list a { font-family: var(--display); font-weight: 600; font-size: 0.88rem; }

/* ---------- Partenaires ---------- */
.logos {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1px;
}
.logos li { background: #fff; box-shadow: 0 0 0 1px var(--rule); }
.logos li.on-dark { background: var(--ink); }
.logos a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    padding: 18px;
}
.logos img { max-height: 100%; width: auto; object-fit: contain; }

/* ---------- Bénévoles ---------- */
.volunteers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 48px;
}
.volunteers h2 { font-size: clamp(2.6rem, 6vw, 4.4rem); margin-bottom: 20px; }
.lead { font-size: 1.2rem; line-height: 1.5; margin: 0 0 28px; max-width: 34ch; }
.missions { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); }
.missions li {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}
.missions strong { font-family: var(--display); font-weight: 700; }

/* ---------- Pied de page ---------- */
.foot { background: var(--forest); color: #dfe3dc; padding: 56px 0 24px; font-size: 0.95rem; }
.foot a { color: #fff; }
.foot a:hover { color: #fff; text-decoration-color: #fff; }
.foot-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.foot p { margin: 0 0 6px; }
.foot-title { font-family: var(--display); font-stretch: 75%; font-weight: 800; font-size: 1.6rem; text-transform: uppercase; color: #fff; }
.foot-label { font-family: var(--display); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.foot-bottom { margin-top: 40px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 0.85rem; opacity: 0.7; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .course { grid-template-columns: 100px minmax(0, 1fr); }
    .course-map { grid-column: 2; }
    .course-rando .course-main { grid-column: 2; }
    .course-time .time { font-size: 2.4rem; }
}

@media (max-width: 760px) {
    .top-inner { height: auto; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 10px; padding-bottom: 8px; }
    .brand img { height: 32px; }
    .nav { flex-wrap: wrap; gap: 4px 18px; }
    .nav a { white-space: nowrap; font-size: 0.78rem; }
    html { scroll-padding-top: 96px; }

    .hero { min-height: 0; }
    .hero-inner { flex-direction: column; align-items: flex-start; padding-top: 72px; }
    .bib { width: 200px; transform: rotate(-2deg); }
    .bib-num { font-size: 3.8rem; }

    .section-head, .infos-list > div, .volunteers { grid-template-columns: minmax(0, 1fr); }
    .section-head { gap: 12px; }

    .course { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 32px 0; }
    .course-time { display: flex; align-items: baseline; gap: 10px; }
    .course-map, .course-rando .course-main { grid-column: auto; }
    .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .facts > div, .facts > div + div { padding: 8px 10px; margin: 0; }
    .facts > div:first-child { padding-left: 0; }
    .facts dd { font-size: 0.95rem; }

    /* tableau des résultats en blocs */
    .table-scroll { overflow: visible; margin: 0; padding: 0; }
    .results { min-width: 0; }
    .results thead { display: none; }
    .results, .results tbody, .results tr { display: block; }
    .results tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 16px;
        padding: 18px 0;
        border-bottom: 1px solid var(--rule);
    }
    .results th, .results td { display: block; padding: 0; border: 0; }
    .results tbody th { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; }
    .results td::before {
        content: attr(data-label);
        display: block;
        font-family: var(--display);
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--ink-2);
    }
    .results td.doc { grid-column: 1 / -1; }
    .results td:nth-of-type(3) { grid-column: 1 / -1; }
    .results td.doc::before { content: none; }

    .missions li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .foot-inner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .logos a { height: 90px; }
}
