/* Livre d'or : des cartes comme des pages de carnet, en colonnes sur grand écran. */
.ecrire .spread h2 { font-size: 22px; }

.photos-zone { display: grid; gap: 10px; }
.ajout { display: flex; align-items: center; gap: 12px; border: 2px dashed var(--line); border-radius: 16px; padding: 14px; cursor: pointer; font-weight: 400; background: var(--bg); }
.ajout:hover, .ajout:focus-within { border-color: var(--sea); }
.ajout input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ajout .plus { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); font-size: 26px; font-weight: 700; }
.ajout small { display: block; color: var(--muted); font-size: 13px; }
.apercus { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.apercus:empty { display: none; }
.apercu { margin: 0; position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--past); display: grid; place-items: center; color: var(--muted); }
.apercu img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apercu .retirer { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.apercu.chargement { animation: respire 1.2s ease-in-out infinite; }
@keyframes respire { 50% { opacity: 0.5; } }

.mots { columns: 1; column-gap: 16px; }
@media (min-width: 700px) { .mots { columns: 2; } }
.mot { break-inside: avoid; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 16px; display: grid; gap: 12px; box-shadow: 0 8px 30px var(--shadow); min-width: 0; }
.mot.brouillon { border-style: dashed; box-shadow: none; }
.mot .texte { font-family: var(--font-serif); font-size: 22px; line-height: 1.3; white-space: pre-wrap; overflow-wrap: anywhere; }
.mot .signature { display: grid; gap: 2px; }
.mot .qui { font-family: var(--font-display); font-weight: 700; }
.mot .qui::before { content: "— "; color: var(--sun); }
.mot .quand { color: var(--muted); font-size: 14px; }
.mot .reponse { background: var(--sea-soft); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; font-size: 15px; }
.mot .reponse strong { color: var(--sea); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.mot .reponse p { white-space: pre-wrap; overflow-wrap: anywhere; }
.mot .pied { justify-content: space-between; }
.mot .meta { color: var(--muted); font-size: 13px; }

.mosaique { display: grid; gap: 4px; border-radius: 14px; overflow: hidden; grid-template-columns: 1fr 1fr; }
.mosaique button { padding: 0; border: 0; background: var(--past); cursor: zoom-in; position: relative; min-width: 0; display: block; }
.mosaique img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.mosaique.n1 { grid-template-columns: 1fr; }
.mosaique.n1 img { aspect-ratio: auto; height: auto; max-height: 520px; }
.mosaique.n3 button:first-child { grid-column: span 2; }
.mosaique.n3 button:first-child img { aspect-ratio: 2; }
.mosaique.n5 { grid-template-columns: repeat(6, 1fr); }
.mosaique.n5 button { grid-column: span 2; }
.mosaique.n5 button:nth-child(-n+2) { grid-column: span 3; }
.plus-photos { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(0 0 0 / 0.45); color: #fff; font-family: var(--font-display); font-size: 24px; font-weight: 700; }

.coeur { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; min-height: 40px; padding: 6px 14px; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; cursor: pointer; }
.coeur span:first-child { font-size: 18px; line-height: 1; }
.coeur.on { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); cursor: default; }
.coeur.pop span:first-child { animation: pop 0.4s ease; }
@keyframes pop { 50% { transform: scale(1.5); } }
@media (prefers-reduced-motion: reduce) { .coeur.pop span:first-child, .apercu.chargement { animation: none; } }

.vide { text-align: center; padding: 40px 16px; display: grid; gap: 8px; break-inside: avoid; }
.vide .grand { font-family: var(--font-serif); font-size: 28px; }

.visionneuse { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; }
.visionneuse::backdrop { background: rgb(10 14 14 / 0.92); }
.visionneuse[open] { display: grid; place-items: center; }
.visionneuse img { max-width: 100vw; max-height: 100dvh; object-fit: contain; display: block; }
.visionneuse .icon-btn { position: fixed; background: rgb(0 0 0 / 0.5); color: #fff; border-color: rgb(255 255 255 / 0.3); width: 48px; height: 48px; font-size: 26px; }
.visionneuse .fermer { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.visionneuse .prec { left: 8px; top: 50%; transform: translateY(-50%); }
.visionneuse .suiv { right: 8px; top: 50%; transform: translateY(-50%); }

/* Espace hôte */
.livre-hote .mot { box-shadow: none; background: var(--bg); margin: 0; }
.livre-hote .mot .texte { font-size: 19px; }
.a-relire { background: var(--option); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 14px; font-family: var(--font-body); vertical-align: middle; }
.livre-hote .mosaique { max-width: 440px; }
