/* Site public : design « console » (voir ~/.claude/stack-web/DESIGN.md).
   Variables en clair ; redéfinies sous html.dark pour le thème sombre. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap;
  src: url("../vendor/fonts/inter/Inter-Regular.3875f8357497.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap;
  src: url("../vendor/fonts/inter/Inter-Medium.7b7f3cfa2944.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap;
  src: url("../vendor/fonts/inter/Inter-SemiBold.b72fa2728a8e.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap;
  src: url("../vendor/fonts/inter/Inter-Bold.66894432e7ff.woff2") format("woff2"); }
@font-face { font-family: "Material Symbols Outlined"; font-style: normal; font-weight: 100 700;
  font-display: block; src: url("../vendor/fonts/material-symbols/Material-Symbols-Outlined.3d7864cf3b00.woff2") format("woff2"); }

:root {
  --ink: #222222; --muted: #6a6a6a; --line: #dddddd; --soft: #f7f7f7;
  --bg: #ffffff; --surface: #ffffff; --on-ink: #ffffff; --input-line: #b0b0b0;
  --accent: var(--brand, #0f766e);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --danger: #c13515; --danger-bg: #fdeeea;
  --ok-bg: #ecfdf3; --ok-fg: #067647;
  --warn-bg: #fef6e7; --warn-fg: #b54708;
  --radius: 12px;
  color-scheme: light;
}
html.dark {
  --ink: #ececec; --muted: #a1a1a1; --line: #3a3a3a; --soft: #2a2a2a;
  --bg: #161616; --surface: #1f1f1f; --on-ink: #161616; --input-line: #555555;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --danger: #f87171; --danger-bg: #3a1c1c;
  --ok-bg: #0f2e1f; --ok-fg: #6ee7a8;
  --warn-bg: #3a2a0c; --warn-fg: #fbbf5d;
  color-scheme: dark;
}

body { font-family: "Inter", system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
a { color: inherit; }

.material-symbols-outlined { font-family: "Material Symbols Outlined"; font-weight: 400; font-style: normal;
  font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block;
  white-space: nowrap; word-wrap: normal; direction: ltr; -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga"; vertical-align: middle; user-select: none; }

/* --- En-tête ------------------------------------------------------------------------ */
.pub-header { position: sticky; top: 0; z-index: 20; min-height: 64px; background: var(--bg);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem 1.5rem; padding: .35rem 2rem; }
.pub-header-lieu { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.pub-header .pub-theme { flex: none; }
.pub-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem;
  color: var(--accent); text-decoration: none; }
.pub-theme { display: inline-flex; background: var(--soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; gap: 2px; }
.pub-theme button { border: 0; background: transparent; color: var(--muted); width: 2.25rem; height: 2.25rem;
  border-radius: 999px; display: grid; place-items: center; cursor: pointer; }
.pub-theme button .material-symbols-outlined { font-size: 20px; }
.pub-theme button:hover { color: var(--ink); }
.pub-theme button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* --- Page --------------------------------------------------------------------------- */
.pub-main { max-width: 1440px; margin: 0 auto; padding: 1rem 2rem 3rem; }
.pub-title { display: flex; align-items: baseline; gap: .25rem 1rem; flex-wrap: wrap; margin-bottom: .75rem; }
.pub-title h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.pub-muted { color: var(--muted); font-size: .9rem; }
/* Une colonne : la photo en grand en premier, puis les routes. */
.pub-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start;
  grid-template-areas: "cam" "route"; }
#cam { grid-area: cam; min-width: 0; }
#circulation { grid-area: route; min-width: 0; }
.pub-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pub-card-body { padding: 1.5rem; display: grid; gap: 1.25rem; }
.pub-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.pub-card-head h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.125rem; }
.pub-card-head .pub-muted { white-space: nowrap; }
.pub-card-head .material-symbols-outlined { color: var(--accent); }

/* --- Webcam ------------------------------------------------------------------------- */
.pub-hero { overflow: hidden; }
.pub-photo { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 82vh; padding: 0; border: 0;
  background: var(--soft); cursor: zoom-in; }
.pub-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-photo-zoom { position: absolute; right: .75rem; bottom: .75rem; background: rgba(0,0,0,.55); color: #fff;
  border-radius: 999px; padding: .35rem; display: grid; place-items: center; }
.pub-photo-zoom .material-symbols-outlined { font-size: 20px; }
.pub-hero-bar { padding: 1.1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); }
.pub-time { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.pub-badge { white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .35rem .85rem;
  font-size: .875rem; font-weight: 500; background: var(--soft); color: var(--muted); }
.pub-badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }
.pub-badge-ok { background: var(--ok-bg); color: var(--ok-fg); }
.pub-badge-warn { background: var(--warn-bg); color: var(--warn-fg); }
.pub-history { border-top: 1px solid var(--line); padding: 1rem 1.5rem 1.25rem; display: grid; gap: .75rem; }
.pub-history-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pub-history h3 { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; }
.pub-datejump { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--input-line);
  border-radius: 999px; padding: .5rem 1rem; cursor: pointer; background: var(--surface); color: var(--ink);
  font: inherit; font-size: .9rem; font-weight: 500; }
.pub-datejump:hover { border-color: var(--ink); }
.pub-datejump.dp-rempli { border-color: var(--ink); font-weight: 600; }
.pub-datejump .material-symbols-outlined { font-size: 22px; color: var(--accent); }
.pub-scrub { display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: center; }
.pub-scrub input[type="range"] { width: 100%; accent-color: var(--ink); height: 1.6rem; margin: 0; cursor: pointer; }
.pub-scrub-label { font-size: .85rem; font-weight: 600; min-width: 11rem; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.pub-strip { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin;
  scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.pub-strip-more { flex: 0 0 1px; }
.pub-thumb { flex: 0 0 132px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--soft); padding: 0; cursor: pointer; text-align: left; color: inherit; scroll-snap-align: start; }
.pub-thumb:hover { border-color: var(--ink); }
.pub-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pub-thumb span { display: block; font-size: .75rem; padding: .25rem .5rem; color: var(--muted); }
.pub-empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 3rem 1.5rem;
  text-align: center; color: var(--muted); }
.pub-empty .material-symbols-outlined { font-size: 40px; display: block; margin: 0 auto .5rem; }

/* --- Météo -------------------------------------------------------------------------- */
.pub-now { display: flex; align-items: center; gap: 1rem; }
.pub-now .material-symbols-outlined { font-size: 56px; color: var(--accent); }
.pub-temp { font-size: 2.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.pub-facts { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1rem; }
.pub-fact { display: flex; gap: .6rem; align-items: center; font-size: .9rem; }
.pub-fact .material-symbols-outlined { font-size: 20px; color: var(--muted); }
.pub-fact b { display: block; font-weight: 600; line-height: 1.2; }
.pub-fact small { color: var(--muted); font-size: .75rem; }
.pub-days { display: grid; }
.pub-day { display: grid; grid-template-columns: 1fr 28px auto; align-items: center; gap: .75rem;
  padding: .65rem 0; border-top: 1px solid var(--line); font-size: .9rem; }
.pub-day:first-child { border-top: 0; }
.pub-day .material-symbols-outlined { font-size: 24px; color: var(--accent); }
.pub-day-name { font-weight: 600; }
.pub-day-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.pub-range { text-align: right; font-variant-numeric: tabular-nums; }
.pub-range span { color: var(--muted); }
.pub-snow { color: var(--accent); font-size: .75rem; display: block; }

/* --- Météo compacte (en-tête, en haut à droite) : icônes et températures --------------------- */
.pub-meteo { margin-left: auto; display: flex; align-items: center; gap: .5rem 1.25rem; min-width: 0; }
.pub-meteo-now { display: flex; align-items: center; gap: .4rem; padding-right: 1.25rem; border-right: 1px solid var(--line); }
.pub-meteo-now .material-symbols-outlined { font-size: 38px; color: var(--accent); }
.pub-meteo-temp { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.pub-meteo-days { display: flex; gap: .25rem; }
.pub-meteo-day { display: grid; justify-items: center; gap: 0; padding: .1rem .5rem; text-align: center; min-width: 3.4rem; }
.pub-meteo-label { font-size: .7rem; color: var(--muted); font-weight: 500; white-space: nowrap; line-height: 1.2; }
.pub-meteo-day .material-symbols-outlined { font-size: 26px; color: var(--accent); }
.pub-meteo-range { font-weight: 600; font-size: .85rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pub-meteo-range small { color: var(--muted); font-weight: 500; font-size: .75rem; }
.pub-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Circulation -------------------------------------------------------------------- */
.pub-road-status { display: flex; align-items: center; gap: .75rem; border-radius: 10px; padding: .85rem 1rem;
  font-weight: 600; background: var(--ok-bg); color: var(--ok-fg); }
.pub-road-status.niveau-gene, .pub-road-status.niveau-incident { background: var(--warn-bg); color: var(--warn-fg); }
.pub-road-status.niveau-coupee { background: var(--danger-bg); color: var(--danger); }
.pub-axes { display: flex; flex-wrap: wrap; gap: .5rem; }
.pub-axe { display: inline-flex; align-items: center; gap: .4rem; border-radius: 999px; padding: .35rem .85rem .35rem .6rem;
  font-size: .9rem; font-weight: 600; background: var(--ok-bg); color: var(--ok-fg); }
.pub-axe .material-symbols-outlined { font-size: 20px; }
.pub-axe.niveau-gene, .pub-axe.niveau-incident { background: var(--warn-bg); color: var(--warn-fg); }
.pub-axe.niveau-coupee { background: var(--danger-bg); color: var(--danger); }
.pub-events { display: grid; }
.pub-event { display: grid; grid-template-columns: 28px 1fr; gap: .75rem; padding: .85rem 0;
  border-top: 1px solid var(--line); font-size: .9rem; }
.pub-event:first-child { border-top: 0; }
.pub-event .material-symbols-outlined { font-size: 24px; color: var(--warn-fg); }
.pub-event.niveau-coupee .material-symbols-outlined { color: var(--danger); }
.pub-event-titre { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.pub-event-axe { background: var(--ink); color: var(--on-ink); border-radius: 999px; padding: .1rem .65rem; font-size: .8rem;
  font-weight: 600; }
.pub-event-route { font-weight: 700; }
.pub-event-meta { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.pub-link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; font-size: .9rem; }
.pub-link .material-symbols-outlined { font-size: 18px; }

/* --- Grand sélecteur de dates (voir DESIGN.md) -------------------------------------------- */
.dp-dialog { border: 0; padding: 0; margin: auto; border-radius: 20px; width: min(760px, 96vw); max-height: 94vh; max-height: 94dvh;
  background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto; }
.dp-dialog::backdrop { background: rgba(0,0,0,.45); }
.dp-tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem .5rem; }
.dp-fleche { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); display: grid; place-items: center; cursor: pointer; flex: none; }
.dp-fleche:hover:not(:disabled) { border-color: var(--ink); }
.dp-fleche:disabled { opacity: .3; cursor: default; }
.dp-selects { display: flex; gap: .5rem; }
.dp-selects select { font: inherit; font-weight: 600; font-size: .95rem; padding: .45rem .8rem; border-radius: 999px;
  border: 1px solid var(--input-line); background: var(--surface); color: var(--ink); cursor: pointer; }
.dp-mois-zone { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; padding: .75rem 1.5rem 1.25rem; }
.dp-titre { text-align: center; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; font-size: .85rem;
  margin-bottom: .9rem; }
.dp-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: .25rem 0; }
.dp-sem { text-align: center; font-size: .75rem; color: var(--muted); font-weight: 500; padding-bottom: .35rem; text-transform: uppercase; }
.dp-jour { aspect-ratio: 1; width: 100%; border-radius: 50%; border: 1px solid transparent; background: transparent; color: var(--ink);
  font: inherit; font-size: .95rem; font-weight: 500; cursor: pointer; display: grid; place-items: center; padding: 0; }
.dp-jour:hover:not(:disabled) { border-color: var(--ink); }
.dp-jour.dp-aujourdhui { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.dp-jour[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.dp-jour:disabled { opacity: .3; text-decoration: line-through; cursor: default; }
.dp-pied { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem;
  border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.dp-effacer { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; padding: .5rem; }
.dp-valider { background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); border-radius: 8px;
  padding: .75rem 1.5rem; font: inherit; font-weight: 600; cursor: pointer; }
.dp-valider:hover { opacity: .88; }
@media (max-width: 699px) {            /* téléphone : plein écran, un seul mois */
  .dp-dialog { width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; margin: 0; }
  .dp-mois-zone { grid-template-columns: 1fr; padding: .75rem 1rem 1.25rem; }
  .dp-tete { padding: 1rem 1rem .25rem; }
  .dp-jour { font-size: 1.05rem; }
}

/* --- Visionneuse plein écran ------------------------------------------------------------- */
.pub-viewer { padding: 0; border: 0; background: #000; color: #fff; margin: 0; max-width: 100vw; max-height: none;
  width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; }
.pub-viewer::backdrop { background: #000; }
.pub-viewer-stage { position: absolute; inset: 0; touch-action: none; overflow: hidden; user-select: none;
  -webkit-user-select: none; cursor: grab; }
.pub-viewer-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; }
/* Rotation manuelle (bouton, utile si la rotation du téléphone est verrouillée) : la scène (image + boutons)
   pivote de 90°. Sa largeur devient la hauteur de l'écran et inversement. */
.pub-viewer[data-rot="1"] .pub-viewer-stage { inset: auto; top: 0; left: 100vw; width: 100vh; width: 100dvh;
  height: 100vw; transform-origin: 0 0; transform: rotate(90deg); }
.pub-viewer-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding: .6rem .8rem .6rem 1rem; cursor: default;
  background: linear-gradient(rgba(0,0,0,.7), transparent); }
.pub-viewer-legende { font-size: .9rem; font-weight: 500; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.pub-viewer-ctrl { position: absolute; bottom: .9rem; left: 50%; transform: translateX(-50%); display: flex; gap: .4rem;
  padding: .35rem; border-radius: 999px; background: rgba(20,20,20,.72); cursor: default; }
.pub-viewer-btn { border: 0; background: transparent; color: #fff; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; }
.pub-viewer-btn:hover, .pub-viewer-btn:focus-visible { background: rgba(255,255,255,.18); }
.pub-viewer-bar .pub-viewer-btn { background: rgba(20,20,20,.72); }
@media (hover: hover) and (pointer: fine) { .pub-viewer-btn[data-visu="rotation"] { display: none; } }  /* ordinateur : inutile */

.pub-footer { max-width: 1440px; margin: 0 auto; padding: 0 2rem 2.5rem; color: var(--muted); font-size: .85rem; }

/* --- Mobile ------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .pub-meteo-day:nth-child(n+4) { display: none; }  /* 3 jours si la place manque */
  .pub-header-lieu { display: none; }
}
@media (max-width: 860px) {
  .pub-header { position: static; flex-wrap: wrap; padding: .5rem 1rem; min-height: 0; }
  .pub-theme { margin-left: auto; }
  .pub-meteo { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .pub-meteo-now { padding-right: .75rem; }
  .pub-meteo-days { flex: 1; justify-content: space-around; }
  .pub-meteo-day { min-width: 0; padding: .1rem .25rem; }
  .pub-meteo-day:nth-child(n+4) { display: flex; flex-direction: column; align-items: center; }
  .pub-main { padding: .5rem 1rem 2rem; }
  .pub-time { font-size: 1.6rem; }
  .pub-history { padding: .9rem 1rem 1rem; }
  .pub-card-head h2 { font-size: 1rem; }
  .pub-scrub { grid-template-columns: 1fr; gap: .25rem; }
  .pub-scrub-label { text-align: left; min-width: 0; }
  .pub-thumb { flex-basis: 112px; }
  .pub-footer { padding: 0 1rem 2rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .pub-thumb, .pub-theme button { transition: border-color .15s, background .15s, color .15s; }
}
