@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/source-serif-4.woff2") format("woff2");
}

@font-face {
    font-family: "Source Serif 4";
    font-style: italic;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/source-serif-4-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/barlow-condensed-500.woff2") format("woff2");
}

@font-face {
    font-family: "Barlow Condensed";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/fonts/barlow-condensed-600.woff2") format("woff2");
}

:root {
    --snow: #f6f8f9;
    --white: #fff;
    --ink: #1c2630;
    --muted: #56636f;
    --sky: #24557f;
    --sky-deep: #173a59;
    --heart: #c8232b;
    --earth: #6a3b1c;
    --line: #d5dde3;
    --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
    --cond: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
    --measure: 42rem;
    --wide: 72rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --scroll-thumb: #74899e;
    color-scheme: light;
    accent-color: var(--heart);
    caret-color: var(--heart);
    scrollbar-color: var(--scroll-thumb) var(--snow);
}

::selection {
    background: var(--heart);
    color: var(--white);
}

/* Navigateurs sans scrollbar-color (Safari) */
@supports not (scrollbar-color: auto) {
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }

    ::-webkit-scrollbar-track {
        background: var(--snow);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--scroll-thumb);
        border: 3px solid var(--snow);
        border-radius: 6px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--sky);
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* En-tête collant : les ancres et le focus ne passent pas dessous. */
    scroll-padding-top: 5rem;
}

body {
    margin: 0;
    background: var(--snow);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.7;
    font-optical-sizing: auto;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--sky);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--sky-deep);
    text-decoration-thickness: 2px;
}

:focus-visible {
    outline: 3px solid var(--heart);
    outline-offset: 2px;
}

/* Sur fond sombre, le rouge n'atteint pas 3:1 : contour blanc. */
.site-footer :focus-visible,
.hero :focus-visible,
.lightbox :focus-visible {
    outline-color: var(--white);
}

/* Cible du lien d'évitement : focalisable sans contour. */
#contenu:focus {
    outline: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

h1,
h2,
h3,
h4 {
    font-family: var(--cond);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.005em;
    color: var(--ink);
}

.skip {
    position: absolute;
    left: -999px;
    top: 0;
    padding: 0.5rem 1rem;
    background: var(--white);
    z-index: 30;
}

.skip:focus {
    left: 1rem;
}

/* En-tête */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}

/* Masqué quand on descend, réaffiché dès qu'on remonte (site.js). */
.site-header.is-hidden {
    transform: translateY(-100%);
}

@media (prefers-reduced-motion: no-preference) {
    .site-header {
        transition: transform 0.25s ease;
    }
}

.bar {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0.6rem var(--gutter);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-right: auto;
    color: var(--ink);
    text-decoration: none;
    font-family: var(--cond);
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1.1;
}

.brand:hover {
    color: var(--ink);
}

.brand img {
    width: 68px;
    height: 30px;
}

#menu ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem 1.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

#menu a {
    display: block;
    padding: 0.35rem 0;
    font-family: var(--cond);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

#menu a:hover {
    color: var(--ink);
}

#menu a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--heart);
}

/* Menu : affiché en ligne sur grand écran ; sur mobile, panneau ouvert par le bouton
   (attribut popover, sans JavaScript : Échap et un toucher à côté le referment). */
#menu {
    display: block;
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: none;
    color: inherit;
}

.menu-toggle {
    display: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    font: 600 1.1rem/1 var(--cond);
    color: var(--ink);
    background: none;
    border: 1px solid var(--line);
    border-radius: 3px;
    cursor: pointer;
}

.menu-line {
    transform-origin: 12px 12px;
}

@media (max-width: 52rem) {
    html {
        scroll-padding-top: 4.5rem;
    }

    .bar {
        flex-wrap: nowrap;
    }

    .brand {
        min-width: 0;
        font-size: 1.1rem;
    }

    .menu-toggle {
        display: inline-flex;
        flex: none;
    }

    #menu:not(:popover-open) {
        display: none;
    }

    #menu:popover-open {
        position: fixed;
        inset: var(--header-h, 3.6rem) 0 auto;
        padding: 0.4rem var(--gutter) 1rem;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 12px 24px rgb(16 34 52 / 0.18);
    }

    #menu::backdrop {
        background: transparent;
    }

    #menu ul {
        flex-direction: column;
        gap: 0;
    }

    #menu a {
        padding: 0.75rem 0;
        font-size: 1.3rem;
        border-bottom: 1px solid var(--line);
    }

    #menu li:last-child a {
        border-bottom: 0;
    }

    #menu a[aria-current="page"] {
        border-bottom-color: var(--line);
        box-shadow: inset 3px 0 0 var(--heart);
        padding-left: 0.8rem;
    }

    /* L'icône devient une croix quand le menu est ouvert. */
    .bar:has(#menu:popover-open) .menu-line-1 {
        transform: translateY(5px) rotate(45deg);
    }

    .bar:has(#menu:popover-open) .menu-line-2 {
        opacity: 0;
    }

    .bar:has(#menu:popover-open) .menu-line-3 {
        transform: translateY(-5px) rotate(-45deg);
    }
}

/* Écran très étroit : le bouton n'affiche que l'icône, le libellé reste lu. */
@media (max-width: 25rem) {
    .menu-toggle span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
}

@media (max-width: 52rem) and (prefers-reduced-motion: no-preference) {
    .menu-line {
        transition: transform 0.2s ease, opacity 0.2s ease;
    }
}

/* Accueil */

.hero {
    position: relative;
    background: var(--sky-deep);
    color: var(--white);
    min-height: min(80vh, 44rem);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% 35%;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Assez dense sous tout le bloc de texte pour garder 3:1 (titre) et 4,5:1 (texte)
       au-dessus de la neige et des nuages. */
    background: linear-gradient(to top, rgb(16 34 52 / 0.94) 0%, rgb(16 34 52 / 0.82) 40%, rgb(16 34 52 / 0.62) 62%, rgb(16 34 52 / 0.25) 85%, rgb(16 34 52 / 0.1) 100%);
}

.hero-text {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--wide);
    margin: 0 auto;
    padding: 8rem var(--gutter) clamp(2rem, 6vw, 4rem);
}

.hero h1 {
    color: var(--white);
    text-shadow: 0 1px 14px rgb(16 34 52 / 0.55);
    font-size: clamp(2.8rem, 9vw, 6.5rem);
    line-height: 0.95;
    margin: 0 0 1rem;
    max-width: 14ch;
}

.hero p {
    max-width: 36rem;
    margin: 0 0 1.2rem;
    font-size: clamp(1.1rem, 2.2vw, 1.3rem);
    line-height: 1.55;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.hero-links a {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font: 600 1.15rem/1.2 var(--cond);
    color: var(--white);
    text-decoration: none;
    border: 2px solid var(--white);
    border-radius: 3px;
}

.hero-links a:first-child {
    background: var(--heart);
    border-color: var(--heart);
}

.hero-links a:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--ink);
}

.intro,
.journal,
.page-head,
.albums,
.cards-page {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.intro {
    padding-top: clamp(2.5rem, 6vw, 4rem);
}

.intro h2,
.journal h2 {
    font-size: clamp(2rem, 4.5vw, 2.8rem);
    margin: 0 0 1.5rem;
}

.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 2rem clamp(1.5rem, 3vw, 2.5rem);
}

.intro-item img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 2px;
}

.intro-item img.contain {
    object-fit: contain;
    background: var(--white);
}

.intro-item h3 {
    font-size: 1.5rem;
    margin: 0.9rem 0 0.4rem;
}

.intro-item p {
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--muted);
}

.journal {
    padding-top: clamp(3rem, 7vw, 5rem);
    padding-bottom: 3rem;
}

.journal h2 {
    margin-bottom: 0.3rem;
}

.journal-lead {
    margin: 0 0 1rem;
    color: var(--muted);
}

/* Le journal est une chronologie : un fil vertical relie les mois. */
.month {
    position: relative;
    font-size: 1.6rem;
    color: var(--earth);
    margin: 2.5rem 0 0;
    padding-left: 1.6rem;
}

.month::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.32em;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--heart);
}

.journal .cards {
    border-left: 2px solid var(--line);
    margin-left: calc(0.35rem - 1px);
    padding-left: calc(1.25rem - 1px);
}

.more {
    margin-top: 2.5rem;
    font-family: var(--cond);
    font-size: 1.3rem;
    font-weight: 600;
}

/* Liste d'articles */

.card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.4rem 0;
    border-bottom: 1px solid var(--line);
}

.card:last-child {
    border-bottom: 0;
}

@media (min-width: 40rem) {
    .card {
        grid-template-columns: 12rem 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    .card:not(:has(.card-media)) .card-body {
        grid-column: 2;
    }
}

.card-media img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 2px;
}

.card-title {
    font-size: 1.6rem;
    margin: 0.1rem 0 0.4rem;
}

.card-title a {
    color: var(--ink);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--sky);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.card p {
    margin: 0;
}

.card-body > p:last-child {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.meta {
    font-family: var(--cond);
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--earth);
    margin: 0;
}

.meta a {
    color: var(--earth);
}

.card-cats {
    margin-left: 0.8rem;
}

.card-cats a,
.meta .sep {
    color: var(--muted);
}

/* Pages et articles */

.entry,
.page-head {
    padding-top: clamp(2rem, 6vw, 3.5rem);
    padding-bottom: 3rem;
}

.entry {
    max-width: calc(var(--measure) + 2 * var(--gutter));
    margin: 0 auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
}

.entry-gallery {
    max-width: calc(var(--wide) + 2 * var(--gutter));
}

.entry-gallery .prose {
    max-width: none;
}

.entry-gallery .prose > p {
    max-width: var(--measure);
}

.entry-header h1,
.page-head h1 {
    font-size: clamp(2.3rem, 6vw, 3.6rem);
    margin: 0.3rem 0 1.5rem;
}

.page-head p {
    max-width: var(--measure);
}

.prose h2 {
    font-size: 1.9rem;
    margin: 2.2rem 0 0.6rem;
}

.prose h3 {
    font-size: 1.5rem;
    margin: 1.8rem 0 0.5rem;
}

.prose p,
.prose ul,
.prose ol {
    margin: 0 0 1.1rem;
}

.prose li {
    margin-bottom: 0.3rem;
}

.prose blockquote {
    margin: 1.5rem 0;
    padding-left: 1.2rem;
    border-left: 3px solid var(--heart);
    font-style: italic;
}

.prose::after {
    content: "";
    display: table;
    clear: both;
}

figure {
    margin: 1.8rem 0;
}

figure img {
    display: block;
    border-radius: 2px;
}

figcaption {
    margin-top: 0.45rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--muted);
}

.prose > figure:not(.fig-small, .video) img {
    width: 100%;
}

.fig-small {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 40rem) {
    .fig-left,
    .fig-right {
        max-width: 45%;
        margin-top: 0.4rem;
        margin-bottom: 1rem;
    }

    .fig-left {
        float: left;
        margin-right: 1.5rem;
    }

    .fig-right {
        float: right;
        margin-left: 1.5rem;
    }
}

.note {
    padding: 0.8rem 1rem;
    border-left: 3px solid var(--line);
    color: var(--muted);
    font-style: italic;
}

/* Galeries */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(10rem, 45%), 1fr));
    gap: 0.6rem;
    margin: 1.8rem 0;
    clear: both;
}

.gallery figure {
    margin: 0;
}

.gallery img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.gallery figcaption {
    font-size: 0.88rem;
}

.entry-gallery .gallery {
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 45%), 1fr));
    gap: 0.8rem;
}

.zoom {
    display: block;
    cursor: zoom-in;
}

.albums {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
    gap: 2rem 1.5rem;
    padding-bottom: 4rem;
}

.albums a {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.albums img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 2px;
}

.album-title {
    display: block;
    margin-top: 0.6rem;
    font: 600 1.45rem/1.15 var(--cond);
}

.albums a:hover .album-title {
    color: var(--sky);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.album-count {
    font: 500 1.05rem/1.4 var(--cond);
    color: var(--earth);
}

/* Vidéos : vignette locale, le lecteur n'est chargé qu'au clic */

.video {
    margin: 2rem 0;
}

.video-play,
.video iframe {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 2px;
    background: var(--ink);
}

.video-play img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
}

.video-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0.7rem 1.2rem 0.7rem 2.6rem;
    font: 600 1.2rem/1.2 var(--cond);
    color: var(--white);
    background: var(--heart);
    border-radius: 3px;
    white-space: nowrap;
}

.video-label::before {
    content: "";
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    border-style: solid;
    border-width: 0.45rem 0 0.45rem 0.75rem;
    border-color: transparent transparent transparent var(--white);
}

.video-play:hover .video-label {
    background: var(--sky-deep);
}

/* Navigation entre articles */

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.pager a {
    font: 600 1.25rem/1.2 var(--cond);
    color: var(--ink);
    text-decoration: none;
}

.pager a span {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 1.05rem;
    color: var(--earth);
}

.pager a:hover {
    color: var(--sky);
}

.pager .next {
    text-align: right;
}

/* Visionneuse */

.lightbox {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #0c141c;
    color: var(--white);
}

.lightbox::backdrop {
    background: rgb(12 20 28 / 0.6);
}

.lightbox[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 7rem);
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox p {
    margin: 0.8rem 1rem 0;
    max-width: 50rem;
    min-height: 1.6em;
    text-align: center;
    font-size: 1rem;
}

.lightbox button {
    position: absolute;
    font: 600 1.15rem/1 var(--cond);
    color: var(--white);
    background: rgb(255 255 255 / 0.12);
    border: 0;
    border-radius: 3px;
    padding: 0.7rem 1rem;
    cursor: pointer;
}

.lightbox button:hover {
    background: rgb(255 255 255 / 0.25);
}

.lb-close {
    top: 1rem;
    right: 1rem;
}

.lb-prev,
.lb-next {
    top: 50%;
    transform: translateY(-50%);
}

.lb-prev {
    left: 1rem;
}

.lb-next {
    right: 1rem;
}

@media (max-width: 40rem) {
    .lb-prev,
    .lb-next {
        top: auto;
        bottom: 1rem;
        transform: none;
    }
}

/* Pied de page */

.site-footer {
    background: var(--ink);
    color: #d7dfe6;
    font-size: 1rem;
}

.footer-inner {
    max-width: var(--wide);
    margin: 0 auto;
    padding: 2.5rem var(--gutter);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 3rem;
    justify-content: space-between;
}

.footer-about {
    max-width: 28rem;
    margin: 0;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    align-content: flex-start;
}

.site-footer a {
    color: var(--white);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

@media print {
    .site-header,
    .site-footer,
    .pager,
    .video {
        display: none;
    }
}

/* Plan du site (sitemap.xml mis en forme par sitemap.xsl) */

.sitemap {
    max-width: var(--wide);
    margin: 0 auto;
    padding: clamp(2rem, 6vw, 3.5rem) var(--gutter) 4rem;
}

.sitemap h1 {
    font-size: clamp(2.3rem, 6vw, 3.6rem);
    margin: 0 0 0.6rem;
}

.sitemap-lead {
    max-width: var(--measure);
    margin: 0 0 2rem;
    color: var(--muted);
}

.sitemap table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--line);
    font-size: 1rem;
}

.sitemap th {
    padding: 0.7rem 1rem;
    text-align: left;
    font: 600 1.15rem/1.2 var(--cond);
    color: var(--earth);
    border-bottom: 2px solid var(--line);
}

.sitemap td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.sitemap tr:last-child td {
    border-bottom: 0;
}

.sitemap td:last-child,
.sitemap th:last-child {
    white-space: nowrap;
    width: 1%;
}

/* Mode contraste élevé : les ombres disparaissent, on souligne la page courante. */
@media (forced-colors: active) {
    #menu a[aria-current="page"] {
        text-decoration: underline;
        text-decoration-thickness: 2px;
    }
}

/* Liens entre le journal et les albums */

.day-photos {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.day-photos h2 {
    font-size: 1.6rem;
    margin: 0 0 1rem;
}

.day-albums {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr));
    gap: 1.2rem;
}

.day-albums a {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.day-albums img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 2px;
}

.day-album-title {
    display: block;
    margin-top: 0.5rem;
    font: 600 1.2rem/1.2 var(--cond);
}

.day-albums a:hover .day-album-title {
    color: var(--sky);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.day-album-count {
    font: 500 1rem/1.4 var(--cond);
    color: var(--earth);
}

.entry-header .recit {
    max-width: var(--measure);
    margin: -0.6rem 0 1.5rem;
    color: var(--muted);
}

.pager {
    margin-top: 2.5rem;
}
