/* =========================================================
   CQM · Clientes y sectores: logos de partículas
   Papel claro después de la plataforma azul: los logos están
   diseñados para blanco. Partículas de tinta y acentos hi-vis.
   Sin JS o con movimiento reducido: lista de sectores + retícula
   de los 31 logos en color.
   ========================================================= */
.cl {
  --cl-line: rgba(11, 26, 44, .12);
  position: relative; overflow: hidden; color: var(--ink);
  background: var(--paper);
  padding: max(calc(var(--header-h) + 28px), 12vh) 0 clamp(48px, 8vh, 88px);
}
.cl-wrap { position: relative; }

/* ---------- Sectores ---------- */
.cl-top { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.15fr); gap: clamp(24px, 4vw, 72px); align-items: center; }
.cl-sec { container-type: inline-size; min-width: 0; }
.cl-title {
  margin: 0 0 .5em; font-family: var(--font-display); font-stretch: 100%; font-weight: 560;
  font-size: clamp(1.05rem, .9rem + .5vw, 1.35rem); letter-spacing: -.005em; color: var(--ink-2);
}
.cl-now { display: none; margin: 0 0 clamp(18px, 3vh, 30px); }
.cl-now span {
  display: block; max-width: 15ch; color: var(--ink);
  font-family: var(--font-display); font-weight: 650; font-size: min(3.5rem, 8.4cqi); line-height: .98; letter-spacing: -.02em;
  font-stretch: 105%; transition: font-stretch 1s var(--ease-out), opacity .3s ease;
}
.cl-now.is-out span { font-stretch: 62%; opacity: 0; transition: font-stretch .32s var(--ease-out), opacity .2s ease; }
.cl-sectors { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.cl-sectors li {
  position: relative; padding-left: 14px;
  font-family: var(--font-display); font-stretch: 96%; font-weight: 600; font-size: clamp(1.05rem, .95rem + .5vw, 1.4rem); color: var(--ink);
}
.cl-sectors li::before { content: ""; position: absolute; left: 0; top: .28em; width: 4px; height: .8em; background: var(--hivis); }

/* ---------- Escenario del logo ---------- */
.cl-stage { position: relative; display: none; min-width: 0; height: clamp(250px, 38vh, 380px); }
.cl-gl { position: absolute; z-index: 2; max-width: none; pointer-events: none; }
/* sin z-index: así el multiply de cada logo se funde con el papel y no deja un recuadro blanco */
.cl-frame { position: absolute; }
.cl-img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; mix-blend-mode: multiply; opacity: 0; }
.cl-tag { position: absolute; left: 0; right: 0; z-index: 3; display: grid; justify-items: center; gap: 8px; }
.cl-dim {
  position: relative; display: block; height: 9px; width: var(--cl-w, 60%);
  border-bottom: 1px solid var(--ink); transform: scaleX(0); transform-origin: 50% 50%;
  transition: transform .5s var(--ease-out);
}
.cl-dim::before, .cl-dim::after { content: ""; position: absolute; bottom: -4px; width: 1px; height: 13px; background: var(--ink); }
.cl-dim::before { left: 0; } .cl-dim::after { right: 0; }
.cl-stage.is-set .cl-dim { transform: scaleX(1); transition: transform .9s var(--ease-out) .05s; }
.cl-label { display: flex; align-items: baseline; gap: 10px; margin: 0; opacity: 0; transition: opacity .2s ease; }
.cl-stage.is-set .cl-label { opacity: 1; transition: opacity .35s ease .15s; }
.cl-kind { display: none; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink-2); }
.cl-kind::before { content: ""; width: 7px; height: 7px; background: var(--hivis); }
.cl-kind.is-m::before { background: var(--ink-2); }
.cl-stage[data-k="c"] .cl-kind.is-c, .cl-stage[data-k="m"] .cl-kind.is-m { display: inline-flex; }
.cl-name {
  font-family: var(--font-display); font-weight: 640; font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); color: var(--ink);
  font-stretch: 62%; transition: font-stretch .3s var(--ease-out);
}
.cl-stage.is-set .cl-name { font-stretch: 100%; transition: font-stretch .9s var(--ease-out) .1s; }

/* ---------- Encabezado de la retícula ---------- */
.cl-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px;
  margin-top: clamp(28px, 5vh, 56px); padding-top: 18px; border-top: 1px solid var(--cl-line);
}
.cl-sub { margin: 0; font-family: var(--font-display); font-stretch: 100%; font-weight: 600; font-size: clamp(1rem, .92rem + .3vw, 1.2rem); color: var(--ink); }
.cl-counts { display: flex; gap: 22px; margin: 0; font-size: .95rem; color: var(--ink-2); }
.cl-k { display: inline-flex; align-items: baseline; gap: .35em; }
.cl-k::before { content: ""; width: 7px; height: 7px; align-self: center; background: var(--hivis); }
.cl-k-m::before { background: var(--ink-2); }
.cl-k b { font-family: var(--font-display); font-stretch: 110%; font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.cl-pause {
  display: none; align-items: center; gap: 8px; margin-left: auto; padding: 8px 2px; min-height: 44px;
  background: none; border: 0; cursor: pointer; font: inherit; font-size: .9rem; color: var(--ink-2);
}
.cl-pause i { position: relative; width: 10px; height: 11px; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.cl-pause[aria-pressed="true"] i { width: 0; height: 0; border: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.cl-pause .cl-p-off, .cl-pause[aria-pressed="true"] .cl-p-on { display: none; }
.cl-pause[aria-pressed="true"] .cl-p-off { display: inline; }
.cl-pause:focus-visible, .cl-tile:focus-visible { outline: 2px solid var(--hivis); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .cl-pause:hover { color: var(--ink); } }

/* ---------- Retícula de los 31 logos ---------- */
.cl-logos { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.cl-logos li { position: relative; aspect-ratio: 263 / 140; }
.cl-logos li::before { content: ""; position: absolute; z-index: 1; left: 4px; top: 4px; width: 5px; height: 5px; background: var(--ink-2); }
.cl-logos li[data-k="c"]::before { background: var(--hivis); }
.cl-logos img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; mix-blend-mode: multiply; }
.cl-tile { position: absolute; inset: 0; display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.cl-tile::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: -5px; height: 2px; background: var(--hivis);
  transform: scaleX(var(--cl-p, 0)); transform-origin: 0 50%;
}

/* ---------- En vivo (JS + movimiento permitido) ---------- */
.cl.is-live .cl-now { display: block; }
.cl.is-live .cl-stage { display: block; }
.cl.is-live .cl-pause { display: inline-flex; }
.cl.is-live .cl-sectors { gap: 6px 18px; }
.cl.is-live .cl-sectors li { font-size: .92rem; font-weight: 540; font-stretch: 92%; color: var(--ink-2); transition: color .3s ease; }
.cl.is-live .cl-sectors li::before { background: rgba(11, 26, 44, .25); transition: background-color .3s ease; }
.cl.is-live .cl-sectors li.is-on { color: var(--ink); }
.cl.is-live .cl-sectors li.is-on::before { background: var(--hivis); }
.cl.is-live .cl-logos { grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 8px 10px; }
.cl.is-live .cl-logos img { filter: grayscale(1) contrast(1.05); opacity: .5; transition: opacity .25s ease, filter .25s ease; }
.cl.is-live .cl-logos li.is-on img { filter: none; opacity: 1; }
@media (hover: hover) and (pointer: fine) { .cl.is-live .cl-tile:hover img { opacity: .9; } }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cl.is-live .cl-logos { grid-template-columns: repeat(11, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cl { padding: calc(var(--header-h) + 18px) 0 44px; }
  .cl-top { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cl-now { margin-bottom: 12px; }
  .cl-now span { font-size: 9.6cqi; max-width: none; }
  .cl-logos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cl.is-live .cl-logos { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px 8px; }
  .cl.is-live .cl-sectors { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .cl.is-live .cl-sectors li { font-size: .875rem; line-height: 1.3; }
  .cl-stage { height: min(62vw, 260px); margin-top: 6px; }
  .cl-head { gap: 6px 18px; margin-top: 18px; padding-top: 14px; }
  .cl-counts { font-size: .88rem; gap: 16px; }
  .cl-logos li::before { left: 2px; top: 2px; width: 4px; height: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .cl-now span, .cl-dim, .cl-name { transition: none; }
}
