/*
 * Les boucles de Val — site public (SPEC §11).
 * Parti pris : fond brun profond, photos sur fond blanc présentées comme des tirages
 * encadrés dans une galerie, accents ocre. Toutes les couleurs sont ici, en un seul endroit.
 */

/* ---- Polices hébergées sur le site (D10, licence OFL) ---------------------------- */

@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Cormorant Garamond";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Cormorant Garamond";
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url("../fonts/jost-latin-300-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Jost";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/jost-latin-400-normal.woff2") format("woff2");
}

/* ---- Palette et variables ---------------------------------------------------------- */

:root {
    --bv-fond: #2A1E17;          /* brun cacao profond */
    --bv-surface: #3A2A20;       /* en-tête, pied de page, cartes */
    --bv-ocre: #C8913A;          /* accent : filets, boutons, liens (5,8:1 sur le fond) */
    --bv-ocre-clair: #E0B872;    /* survol, focus (8,7:1 sur le fond) */
    --bv-creme: #F4ECDF;         /* texte principal (13,8:1) */
    --bv-sable: #CDBBA4;         /* texte secondaire, légendes (9,0:1) */

    --bv-police-titres: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --bv-police-texte: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;

    --bv-passe-partout: #FBF8F3; /* liseré clair autour des photos (blanc cassé) */
    --bv-epaisseur-passe-partout: .45rem;
    --bv-ombre-tirage: 0 .6rem 1.6rem rgba(0, 0, 0, .35), 0 .1rem .3rem rgba(0, 0, 0, .25);
    --bv-transition: .25s ease;

    /* Personnalisation de Bootstrap par variables, sans Sass */
    --bs-body-bg: var(--bv-fond);
    --bs-body-color: var(--bv-creme);
    --bs-body-font-family: var(--bv-police-texte);
    --bs-body-font-weight: 300;
    --bs-link-color: var(--bv-ocre);
    --bs-link-color-rgb: 200, 145, 58;
    --bs-link-hover-color: var(--bv-ocre-clair);
    --bs-link-hover-color-rgb: 224, 184, 114;
    --bs-border-color: rgba(200, 145, 58, .35);
    --bs-emphasis-color: var(--bv-creme);
}

/* ---- Base ----------------------------------------------------------------------- */

body.bv {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bv-fond);
    color: var(--bv-creme);
    font-family: var(--bv-police-texte);
    font-weight: 300;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.bv a {
    color: var(--bv-ocre);
    text-underline-offset: .2em;
    text-decoration-thickness: 1px;
}

.bv a:hover {
    color: var(--bv-ocre-clair);
}

.bv :focus-visible {
    outline: 2px solid var(--bv-ocre-clair);
    outline-offset: 3px;
}

.bv strong {
    font-weight: 400;
}

.bv-lien-evitement {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 1100;
    padding: .5rem 1rem;
    background: var(--bv-surface);
    color: var(--bv-creme);
}

.bv-contenu {
    flex: 1;
}

.bv-section {
    padding-block: 2.5rem 3.5rem;
}

.bv-titre,
.bv-titre-section {
    font-family: var(--bv-police-titres);
    font-weight: 500;
    color: var(--bv-creme);
    letter-spacing: .01em;
}

.bv-titre {
    margin-bottom: .75rem;
    font-size: clamp(2.2rem, 6vw, 3.4rem);
    line-height: 1.1;
    text-align: center;
}

.bv-titre-section {
    margin-bottom: 2rem;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    text-align: center;
}

/* Petit filet ocre sous les titres de section */
.bv-titre-section::after {
    content: "";
    display: block;
    width: 3rem;
    height: 1px;
    margin: .9rem auto 0;
    background: var(--bv-ocre);
}

.bv-texte-secondaire,
.bv-intro {
    color: var(--bv-sable);
}

.bv-intro {
    max-width: 40rem;
    margin: 0 auto;
    text-align: center;
    font-size: 1.05rem;
}

.bv-filet {
    width: 100%;
    max-width: 8rem;
    margin: 2rem auto 2.5rem;
    border: 0;
    border-top: 1px solid var(--bv-ocre);
    opacity: 1;
}

/* ---- En-tête -------------------------------------------------------------------- */

.bv-entete {
    background: var(--bv-surface);
    border-bottom: 1px solid var(--bv-ocre);
}

.bv-entete__interieur {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1.5rem;
    min-height: 4.5rem;
    padding-block: .6rem;
}

.bv .bv-logo {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: var(--bv-creme);
    text-decoration: none;
}

.bv-logo__motif {
    flex: 0 0 auto;
    color: var(--bv-ocre);
}

.bv-logo__texte {
    font-family: var(--bv-police-titres);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.55rem, 5vw, 2rem);
    line-height: 1;
    letter-spacing: .01em;
}

.bv .bv-logo:hover .bv-logo__texte {
    color: var(--bv-ocre-clair);
}

.bv-menu__liste {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bv .bv-menu__lien {
    display: inline-block;
    padding-block: .5rem;
    color: var(--bv-sable);
    text-decoration: none;
    font-size: .95rem;
    letter-spacing: .04em;
}

.bv .bv-menu__lien:hover {
    color: var(--bv-ocre-clair);
}

/* ---- Accueil : présentation et mosaïque ----------------------------------------- */

.bv-presentation {
    padding-top: 3rem;
    text-align: center;
}

.bv-presentation__texte {
    max-width: 38rem;
    margin: 0 auto;
    font-family: var(--bv-police-titres);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.3rem, 3.6vw, 1.65rem);
    line-height: 1.45;
    color: var(--bv-creme);
}

.bv-mosaique {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem 1.5rem;
    margin: 0;
}

/* Petit écran : une seule colonne, photo moins large que l'écran pour garder l'effet tirage. */
@media (max-width: 575.98px) {
    .bv-carte-collection {
        width: 100%;
        max-width: 22rem;
        margin-inline: auto;
    }
}

@media (min-width: 576px) {
    .bv-mosaique { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .bv-mosaique { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
    .bv-mosaique { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.bv .bv-carte-collection__lien {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    color: var(--bv-creme);
    text-decoration: none;
}

.bv-carte-collection__nom {
    font-family: var(--bv-police-titres);
    font-weight: 500;
    font-size: clamp(1.2rem, 3vw, 1.45rem);
    line-height: 1.2;
    text-align: center;
}

.bv .bv-carte-collection__lien:hover .bv-carte-collection__nom {
    color: var(--bv-ocre-clair);
}

/* ---- Photos présentées comme des tirages ---------------------------------------- */

.bv-tirage {
    position: relative;
    display: block;
    width: 100%;
    /* Passe-partout : la photo (souvent sur fond noir) se détache du fond brun de la page. */
    padding: var(--bv-epaisseur-passe-partout);
    background: var(--bv-passe-partout);
    box-shadow: var(--bv-ombre-tirage);
    transition: box-shadow var(--bv-transition), transform var(--bv-transition);
}

.bv-tirage img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.bv-format-paysage .bv-tirage img {
    aspect-ratio: 4 / 3;
}

/* Au survol : fin filet ocre et léger agrandissement. */
a:hover > .bv-tirage,
a.bv-tirage:hover,
a:focus-visible > .bv-tirage,
a.bv-tirage:focus-visible {
    transform: scale(1.02);
    box-shadow: 0 0 0 1px var(--bv-ocre), var(--bv-ombre-tirage);
}

/* ---- Page collection : grille ----------------------------------------------------- */

.bv-fil {
    margin-bottom: 1.5rem;
    font-size: .95rem;
}

.bv-grille {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem 1.5rem;
    margin: 0;
}

@media (min-width: 576px) {
    .bv-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
    .bv-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
    .bv-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Une seule colonne sur mobile : photo moins large que l'écran pour garder l'effet tirage. */
@media (max-width: 575.98px) {
    .bv-photo {
        max-width: 22rem;
        width: 100%;
        margin-inline: auto;
    }
}

.bv-photo__figure {
    margin: 0;
}

.bv-photo__lien {
    cursor: zoom-in;
}

.bv-photo__legende {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-top: .8rem;
    text-align: center;
}

.bv-photo__reference {
    color: var(--bv-ocre-clair);
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bv-photo__description {
    color: var(--bv-sable);
    font-size: .95rem;
    line-height: 1.5;
}

.bv-badge-vendu {
    position: absolute;
    top: calc(var(--bv-epaisseur-passe-partout) + .6rem);
    right: calc(var(--bv-epaisseur-passe-partout) + .6rem);
    padding: .15rem .6rem;
    background: rgba(42, 30, 23, .88);
    color: var(--bv-creme);
    border: 1px solid var(--bv-ocre);
    font-size: .72rem;
    font-weight: 400;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.bv-badge-vendu--legende {
    position: static;
    background: transparent;
    color: var(--bv-ocre-clair);
}

/* Collections voisines */
.bv-voisines {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 145, 58, .35);
}

.bv .bv-voisines__lien {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    color: var(--bv-creme);
    text-decoration: none;
}

.bv-voisines__lien--suivante {
    margin-left: auto;
    text-align: right;
}

.bv-voisines__sens {
    color: var(--bv-sable);
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.bv-voisines__nom {
    font-family: var(--bv-police-titres);
    font-size: 1.35rem;
}

.bv .bv-voisines__lien:hover .bv-voisines__nom {
    color: var(--bv-ocre-clair);
}

/* Bandeau d'aperçu (collection non publiée, vue par l'administratrice) */
.bv-bandeau-apercu {
    padding-block: .7rem;
    background: var(--bv-ocre);
    color: var(--bv-fond);
    font-weight: 400;
    text-align: center;
}

.bv .bv-bandeau-apercu a {
    margin-left: .5rem;
    color: var(--bv-fond);
    font-weight: 400;
}

/* ---- Boutons ------------------------------------------------------------------------ */

.bv .bv-bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .6rem 1.6rem;
    border: 1px solid var(--bv-ocre);
    color: var(--bv-creme);
    background: transparent;
    font-weight: 400;
    letter-spacing: .06em;
    text-decoration: none;
    transition: background-color var(--bv-transition), color var(--bv-transition);
}

.bv .bv-bouton:hover,
.bv .bv-bouton:focus-visible {
    background: var(--bv-ocre);
    color: var(--bv-fond);
}

.bv .bv-bouton--petit {
    padding: .45rem 1.1rem;
    font-size: .9rem;
}

/* ---- Pied de page ------------------------------------------------------------------- */

.bv-pied {
    padding-block: 2.5rem 2rem;
    background: var(--bv-surface);
    border-top: 1px solid var(--bv-ocre);
    color: var(--bv-sable);
    font-size: .9rem;
}

.bv-pied__interieur {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
}

.bv-pied__liens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bv .bv-pied__liens a {
    display: inline-block;
    padding-block: .4rem;
    color: var(--bv-sable);
}

.bv .bv-pied__liens a:hover {
    color: var(--bv-ocre-clair);
}

.bv-pied__copyright {
    margin: 0;
}

/* ---- Visionneuse (lightbox) --------------------------------------------------------- */

.bv-visionneuse {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(18, 12, 9, .96);
    color: var(--bv-creme);
    overflow: hidden;
}

.bv-visionneuse::backdrop {
    background: rgba(18, 12, 9, .96);
}

.bv-visionneuse[open] {
    display: flex;
    animation: bv-apparition .2s ease;
}

.bv-visionneuse-ouverte {
    overflow: hidden;
}

.bv-visionneuse__scene {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 3.75rem .75rem 1rem;
    /* Balayage horizontal et vertical gérés par lightbox.js ; le zoom à deux doigts reste possible. */
    touch-action: pinch-zoom;
}

.bv-visionneuse__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    margin: 0;
}

.bv-visionneuse__cadre {
    /* Même passe-partout que les vignettes. */
    padding: var(--bv-epaisseur-passe-partout);
    background: var(--bv-passe-partout);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .55);
}

.bv-visionneuse__image {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 1.5rem - 2 * var(--bv-epaisseur-passe-partout));
    max-height: calc(100dvh - 13rem - 2 * var(--bv-epaisseur-passe-partout));
    transition: opacity .2s ease, transform .2s ease;
}

.bv-visionneuse__image--chargement {
    opacity: .35;
}

.bv-visionneuse__image--depart-gauche { transform: translateX(-1.5rem); opacity: 0; }
.bv-visionneuse__image--depart-droite { transform: translateX(1.5rem); opacity: 0; }

.bv-visionneuse__legende {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    max-width: 36rem;
    text-align: center;
}

.bv-visionneuse__description {
    margin: 0;
    color: var(--bv-creme);
    font-size: .95rem;
    line-height: 1.45;
}

.bv-visionneuse__infos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .4rem 1rem;
    margin: 0;
    color: var(--bv-sable);
    font-size: .85rem;
    letter-spacing: .04em;
}

.bv-visionneuse__bouton {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(200, 145, 58, .5);
    border-radius: 50%;
    background: rgba(42, 30, 23, .7);
    color: var(--bv-creme);
    cursor: pointer;
    transition: background-color var(--bv-transition), border-color var(--bv-transition);
}

.bv-visionneuse__bouton:hover {
    border-color: var(--bv-ocre-clair);
    background: var(--bv-surface);
}

.bv-visionneuse__fermer {
    top: .6rem;
    right: .6rem;
}

.bv-visionneuse__precedente,
.bv-visionneuse__suivante {
    top: 50%;
    transform: translateY(-50%);
}

.bv-visionneuse__precedente { left: .6rem; }
.bv-visionneuse__suivante { right: .6rem; }

/* Sur petit écran, les flèches passent en bas pour ne pas masquer la photo. */
@media (max-width: 767.98px) {
    .bv-visionneuse__precedente,
    .bv-visionneuse__suivante {
        top: auto;
        bottom: .75rem;
        transform: none;
    }

    .bv-visionneuse__scene {
        padding-bottom: 4.5rem;
    }

    .bv-visionneuse__image {
        max-height: calc(100dvh - 16rem - 2 * var(--bv-epaisseur-passe-partout));
    }
}

@keyframes bv-apparition {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---- Pages d'erreur ----------------------------------------------------------------- */

.bv-erreur {
    padding-block: 4rem;
    text-align: center;
}

.bv-erreur__code {
    margin-bottom: .5rem;
    color: var(--bv-ocre);
    font-family: var(--bv-police-titres);
    font-size: 4.5rem;
    line-height: 1;
}

.bv-erreur .bv-titre {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.bv-erreur__detail {
    max-width: 100%;
    margin: 2rem auto;
    padding: 1rem;
    overflow-x: auto;
    background: var(--bv-surface);
    color: var(--bv-sable);
    font-size: .8rem;
    text-align: left;
    white-space: pre-wrap;
}

/* ---- Mouvements réduits : aucune animation ------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    a:hover > .bv-tirage,
    a.bv-tirage:hover,
    a:focus-visible > .bv-tirage,
    a.bv-tirage:focus-visible {
        transform: none;
    }
}

/* ---- Pages annexes : texte mis en forme ------------------------------------------------ */

.bv-texte-riche {
    max-width: 42rem;
    margin-inline: auto;
}

.bv-texte-riche p,
.bv-texte-riche ul {
    margin-bottom: 1.15rem;
}

.bv-texte-riche h2 {
    margin: 2.2rem 0 .8rem;
    font-family: var(--bv-police-titres);
    font-weight: 500;
    font-size: clamp(1.5rem, 4vw, 1.9rem);
    color: var(--bv-creme);
}

.bv-texte-riche > h2:first-child {
    margin-top: 0;
}

.bv-texte-riche ul {
    padding-left: 1.3rem;
}

.bv-texte-riche li {
    margin-bottom: .35rem;
}

.bv-texte-riche a {
    word-break: break-word;
}

.bv-presentation__texte p {
    margin: 0 0 .9rem;
}

.bv-presentation__texte > :last-child {
    margin-bottom: 0;
}

.bv-contact {
    max-width: 42rem;
    margin: 2.5rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(200, 145, 58, .35);
    text-align: center;
}

.bv-contact__ligne {
    margin-bottom: 1.5rem;
    font-family: var(--bv-police-titres);
    font-size: clamp(1.4rem, 4vw, 1.8rem);
    overflow-wrap: anywhere;
}

.bv-contact__liens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    margin: 0;
}
