/* ================================================================
   HEAR THE LIGHT — Page Travaux (travaux.html)
   L'idée forte de la page : les filtres SONT la typographie. Le mot
   choisi s'étire (axe wdth d'Anybody) et s'allume ; les autres restent
   condensés. Le reste est calme : une grille, le nom du client.
   Les cartes et la grille viennent de js/htl-works.js (styles injectés).
   Règles projet : animations toujours actives, mobile uniquement dans
   @media (max-width: 768px).
   ================================================================ */

.tv { position: relative; z-index: 2; }
.tv-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── En-tête ──────────────────────────────────────────────────── */
.tv-head {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(48px, 9vw, 150px));
  padding-bottom: clamp(36px, 5vw, 72px);
  /* Titre puis phrase en dessous : le titre s'élargit à l'animation, il ne doit jamais mordre sur le texte */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: clamp(16px, 2vw, 28px);
}
/* Halo : s'éteint avant les bords de sa boîte (plus de coupure nette sur les grands écrans) */
.tv-head::before {
  content: '';
  position: absolute; z-index: -1; pointer-events: none;
  left: -10%; top: 0; width: min(1100px, 90vw); height: 130%;
  background: radial-gradient(closest-side at 45% 58%, color-mix(in srgb, var(--light) 11%, transparent), transparent);
}
.tv-title { --tune-to: 96; margin-left: -.04em; white-space: nowrap; }
.tv-explain { color: var(--muted); font-size: clamp(17px, 1.35vw, 20px); max-width: 30em; margin: 0; }

/* ── Barre de filtres : les mots s'étirent ────────────────────── */
.tv-works { position: relative; z-index: 2; padding-bottom: clamp(40px, 6vw, 96px); }
.tv-bar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap;
  padding-top: clamp(20px, 2.4vw, 32px);
  border-top: 1px solid var(--line);
}
.tv-filters { display: flex; align-items: flex-end; gap: clamp(18px, 3.2vw, 52px); flex-wrap: wrap; }
.tv-filter {
  position: relative;
  display: inline-flex; align-items: flex-start; gap: .18em;
  margin: 0; padding: 0 0 14px; border: 0; background: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 5.4vw, 88px); line-height: .9; letter-spacing: -.01em;
  color: var(--muted);
  font-variation-settings: 'wdth' 56;
  transition: font-variation-settings .9s var(--ease-out), color .4s var(--ease-out);
}
.tv-filter:hover { color: var(--fg); font-variation-settings: 'wdth' 74; }
.tv-filter.is-active { color: var(--fg); font-variation-settings: 'wdth' 112; }
.tv-filter::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--light), var(--light-2));
  box-shadow: 0 0 18px color-mix(in srgb, var(--light) 70%, transparent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .8s var(--ease-out);
}
.tv-filter.is-active::after { transform: scaleX(1); }
.tv-count {
  font-family: var(--font-body); font-weight: 500; font-size: 13px; line-height: 1;
  letter-spacing: 0; font-variation-settings: normal;
  color: var(--muted); margin-top: .35em; min-width: 1ch;
  transition: color .4s;
}
.tv-filter.is-active .tv-count { color: var(--light); }
.tv-status { margin: 0 0 18px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Sous-filtres du côté Client : s'ouvrent sous la barre */
.tv-subbar {
  display: grid; grid-template-rows: 0fr;
  opacity: 0; transform: translateY(-6px);
  transition: grid-template-rows .55s var(--ease-out), opacity .45s var(--ease-out), transform .55s var(--ease-out);
}
.tv-subbar.is-open { grid-template-rows: 1fr; opacity: 1; transform: none; }
.tv-subbar__in { overflow: hidden; display: flex; flex-wrap: wrap; gap: 8px; }
.tv-subbar.is-open .tv-subbar__in { padding-top: 18px; }
.tv-sub {
  height: 40px; padding: 0 18px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  transition: background-color .3s, color .3s, box-shadow .3s;
}
.tv-sub:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--fg); }
.tv-sub.is-active { background: var(--fg); color: var(--bg); box-shadow: none; }

/* ── Grille ───────────────────────────────────────────────────── */
.tv-grid { margin-top: clamp(32px, 4vw, 56px); }
.tv-grid[hidden] { display: none; }

/* ── Rien à montrer ───────────────────────────────────────────── */
.tv-empty { margin-top: clamp(40px, 5vw, 72px); padding: clamp(32px, 5vw, 64px) 0; border-top: 1px solid var(--line); max-width: 860px; }
.tv-empty__title { font-variation-settings: 'wdth' 84; }
.tv-empty__body { margin: 18px 0 0; font-size: 17px; }
.tv-empty__actions { margin: 28px 0 0; }

/* ── Fin de page ──────────────────────────────────────────────── */
.tv-next { border-top: 1px solid var(--line); text-align: center; overflow: hidden; }
.tv-next__in { position: relative; display: flex; flex-direction: column; align-items: center; }
.tv-next__in::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 55%; width: min(1100px, 120vw); height: 420px; transform: translate(-50%, -50%);
  background: radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--light) 12%, transparent), transparent 70%);
}
.tv-next__title { max-width: 12em; font-variation-settings: 'wdth' 80; transition: font-variation-settings 1.2s var(--ease-out), opacity 1s var(--ease-out), transform 1s var(--ease-out); }
.tv-next__title:hover { font-variation-settings: 'wdth' 100; }
.tv-next__body { margin: 26px auto 0; font-size: 17px; max-width: 34em; }
.tv-next__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 36px; }

/* ================================================================
   MOBILE (≤ 768px)
   ================================================================ */
@media (max-width: 768px) {
  .tv-head { grid-template-columns: 1fr; gap: 18px; padding-top: calc(var(--nav-h) + 44px); padding-bottom: 28px; }
  .tv-head::before { left: -30%; width: 130%; } /* bord droit = 100 % : pas de défilement horizontal */
  .tv-title { font-size: clamp(56px, 19vw, 110px); }
  .tv-explain { font-size: 16px; padding-bottom: 0; }

  .tv-bar { flex-direction: column; align-items: flex-start; gap: 10px; padding-top: 18px; }
  .tv-filters { gap: 14px 16px; }
  .tv-filter { font-size: clamp(28px, 8.2vw, 36px); padding-bottom: 10px; min-height: 44px; align-items: flex-end; }
  .tv-filter.is-active { font-variation-settings: 'wdth' 96; }
  .tv-filter:hover { font-variation-settings: 'wdth' 56; color: var(--muted); }
  .tv-filter.is-active:hover { font-variation-settings: 'wdth' 96; color: var(--fg); }
  .tv-count { font-size: 11px; align-self: flex-start; }
  .tv-status { margin: 0; font-size: 13px; }

  .tv-subbar.is-open .tv-subbar__in { padding-top: 14px; }
  .tv-sub { height: 40px; padding: 0 15px; font-size: 13.5px; }

  .tv-grid { margin-top: 24px; }
  .tv-empty__body { font-size: 16px; }

  .tv-next__title { font-size: clamp(40px, 12vw, 60px); }
  .tv-next__body { font-size: 16px; }
  .tv-next__actions { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; }
}

/* ================================================================
   CHANTIER MOBILE (30/11) — Travaux, téléphones (≤ 768 px)
   ================================================================ */
@media (max-width: 768px) {
  /* Sous-filtres sur une seule ligne qui glisse, pastilles de 44 px */
  .tv-subbar__in {
    display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter);
    scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);
  }
  .tv-subbar__in::-webkit-scrollbar { display: none; }
  .tv-sub { flex: none; height: 44px; padding: 0 16px; font-size: 14px; scroll-snap-align: start; }
  .tv-count { font-size: 12px; }
  .tv-status { font-size: 14px; }
  .tv-next__actions .htl-btn { height: 52px; }
}
