/* ==========================================================================
   neimënster — Totem 1080 × 1920 (DynaScan 65" portrait)
   Couleurs : charte graphique 2026
   ========================================================================== */

:root {
  --ink: #231f20;          /* noir charte */
  --grey: #524d4a;         /* gris pictos */
  --yellow: #ffd946;       /* jaune logo */
  --yellow-soft: #fcf3d2;  /* jaune 30 % (univers pastel) */
  --blue: #cee0e1;         /* couleur neutre / fond bleuté */
  --blue-soft: #e3eeee;
  --line: 2.5px;
  --radius: 22px;
  --side: 48px;
  --font: "kiro", "FF Kiro", "Kiro", system-ui, sans-serif;

  /* Dégradé CSS de secours (approximation de la charte §3.4) */
  --gradient:
    radial-gradient(ellipse 70% 40% at 0% 0%, #d4b9b6 0%, transparent 100%),
    radial-gradient(ellipse 70% 40% at 100% 4%, #e5efdc 0%, transparent 100%),
    radial-gradient(ellipse 80% 45% at 55% 42%, #f8dc79 0%, transparent 100%),
    radial-gradient(ellipse 75% 40% at 0% 100%, #e6edce 0%, transparent 100%),
    radial-gradient(ellipse 75% 40% at 100% 100%, #d4e6ee 0%, transparent 100%),
    #f1e4b0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #111; overflow: hidden; }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- Scène fixe 1080×1920, mise à l'échelle par JS ---------- */
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1080px; height: 1920px;
  transform-origin: 0 0;
  overflow: hidden;
  /* Dégradé de la charte (§3.4) rendu depuis le PDF, adouci par un voile blanc
     (--voile : 0 = dégradé pur, 1 = blanc) ; dégradé CSS en secours */
  --voile: .35;
  background:
    linear-gradient(rgba(255,255,255,var(--voile)), rgba(255,255,255,var(--voile))),
    url("../assets/img/fond-degrade.jpg") center / 100% 100% no-repeat,
    var(--gradient);
}
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* Variante ?fond=blanc : fond blanc uni */
#stage.bg-white { background: #fff; }

/* ---------- En-tête : logo · Agenda (centré) · date ---------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  height: 204px; padding: 30px var(--side) 14px; transition: margin-top .45s ease;
  flex: none;
}
.logo { height: 138px; width: auto; justify-self: start; }
.top h1 {
  margin: 0; font-size: 118px; line-height: 1; font-weight: 400;
  letter-spacing: -2px; transform: translateY(-6px);
}
.clock { justify-self: end; }

/* Widget date / heure / météo — cases carrées comme le cahier des charges */
.clock {
  display: flex; gap: 5px; padding: 5px;
  border: 2px solid var(--ink); border-radius: 10px; background: #fff;
}
.clock-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 76px; height: 76px;
  border: 2px solid var(--ink); border-radius: 6px; background: #fff; line-height: 1;
}
.clock-box small { font-size: 12px; font-weight: 400; display: flex; align-items: center; gap: 4px; }
.date-box small:first-child { text-transform: lowercase; margin-bottom: 1px; }
.date-box b { font-size: 33px; font-weight: 700; }
.date-box small:last-child { text-transform: uppercase; font-weight: 700; margin-top: 1px; }
.time-box b { font-size: 26px; font-weight: 700; }
.time-box .weather { font-size: 16px; font-weight: 700; margin-top: 5px; }
.time-box .weather img { width: 19px; height: 19px; }

/* ---------- Zone de contenu ---------- */
.scroller { flex: 1; display: flex; flex-direction: column; min-height: 0; transition: margin-top .45s ease; }
.content { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 48px; padding: 0 0 12px; }

/* ---------- Rangées / carrousels (sans box, sur le dégradé) ---------- */
.row { position: relative; }
.row-head { height: 48px; display: flex; align-items: center; padding: 0 var(--side) 0 0; margin-bottom: 10px; }
.row-head h2 { margin: 0; font-size: 38px; line-height: 1.1; font-weight: 300; }
.row-head h2 b { font-weight: 700; }

.arrow { display: grid; place-items: center; transition: opacity .2s; }
.arrow img { width: 100%; height: 100%; }
.arrow.prev img { transform: scaleX(-1); }
.arrow:disabled { opacity: .3; cursor: default; }

/* Par défaut : flèches en haut à droite, les cards prennent toute la largeur */
.carousel { display: block; }
.arrow { position: absolute; top: 0; width: 48px; height: 48px; }
.arrow.prev { right: calc(var(--side) + 58px); }
.arrow.next { right: var(--side); }
.carousel .track { padding: 0 var(--side) 0 0; scroll-padding-inline: 0; }

/* Variante ?box=1 : box blanche sans filet (proposition initiale) */
.boxed .content { gap: 14px; padding-bottom: 0; }
.boxed .alert { margin: 0 30px 0 0; }
.boxed .row { margin: 0 30px 0 0; padding: 18px 0 22px; background: #fff; border-radius: 30px; }
.boxed .row-head, .boxed .carousel .track { padding-left: 30px; padding-right: 30px; scroll-padding-inline: 30px; }
.boxed .row-head h2 { font-size: 42px; }
.boxed .arrow { top: 18px; }
.boxed .arrow.prev { right: 98px; }
.boxed .arrow.next { right: 30px; }

/* Variante ?fleches=cotes : flèches sur les côtés, sur toute la hauteur des cards */
.arrows-sides .carousel { display: grid; grid-template-columns: 64px 1fr 64px; align-items: stretch; }
.arrows-sides .arrow { position: static; width: auto; height: auto; }
.arrows-sides .arrow img { width: 46px; height: 46px; }
.arrows-sides .carousel .track { padding: 0; scroll-padding-inline: 0; }
.arrows-sides .row-head { padding-left: 76px; }
.arrows-sides .card { flex-basis: 250px; }

.track {
  display: flex; gap: 18px; min-width: 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { scroll-snap-type: none; cursor: grabbing; }
.track:empty::before { content: attr(data-empty); font-size: 24px; padding: 40px 0; opacity: .6; }

/* ---------- Card : titre + catégorie au-dessus, photo sans texte ---------- */
.card {
  flex: 0 0 262px; scroll-snap-align: start;
  display: flex; flex-direction: column;
  padding: 12px; border-radius: 20px;
  background: var(--blue);
}
.std .card { background: var(--yellow-soft); }
/* Titre surligné en blanc : deux couches superposées.
   .t-bg porte le fond et passe par le filtre #goo, qui fusionne les lignes
   en une seule forme aux coins arrondis ; .t-fg porte le texte, net. */
.card-title {
  display: grid; margin: -4px 0 0;
  font-size: 20px; line-height: 1.15; font-weight: 700;
}
.card-title .t {
  grid-area: 1 / 1;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  height: calc(2.3em + 8px); padding: 4px 0;
}
.card-title .t span { padding: 3px 8px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.card-title .t-bg { color: transparent; filter: url(#goo); }
.card-title .t-bg span { background: #fff; }
.card-title .t-fg { position: relative; }
.tags { display: flex; gap: 5px; margin: 6px 0 9px; height: 22px; overflow: hidden; }
.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.tag.private { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); gap: 5px; padding: 0 7px; }
.tag.private img { width: 16px; height: 16px; }
.media { position: relative; height: var(--media-h, 204px); border-radius: 12px; overflow: hidden; background: #fff; }
.media img { width: 100%; height: 100%; object-fit: cover; }

/* Hauteur des photos : remplit l'écran, avec ou sans message important */
#stage { --media-h: 230px; }
#stage:not(.has-alert) { --media-h: 266px; }
#stage.boxed { --media-h: 204px; }
#stage.boxed:not(.has-alert) { --media-h: 236px; }

/* Date : posée au bord bas de la photo */
.date {
  position: absolute; left: 8px; bottom: 8px;
  display: flex; flex-direction: column; justify-content: center;
  padding: 4px 9px; border-radius: 7px; line-height: 1.1;
  background: var(--yellow); color: var(--ink);
}
.date b { font-size: 17px; font-weight: 700; }
.date small { font-size: 12px; }
.date-sobre .date { background: #fff; border: 1.5px solid var(--ink); }

/* ---------- Message important : simple cadre ---------- */
.alert {
  display: flex; align-items: center; gap: 18px;
  margin: 0 var(--side) 0 0; height: 62px; padding: 0 20px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: var(--radius);
  overflow: hidden;
}
.alert-label { flex: none; font-size: 21px; font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.alert-count, .modal-box h3 i {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #ef6c62; color: #fff; font-style: normal; font-size: 16px;
}
.alert-window { flex: 1; overflow: hidden; white-space: nowrap; border-left: 2px solid var(--ink); padding-left: 18px; }
.alert-text { display: inline-block; font-size: 23px; padding-left: 100%; animation: marquee var(--dur, 18s) linear infinite; }
.alert-text em { font-style: italic; }
.alert-text .sep { margin: 0 40px; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Raccourcis ---------- */
/* Menu : vraie barre de navigation en bas, fixe sur toutes les pages.
   Barre blanche pleine largeur, filet en haut, onglet actif en jaune. */
.body { display: contents; }
.views { order: 1; padding-left: var(--side); }
.bottom { order: 2; }
.rail {
  order: 3; flex: none; height: 132px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 var(--side) 14px 26px;
  background: #fff; border-top: var(--line) solid var(--ink);
}
.rail .tile {
  flex: 0 0 190px; height: 98px; gap: 8px;
  border: 0; border-radius: 16px; background: transparent;
  font-size: 15px; letter-spacing: .4px; text-transform: uppercase;
}
.rail .tile img { width: 38px; height: 38px; }
.rail .tile br { display: none; }
.rail .tile.active { background: var(--yellow); }
.a11y-btn::before {
  content: ""; position: absolute; left: -57px; top: -10px; bottom: -10px;
  border-left: 2px solid var(--ink); opacity: .25;
}
.tile.active { background: var(--yellow); }

/* Zone sous le menu : accueil ou sous-page */
.views { position: relative; flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#home.paged .content { visibility: hidden; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  height: 108px; padding: 0 4px; border-radius: 16px;
  border: var(--line) solid var(--ink); background: #fff;
  font-size: 14px; line-height: 1.1; font-weight: 700; text-align: center; gap: 7px;
}
.tile img { width: 38px; height: 38px; object-fit: contain; }

/* ---------- Pied de page ---------- */
.bottom { display: flex; align-items: center; padding: 0 var(--side) 6px; height: 76px; flex: none; }
.more { font-size: 28px; font-weight: 400; }
.more em { font-style: italic; font-weight: 700; }

.a11y-btn {
  position: absolute; right: var(--side); bottom: 42px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  height: 62px; padding: 0 10px 0 14px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 16px;
}
.a11y-chair { height: 40px; width: auto; }
.a11y-arrow { width: 38px; height: 38px; transform: rotate(90deg); transition: transform .3s; }
.a11y .a11y-btn { background: var(--yellow); }
.a11y .a11y-arrow { transform: rotate(-90deg); }

/* ---------- Mode accessibilité : tout le contenu descend ---------- */
#home.a11y .top { margin-top: 520px; }
#home.a11y .views { flex: none; min-height: 1100px; }
#home.a11y .scroller { overflow-y: auto; scrollbar-width: none; }
#home.a11y .rail { position: sticky; bottom: 0; z-index: 3; }
#home.a11y .scroller::-webkit-scrollbar { display: none; }
#home.a11y .top::after {
  content: "Mode accessibilité · faites glisser vers le haut pour voir la suite";
  position: absolute; left: var(--side); right: var(--side); top: 200px;
  font-size: 28px; text-align: center; padding: 26px; border: var(--line) dashed var(--ink); border-radius: var(--radius);
  background: rgba(255,255,255,.5);
}

/* ==========================================================================
   Sous-pages
   ========================================================================== */
.page {
  position: absolute; inset: 0; z-index: 2;
  overflow-y: auto; padding: 0 var(--side) 40px; scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.back {
  display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 26px 0 12px; margin-bottom: 18px;
  background: #fff; border: var(--line) solid var(--ink); border-radius: 18px;
  font-size: 30px; font-weight: 700;
}
.back img { width: 52px; height: 52px; transform: scaleX(-1); }
.page-body h1 { font-size: 64px; line-height: 1.05; margin: 10px 0 16px; font-weight: 700; }
.page-body h1 .light { font-weight: 300; }
.page-body .tags { height: auto; margin: 0 0 22px; }
.page-body .tag { height: 32px; font-size: 20px; padding: 0 12px; }

.panel { background: #fff; border: var(--line) solid var(--ink); border-radius: var(--radius); padding: 30px 34px; }
.detail-media { border-radius: var(--radius); overflow: hidden; height: 600px; margin-bottom: 24px; background: #fff; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.fact { background: var(--yellow); border-radius: 10px; padding: 10px 16px; font-size: 26px; line-height: 1.15; }
.fact b { display: block; font-size: 30px; }
.fact.neutral { background: #fff; border: 2px solid var(--ink); }
.prose { font-size: 27px; line-height: 1.45; }
.prose p { margin: 0 0 .8em; }
.qr-panel { display: flex; align-items: center; gap: 30px; margin-top: 28px; }
.qr { flex: none; width: 200px; height: 200px; padding: 10px; background: #fff; border-radius: 12px; }
.qr img, .qr canvas { width: 100% !important; height: 100% !important; }
.qr-panel p { margin: 0; font-size: 27px; line-height: 1.35; }
.qr-panel .url { font-weight: 700; word-break: break-all; }
.btn {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; height: 64px; padding: 0 26px;
  border: var(--line) solid var(--ink); border-radius: 16px; background: var(--yellow); font-size: 26px; font-weight: 700;
}
.map-frame { width: 100%; height: 1000px; border: var(--line) solid var(--ink); border-radius: var(--radius); background: #fff; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.legend li { list-style: none; background: #fff; border-radius: 12px; padding: 14px 18px; font-size: 24px; }
.legend ul { padding: 0; margin: 0; }
.plan-img { background: #fff; border-radius: var(--radius); padding: 24px; height: 1080px; display: grid; place-items: center; }
.plan-img img { max-height: 100%; }
.about-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
.about-photos img { width: 100%; height: 300px; object-fit: cover; border-radius: var(--radius); }
.todo { background: var(--yellow-soft); border: 2px dashed var(--grey); border-radius: 12px; padding: 12px 18px; font-size: 20px; margin-top: 20px; }

/* ---------- Pop-up messages : simples cadres ---------- */
.modal { position: absolute; inset: 0; z-index: 20; background: rgba(35,31,32,.35); display: grid; place-items: center; }
.modal-box { position: relative; width: 900px; background: #fff; border: var(--line) solid var(--ink); border-radius: 28px; padding: 40px 44px 44px; }
.modal-box h3 { margin: 0 0 26px; text-align: center; font-size: 40px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 12px; }
.modal-close { position: absolute; right: 22px; top: 22px; width: 58px; height: 58px; border: var(--line) solid var(--ink); border-radius: 50%; font-size: 40px; line-height: 1; display: grid; place-items: center; }
.modal-list { display: flex; flex-direction: column; gap: 16px; }
.modal-item { border: var(--line) solid var(--ink); border-radius: 18px; padding: 20px 26px; text-align: center; }
.modal-item strong { display: block; font-size: 28px; }
.modal-item span { font-size: 24px; }
