/* ============================================================
   LES VIEUX CHATS — V1.14

   Arborescence :

   /
   ├── index.php
   ├── index.css
   └── assets/
       ├── background-village.png
       ├── photo.jpg
       ├── facade-boutique.png
       ├── tableau.png
       └── fond message.png

   Ordre des couches :
   1. /assets/background-village.webp
   2. /assets/photo.jpg dans l'œil-de-bœuf
   3. /assets/facade-boutique.webp
   4. textes manuscrits
   5. /assets/tableau.webp avec statistiques à la craie

   facade-boutique.png : 1536 × 1024
   ============================================================ */

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

html {
    background: #111;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    background: #111;
}


/* ============================================================
   COUCHE 1 — BACKGROUND
   ============================================================ */

.scene {
    position: relative;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    overflow: hidden;

    background-image: url("/assets/background-village.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}


/* ============================================================
   REPÈRE COMMUN

   Tous les éléments sont placés relativement à cette boîte,
   qui conserve exactement le ratio 1536 / 1024 de la façade.
   ============================================================ */

.facade-stage {
    position: absolute;

    left: 50%;
    bottom: 0;

    width: 100vw;
    aspect-ratio: 1536 / 1024;

    transform: translateX(-50%);

    /*
       Les unités cqw utilisées pour les textes suivent
       directement la largeur réelle de la façade.
    */
    container-type: inline-size;
}


/* ============================================================
   COUCHE 2 — PHOTO DANS L'ŒIL-DE-BŒUF
   /assets/photo.jpg
   ============================================================ */

.oeil-de-boeuf {
    position: absolute;
    z-index: 1;

    left: 49.84%;
    top: 25.20%;

    width: 9.3%;
    aspect-ratio: 1 / 1;

    transform: translate(-50%, -50%);

    overflow: hidden;
    border-radius: 50%;

    background-image: url("/assets/photo.jpg");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}


/* ============================================================
   COUCHE 3 — FAÇADE
   /assets/facade-boutique.webp
   ============================================================ */

.facade {
    position: absolute;
    z-index: 2;

    inset: 0;

    display: block;
    width: 100%;
    height: 100%;

    user-select: none;
    pointer-events: none;
}


/* ============================================================
   COUCHE 4 — TEXTE DE LA GRANDE PANCARTE
   "Les Vieux Chats"

   Positionnée dans la pancarte suspendue sous l'œil-de-bœuf.
   ============================================================ */

.texte-enseigne {
    position: absolute;
    z-index: 3;

    left: 49.85%;
    top: 38.55%;

    width: 31.5%;
    height: 7.2%;

    transform: translate(-50%, -50%) rotate(-1deg);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 1.5%;

    color: #552b17;

    /*
       Style manuscrit sans dépendre d'un fichier de police externe.
       Le navigateur utilisera la première police disponible.
    */
    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        "URW Chancery L",
        "Comic Sans MS",
        cursive;

    font-size: 3.35cqw;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.015em;

    white-space: nowrap;
    text-align: center;

    text-shadow:
        0 0.05em 0 rgba(255, 235, 190, 0.55),
        0 0.08em 0.08em rgba(75, 35, 13, 0.15);

    pointer-events: none;
    user-select: none;
}


/* ============================================================
   COUCHE 4 — TEXTE SUR LA PANCARTE DE LA PORTE
   "Laissez nous un message"
   ============================================================ */

.texte-porte {
    position: absolute;
    z-index: 3;

    left: 50%;
    top: 78.55%;

    width: 11.2%;
    height: 10.8%;

    transform: translate(-50%, -50%) rotate(-0.6deg);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 0.15%;

    color: #3f1d0d;

    font-family:
        Georgia,
        "Palatino Linotype",
        "Book Antiqua",
        Palatino,
        serif;

    font-size: 1.72cqw;
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: 0.015em;

    text-align: center;

    text-shadow:
        0 0.04em 0 rgba(255, 241, 205, 0.70),
        0 0.08em 0.08em rgba(55, 25, 10, 0.18);

    pointer-events: none;
    user-select: none;
}

.texte-porte span {
    display: block;
    white-space: nowrap;
}




/* ============================================================
   TABLEAU DE STATISTIQUES
   /assets/tableau.webp

   V1.10 :
   - taille plus naturelle sur PC
   - taille PROPORTIONNELLE à la largeur de l'écran sur tablette/smartphone
   - cela évite un tableau trop petit ou trop grand selon l'appareil
   - le nombre reste au-dessus du titre
   ============================================================ */

.tableau-stage {
    position: absolute;
    z-index: 4;

    /* posé à gauche, sur le trottoir */
    left: clamp(-10px, -0.5vw, 0px);
    bottom: 0;

    /*
       On travaille désormais principalement en LARGEUR.
       L'image garde ensuite automatiquement son ratio.
    */
    width: clamp(170px, 15vw, 280px);
    aspect-ratio: 2 / 3;
    height: auto;

    container-type: inline-size;
    pointer-events: none;
}

.tableau-image {
    position: absolute;
    z-index: 1;
    inset: 0;

    display: block;
    width: 100%;
    height: 100%;

    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.tableau-content {
    position: absolute;
    z-index: 2;

    left: 58%;
    top: 18.9%;
    width: 47.2%;
    height: 55%;

    transform: translateX(-50%) rotate(-2deg);
    transform-origin: center center;

    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.8cqw;

    color: rgba(246, 245, 238, 0.97);

    font-family:
        "Chalkduster",
        "Marker Felt",
        "Segoe Print",
        "Comic Sans MS",
        cursive;

    text-shadow:
        0.015em 0.02em 0 rgba(255, 255, 255, 0.10),
        0.05em 0.06em 0 rgba(20, 20, 20, 0.18);
}

.chalk-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-width: 0;
    padding: 0.35cqw 0 0.95cqw;
    gap: 0.35cqw;

    border-bottom: 0.12cqw dashed rgba(240, 240, 235, 0.34);
}

.chalk-value {
    display: block;

    font-size: 10.5cqw;
    font-weight: 700;
    line-height: 0.9;
}

.chalk-label {
    display: block;

    font-size: 5.2cqw;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   TEXTE 100 % PROPORTIONNEL AU TABLEAU

   Grâce à "container-type: inline-size" sur .tableau-stage,
   1cqw = 1 % de la largeur réelle du tableau.

   Donc :
   - si le tableau grandit, le texte grandit ;
   - si le tableau rétrécit, le texte rétrécit ;
   - aucune taille en px n'est imposée au texte.
   ------------------------------------------------------------ */

.tableau-stage .chalk-value {
    font-size: 10.5cqw;
}

.tableau-stage .chalk-label {
    font-size: 5.2cqw;
}

.tableau-stage .tableau-content {
    gap: 3.1cqw;
}

.tableau-stage .chalk-row {
    gap: 0.7cqw;
    padding-bottom: 1.3cqw;
}

/* ------------------------------------------------------------
   TABLETTE
   Taille proportionnelle à la largeur de l'écran
   ------------------------------------------------------------ */
@media screen and (max-width: 1024px) {
    .tableau-stage {
        left: clamp(-8px, -1vw, 0px);
        width: clamp(135px, 23vw, 215px) !important;
    }

    .tableau-content {
        gap: 2.7cqw;
    }

    .chalk-value {
        font-size: 10.5cqw;
    }

    .chalk-label {
        font-size: 5.2cqw;
    }
}

/* ------------------------------------------------------------
   SMARTPHONE
   Taille proportionnelle à la largeur de l'écran
   ------------------------------------------------------------ */
@media screen and (max-width: 768px) {
    .tableau-stage {
        left: clamp(-6px, -1vw, 0px);
        width: clamp(125px, 34vw, 185px) !important;
    }

    .tableau-content {
        gap: 2.5cqw;
    }

    .chalk-row {
        padding: 0.28cqw 0 0.75cqw;
        gap: 0.18cqw;
    }

    .chalk-value {
        font-size: 10.5cqw;
    }

    .chalk-label {
        font-size: 5.2cqw;
    }
}

/* Très petits smartphones */
@media screen and (max-width: 420px) {
    .tableau-stage {
        width: clamp(120px, 37vw, 165px) !important;
    }
}



/* ============================================================
   SMARTPHONE + TABLETTE

   - façade = hauteur complète de l'écran
   - ratio conservé
   - surplus coupé à gauche et à droite
   - photo et textes restent attachés à la façade
   ============================================================ */

@media (max-width: 1200px), (hover: none) and (pointer: coarse) {

    .facade-stage {
        top: 0;
        bottom: auto;

        height: 100vh;
        height: 100dvh;

        width: 150vh;
        width: 150dvh;

        max-width: none;
    }

    .tableau-stage {
        left: clamp(-34px, -4vw, -10px);
        --tableau-h: clamp(250px, 62dvh, 620px);
    }

    .tableau-content {
        left: 30.5%;
        top: 18.5%;
        width: 47.8%;
        height: 56%;

        gap: 4.2cqw;
    }

    .chalk-row {
        gap: 1.5cqw;
        padding-bottom: 1.3cqw;
    }

    .chalk-label {
        font-size: clamp(10px, 2.45cqw, 22px);
    }

    .chalk-value {
        font-size: clamp(17px, 4.5cqw, 40px);
    }

}


/* ============================================================
   Compatibilité navigateurs sans dvh
   ============================================================ */

@supports not (height: 100dvh) {

    .scene {
        height: 100vh;
    }

    @media (max-width: 1200px), (hover: none) and (pointer: coarse) {

        .facade-stage {
            height: 100vh;
            width: 150vh;
        }

        .tableau-stage {
            --tableau-h: clamp(190px, 42vh, 420px);
        }

    }
}








/* ============================================================
   CORRECTIONS SPÉCIFIQUES FALLBACK
   ============================================================ */
@supports not (height: 100dvh) {
    .tableau-stage {
        width: clamp(170px, 15vw, 280px);
    }

    @media screen and (max-width: 1024px) {
        .tableau-stage {
            width: clamp(135px, 23vw, 215px) !important;
        }
    }

    @media screen and (max-width: 768px) {
        .tableau-stage {
            width: clamp(125px, 34vw, 185px) !important;
        }
    }

    @media screen and (max-width: 420px) {
        .tableau-stage {
            width: clamp(120px, 37vw, 165px) !important;
        }
    }
}


/* ============================================================
   V1.12 — RECENTRAGE DU TEXTE DU TABLEAU
   ============================================================

   La zone noire de tableau.png est légèrement décalée vers la
   droite dans l'image. Le contenu est donc centré autour de 58 %
   de la largeur de l'asset et non autour de 50 % du PNG complet.
   Cette règle s'applique sur PC, tablette et smartphone.
   ============================================================ */

.tableau-stage .tableau-content {
    left: 58%;
    transform: translateX(-50%) rotate(-2deg);
    transform-origin: center center;
}



/* ============================================================
   LIVRE D'OR — V2.10
   /assets/fond message.webp

   Intégration des fonctions du Télégramme Team Papaye :
   formulaire + parcours + Poi'Z + reCAPTCHA + compteur.

   Le décor reste pleine largeur et chevauche légèrement la façade.
   Sur tablette / smartphone, le fond est recadré latéralement sans
   être déformé afin de conserver une grande zone d'écriture.
   ============================================================ */

.livre-or-section {
    position: relative;
    z-index: 8;

    width: 100%;
    margin: 0;
    padding: 0;

    background-image: url("/assets/background-village.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;

    display: flow-root;
}

.livre-or-stage {
    position: relative;
    z-index: 2;

    width: 100vw;
    min-height: clamp(720px, 54.9vw, 980px);

    margin-top: clamp(-105px, -5.5vw, -38px);
    margin-left: 50%;
    transform: translateX(-50%);

    background-image: url("/assets/fond message.webp");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;

    overflow: visible;
}

.livre-or-content {
    position: relative;
    z-index: 2;

    width: min(78vw, 1080px);
    margin: 0 auto;

    padding-top: clamp(118px, 10.4vw, 180px);
    padding-bottom: clamp(72px, 6vw, 110px);

    color: #3a2412;

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}

.livre-or-head {
    width: min(100%, 900px);
    margin: 0 auto clamp(18px, 2vw, 30px);
    text-align: center;
}

.livre-or-head h2 {
    margin: 0 0 8px;

    color: #3a210f;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(30px, 3.2vw, 58px);
    line-height: 1;
    font-weight: 700;
}

.livre-or-head p {
    max-width: 760px;
    margin: 0 auto 14px;

    font-size: clamp(14px, 1.15vw, 18px);
    line-height: 1.35;
    color: #57381d;
}

.livre-or-counter {
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;

    padding: 7px 14px;

    border-top: 1px solid rgba(92, 56, 25, 0.34);
    border-bottom: 1px solid rgba(92, 56, 25, 0.34);

    color: #5a371b;

    font-size: clamp(12px, 1vw, 15px);
    font-weight: 700;
}

.livre-or-counter__number {
    font-size: 1.35em;
    color: #321b0c;
}


/* ============================================================
   FORMULAIRE
   ============================================================ */

.livre-or-form {
    width: min(100%, 940px);
    margin: 0 auto;
}

.livre-or-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(15px, 1.6vw, 24px);
}

.livre-or-field {
    position: relative;
    margin-bottom: clamp(14px, 1.5vw, 22px);
}

.livre-or-field label {
    display: block;

    margin-bottom: 5px;

    color: #43270f;

    font-size: clamp(13px, 1vw, 16px);
    font-weight: 700;
}

.livre-or-field label small {
    font-size: .78em;
    font-weight: 400;
}

.livre-or-field input,
.livre-or-field textarea,
.livre-or-field select {
    display: block;

    width: 100%;
    min-width: 0;

    padding: 10px 8px;

    border: 0;
    border-bottom: 2px dashed rgba(98, 59, 27, 0.76);
    border-radius: 0;

    outline: none;

    background: rgba(255, 250, 226, 0.16);

    color: #2d1b0d;

    font: inherit;
    font-size: clamp(15px, 1.05vw, 17px);
}

.livre-or-field textarea {
    min-height: 126px;
    resize: vertical;
}

.livre-or-field input:focus,
.livre-or-field textarea:focus,
.livre-or-field select:focus {
    background: rgba(255, 250, 226, 0.32);
    border-bottom-style: solid;
}

.livre-or-field input::placeholder,
.livre-or-field textarea::placeholder {
    color: rgba(65, 40, 19, 0.55);
}

.livre-or-field select option {
    color: #2d1b0d;
    background: #efd8aa;
}

.livre-or-parcours[hidden] {
    display: none !important;
}

.poiz-hint {
    min-height: 1.2em;
    margin: 6px 0 0;

    color: #72451f;

    font-size: 13px;
}


/* ============================================================
   AUTOCOMPLÉTION LIEU
   ============================================================ */

.lieu-autocomplete {
    position: relative;
}

.lieu-suggestions {
    position: absolute;
    z-index: 50;

    top: 100%;
    left: 0;
    right: 0;

    max-height: 220px;
    overflow-y: auto;

    margin: 4px 0 0;
    padding: 0;

    list-style: none;

    border: 1px solid #65401f;

    background: #efd9ad;

    box-shadow: 5px 7px 14px rgba(42, 23, 8, .28);
}

.lieu-suggestions[hidden] {
    display: none;
}

.lieu-suggestions li {
    padding: 9px 12px;

    border-bottom: 1px dashed rgba(85, 51, 23, .24);

    color: #35200f;

    cursor: pointer;
}

.lieu-suggestions li:last-child {
    border-bottom: 0;
}

.lieu-suggestions li:hover,
.lieu-suggestions li.active {
    background: #d7b176;
}

.lieu-suggestions li.empty {
    cursor: default;
    color: #77552f;
}


/* ============================================================
   HONEYPOT / RECAPTCHA / BOUTON
   ============================================================ */

.hp-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.livre-or-recaptcha {
    display: flex;
    justify-content: center;

    margin: 12px auto 16px;
}

.livre-or-submit {
    display: flex;
    justify-content: center;
}

.livre-or-button {
    min-height: 48px;

    padding: 13px 26px;

    border: 2px solid #32190a;
    outline: 1px solid #deb36c;
    outline-offset: -6px;

    background:
        linear-gradient(
            180deg,
            #bd7833 0%,
            #88481f 58%,
            #5c2d14 100%
        );

    color: #fff1cf;

    font-family:
        Georgia,
        "Times New Roman",
        serif;

    font-size: clamp(13px, 1vw, 16px);
    font-weight: 900;

    letter-spacing: .35px;
    text-transform: uppercase;

    cursor: pointer;

    box-shadow:
        0 5px 12px rgba(39, 18, 4, .28),
        inset 0 1px 0 rgba(255, 255, 255, .28);
}

.livre-or-button:hover {
    filter: brightness(1.10);
    transform: translateY(-1px);
}

.livre-or-button:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}

.livre-or-status {
    min-height: 22px;

    margin-top: 10px;

    text-align: center;

    font-weight: 700;
}

.livre-or-status.ok {
    color: #315d2d;
}

.livre-or-status.err {
    color: #8b261d;
}

.livre-or-note {
    max-width: 720px;

    margin: 5px auto 0;

    text-align: center;

    color: #69451f;

    font-size: clamp(11px, .85vw, 13px);
    line-height: 1.35;
}


/* ============================================================
   TABLETTE
   ============================================================ */

@media screen and (max-width: 1024px) {

    .livre-or-stage {
        min-height: 900px;

        margin-top: clamp(-72px, -6vw, -32px);

        /*
           Même principe que le Télégramme Team Papaye :
           le fond conserve son ratio et est recadré sur les côtés.
        */
        background-size: auto 100%;
        background-position: center top;
    }

    .livre-or-content {
        width: min(86vw, 760px);

        padding-top: 135px;
        padding-bottom: 90px;
    }

    .livre-or-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}


/* ============================================================
   SMARTPHONE
   ============================================================ */

@media screen and (max-width: 768px) {

    .livre-or-stage {
        min-height: 890px;

        margin-top: clamp(-48px, -8vw, -24px);

        background-size: auto 100%;
        background-position: center top;
    }

    .livre-or-content {
        width: min(84vw, 520px);

        padding-top: 126px;
        padding-bottom: 86px;
    }

    .livre-or-head h2 {
        font-size: clamp(29px, 9vw, 43px);
    }

    .livre-or-field textarea {
        min-height: 145px;
    }

    .livre-or-button {
        width: min(100%, 330px);
    }
}


/* ============================================================
   PETITS SMARTPHONES
   ============================================================ */

@media screen and (max-width: 390px) {

    .livre-or-stage {
        min-height: 920px;
    }

    .livre-or-content {
        width: 82vw;
        padding-top: 122px;
    }

    /*
       reCAPTCHA v2 fait 304 px de large.
       On le réduit légèrement uniquement si l'écran est trop étroit.
    */
    .livre-or-recaptcha .g-recaptcha {
        transform: scale(.88);
        transform-origin: center center;
        margin: -4px -18px;
    }
}


html {
    scroll-behavior: smooth;
}


/* ============================================================
   V2.10 — PANCARTE "LAISSEZ NOUS UN MESSAGE"
   ============================================================ */

a.texte-porte {
    text-decoration: none;
    cursor: pointer;

    /*
       La V2 d'origine avait pointer-events:none car ce n'était
       qu'un texte décoratif. Le lien doit maintenant être cliquable.
    */
    pointer-events: auto;
}

a.texte-porte:hover,
a.texte-porte:focus-visible {
    color: #2f1609;
    filter: brightness(.92);
}

a.texte-porte:focus-visible {
    outline: 2px dashed rgba(63, 29, 13, .70);
    outline-offset: 2px;
}

/*
   Quand l'ancre #livre-or est utilisée, on garde une petite marge
   pour que le début du bloc message ne soit pas collé en haut
   de la fenêtre.
*/
#livre-or {
    scroll-margin-top: clamp(12px, 2vw, 30px);
}


/* ============================================================
   V2.10 — LIVRE D'OR SANS TITRE NI TEXTE D'INTRODUCTION
   ============================================================ */

.livre-or-head {
    margin-bottom: clamp(14px, 1.5vw, 22px);
}

.livre-or-head h2,
.livre-or-head > p {
    display: none;
}


/* ============================================================
   V2.10 — POSITION DU CHAMP "VOTRE MESSAGE"
   ============================================================

   Le champ de texte est volontairement séparé des deux premiers
   champs pour être placé plus bas dans la grande zone centrale
   du parchemin.

   Les dimensions utilisent clamp() :
   - PC : grand champ mais contenu dans la zone claire
   - tablette : largeur et hauteur réduites progressivement
   - smartphone : largeur quasi complète de la zone utile
   ============================================================ */

.livre-or-message-field {
    /*
       Descend le champ par rapport au bloc Nom / Lieu / Parcours.
    */
    margin-top: clamp(28px, 3.2vw, 58px);

    /*
       On réduit légèrement la largeur par rapport au formulaire global
       pour éviter que le champ touche les ornements latéraux.
    */
    width: min(92%, 860px);
    margin-left: auto;
    margin-right: auto;
}

.livre-or-message-field label {
    text-align: center;
    margin-bottom: clamp(7px, .7vw, 11px);
}

.livre-or-message-field #c-msg {
    width: 100%;

    /*
       Hauteur suffisamment importante pour écrire confortablement,
       mais limitée pour rester dans l'espace prévu du parchemin.
    */
    min-height: clamp(105px, 9vw, 145px);
    max-height: 170px;

    padding: clamp(10px, 1vw, 15px) clamp(10px, 1.2vw, 18px);

    line-height: 1.38;

    background: rgba(255, 250, 226, 0.13);

    border: 1px solid rgba(91, 54, 24, 0.22);
    border-bottom: 2px dashed rgba(98, 59, 27, 0.76);

    box-shadow:
        inset 0 0 18px rgba(102, 62, 27, 0.045);
}


/* ============================================================
   V2.10 — AJUSTEMENT DU FORMULAIRE DANS LE PARCHEMIN
   ============================================================ */

/*
   Le formulaire reste dans la partie réellement exploitable du parchemin.
   On évite ainsi les lanternes, les montants en bois et le décor supérieur.
*/
.livre-or-form {
    width: min(72vw, 920px);
}

/*
   Les champs supérieurs sont volontairement un peu plus compacts :
   cela libère de la place verticale avant la zone de message.
*/
.livre-or-row .livre-or-field {
    margin-bottom: clamp(10px, 1vw, 16px);
}

.livre-or-parcours {
    margin-bottom: clamp(8px, .8vw, 13px);
}


/* ------------------------------------------------------------
   TABLETTE
   ------------------------------------------------------------ */

@media screen and (max-width: 1024px) {

    .livre-or-form {
        width: min(76vw, 700px);
    }

    .livre-or-message-field {
        width: 94%;
        margin-top: clamp(30px, 4.2vw, 46px);
    }

    .livre-or-message-field #c-msg {
        min-height: clamp(115px, 15vw, 145px);
        max-height: 155px;
    }
}


/* ------------------------------------------------------------
   SMARTPHONE
   ------------------------------------------------------------ */

@media screen and (max-width: 768px) {

    .livre-or-form {
        width: 100%;
    }

    .livre-or-message-field {
        width: 96%;

        /*
           Le champ est descendu mais sans gaspiller trop de hauteur
           sur les petits écrans.
        */
        margin-top: clamp(22px, 7vw, 36px);
    }

    .livre-or-message-field #c-msg {
        min-height: clamp(110px, 32vw, 138px);
        max-height: 145px;

        font-size: 15px;
    }
}


/* ------------------------------------------------------------
   PETITS SMARTPHONES
   ------------------------------------------------------------ */

@media screen and (max-width: 390px) {

    .livre-or-message-field {
        width: 98%;
        margin-top: 20px;
    }

    .livre-or-message-field #c-msg {
        min-height: 108px;
        max-height: 132px;
    }
}


/* ============================================================
   V2.10 — ZONE "VOTRE MESSAGE" PLUS BASSE DANS LE PARCHEMIN
   ============================================================

   Objectif :
   - descendre davantage la zone de saisie ;
   - la rendre légèrement moins haute ;
   - conserver un rendu responsive ;
   - ne pas modifier les autres éléments du formulaire.
   ============================================================ */

/* PC */
.livre-or-message-field {
    width: min(90%, 820px);

    /*
       Décalage vertical plus important que dans la V2.4.
    */
    margin-top: clamp(58px, 5.8vw, 96px);
}

.livre-or-message-field #c-msg {
    min-height: clamp(92px, 7.5vw, 122px);
    max-height: 135px;
}


/* ------------------------------------------------------------
   TABLETTE
   ------------------------------------------------------------ */

@media screen and (max-width: 1024px) {

    .livre-or-message-field {
        width: 92%;
        margin-top: clamp(52px, 7vw, 74px);
    }

    .livre-or-message-field #c-msg {
        min-height: clamp(96px, 13vw, 118px);
        max-height: 128px;
    }
}


/* ------------------------------------------------------------
   SMARTPHONE
   ------------------------------------------------------------ */

@media screen and (max-width: 768px) {

    .livre-or-message-field {
        width: 95%;
        margin-top: clamp(42px, 11vw, 58px);
    }

    .livre-or-message-field #c-msg {
        min-height: clamp(96px, 25vw, 112px);
        max-height: 120px;
    }
}


/* ------------------------------------------------------------
   PETITS SMARTPHONES
   ------------------------------------------------------------ */

@media screen and (max-width: 390px) {

    .livre-or-message-field {
        width: 97%;
        margin-top: 38px;
    }

    .livre-or-message-field #c-msg {
        min-height: 94px;
        max-height: 108px;
    }
}


/* ============================================================
   V2.10 — FAÇADE ENTIÈREMENT VISIBLE SUR PC
   ============================================================

   facade-boutique.png = 1536 × 1024, soit un ratio 3:2.

   Sur un écran 16:9, width:100vw rend la façade plus haute que
   la fenêtre. Comme .scene possède overflow:hidden, le toit était
   alors coupé en haut.

   Sur PC :
   - on conserve le ratio exact ;
   - on utilise toute la largeur lorsque c'est possible ;
   - sur un écran large (16:9, ultrawide), la hauteur de fenêtre
     devient la limite et background-village.png apparaît sur les côtés.
   ============================================================ */

@media screen and (min-width: 1201px) {

    .facade-stage {
        width: min(100vw, 150dvh);
        aspect-ratio: 3 / 2;
        height: auto;

        left: 50%;
        top: auto;
        bottom: 0;

        transform: translateX(-50%);
    }

    /*
       Le tableau reste aligné avec le bord gauche réel de la façade
       lorsque celle-ci ne remplit pas toute la largeur d'un écran 16:9.
    */
    .tableau-stage {
        left: calc(
            (100vw - min(100vw, 150dvh)) / 2
            + clamp(-10px, -0.5vw, 0px)
        );
    }
}


/* Repli pour les navigateurs plus anciens sans unité dvh. */
@supports not (height: 100dvh) {

    @media screen and (min-width: 1201px) {

        .facade-stage {
            width: min(100vw, 150vh);
        }

        .tableau-stage {
            left: calc(
                (100vw - min(100vw, 150vh)) / 2
                + clamp(-10px, -0.5vw, 0px)
            );
        }
    }
}


/* ======================================================================
   V2.10 — LIVRE D'OR : ZONE SÛRE ET LISIBILITÉ RESPONSIVE
   ======================================================================

   But :
   - empêcher les textes de passer sur le vitrail, les lanternes,
     les montants en bois et les ornements du parchemin ;
   - conserver une zone d'écriture centrale stable ;
   - garantir une taille de texte confortable sur PC, tablette et mobile.

   Ces règles sont placées en fin de fichier afin de prendre le dessus
   sur les anciens essais V2.4 / V2.5 sans modifier le reste du site.
   ====================================================================== */


/* ----------------------------------------------------------------------
   RÉGLAGES COMMUNS
   ---------------------------------------------------------------------- */

.livre-or-stage {
    /*
       Le décor garde son comportement V2.10.
       On garantit simplement assez de hauteur pour contenir le formulaire.
    */
    min-height: clamp(790px, 55vw, 1000px);
}

.livre-or-content {
    /*
       Zone centrale volontairement plus étroite.
       Cela éloigne tous les textes des montants et lanternes.
    */
    width: min(72vw, 980px);

    margin-left: auto;
    margin-right: auto;

    /*
       Le contenu commence sous le médaillon / décor supérieur.
    */
    padding-top: clamp(220px, 15vw, 235px);
    padding-bottom: clamp(115px, 7.5vw, 150px);
}

.livre-or-form {
    width: 100%;
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
}


/* Compteur : fond discret pour rester lisible même sur une texture marquée. */
.livre-or-counter {
    padding: 8px 16px;

    background: rgba(244, 220, 174, .72);
    border: 1px solid rgba(92, 56, 25, .30);
    border-radius: 3px;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.22),
        0 2px 5px rgba(76,42,18,.08);

    color: #40250f;

    font-size: clamp(13px, .95vw, 16px);
    line-height: 1.2;
}

.livre-or-counter__number {
    font-size: 1.45em;
    font-weight: 900;
}


/* ----------------------------------------------------------------------
   CHAMPS : contraste renforcé
   ---------------------------------------------------------------------- */

.livre-or-field {
    margin-bottom: clamp(12px, 1vw, 17px);
}

.livre-or-field label {
    margin-bottom: 6px;

    color: #35200d;

    font-size: clamp(14px, .95vw, 17px);
    line-height: 1.2;
    font-weight: 800;

    text-shadow: 0 1px rgba(255, 239, 202, .72);
}

.livre-or-field input,
.livre-or-field textarea,
.livre-or-field select {
    width: 100%;

    padding:
        clamp(10px, .8vw, 13px)
        clamp(10px, 1vw, 15px);

    /*
       Le fond n'est plus quasi transparent :
       la texture du parchemin reste visible mais ne gêne plus la lecture.
    */
    background: rgba(248, 229, 190, .74);

    border: 1px solid rgba(91, 54, 24, .30);
    border-bottom: 2px dashed rgba(82, 47, 20, .78);

    color: #25170b;

    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.3;

    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.32),
        inset 0 0 12px rgba(94,54,21,.05);
}

.livre-or-field input:focus,
.livre-or-field textarea:focus,
.livre-or-field select:focus {
    background: rgba(252, 238, 207, .90);
    border-color: rgba(74, 40, 16, .58);
    border-bottom-style: solid;

    box-shadow:
        0 0 0 2px rgba(121, 75, 32, .10),
        inset 0 1px 0 rgba(255,255,255,.38);
}

.livre-or-field input::placeholder,
.livre-or-field textarea::placeholder {
    color: rgba(55, 34, 16, .60);
}


/* ----------------------------------------------------------------------
   PREMIÈRE LIGNE : reste dans la zone claire
   ---------------------------------------------------------------------- */

.livre-or-row {
    width: 100%;
    gap: clamp(16px, 1.4vw, 24px);
}


/* ----------------------------------------------------------------------
   CHAMP "VOTRE MESSAGE"
   ---------------------------------------------------------------------- */

.livre-or-message-field {
    /*
       Il reste plus bas que les autres champs, mais sans être repoussé
       jusque dans le décor inférieur.
    */
    width: min(88%, 800px);

    margin-top: clamp(30px, 2.8vw, 46px);
    margin-left: auto;
    margin-right: auto;
}

.livre-or-message-field label {
    text-align: center;
}

.livre-or-message-field #c-msg {
    min-height: clamp(105px, 7vw, 128px);
    max-height: 145px;

    resize: vertical;
}


/* ----------------------------------------------------------------------
   ÉLÉMENTS BAS DU FORMULAIRE
   ---------------------------------------------------------------------- */

.livre-or-recaptcha {
    margin-top: 14px;
    margin-bottom: 14px;
}

.livre-or-button {
    font-size: clamp(14px, .9vw, 16px);
}

.livre-or-note {
    max-width: 680px;

    margin-top: 10px;

    padding: 6px 10px;

    background: rgba(244, 220, 174, .46);

    color: #4c2e15;

    font-size: clamp(12px, .78vw, 14px);
    line-height: 1.4;
}


/* ======================================================================
   TABLETTE
   ====================================================================== */

@media screen and (max-width: 1024px) {

    .livre-or-stage {
        /*
           Plus de hauteur car Nom et Lieu passent l'un sous l'autre.
        */
        min-height: 980px;
    }

    .livre-or-content {
        /*
           La zone est volontairement resserrée pour rester au centre
           du parchemin malgré le recadrage latéral du décor.
        */
        width: min(76vw, 700px);

        padding-top: 230px;
        padding-bottom: 110px;
    }

    .livre-or-form {
        width: 100%;
        max-width: 680px;
    }

    .livre-or-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .livre-or-field {
        margin-bottom: 12px;
    }

    .livre-or-field label {
        font-size: 15px;
    }

    .livre-or-field input,
    .livre-or-field textarea,
    .livre-or-field select {
        font-size: 16px;
    }

    .livre-or-message-field {
        width: 92%;
        margin-top: 30px;
    }

    .livre-or-message-field #c-msg {
        min-height: 112px;
        max-height: 135px;
    }
}


/* ======================================================================
   SMARTPHONE
   ====================================================================== */

@media screen and (max-width: 768px) {

    .livre-or-stage {
        /*
           La hauteur supplémentaire permet de garder le bouton / la note
           au-dessus de l'ornement inférieur.
        */
        min-height: 1010px;
    }

    .livre-or-content {
        /*
           Centre la totalité des textes dans la vraie zone de parchemin.
           80vw laisse une marge visuelle nette de chaque côté.
        */
        width: min(80vw, 470px);

        padding-top: 235px;
        padding-bottom: 115px;
    }

    .livre-or-head {
        margin-bottom: 16px;
    }

    .livre-or-counter {
        max-width: 100%;

        padding: 7px 10px;

        font-size: 13px;

        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    .livre-or-form {
        width: 100%;
        max-width: none;
    }

    .livre-or-field {
        margin-bottom: 11px;
    }

    .livre-or-field label {
        font-size: 14px;
    }

    /*
       16px minimum évite également le zoom automatique d'iOS Safari
       lorsqu'un champ reçoit le focus.
    */
    .livre-or-field input,
    .livre-or-field textarea,
    .livre-or-field select {
        padding: 10px 9px;

        font-size: 16px;
        line-height: 1.28;
    }

    .poiz-hint {
        font-size: 12px;
        line-height: 1.25;
    }

    .livre-or-message-field {
        width: 94%;
        margin-top: 26px;
    }

    .livre-or-message-field #c-msg {
        min-height: 108px;
        max-height: 128px;
    }

    .livre-or-button {
        width: min(100%, 310px);

        min-height: 47px;

        padding: 12px 14px;

        font-size: 14px;
    }

    .livre-or-note {
        width: 96%;

        font-size: 12px;
        line-height: 1.32;
    }
}


/* ======================================================================
   PETITS SMARTPHONES
   ====================================================================== */

@media screen and (max-width: 390px) {

    .livre-or-stage {
        min-height: 1030px;
    }

    .livre-or-content {
        width: 78vw;

        padding-top: 240px;
        padding-bottom: 118px;
    }

    .livre-or-counter {
        font-size: 12px;
    }

    .livre-or-message-field {
        width: 96%;
        margin-top: 24px;
    }

    .livre-or-message-field #c-msg {
        min-height: 104px;
        max-height: 120px;
    }

    /*
       Le reCAPTCHA standard mesure 304 px.
       Ajustement uniquement quand la zone utile est plus étroite.
    */
    .livre-or-recaptcha .g-recaptcha {
        transform: scale(.82);
        transform-origin: center center;

        margin: -7px -28px;
    }
}


/* ======================================================================
   V2.10 — PLANCHES EN BOIS DERRIÈRE "fond message.png"
   ======================================================================

   Ajout d'une texture de planches verticales derrière le parchemin.
   Principe :
   - 1er calque : fond message.png
   - 2e calque : planches-bois.png
   - la texture bois se répète horizontalement selon la largeur écran
   - le parchemin reste au-dessus
   ====================================================================== */

.livre-or-stage {
    background-image:
        url("/assets/fond message.webp"),
        url("/assets/planche.webp");
    background-repeat:
        no-repeat,
        repeat-x;
    background-position:
        center top,
        center top;
    background-size:
        cover,
        auto 100%;

    /*
       Teinte de secours si l'image bois n'est pas encore copiée.
    */
    background-color: #8b5b2e;
}


/* ----------------------------------------------------------------------
   TABLETTE
   ---------------------------------------------------------------------- */

@media screen and (max-width: 1024px) {
    .livre-or-stage {
        background-size:
            cover,
            auto 100%;
    }
}


/* ----------------------------------------------------------------------
   SMARTPHONE
   ---------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    .livre-or-stage {
        background-size:
            cover,
            auto 100%;
    }
}


/* ======================================================================
   V2.10 — PLANCHE.PNG DERRIÈRE FOND MESSAGE.PNG
   ======================================================================

   Ordre des calques du bloc message :
   1. fond message.png (au-dessus)
   2. planche.png (en dessous, répétée horizontalement)

   La planche est une texture verticale destinée à être dupliquée
   selon la largeur de l'écran.
   ====================================================================== */

.livre-or-stage {
    background-image:
        url("/assets/fond message.webp"),
        url("/assets/planche.webp");

    background-repeat:
        no-repeat,
        repeat-x;

    background-position:
        center top,
        center top;

    background-size:
        cover,
        auto 100%;

    background-color: #8b5b2e;
}


/* ======================================================================
   V2.10 — ORDRE EXACT DES PLANS
   ======================================================================

   Du PREMIER PLAN vers l'ARRIÈRE-PLAN :

   1. fond message.png
   2. facade-boutique.png + tableau / textes de façade
   3. planche.png
   4. background-village.png

   Important :
   fond message.png et planche.png ne sont plus deux backgrounds du même
   calque. Ils sont séparés avec ::before et ::after afin que la façade
   puisse réellement passer ENTRE les deux.
   ====================================================================== */


/* ----------------------------------------------------------------------
   ARRIÈRE-PLAN GLOBAL : VILLAGE
   ---------------------------------------------------------------------- */

.livre-or-section {
    /*
       Le village est le dernier plan.
    */
    z-index: auto;

    background-image: url("/assets/background-village.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
}


/* ----------------------------------------------------------------------
   CONTENEUR DU LIVRE D'OR
   ---------------------------------------------------------------------- */

.livre-or-stage {
    position: relative;

    /*
       IMPORTANT :
       pas de z-index ni de transform ici, sinon on créerait un contexte
       d'empilement qui empêcherait les calques de passer autour de la façade.
    */
    z-index: auto;

    width: 100vw;
    margin-left: 0;

    /*
       L'ancien translateX créait lui aussi un contexte d'empilement.
       Avec 100vw il n'est pas nécessaire.
    */
    transform: none;

    /*
       On retire les anciens backgrounds du bloc lui-même.
       Ils sont maintenant portés par ::before et ::after.
    */
    background-image: none !important;
    background-color: transparent;
}


/* ----------------------------------------------------------------------
   PLAN 3 : PLANCHES EN BOIS
   ---------------------------------------------------------------------- */

.livre-or-stage::before {
    content: "";

    position: absolute;
    z-index: 10;

    inset: 0;

    /*
       Une texture verticale répétée horizontalement sur toute
       la largeur du viewport.
    */
    background-image: url("/assets/planche.webp");
    background-repeat: repeat-x;
    background-position: center top;
    background-size: auto 100%;

    pointer-events: none;
}


/* ----------------------------------------------------------------------
   PLAN 2 : FAÇADE
   ---------------------------------------------------------------------- */

/*
   Seule la façade passe au-dessus des planches.
   Le background-village de .scene n'est donc pas remonté avec elle.
*/
.facade-stage {
    z-index: 20;
}

/*
   Le tableau fait visuellement partie du premier bloc / de la façade.
*/
.tableau-stage {
    z-index: 21;
}


/* ----------------------------------------------------------------------
   PLAN 1 : FOND MESSAGE
   ---------------------------------------------------------------------- */

.livre-or-stage::after {
    content: "";

    position: absolute;
    z-index: 30;

    inset: 0;

    background-image: url("/assets/fond message.webp");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;

    /*
       Le PNG possède des transparences :
       dans ces zones, on voit donc successivement la façade,
       puis les planches, puis le village.
    */
    pointer-events: none;
}


/* ----------------------------------------------------------------------
   CONTENU DU FORMULAIRE
   Toujours au-dessus du décor fond message.png.
   ---------------------------------------------------------------------- */

.livre-or-content {
    position: relative;
    z-index: 40;
}


/* ----------------------------------------------------------------------
   TABLETTE / SMARTPHONE
   On conserve le même ordre des plans.
   ---------------------------------------------------------------------- */

@media screen and (max-width: 1024px) {

    .livre-or-stage::before {
        background-size: auto 100%;
        background-position: center top;
    }

    .livre-or-stage::after {
        background-size: cover;
        background-position: center top;
    }
}

@media screen and (max-width: 768px) {

    .livre-or-stage::before {
        background-size: auto 100%;
    }

    .livre-or-stage::after {
        background-size: cover;
    }
}


/* ======================================================================
   V2.10 — PLANCHES D'ARRIÈRE-PLAN À 50 %
   ======================================================================

   On conserve strictement l'ordre des calques V2.10 :
   1. fond message.png
   2. facade-boutique.png
   3. planche.png
   4. background-village.png

   Modification :
   - planche.png est affichée à 50 % de sa taille précédente ;
   - elle est répétée horizontalement ET verticalement afin de couvrir
     toute la zone sans laisser d'espace vide.
   ====================================================================== */

.livre-or-stage::before {
    background-image: url("/assets/planche.webp");

    /*
       À la V2.10 :
       background-size: auto 100%;

       Maintenant :
       hauteur du motif = 50 % de la hauteur du bloc.
       La largeur suit automatiquement le ratio de l'image.
    */
    background-size: auto 50%;

    /*
       Comme l'image ne fait plus toute la hauteur, on la duplique dans
       les deux directions pour remplir totalement l'arrière-plan.
    */
    background-repeat: repeat;

    background-position: left top;
}


/* ----------------------------------------------------------------------
   TABLETTE
   ---------------------------------------------------------------------- */

@media screen and (max-width: 1024px) {
    .livre-or-stage::before {
        background-size: auto 50%;
        background-repeat: repeat;
        background-position: left top;
    }
}


/* ----------------------------------------------------------------------
   SMARTPHONE
   ---------------------------------------------------------------------- */

@media screen and (max-width: 768px) {
    .livre-or-stage::before {
        background-size: auto 50%;
        background-repeat: repeat;
        background-position: left top;
    }
}


/* ======================================================================
   V2.10 — MUR DES MESSAGES / POST-IT
   ======================================================================

   Ce nouveau bloc vient APRÈS le formulaire V2.5 figé.
   Le formulaire existant n'est pas modifié.

   Fond :
   - planche.png répétée sur toute la surface.

   Responsive :
   - PC large : 3 Post-it par ligne
   - tablette : 2
   - smartphone : 1
   ====================================================================== */

.messages-wall {
    position: relative;
    z-index: 5;

    width: 100%;
    margin: 0;
    padding: clamp(54px, 6vw, 96px) clamp(18px, 4vw, 64px)
             clamp(70px, 7vw, 110px);

    /*
       Une texture de bois suffisamment petite pour donner l'impression
       d'un véritable mur de planches et répétée dans les deux directions.
    */
    background-color: #8a582d;
    background-image: url("/assets/planche.webp");
    background-repeat: repeat;
    background-position: left top;
    background-size: clamp(230px, 18vw, 340px) auto;

    box-shadow:
        inset 0 22px 34px rgba(45, 22, 7, .20),
        inset 0 -18px 30px rgba(45, 22, 7, .18);
}

.messages-wall__inner {
    width: min(1500px, 100%);
    margin: 0 auto;
}

.messages-wall__head {
    max-width: 720px;
    margin: 0 auto clamp(42px, 4vw, 64px);

    padding: 16px 22px;

    text-align: center;

    color: #f5dfb5;

    background: rgba(53, 28, 12, .62);

    border: 1px solid rgba(224, 175, 101, .36);
    border-radius: 4px;

    box-shadow:
        0 7px 15px rgba(38, 18, 5, .28),
        inset 0 1px rgba(255, 255, 255, .08);

    text-shadow: 0 2px 2px rgba(34, 16, 5, .75);
}

.messages-wall__head h2 {
    margin: 0 0 5px;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(28px, 2.7vw, 46px);
    line-height: 1;

    color: #ffe7b7;
}

.messages-wall__head p {
    margin: 0;

    font-size: clamp(13px, 1vw, 16px);
    line-height: 1.35;
}


/* ----------------------------------------------------------------------
   GRILLE
   ---------------------------------------------------------------------- */

.postit-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    align-items: start;

    gap:
        clamp(38px, 4vw, 68px)
        clamp(28px, 3.3vw, 58px);

    width: 100%;
}


/* ----------------------------------------------------------------------
   POST-IT
   ---------------------------------------------------------------------- */

.message-postit {
    --postit-rotation: -1deg;
    --postit-offset: 0px;
    --postit-paper: #f4e29b;

    position: relative;

    min-width: 0;
    min-height: clamp(235px, 20vw, 310px);

    padding:
        clamp(42px, 3.5vw, 58px)
        clamp(22px, 2.2vw, 34px)
        clamp(24px, 2.3vw, 36px);

    transform:
        translateY(var(--postit-offset))
        rotate(var(--postit-rotation));

    transform-origin: 50% 7%;

    color: #342515;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.21),
            transparent 30%
        ),
        var(--postit-paper);

    border: 1px solid rgba(114, 83, 31, .20);

    box-shadow:
        7px 10px 16px rgba(38, 20, 8, .30),
        inset 0 0 25px rgba(126, 89, 31, .06);

    /*
       Les textes très longs restent contenus.
    */
    overflow-wrap: anywhere;

    transition:
        transform .18s ease,
        box-shadow .18s ease;
}

.message-postit:hover {
    transform:
        translateY(calc(var(--postit-offset) - 4px))
        rotate(calc(var(--postit-rotation) * .45));

    box-shadow:
        9px 14px 22px rgba(38, 20, 8, .36),
        inset 0 0 25px rgba(126, 89, 31, .06);
}


/* Papier légèrement irrégulier en bas */
.message-postit::after {
    content: "";

    position: absolute;

    left: 3%;
    right: 3%;
    bottom: -5px;

    height: 8px;

    background: inherit;

    clip-path: polygon(
        0 0,
        7% 45%,
        15% 10%,
        25% 62%,
        36% 18%,
        48% 70%,
        60% 20%,
        72% 56%,
        83% 12%,
        92% 50%,
        100% 8%,
        100% 100%,
        0 100%
    );

    opacity: .82;
}


/* ----------------------------------------------------------------------
   PUNAISE
   ---------------------------------------------------------------------- */

.message-postit__pin {
    position: absolute;
    z-index: 3;

    top: 10px;
    left: 50%;

    width: clamp(17px, 1.45vw, 23px);
    aspect-ratio: 1;

    transform: translateX(-50%);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 28%,
            #ffd995 0 12%,
            #c96f3d 30%,
            #7e301c 72%,
            #4e190d 100%
        );

    border: 1px solid rgba(70, 24, 12, .65);

    box-shadow:
        1px 3px 4px rgba(39, 17, 7, .42),
        inset 1px 1px rgba(255, 228, 175, .60);
}

.message-postit__pin::after {
    content: "";

    position: absolute;

    left: 50%;
    top: 78%;

    width: 2px;
    height: 10px;

    transform: translateX(-50%) rotate(5deg);

    background: rgba(59, 43, 32, .74);

    box-shadow: 1px 1px 1px rgba(255,255,255,.18);
}


/* ----------------------------------------------------------------------
   TEXTE DU POST-IT
   ---------------------------------------------------------------------- */

.message-postit__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;

    gap: 5px 12px;

    margin-bottom: 15px;

    padding-bottom: 8px;

    border-bottom: 1px dashed rgba(84, 59, 25, .26);
}

.message-postit__author {
    min-width: 0;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(19px, 1.55vw, 25px);
    line-height: 1.08;

    color: #342112;
}

.message-postit__date {
    flex: 0 0 auto;

    color: rgba(67, 49, 26, .70);

    font-size: clamp(10px, .78vw, 12px);
    font-style: italic;
}

.message-postit__text {
    white-space: pre-wrap;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Comic Sans MS",
        cursive;

    font-size: clamp(16px, 1.22vw, 20px);
    line-height: 1.45;

    color: #302317;
}

.message-postit__spot {
    margin-top: 18px;
    padding-top: 8px;

    border-top: 1px dashed rgba(84, 59, 25, .22);

    color: rgba(68, 46, 21, .78);

    font-size: clamp(11px, .82vw, 13px);
    line-height: 1.3;
}


/* ----------------------------------------------------------------------
   VARIATIONS POUR ÉVITER UN ASPECT TROP RÉGULIER
   ---------------------------------------------------------------------- */

.message-postit[data-variant="1"] {
    --postit-rotation: -1.8deg;
    --postit-offset: 4px;
    --postit-paper: #f4e29b;
}

.message-postit[data-variant="2"] {
    --postit-rotation: 1.3deg;
    --postit-offset: -4px;
    --postit-paper: #f1dca0;
}

.message-postit[data-variant="3"] {
    --postit-rotation: -.6deg;
    --postit-offset: 8px;
    --postit-paper: #f6e8af;
}

.message-postit[data-variant="4"] {
    --postit-rotation: 1.8deg;
    --postit-offset: 2px;
    --postit-paper: #ead8a0;
}

.message-postit[data-variant="5"] {
    --postit-rotation: -1.2deg;
    --postit-offset: -5px;
    --postit-paper: #f6e3a2;
}

.message-postit[data-variant="6"] {
    --postit-rotation: .7deg;
    --postit-offset: 6px;
    --postit-paper: #efe0aa;
}


/* ----------------------------------------------------------------------
   CHARGEMENT / ERREUR / AUCUN MESSAGE
   ---------------------------------------------------------------------- */

.postit-loading,
.postit-empty,
.postit-error {
    grid-column: 1 / -1;

    max-width: 620px;
    margin: 0 auto;

    padding: 28px 32px;

    text-align: center;

    color: #f3dbad;

    background: rgba(52, 28, 12, .68);

    border: 1px solid rgba(220, 169, 93, .30);

    box-shadow: 0 7px 15px rgba(38, 18, 5, .24);

    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.45;
}


/* ----------------------------------------------------------------------
   BOUTON "AFFICHER PLUS"
   ---------------------------------------------------------------------- */

.messages-wall__actions {
    display: flex;
    justify-content: center;

    margin-top: clamp(46px, 5vw, 76px);
}

.messages-more {
    min-height: 48px;

    padding: 12px 24px;

    border: 2px solid #32190a;
    outline: 1px solid #d7a35e;
    outline-offset: -6px;

    background:
        linear-gradient(
            180deg,
            #a9652b 0%,
            #754019 60%,
            #4b250f 100%
        );

    color: #ffe6b6;

    font: 800 clamp(13px, .9vw, 15px) Georgia, serif;
    text-transform: uppercase;
    letter-spacing: .4px;

    cursor: pointer;

    box-shadow: 0 6px 13px rgba(37, 17, 5, .33);
}

.messages-more:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}

.messages-more:disabled {
    opacity: .5;
    cursor: wait;
    transform: none;
}


/* ======================================================================
   TABLETTE
   ====================================================================== */

@media screen and (max-width: 1024px) {

    .messages-wall {
        padding-inline: clamp(18px, 4vw, 38px);

        background-size: clamp(210px, 28vw, 300px) auto;
    }

    .postit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 46px clamp(24px, 4vw, 42px);
    }

    .message-postit {
        min-height: 245px;

        padding: 46px 25px 28px;
    }

    .message-postit__author {
        font-size: clamp(20px, 2.4vw, 24px);
    }

    .message-postit__text {
        font-size: clamp(16px, 1.9vw, 19px);
    }
}


/* ======================================================================
   SMARTPHONE
   ====================================================================== */

@media screen and (max-width: 680px) {

    .messages-wall {
        padding:
            48px
            clamp(18px, 6vw, 28px)
            70px;

        background-size: clamp(180px, 52vw, 250px) auto;
    }

    .messages-wall__head {
        margin-bottom: 40px;
        padding: 14px 16px;
    }

    .messages-wall__head h2 {
        font-size: clamp(28px, 9vw, 39px);
    }

    .postit-grid {
        grid-template-columns: 1fr;

        gap: 42px;
    }

    .message-postit {
        /*
           Les rotations sont réduites sur téléphone afin que le Post-it
           ne déborde jamais de l'écran.
        */
        width: min(100%, 470px);
        min-height: 220px;

        margin-inline: auto;

        padding: 44px 22px 27px;

        transform:
            translateY(calc(var(--postit-offset) * .35))
            rotate(calc(var(--postit-rotation) * .45));
    }

    .message-postit:hover {
        transform:
            translateY(-2px)
            rotate(0deg);
    }

    .message-postit__head {
        margin-bottom: 13px;
    }

    .message-postit__author {
        font-size: clamp(20px, 6.2vw, 25px);
    }

    .message-postit__date {
        font-size: 11px;
    }

    .message-postit__text {
        font-size: 17px;
        line-height: 1.42;
    }

    .message-postit__spot {
        font-size: 12px;
    }

    .messages-wall__actions {
        margin-top: 48px;
    }

    .messages-more {
        width: min(100%, 330px);
    }
}


/* ======================================================================
   V2.10 — MÊME ÉCHELLE DE PLANCHES DANS LES DEUX BLOCS
   ======================================================================

   Dans le bloc formulaire précédent, planche.png est affichée à 50 %
   de la hauteur du bloc.

   Le mur de messages peut devenir beaucoup plus haut selon le nombre
   de Post-it. Utiliser "50%" directement sur le mur ferait donc grossir
   progressivement la texture.

   On reprend ici la hauteur VISUELLE correspondant à 50 % du bloc
   précédent, avec les mêmes adaptations PC / tablette / smartphone.
   ====================================================================== */

/* PC : moitié du bloc précédent
   .livre-or-stage = clamp(790px, 55vw, 1000px)
   => planche ≈ clamp(395px, 27.5vw, 500px)
*/
.messages-wall {
    background-image: url("/assets/planche.webp");
    background-repeat: repeat;
    background-position: left top;
    background-size: auto clamp(395px, 27.5vw, 500px);
}


/* Tablette : le bloc précédent est autour de 980px de haut,
   donc une planche à 50 % correspond à environ 490px. */
@media screen and (max-width: 1024px) {
    .messages-wall {
        background-size: auto 490px;
        background-repeat: repeat;
        background-position: left top;
    }
}


/* Smartphone : le bloc précédent est autour de 1010px,
   donc environ 505px pour la texture à 50 %. */
@media screen and (max-width: 768px) {
    .messages-wall {
        background-size: auto 505px;
        background-repeat: repeat;
        background-position: left top;
    }
}


/* Petit smartphone : V2.5 utilise environ 1030px de hauteur,
   soit environ 515px à 50 %. */
@media screen and (max-width: 390px) {
    .messages-wall {
        background-size: auto 515px;
    }
}


/* ======================================================================
   V2.10 — PANNEAUX DE BOIS EMPILÉS AUTOMATIQUEMENT
   ======================================================================

   Principe demandé :
   - chaque panneau utilise réellement :
         background-size: auto 50%;
   - donc deux motifs planche.png par panneau ;
   - la hauteur d'un panneau reste fixe pour une catégorie d'écran ;
   - si le mur grandit, JavaScript ajoute un autre panneau en dessous.

   Résultat :
   les planches NE grossissent PAS quand le nombre de messages augmente.
   ====================================================================== */


/* ----------------------------------------------------------------------
   MUR GLOBAL
   ---------------------------------------------------------------------- */

.messages-wall {
    /*
       Hauteur de référence d'un panneau bois.
       Elle reprend la hauteur du bloc message précédent.
    */
    --messages-wood-panel-height: 900px;

    position: relative;
    isolation: isolate;

    /*
       On enlève la texture directement appliquée au mur.
       Elle est maintenant gérée par les panneaux dynamiques.
    */
    background-image: none !important;
    background-color: #8a582d;

    overflow: hidden;
}


/* ----------------------------------------------------------------------
   CALQUE BOIS
   ---------------------------------------------------------------------- */

.messages-wall__wood {
    position: absolute;
    z-index: 0;

    inset: 0;

    width: 100%;
    min-height: 100%;

    pointer-events: none;
}


/*
   Chaque panneau est une tranche verticale indépendante.
   C'est ici qu'on utilise exactement background-size: auto 50%.
*/
.messages-wall__wood-panel {
    width: 100%;
    height: var(--messages-wood-panel-height);

    flex: 0 0 var(--messages-wood-panel-height);

    background-image: url("/assets/planche.webp");
    background-repeat: repeat;
    background-position: left top;
    background-size: auto 50%;
}


/*
   Les panneaux doivent se suivre verticalement sans espace.
*/
.messages-wall__wood {
    display: flex;
    flex-direction: column;
}


/* ----------------------------------------------------------------------
   CONTENU AU-DESSUS DU BOIS
   ---------------------------------------------------------------------- */

.messages-wall__inner {
    position: relative;
    z-index: 2;
}


/* Légère ombre générale par-dessus les panneaux */
.messages-wall::after {
    content: "";

    position: absolute;
    z-index: 1;

    inset: 0;

    pointer-events: none;

    box-shadow:
        inset 0 22px 34px rgba(45, 22, 7, .20),
        inset 0 -18px 30px rgba(45, 22, 7, .18);
}


/* ======================================================================
   PC
   ====================================================================== */

/*
   Le bloc message précédent utilisait approximativement :
   min-height: clamp(790px, 55vw, 1000px)

   On reprend cette hauteur comme hauteur d'un panneau.
*/
@media screen and (min-width: 1025px) {
    .messages-wall {
        --messages-wood-panel-height: clamp(790px, 55vw, 1000px);
    }
}


/* ======================================================================
   TABLETTE
   ====================================================================== */

@media screen and (max-width: 1024px) {
    .messages-wall {
        --messages-wood-panel-height: 980px;
    }
}


/* ======================================================================
   SMARTPHONE
   ====================================================================== */

@media screen and (max-width: 768px) {
    .messages-wall {
        --messages-wood-panel-height: 1010px;
    }
}


/* ======================================================================
   PETIT SMARTPHONE
   ====================================================================== */

@media screen and (max-width: 390px) {
    .messages-wall {
        --messages-wood-panel-height: 1030px;
    }
}


/* ======================================================================
   V2.10 — SYNCHRONISATION EXACTE DES PLANCHES SUR PC
   ======================================================================

   Problème :
   Dans le bloc formulaire :
       background-size: auto 50%;

   Le 50 % est calculé à partir de la hauteur RÉELLE de .livre-or-stage.
   Cette hauteur peut être légèrement supérieure à son min-height selon
   le formulaire, le reCAPTCHA, les polices, etc.

   Dans le mur des messages, une hauteur de référence fixe créait donc
   quelques pixels de différence visibles entre les deux blocs.

   Correction PC :
   JavaScript mesure la hauteur réellement rendue de .livre-or-stage.
   Puis :
       taille d'un motif = hauteur réelle / 2
       hauteur d'un panneau = hauteur réelle

   Les deux blocs utilisent alors exactement la même échelle.
   ====================================================================== */

@media screen and (min-width: 1025px) {

    .messages-wall {
        /*
           Valeurs de secours avant que JavaScript ne fasse la mesure.
        */
        --desktop-wood-tile-height: clamp(395px, 27.5vw, 500px);
        --desktop-wood-panel-height: clamp(790px, 55vw, 1000px);

        --messages-wood-panel-height: var(--desktop-wood-panel-height);
    }

    .messages-wall__wood-panel {
        height: var(--desktop-wood-panel-height);
        flex-basis: var(--desktop-wood-panel-height);

        /*
           Taille exacte de planche.png mesurée depuis le bloc précédent.
        */
        background-size: auto var(--desktop-wood-tile-height);
        background-repeat: repeat;
        background-position: left top;
    }
}


/* Tablette / smartphone :
   on garde les réglages V2.8 validés. */
@media screen and (max-width: 1024px) {

    .messages-wall__wood-panel {
        background-size: auto 50%;
    }
}


/* ======================================================================
   V2.10 — BLOC "AFFICHAGE DES MESSAGES" REMONTÉ AU MAXIMUM
   ======================================================================

   Le fond bois et les Post-it restent inchangés.
   On retire presque tout l'espace supérieur afin que les écritures
   commencent immédiatement au début du nouveau bloc.
   ====================================================================== */

.messages-wall {
    /*
       Ancien réglage : clamp(54px, 6vw, 96px)
       Nouveau réglage : seulement quelques pixels de respiration.
    */
    padding-top: 6px !important;
}

.messages-wall__inner {
    padding-top: 0 !important;
}

.messages-wall__head {
    margin-top: 0 !important;
    margin-bottom: clamp(16px, 1.6vw, 24px) !important;

    /*
       Titre plus compact pour libérer au maximum la partie haute.
    */
    padding: 8px 16px !important;
}

.messages-wall__head h2 {
    margin-top: 0 !important;
    margin-bottom: 2px !important;
}

.messages-wall__head p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}


/* Tablette */
@media screen and (max-width: 1024px) {
    .messages-wall {
        padding-top: 5px !important;
    }

    .messages-wall__head {
        margin-bottom: 16px !important;
        padding: 7px 14px !important;
    }
}


/* Smartphone */
@media screen and (max-width: 680px) {
    .messages-wall {
        padding-top: 4px !important;
    }

    .messages-wall__head {
        margin-bottom: 14px !important;
        padding: 7px 12px !important;
    }
}


/* ======================================================================
   V2.10 — PIED DE PAGE
   ====================================================================== */

.site-footer {
    position: relative;
    z-index: 6;

    width: 100%;

    padding:
        clamp(24px, 3.2vw, 46px)
        clamp(18px, 4vw, 58px)
        clamp(28px, 3.5vw, 52px);

    color: #f3ddb2;

    background:
        linear-gradient(
            rgba(45, 22, 8, .80),
            rgba(45, 22, 8, .88)
        ),
        url("/assets/planche.webp");

    background-repeat:
        no-repeat,
        repeat;

    background-position:
        center,
        left top;

    background-size:
        cover,
        auto 50%;

    border-top: 2px solid rgba(232, 183, 108, .28);

    box-shadow:
        inset 0 15px 28px rgba(20, 9, 3, .28),
        0 -4px 14px rgba(35, 17, 5, .18);

    text-align: center;
}

.site-footer__inner {
    width: min(1050px, 100%);
    margin: 0 auto;
}

.site-footer__signature {
    margin: 0 auto 13px;

    max-width: 950px;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(12px, .95vw, 15px);
    line-height: 1.55;

    color: #f2d7a2;

    text-shadow: 0 2px 2px rgba(34, 15, 4, .80);
}

.site-footer__signature span {
    display: inline-block;
    margin: 0 .35em;

    color: #c9944c;
}

.site-footer__legal-link {
    display: inline-block;

    padding: 7px 13px;

    color: #ffe4ad;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(12px, .9vw, 15px);
    font-weight: 700;

    text-decoration: none;

    border-bottom: 1px dashed rgba(255, 220, 157, .70);
}

.site-footer__legal-link:hover,
.site-footer__legal-link:focus-visible {
    color: #fff4d3;
    border-bottom-style: solid;
    outline: none;
}


/* ======================================================================
   PAGE MENTIONS LÉGALES — DESIGN LES VIEUX CHATS
   ====================================================================== */

body.legal-page {
    position: relative;
    isolation: isolate;

    min-height: 100vh;
    min-height: 100dvh;

    margin: 0;

    color: #35210f;
    background: #805027;

    font-family: Georgia, "Times New Roman", serif;
}

/*
 * Fond pleine fenêtre des Mentions légales.
 *
 * Le calque reste toujours exactement à la taille de l'écran.
 * planche.webp est répétée horizontalement ET verticalement.
 *
 * Taille des tuiles :
 * - smartphone ~ 190 à 215 px de large ;
 * - tablette ~ 380 px ;
 * - grand écran : maximum 520 px.
 *
 * Cela garantit plusieurs répétitions sur toute la largeur ainsi que
 * suffisamment de répétitions en hauteur, indépendamment de la longueur
 * du document.
 */
body.legal-page::before {
    content: "";

    position: fixed;
    z-index: 0;

    inset: 0;

    width: 100vw;
    height: 100vh;
    height: 100dvh;

    pointer-events: none;

    background-color: #805027;
    background-image:
        linear-gradient(
            rgba(72, 39, 15, .16),
            rgba(48, 23, 7, .26)
        ),
        url("/assets/planche.webp");

    background-repeat:
        no-repeat,
        repeat;

    background-position:
        center,
        left top;

    background-size:
        100% 100%,
        clamp(190px, 50vw, 520px) auto;
}

/*
 * Tout le contenu légal passe devant le fond fixe.
 */
body.legal-page > .legal-shell {
    position: relative;
    z-index: 1;
}

.legal-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;

    padding:
        clamp(26px, 4vw, 60px)
        0
        clamp(52px, 7vw, 94px);
}

.legal-topbar {
    display: flex;
    justify-content: flex-start;

    margin-bottom: clamp(20px, 3vw, 38px);
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    min-height: 42px;

    padding: 9px 16px;

    color: #ffe6b6;

    background:
        linear-gradient(
            180deg,
            #a9652b 0%,
            #754019 60%,
            #4b250f 100%
        );

    border: 2px solid #32190a;
    outline: 1px solid rgba(230, 178, 102, .80);
    outline-offset: -6px;

    box-shadow: 0 6px 13px rgba(37, 17, 5, .33);

    text-decoration: none;

    font-weight: 800;
    font-size: clamp(12px, .9vw, 15px);
}

.legal-back:hover,
.legal-back:focus-visible {
    filter: brightness(1.10);
    outline-offset: -6px;
}

.legal-title-board {
    position: relative;

    max-width: 850px;

    margin: 0 auto clamp(25px, 4vw, 48px);

    padding:
        clamp(25px, 3vw, 38px)
        clamp(20px, 4vw, 50px);

    text-align: center;

    background:
        linear-gradient(
            180deg,
            rgba(109, 63, 25, .95),
            rgba(68, 34, 13, .97)
        );

    border: 5px solid #3d210e;
    outline: 2px solid #ba7c38;
    outline-offset: -10px;

    box-shadow:
        0 14px 28px rgba(35, 16, 4, .40),
        inset 0 0 18px rgba(255, 207, 121, .08);

    transform: rotate(-.35deg);
}

.legal-title-board::before,
.legal-title-board::after {
    content: "";

    position: absolute;

    top: -10px;

    width: 15px;
    height: 15px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 28%,
            #ffd995 0 12%,
            #c96f3d 30%,
            #7e301c 72%,
            #4e190d 100%
        );

    box-shadow: 1px 3px 4px rgba(39, 17, 7, .42);
}

.legal-title-board::before {
    left: 10%;
}

.legal-title-board::after {
    right: 10%;
}

.legal-title-board h1 {
    margin: 0 0 9px;

    color: #ffe5ae;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(31px, 4.3vw, 60px);
    line-height: 1.03;

    text-shadow: 0 3px 3px rgba(38, 16, 4, .75);
}

.legal-title-board p {
    margin: 0;

    color: #ebc98d;

    font-size: clamp(12px, 1vw, 15px);
}

.legal-stack {
    display: grid;
    gap: clamp(22px, 3vw, 38px);
}

.legal-card {
    position: relative;

    width: min(940px, 100%);

    margin: 0 auto;

    padding:
        clamp(30px, 4vw, 52px)
        clamp(24px, 5vw, 65px);

    color: #3a2714;

    background:
        linear-gradient(
            145deg,
            rgba(255,255,255,.18),
            transparent 28%
        ),
        #ead6a6;

    border: 1px solid rgba(91, 57, 22, .30);

    box-shadow:
        8px 12px 22px rgba(36, 17, 5, .34),
        inset 0 0 34px rgba(105, 69, 23, .08);

    transform: rotate(var(--legal-rotate, -.15deg));
}

.legal-card:nth-child(even) {
    --legal-rotate: .18deg;
}

.legal-card::before {
    content: "";

    position: absolute;

    top: 12px;
    left: 50%;

    width: 18px;
    height: 18px;

    transform: translateX(-50%);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 28%,
            #ffe6a4 0 12%,
            #be6639 31%,
            #762c18 72%,
            #48170b 100%
        );

    box-shadow:
        1px 3px 4px rgba(39,17,7,.38);
}

.legal-card h2 {
    margin: 0 0 16px;

    color: #4b2c12;

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Apple Chancery",
        cursive;

    font-size: clamp(22px, 2.3vw, 34px);
    line-height: 1.12;
}

.legal-card h3 {
    margin: 22px 0 8px;

    color: #543516;

    font-size: clamp(16px, 1.45vw, 21px);
}

.legal-card p,
.legal-card li {
    font-size: clamp(14px, 1.04vw, 17px);
    line-height: 1.62;
}

.legal-card p {
    margin: 0 0 13px;
}

.legal-card ul {
    margin: 10px 0 15px;
    padding-left: 1.4em;
}

.legal-card a {
    color: #713d16;
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.legal-card code {
    padding: 2px 5px;

    color: #452713;
    background: rgba(255,255,255,.24);

    border: 1px solid rgba(85, 51, 20, .15);
}

.legal-warning {
    margin-top: 16px !important;

    padding: 12px 15px;

    color: #59300e;

    background: rgba(255, 238, 184, .58);

    border-left: 4px solid #9d5b22;
}

.legal-page-footer {
    margin-top: clamp(32px, 5vw, 60px);

    text-align: center;

    color: #f4ddb0;

    text-shadow: 0 2px 2px rgba(34,15,4,.75);
}

.legal-page-footer p {
    margin: 0 0 12px;

    font-size: clamp(12px, .92vw, 15px);
    line-height: 1.5;
}

.legal-page-footer a {
    color: #ffe6b4;
    font-weight: 700;
}


/* ----------------------------------------------------------------------
   RESPONSIVE PAGE LÉGALE
   ---------------------------------------------------------------------- */

@media screen and (max-width: 768px) {

    .site-footer {
        padding:
            24px
            18px
            30px;
    }

    .site-footer__signature span {
        margin-inline: .2em;
    }

    .legal-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 18px;
    }

    .legal-topbar {
        margin-bottom: 18px;
    }

    .legal-title-board {
        margin-bottom: 22px;

        padding:
            24px
            18px;
    }

    .legal-card {
        padding:
            35px
            20px
            28px;

        transform: none !important;
    }

    .legal-card p,
    .legal-card li {
        font-size: 15px;
        line-height: 1.55;
    }
}


/* ======================================================================
   LES VIEUX CHATS — V3.1
   POI'Z SUR LES COMMENTAIRES / POST-IT
   ======================================================================

   Les images sont chargées depuis :
       /assets/POIZ/NomDuPoiz.png

   Le Poi'Z est posé dans l'angle inférieur droit du Post-it.
   ====================================================================== */

.message-postit--with-poiz {
    /*
       On réserve de la place pour que le Poi'Z ne recouvre ni
       le commentaire ni le lieu.
    */
    padding-right: clamp(98px, 7.5vw, 128px);
    padding-bottom: clamp(82px, 6vw, 104px);
}


/* ------------------------------------------------------------
   PERSONNAGE
   ------------------------------------------------------------ */

.message-postit__poiz {
    position: absolute;
    z-index: 5;

    right: clamp(8px, .9vw, 14px);
    bottom: clamp(7px, .8vw, 12px);

    width: clamp(78px, 6.6vw, 108px);

    margin: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;

    pointer-events: none;

    transform: rotate(2deg);
    transform-origin: center bottom;
}

.message-postit__poiz[hidden] {
    display: none !important;
}

.message-postit__poiz-image {
    display: block;

    width: 100%;
    height: auto;

    max-height: clamp(100px, 8.5vw, 138px);

    object-fit: contain;

    filter:
        drop-shadow(2px 4px 3px rgba(54, 29, 10, .32));

    user-select: none;
}


/* ------------------------------------------------------------
   NOM DU POI'Z
   ------------------------------------------------------------ */

.message-postit__poiz-name {
    max-width: 100%;

    margin-top: 1px;
    padding: 2px 6px;

    overflow: hidden;

    color: #4d3014;

    background: rgba(249, 232, 169, .86);

    border: 1px solid rgba(92, 58, 22, .14);
    border-radius: 2px;

    box-shadow: 0 1px 2px rgba(54, 31, 10, .12);

    font-family:
        "Segoe Print",
        "Bradley Hand",
        "Comic Sans MS",
        cursive;

    font-size: clamp(9px, .72vw, 11px);
    font-weight: 800;
    line-height: 1.15;

    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ======================================================================
   TABLETTE
   ====================================================================== */

@media screen and (max-width: 1024px) {

    .message-postit--with-poiz {
        padding-right: 104px;
        padding-bottom: 88px;
    }

    .message-postit__poiz {
        width: clamp(76px, 10vw, 96px);

        right: 9px;
        bottom: 8px;
    }

    .message-postit__poiz-image {
        max-height: 118px;
    }

    .message-postit__poiz-name {
        font-size: 10px;
    }
}


/* ======================================================================
   SMARTPHONE
   ====================================================================== */

@media screen and (max-width: 680px) {

    .message-postit--with-poiz {
        padding-right: 88px;
        padding-bottom: 78px;
    }

    .message-postit__poiz {
        width: clamp(66px, 20vw, 86px);

        right: 7px;
        bottom: 6px;

        transform: rotate(1deg);
    }

    .message-postit__poiz-image {
        max-height: 102px;
    }

    .message-postit__poiz-name {
        max-width: 82px;
        font-size: 9px;
    }
}


/* ======================================================================
   TRÈS PETITS SMARTPHONES
   ====================================================================== */

@media screen and (max-width: 390px) {

    .message-postit--with-poiz {
        padding-right: 80px;
        padding-bottom: 74px;
    }

    .message-postit__poiz {
        width: 68px;
    }

    .message-postit__poiz-image {
        max-height: 92px;
    }
}
\n\n/* ======================================================================\n   V3.1 — CORRECTION ZONE SÛRE DU LIVRE D'OR\n   ======================================================================\n\n   Correction validée à partir de fond message.webp 1672 × 941.\n\n   Seule la position verticale GLOBALE de .livre-or-content a été ajustée :\n   - PC : clamp(220px, 15vw, 235px)\n   - tablette <= 1024px : 230px\n   - smartphone <= 768px : 235px\n   - petits smartphones <= 390px : 240px\n\n   Inchangés :\n   - largeur de la zone d'écriture ;\n   - tailles de texte ;\n   - espacements internes ;\n   - position relative du champ « Votre message » ;\n   - reCAPTCHA ;\n   - bouton ;\n   - note d'information ;\n   - dimensions et ordre des calques.\n   ====================================================================== */\n\n\n/* ======================================================================\n   V3.1 — CORRECTION DU FOND DES MENTIONS LÉGALES\n   ======================================================================\n   La page .legal-page utilise /assets/planche.webp,\n   afin d'utiliser la texture optimisée WebP.\n\n   Les autres zones du site continuent d'utiliser planche.webp lorsqu'elles\n   le faisaient déjà : cette correction est limitée aux mentions légales.\n   ====================================================================== */\n

/* ======================================================================
   V3.1 — MENTIONS LÉGALES : PLANCHES RÉPÉTÉES
   ======================================================================
   planche.webp est maintenant carrelée sur toute la largeur et toute la
   hauteur de la page. La taille de la tuile est indépendante de la hauteur
   du document afin d'éviter qu'elle ne devienne gigantesque sur une longue
   page de mentions légales.
   ====================================================================== */


/* ======================================================================
   V3.1 — MENTIONS LÉGALES : FOND PLEIN ÉCRAN
   ======================================================================
   Le fond planche.webp est désormais porté par un calque fixe couvrant
   100vw × 100dvh et carrelé avec background-repeat: repeat.

   Le fond s'adapte donc automatiquement :
   - PC ;
   - tablette ;
   - smartphone ;
   - page courte ou très longue.
   ====================================================================== */
