/* Design phase 1 : épuré minimal — fond neutre clair, typographie discrète,
   les toiles portent la couleur. Affiné avec Cathy en phase 2. */

/* L'attribut hidden masque toujours, même un élément auquel une règle donne
   un display (flex, grid…) — sans quoi `el.hidden = true` ne fait rien. */
[hidden] {
  display: none !important;
}

/* Charte validée avec Cathy : Josefin Sans (linéale fine, un air Art déco).
   Titres en 300, corps en 400. Fichiers copiés du proto vers polices/. */
@font-face {
  font-family: "Josefin Sans";
  src: url("polices/josefin-300.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Josefin Sans";
  src: url("polices/josefin-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.5rem clamp(1rem, 4vw, 3rem) 3rem;
  background: #faf8f5;
  color: #3a3733;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

/* Tous les titres de page sont centrés, comme l'entête. */
h2 {
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: normal;
  letter-spacing: 0.06em;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

.sous-titre {
  margin: 0.2rem 0 0;
  font-size: 0.95rem;
  font-style: italic;
  color: #8a857d;
}

.menu {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.8rem;
  flex-wrap: wrap;
}

.menu a {
  color: #6b665e;
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.menu a:hover {
  text-decoration: underline;
}

/* Interrupteur du mode admin — présent seulement quand le serveur local
   répond (js/admin.js). Discret éteint, nettement visible allumé. */
.interrupteur-admin {
  margin-top: 1rem;
  padding: 0.3rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #8a857d;
  background: none;
  border: 1px solid #d8d3ca;
  border-radius: 999px;
  cursor: pointer;
}

.interrupteur-admin:hover {
  color: #3a3733;
  border-color: #8a857d;
}

.interrupteur-admin[aria-pressed="true"] {
  color: #faf8f5;
  background: #3a5a40;
  border-color: #3a5a40;
}

/* Essai / maintenance (ADR-0007). En essai : un rappel discret à côté de
   l'interrupteur. En maintenance : bord rouge fixe au-dessus de tout (sans
   capter les clics) et bandeau en haut ; la vue agrandie, l'écran de
   préparation et les messages se décalent sous le bandeau pour qu'il ne masque
   jamais leurs boutons. */
:root {
  --hauteur-bandeau-maintenance: 2.6rem;
  --rouge-maintenance: #c62828;
}

.controle-essai {
  margin-left: 0.5rem;
  white-space: nowrap;
}

.badge-essai {
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6358;
  background: #efe9df;
  border-radius: 999px;
  vertical-align: middle;
}

.bouton-maintenance {
  margin-left: 0.4rem;
  padding: 0.3rem 0.9rem;
  font: inherit;
  font-size: 0.85rem;
  color: #8a857d;
  background: none;
  border: 1px solid #d8d3ca;
  border-radius: 999px;
  cursor: pointer;
}

.bouton-maintenance:hover:not(:disabled) {
  color: var(--rouge-maintenance);
  border-color: var(--rouge-maintenance);
}

.cadre-maintenance {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 6px solid var(--rouge-maintenance);
  pointer-events: none;
}

.cadre-maintenance.entree {
  animation: clignoter-maintenance 0.5s steps(1) 6;
}

@keyframes clignoter-maintenance {
  50% {
    border-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cadre-maintenance.entree {
    animation: none;
  }
}

.bandeau-maintenance {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 35;
  height: var(--hauteur-bandeau-maintenance);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--rouge-maintenance);
}

.libelle-maintenance {
  font-weight: 400;
}

.compteur-maintenance {
  margin-left: -0.5rem;
  opacity: 0.9;
  cursor: help;
}

.bandeau-maintenance button {
  padding: 0.2rem 0.8rem;
  font: inherit;
  color: var(--rouge-maintenance);
  background: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.bandeau-maintenance button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Fenêtre de validation de la publication, au-dessus de tout sauf le bord. */
.fenetre-publication {
  position: fixed;
  inset: 0;
  z-index: 38;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(30, 28, 25, 0.6);
}

.boite-publication {
  width: min(40rem, 100%);
  max-height: 85vh;
  overflow: auto;
  padding: 1.5rem;
  background: #faf8f5;
  border-radius: 6px;
}

.boite-publication h2 {
  margin-top: 0;
}

.changements-publication {
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
}

.actions-publication {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0;
}

.actions-publication button {
  padding: 0.4rem 1rem;
  font: inherit;
  border-radius: 999px;
  cursor: pointer;
}

.bouton-confirmer {
  color: #fff;
  background: var(--rouge-maintenance);
  border: 1px solid var(--rouge-maintenance);
}

.bouton-annuler {
  color: #3a3733;
  background: none;
  border: 1px solid #d8d3ca;
}

.actions-publication button:disabled {
  opacity: 0.6;
  cursor: default;
}

body.maintenance {
  padding-top: var(--hauteur-bandeau-maintenance);
}

body.maintenance .vue-agrandie,
body.maintenance .ecran-preparation {
  top: var(--hauteur-bandeau-maintenance);
}

body.maintenance .message-admin {
  top: calc(var(--hauteur-bandeau-maintenance) + 0.8rem);
}

@media (max-width: 40rem) {
  .libelle-maintenance {
    font-size: 0.75rem;
  }
  .bandeau-maintenance {
    gap: 0.5rem;
  }
}

/* Bandeau flottant : visible aussi par-dessus la vue agrandie (z-index 10)
   et l'écran de préparation (z-index 20), où l'entête est recouverte. */
.message-admin {
  position: fixed;
  top: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  margin: 0;
  max-width: min(40rem, 90vw);
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  color: #8a4a3a;
  background: #faf8f5;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(60, 50, 30, 0.3);
}

/* Mode admin : la tuile « + » qui ajoute des photos (grilles et accueil) */

.tuile-ajout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  aspect-ratio: 1;
  font: inherit;
  color: #8a857d;
  background: none;
  border: 2px dashed #c9c3b8;
  cursor: pointer;
}

.tuile-ajout:hover,
.tuile-ajout.survol {
  border-color: #3a5a40;
  color: #3a5a40;
}

.tuile-ajout .plus {
  font-size: 3rem;
  line-height: 1;
}

.tuile-ajout .tuile-etiquette {
  font-size: 0.9rem;
  padding: 0 0.5rem;
}

/* Mode admin : l'écran de préparation d'un lot de photos (avant tout envoi) */

.ecran-preparation {
  --marge-ecran: 1.5rem;
  --hauteur-apercu: 62vh;
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: var(--marge-ecran);
  background: rgba(30, 28, 25, 0.96);
}

.ecran-preparation .compteur-lot {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  color: #b8b2a8;
}

.ecran-preparation figure {
  margin: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* L'avis de cadrage sous l'aperçu : une information, pas une alarme — ton
   sobre, jamais le rouge d'une erreur. Il informe sans bloquer l'enregistrement. */
.ecran-preparation .avis-cadrage {
  margin: 0.6rem 0 0;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #e8c98a;
}

.ecran-preparation img {
  max-width: 100%;
  max-height: var(--hauteur-apercu);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

/* Le tracé de recadrage posé sur l'aperçu : quadrilatère + 4 poignées */

.ecran-preparation .zone-trace {
  position: relative;
  display: flex;
  min-height: 0;
}

/* Photo pivotée d'un quart de tour impair : la zone prend les proportions de
   la photo pivotée (--ratio-pivote posé par le JS), l'aperçu tourné se cale
   dedans en unités de conteneur. Au demi-tour, l'aperçu tourne sur place. */

.ecran-preparation .zone-trace.pivotee {
  container-type: size;
  aspect-ratio: var(--ratio-pivote);
  height: min(var(--hauteur-apercu), calc((100vw - 2 * var(--marge-ecran)) / var(--ratio-pivote)));
}

.ecran-preparation .zone-trace.pivotee > img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100cqh;
  height: 100cqw;
  max-width: none;
  max-height: none;
}

.ecran-preparation .trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.ecran-preparation .trace polygon {
  fill: rgba(250, 248, 245, 0.1);
  stroke: #faf8f5;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.ecran-preparation .poignee {
  position: absolute;
  width: 22px;
  height: 22px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid #faf8f5;
  border-radius: 50%;
  background: rgba(58, 90, 64, 0.85);
  cursor: grab;
  touch-action: none;
}

.ecran-preparation .poignee:active {
  cursor: grabbing;
  background: #3a5a40;
}

/* La loupe de précision : la photo grossie sous le coin saisi, réticule au centre */

/* Diamètre posé par le JS : 2 × LOUPE.rayon */
.ecran-preparation .loupe {
  position: absolute;
  transform: translate(-50%, -50%);
  border: 2px solid #faf8f5;
  border-radius: 50%;
  overflow: hidden;
  background: #1e1c19;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.ecran-preparation .loupe .loupe-photo {
  position: absolute;
}

/* Dimensions et rotation posées par le JS, à l'image de l'aperçu */
.ecran-preparation .loupe .loupe-photo img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  max-height: none;
}

.ecran-preparation .loupe .reticule {
  position: absolute;
  inset: 0;
}

.ecran-preparation .loupe .reticule::before,
.ecran-preparation .loupe .reticule::after {
  content: "";
  position: absolute;
  background: rgba(250, 248, 245, 0.9);
}

.ecran-preparation .loupe .reticule::before {
  left: 50%;
  top: 15%;
  bottom: 15%;
  width: 1px;
}

.ecran-preparation .loupe .reticule::after {
  top: 50%;
  left: 15%;
  right: 15%;
  height: 1px;
}

.gestes-preparation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.gestes-preparation button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
}

.gestes-preparation button:disabled {
  opacity: 0.5;
  cursor: default;
}

.gestes-preparation .ajouter-photo {
  color: #faf8f5;
  background: #3a5a40;
  border: 1px solid #3a5a40;
}

.gestes-preparation .clair {
  color: #b8b2a8;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.gestes-preparation .clair:hover {
  color: #f0ece5;
  border-color: rgba(255, 255, 255, 0.5);
}

/* Mode admin : édition du cartel dans la vue agrandie */

.mode-admin .vue-agrandie {
  overflow-y: auto;
}

.mode-admin .oeuvre-agrandie img {
  max-height: 48vh;
}

.cartel-edition {
  display: grid;
  gap: 0.5rem;
  justify-items: center;
  margin: 0.9rem auto 0;
  max-width: 26rem;
}

.cartel-edition input,
.cartel-edition select {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  color: #f0ece5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
}

.cartel-edition input::placeholder {
  color: #8f8a81;
}

/* Les deux mesures côte à côte, étiquette toujours visible au-dessus du
   nombre — un nombre nu ne dit pas s'il est la hauteur ou la largeur. */
.mesures-cartel {
  display: flex;
  gap: 1rem;
  align-items: end;
}

.mesures-cartel label {
  display: grid;
  gap: 0.15rem;
  flex: 1;
  /* le même gris d'étiquette que .dates-expo label */
  color: #8a857d;
  font-size: 0.8rem;
  text-align: left;
}

/* L'alerte de cohérence dimensions / photo : discrète, l'explication vit
   dans son title au survol. */
.alerte-dimensions {
  align-self: center;
  color: #e0a33c;
  font-size: 1.1rem;
  cursor: help;
}

.cartel-edition option {
  color: #3a3733;
}

.etat-enregistrement {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #9db8a0;
}

.etat-enregistrement.echec {
  color: #e0a49a;
}

.vers-corbeille {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.9rem;
  color: #e0a49a;
  background: none;
  border: 1px solid rgba(224, 164, 154, 0.5);
  border-radius: 999px;
  cursor: pointer;
}

.vers-corbeille:hover {
  border-color: #e0a49a;
}

.message-admin.info {
  color: #3a5a40;
}

/* Mode admin : sections À classer et Corbeille en bas de l'accueil */

.section-admin {
  max-width: 60rem;
  margin: 2.5rem auto 0;
  padding-top: 1.2rem;
  border-top: 1px dashed #c9c3b8;
}

.section-admin h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.section-admin p {
  margin: 0.3rem 0 1rem;
  font-size: 0.9rem;
  color: #8a857d;
  text-align: center;
}

.vignettes-admin {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.vignettes-admin > * {
  width: 130px;
}

.vignette-admin {
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: center;
  background: none;
  border: none;
  cursor: pointer;
}

.vignette-admin img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 6px rgba(60, 50, 30, 0.18);
}

.vignette-admin:hover img {
  outline: 3px solid #3a5a40;
}

.vignette-admin span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: #6b665e;
}

.section-admin .vignette-admin img {
  opacity: 0.95;
}

/* Mode admin : les icônes d'édition posées sur chaque œuvre
   (tuiles des grilles, vignettes À classer, vue agrandie) */

.mode-admin .oeuvre,
.vignette-cadre {
  position: relative;
}

/* Le cadre prend la place de la vignette dans la grille (130px via
   .vignettes-admin > *) : le bouton interne doit remplir cette largeur. */
.vignette-cadre .vignette-admin {
  display: block;
  width: 100%;
}

/* Dans la vue agrandie, un cadre serré sur l'image porte les icônes : elles
   se posent sur le coin de l'image, pas sur la figure large comme l'écran. */
.cadre-image {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.icones-oeuvre {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: flex;
  gap: 0.35rem;
}

.icone-oeuvre {
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #4a453c;
  box-shadow: 0 1px 4px rgba(60, 50, 30, 0.35);
  cursor: pointer;
}

.icone-oeuvre svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

.icone-oeuvre:hover {
  background: #fff;
  color: #3a5a40;
}

/* L'œil « couverture » : discret quand l'œuvre est dans le fond bandeau (la
   règle, l'œil ne s'y arrête pas), franchement marqué quand elle en est
   écartée (l'exception, repérable d'un coup d'œil). */

.icone-couverture {
  opacity: 0.5;
}

.icone-couverture:hover {
  opacity: 1;
}

.icone-couverture.ecartee {
  opacity: 1;
  color: #a03c32;
}

.icone-couverture.ecartee:hover {
  color: #a03c32;
}

/* L'appui maintenu sur la corbeille : l'icône se remplit pendant la durée
   du geste — même durée que APPUI_RETRAIT_MS (js/admin.js). */

.icone-corbeille.appui {
  color: #fff;
  background-image: linear-gradient(#a03c32, #a03c32);
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 0%;
  animation: appui-corbeille 1.5s linear forwards;
}

@keyframes appui-corbeille {
  to {
    background-size: 100% 100%;
  }
}

/* Mode admin : la carte « Nouveau thème » sur l'accueil */

.nouveau-theme {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  aspect-ratio: 1;
  padding: 1rem;
  color: #8a857d;
  border: 2px dashed #c9c3b8;
}

.nouveau-theme input {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
}

/* Mode admin : titre de thème éditable et retrait d'un thème vide */

.titre-theme-edition {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.8rem;
  margin: 0 0 1.5rem;
}

.titre-theme-edition input {
  font: inherit;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.4rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
}

.titre-theme-edition .etat-enregistrement {
  color: #3a5a40;
}

.titre-theme-edition .etat-enregistrement.echec {
  color: #8a4a3a;
}

.vers-corbeille.clair {
  display: block;
  margin-top: 2rem;
  color: #8c2f28;
  border-color: #d4a49f;
}

.vers-corbeille.clair:hover {
  border-color: #8c2f28;
}

.themes-corbeille {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.themes-corbeille button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.3rem 0.9rem;
  color: #6b665e;
  background: none;
  border: 1px solid #c9c3b8;
  border-radius: 999px;
  cursor: pointer;
}

.themes-corbeille button:hover {
  color: #3a5a40;
  border-color: #3a5a40;
}

/* Mode admin : la page expositions en fiches éditables */

.nouvelle-exposition {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #8a857d;
  border: 2px dashed #c9c3b8;
}

.nouvelle-exposition input,
.fiche-expo input,
.fiche-expo textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
}

.fiche-expo {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid #e0dcd3;
  border-radius: 8px;
  background: #fff;
}

.fiche-expo textarea {
  resize: vertical;
}

.dates-expo {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.dates-expo label {
  display: grid;
  gap: 0.15rem;
  color: #8a857d;
}

.dates-expo input {
  width: auto;
}

.pied-fiche {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fiche-expo .etat-enregistrement {
  color: #3a5a40;
}

.fiche-expo .etat-enregistrement.echec {
  color: #8a4a3a;
}

.fiche-expo .vers-corbeille.clair {
  margin-top: 0;
}

/* Mode admin : pages à propos et contact éditables */

.aide-admin {
  font-size: 0.9rem;
  color: #8a857d;
}

.texte-edition {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
  resize: vertical;
}

.etat-enregistrement.clair {
  display: block;
  margin-top: 0.5rem;
  color: #3a5a40;
}

.etat-enregistrement.clair.echec {
  color: #8a4a3a;
}

/* Éditeur de note WYSIWYT (à propos, description d'expo, note contact) : barre
   d'outils + zone contentEditable qui affiche la mise en forme rendue. */

.editeur-note {
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.note-barre {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #e0dcd3;
  background: #faf8f5;
}

.note-barre button {
  font: inherit;
  min-width: 2rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #c9c3b8;
  border-radius: 5px;
  background: #fff;
  color: #3a3733;
  cursor: pointer;
}

.note-barre button:hover {
  background: #f0ece4;
}

.note-barre .note-gras {
  font-weight: bold;
}

.note-barre .note-ital {
  font-style: italic;
}

.note-zone {
  min-height: 6rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.note-zone:focus {
  box-shadow: inset 0 0 0 2px #d9c7ad;
}

.note-zone p {
  margin: 0 0 0.6rem;
}

.note-zone p:last-child {
  margin-bottom: 0;
}

.note-zone ul {
  margin: 0.4rem 0;
  padding-left: 1.3rem;
}

.note-zone a {
  color: #96703d;
}

/* Une description d'expo tient dans une zone plus courte que l'à propos. */
.fiche-expo .note-zone {
  min-height: 3.5rem;
}

/* Mini-formulaire d'insertion de lien (deux champs). */
.dlg-lien {
  border: 1px solid #c9c3b8;
  border-radius: 8px;
  padding: 1.2rem;
  min-width: min(24rem, 90vw);
}

.dlg-lien input {
  display: block;
  width: 100%;
  font: inherit;
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
}

.dlg-lien .dlg-pied {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.dlg-lien button {
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 1px solid #c9c3b8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.dlg-lien::backdrop {
  background: rgba(40, 38, 34, 0.35);
}

/* La surcouche d'édition (œuvre à classer) : bouton fermer sans habillage */

.vue-admin .fermer {
  background: none;
  border: none;
  cursor: pointer;
}

/* Pages de texte (à propos, contact) */

.page-texte {
  max-width: 38rem;
  margin: 0 auto;
}

.page-texte h2 {
  font-size: 1.4rem;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.email {
  color: inherit;
}

/* Notes markdown (à propos, description d'expo, contact) : liens et listes du
   noyau réduit rendu par rendreNote. Le reste (gras/italique) suit la charte. */
.page-texte a:not(.email),
.expo-description a {
  color: #96703d;
}

.page-texte ul,
.expo-description ul {
  margin: 0.6rem 0;
  padding-left: 1.3rem;
}

.expo-section {
  font-size: 1.4rem;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.exposition {
  margin-bottom: 1.8rem;
}

.expo-titre {
  margin: 0;
  font-size: 1.05rem;
  font-weight: normal;
  font-style: italic;
}

.exposition p {
  margin: 0.15rem 0;
}

.expo-lieu {
  color: #6b665e;
}

.expo-dates {
  color: #96703d;
  font-size: 0.9rem;
}

.expo-aucune {
  color: #6b665e;
  font-style: italic;
}

/* Accueil : cartes des thèmes */

.themes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  max-width: 60rem;
  margin: 0 auto;
}

/* Cartes à largeur constante : chaque rangée est centrée, même incomplète. */
.themes > * {
  width: 230px;
}

.theme-carte {
  display: block;
  text-align: center;
  color: inherit;
  text-decoration: none;
}

.theme-carte img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 6px rgba(60, 50, 30, 0.18);
}

.theme-nom {
  display: block;
  margin-top: 0.7rem;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.theme-carte:hover .theme-nom {
  text-decoration: underline;
}

/* Page d'un thème : grille des œuvres */

.retour {
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
  color: #8a857d;
  text-decoration: none;
  font-size: 0.9rem;
}

.retour:hover {
  text-decoration: underline;
}

/* La ligne du titre : le thème encadré par ses voisins nommés — trois cases
   fixes, le titre au centre (le mode admin le remplace dans sa case). */
.ligne-theme {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  max-width: 70rem;
  margin: 0 auto 1.5rem;
}

.theme-precedent,
.theme-suivant {
  color: #8a857d;
  text-decoration: none;
  font-size: 0.9rem;
}

.theme-suivant {
  justify-self: end;
  text-align: right;
}

a.theme-precedent:hover,
a.theme-suivant:hover {
  text-decoration: underline;
}

.theme-titre {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: normal;
  letter-spacing: 0.05em;
}

.grille {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem 2rem;
  max-width: 70rem;
  margin: 0 auto;
}

.grille > * {
  width: 240px;
}

.oeuvre {
  margin: 0;
}

.oeuvre img {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 1px 6px rgba(60, 50, 30, 0.18);
}

/* Cartel */

.cartel {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #6b665e;
  text-align: center;
}

.cartel span {
  display: block;
}

.cartel-titre {
  font-style: italic;
  color: #3a3733;
  font-size: 0.95rem;
}

.cartel-distinction {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #96703d;
}

.erreur {
  text-align: center;
  color: #8a4a3a;
}

/* Vue agrandie : plein écran sur fond sombre, la toile au centre */

.vue-agrandie {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  background: rgba(30, 28, 25, 0.96);
}

.oeuvre-agrandie {
  margin: 0;
  min-width: 0;
  text-align: center;
  padding: 2.5rem 0.25rem 1.5rem;
}

.oeuvre-agrandie img {
  max-width: 100%;
  max-height: 72vh;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}

.vue-agrandie .cartel {
  margin-top: 0.9rem;
  color: #b8b2a8;
}

.vue-agrandie .cartel-titre {
  color: #f0ece5;
}

.vue-agrandie .cartel-distinction {
  color: #cfa15e;
}

.fermer {
  position: absolute;
  top: 0.3rem;
  right: 0.8rem;
  font-size: 2.2rem;
  line-height: 1;
  padding: 0.5rem;
  color: #b8b2a8;
  text-decoration: none;
}

.fermer:hover {
  color: #f0ece5;
}

.feuillete {
  font-size: 2.6rem;
  padding: 1.2rem 0.6rem;
  min-width: 2.8rem;
  text-align: center;
  color: #b8b2a8;
  text-decoration: none;
  user-select: none;
}

a.feuillete:hover {
  color: #f0ece5;
}

/* Page autonome d'une œuvre (entrée directe, lien partagé, pré-rendu) : le même
   contenu interne que la lightbox, mais dans le flux normal, entête visible, sur
   fond clair — d'où des flèches assombries et pas de fond sombre plein écran. */
.page-oeuvre {
  padding: 0.5rem 0 2rem;
}

.page-oeuvre .oeuvre-cadre {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.page-oeuvre .oeuvre-agrandie img {
  max-height: 78vh;
}

.page-oeuvre .feuillete {
  color: #8a8172;
}

.page-oeuvre a.feuillete:hover {
  color: #1e1c19;
}

/* Téléphone : une colonne confortable */

@media (max-width: 480px) {
  .grille > *,
  .themes > * {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   Ambiance de couverture — la charte validée avec Cathy (direction 3).
   Portée depuis proto-charte/bandeau.css : une toile estompée en bande haute
   derrière le nom, pleine largeur, qui fond dans la page ; typographie Josefin
   Sans ; accents bleus (219°, la seconde famille des toiles). Ce bloc surcharge
   le socle « phase 1 » ci-dessus, comme la feuille du proto le faisait.

   Le carrousel #fond-bandeau (les deux plans .plan) est injecté et animé par
   js/bandeau.js ; ici on ne décide que la géométrie de la bande, le voile et
   la typographie.
   ══════════════════════════════════════════════════════════════════════════ */

body {
  font-family: "Josefin Sans", sans-serif;
  color: #33302b;
}

/* La bande : posée en haut de l'écran, pleine largeur, derrière tout
   (z-index -1). Le carrousel fait tourner les toiles ; un dégradé fond la
   bande dans le fond de page vers le bas. */
#fond-bandeau {
  position: fixed;
  inset: 0 0 auto 0;
  height: clamp(240px, 42vh, 380px);
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

#fond-bandeau .plan {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#fond-bandeau::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(250, 248, 245, 0.2),
    rgba(250, 248, 245, 0.82) 66%,
    #faf8f5
  );
}

/* L'entête se pose sur la bande. */
header {
  position: relative;
  padding: 3.5rem 1rem 1.2rem;
}

header h1 {
  font-weight: 300;
  font-size: 2.7rem;
}

.sous-titre {
  font-style: normal;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #56524a;
}

.menu a {
  color: #4c5f80;
  letter-spacing: 0.06em;
}

.menu a:hover {
  /* soulignement sans reflow (une border-bottom décalerait le contenu). */
  text-decoration: underline;
  text-decoration-color: #8396b9;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.retour,
.theme-precedent,
.theme-suivant {
  color: #4c5f80;
}

.retour:hover,
a.theme-precedent:hover,
a.theme-suivant:hover {
  text-decoration-color: #8396b9;
  text-decoration-thickness: 2px;
}

.theme-titre,
h2 {
  font-weight: 300;
  font-size: 1.7rem;
  letter-spacing: 0.08em;
}

.theme-nom {
  letter-spacing: 0.1em;
}

.cartel-distinction {
  color: #4c5f80;
}

/* L'interrupteur admin se pose parfois sur la bande : un fond clair le détache. */
.interrupteur-admin {
  background: rgba(250, 248, 245, 0.7);
}
