/* Éditeur : choix dans la Bibliothèque, pages des carrousels, aperçus (sorti de pages.css en 1.21.1, sans changement). */

/* 1.16.0 : choix d'images dans la Bibliothèque (éditeur). */
.fenetre.choix-bibliotheque { width: min(720px, 94vw); }
.choix-bibliotheque .aide-choix { margin: 0 0 10px; color: var(--gris); font-size: 14px; }
.choix-bibliotheque .onglets-choix { flex-wrap: wrap; margin-bottom: 12px; }
.grille-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.vignette-choix { aspect-ratio: 1; padding: 6px; border: 2px solid var(--trait, #ddd); border-radius: 12px; background: #f4f4f2; cursor: pointer; }
.vignette-choix img { width: 100%; height: 100%; object-fit: contain; }
.vignette-choix[aria-pressed="true"] { border-color: var(--couleur-vive); box-shadow: 0 0 0 2px var(--couleur-vive); }

/* 1.17.1 : pages d'un carrousel en colonne, de haut en bas, à droite de l'aperçu (demande de Sarah). */
.scene-et-pages { display: flex; gap: 12px; flex: 1; min-height: 0; width: 100%; }
.scene-et-pages .pile { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scene-et-pages .pile .scene { flex: 1; }
/* 1.17.2 : pages en grand l'une sous l'autre ; on descend au doigt, à la molette ou au pavé tactile. */
.pile.en-pile { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: y proximity; }
.pile-contenu { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 10px 8px 40px; } /* 1.21.7 : place pour le cadre de la page en cours (plus coupé en haut) */
.place-page { position: relative; flex: none; overflow: hidden; border-radius: 4px; background: #e6e6e1; cursor: pointer; scroll-snap-align: start; scroll-margin-top: 16px; box-shadow: 0 1px 6px #0002; }
.place-page img { display: block; width: 100%; height: 100%; object-fit: cover; }
.place-page.active { cursor: default; outline: 3px solid var(--couleur-vive); outline-offset: 3px; }
.numero-place { position: absolute; left: -2px; top: -2px; padding: 3px 8px; border-radius: 0 0 8px 0; background: #000a; color: #fff; font-size: 12px; font-weight: 700; }
.pile.en-pile .scene { z-index: 2; }
.colonne-pages { flex: 0 0 112px; display: flex; flex-direction: column; gap: 8px; min-height: 0; max-height: 100%; overflow-y: auto; padding: 2px 4px 2px 2px; }
.colonne-pages[hidden] { display: none; }
.colonne-pages .bouton-apercu { padding: 8px 6px; border: 0; border-radius: 9px; background: var(--couleur-vive); color: #fff; font-weight: 700; cursor: pointer; }
.outils-pages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.outil-page { padding: 5px 0; border: 1px solid var(--trait, #ddd); border-radius: 7px; background: #fff; color: var(--encre); font-size: 12px; cursor: pointer; }
.outil-page:disabled { opacity: .35; cursor: default; }
.liste-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ligne-page { position: relative; }
.ligne-page.glissee { opacity: .4; }
.ligne-page.depot-avant::before, .ligne-page.depot-apres::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--couleur-vive); }
.ligne-page.depot-avant::before { top: -6px; }
.ligne-page.depot-apres::after { bottom: -6px; }
.vignette-page { position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; padding: 0; overflow: hidden; border: 2px solid transparent; border-radius: 9px; background: #e9e9e5; cursor: grab; }
.vignette-page img { display: block; width: 100%; height: 100%; object-fit: cover; }
.vignette-page.active { border-color: var(--couleur-vive); box-shadow: 0 0 0 2px var(--couleur-vive); }
.vignette-attente { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e6e6e1, #f4f4f1); }
.numero-page { position: absolute; left: 5px; top: 5px; min-width: 20px; padding: 1px 5px; border-radius: 6px; background: #000a; color: #fff; font-size: 11px; font-weight: 700; }
@media (max-width: 760px) { .scene-et-pages { flex-direction: column; } .colonne-pages { flex: none; max-height: none; } .liste-pages { flex-direction: row; overflow-x: auto; } .vignette-page { width: 84px; } }

/* 1.17.1 : « Aperçu » du carrousel, une page à la fois, comme une publication. */
.fenetre.apercu-carrousel { width: min(440px, 94vw); padding: 0 0 16px; overflow: hidden; }
.entete-publication { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14px; }
.avatar-publication { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: var(--couleur-2); display: grid; place-items: center; flex: none; }
.avatar-publication img { width: 80%; height: 80%; object-fit: contain; }
.entete-publication .points-menu { margin-left: auto; color: var(--gris); letter-spacing: 1px; }
.media-publication { position: relative; width: 100%; background: #111; }
.piste-publication { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.piste-publication::-webkit-scrollbar { display: none; }
.diapo-publication { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; }
.diapo-publication img { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.diapo-attente { color: #fff9; font-size: 13px; }
.compteur-publication { position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 12px; background: #000a; color: #fff; font-size: 12px; }
.fleche-publication { position: absolute; top: 50%; translate: 0 -50%; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #fffd; color: #111; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 1px 4px #0004; }
.fleche-publication.gauche { left: 10px; }
.fleche-publication.droite { right: 10px; }
.points-publication { display: flex; justify-content: center; gap: 5px; padding: 12px 0 4px; }
.points-publication .point { width: 6px; height: 6px; border-radius: 50%; background: #c8c8c3; }
.points-publication .point.active { background: var(--couleur-vive); }
.apercu-carrousel .formulaire-ligne { padding: 6px 16px 0; }

/* 1.20.0 : Aperçu d'un visuel avec ses marges (story, publication, bannière). */
.fenetre.apercu-carrousel.apercu-story { width: min(380px, 94vw, calc((92vh - 90px) * 9 / 16)); padding: 10px 10px 14px; background: #111; color: #fff; }
.apercu-story .media-publication { border-radius: 14px; overflow: hidden; }
.fenetre.apercu-carrousel.apercu-banniere { width: min(820px, 94vw); padding: 12px 12px 14px; }
.apercu-carrousel .choix-marges { margin-right: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: inherit; }
.marges-apercu { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sans-marges .marges-apercu { display: none; }
.marge-securite { position: absolute; inset: 5%; border: 2px dashed #ffffffcc; box-shadow: 0 0 0 1px #0006; border-radius: 2px; }
.zone-cachee { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, #ff3b5c33 0 8px, #ff3b5c1a 8px 16px); border-color: #ff3b5c; border-style: dashed; border-width: 0; }
.zone-cachee.haut { top: 0; height: 13%; border-bottom-width: 2px; }
.zone-cachee.bas { bottom: 0; height: 18%; border-top-width: 2px; }
.interface-story { position: absolute; inset: 0; z-index: 3; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 8px 10px 12px; color: #fff; text-shadow: 0 1px 3px #0009; font-size: 12px; }
.barres-story { display: flex; gap: 3px; }
.barres-story .barre { flex: 1; height: 2px; border-radius: 2px; background: #ffffff66; }
.barres-story .barre.vue { background: #fff; }
.qui-story { display: flex; align-items: center; gap: 8px; margin-top: 8px; margin-bottom: auto; }
.qui-story .avatar-publication { width: 28px; height: 28px; }
.heure-story { opacity: .75; }
.message-story { display: flex; align-items: center; gap: 12px; }
.champ-message { flex: 1; padding: 8px 12px; border: 1px solid #ffffffcc; border-radius: 20px; font-size: 12px; }
.icone-story { font-size: 18px; }
.apercu-story .compteur-publication { top: 40px; }
.bouton-apercu-format { margin-left: 10px; padding: 6px 14px; border: 0; border-radius: 20px; background: var(--couleur-vive); color: #fff; font-weight: 700; cursor: pointer; }
.format-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* 1.21.2 (Sarah) : le bouton « Aperçu » à droite, au bout de la ligne des formats.
   1.22.5 (Sarah) : « Réglages » de l'élément choisi juste avant, dans la même ligne (plus jamais l'un sur l'autre). */
.format-toolbar #barre { margin-left: auto; display: flex; align-items: center; }
.format-toolbar .bouton-apercu-format { margin-left: 0; }
.format-toolbar .outils-selection { position: static; top: auto; right: auto; display: flex; align-items: center; }
/* La fenêtre des réglages s'accroche au bord droit de la zone du visuel (jamais sous le panneau de gauche). */
.format-toolbar .outils-selection .selection-bar { top: calc(100% + 8px); right: 0; max-width: 100%; }
/* 1.21.4 : catégories vides montrées (plus pâles), avec un mot pour les remplir. */
.choix-bibliotheque .onglet-vide { opacity: .55; }
.choix-bibliotheque .vide-choix { grid-column: 1 / -1; margin: 8px 0; color: var(--gris); font-size: 14px; line-height: 1.45; }
.choix-bibliotheque .onglet-vide.active { opacity: 1; }
/* 1.21.6 : nom de chaque élément sous sa miniature. */
.element-nomme { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none; }
.element-nomme figcaption { font-size: 10px; color: #c7cbd0; white-space: nowrap; }
.format-toolbar { position: relative; z-index: 40; overflow: visible; } /* 1.22.5 : la fenêtre des réglages passe au-dessus du visuel */
.format-toolbar .coin-dupliquer { position: static; margin-right: 6px; } /* 1.22.5 : Dupliquer dans la même ligne, avant Réglages (plus de chevauchement) */
/* 1.24.1 : image d'un réglage d'atelier (ex. dos de carte) : sa vignette au-dessus des boutons. */
.image-option { display: grid; place-items: center; min-height: 64px; padding: 6px; border: 1px dashed rgba(255,255,255,.18); border-radius: 8px; color: #a8adb4; font-size: 11px; }
.image-option img { max-width: 100%; max-height: 120px; object-fit: contain; }
