/* ==========================================================================
   SUBVENCIONES · piezas de enlace al buscador (subvenciones.summummarketing.es)
   Tema: summum (WordPress, tema propio)
   Prefijo de clase: .sbv-   → cero colisiones con el tema
   Depende de las variables del tema (summum-v3.css / critical.css).
   Todas las var() llevan fallback literal por si la pieza se usa fuera del tema.

   Piezas:
     A) .sbv-franja   → banda ancha de home, antes del footer
     B) .sbv-kit      → banda contenida para las 161 páginas Kit Digital / Consulting
        .sbv-kit--sector → variante sin geografía (Kit Consulting)

   Reutiliza tal cual del tema: .wrap .section .eyebrow .h-display .it .underline
   .lead .btn .btn-large .arr .card .tag
   ========================================================================== */

/* --------------------------------------------------------------------------
   0 · Tokens locales (mapeados a los del tema; ver contraste medido en cada uno)
   -------------------------------------------------------------------------- */
.sbv-franja,
.sbv-kit {
  --sbv-ink:        var(--bg-ink, #0A0A0A);
  --sbv-paper:      var(--bg, #FAFAF7);
  --sbv-soft:       var(--bg-soft, #F0EDE5);
  --sbv-warm:       var(--bg-warm, #F6E9D7);
  --sbv-text:       var(--fg, #0A0A0A);
  --sbv-text-dim:   var(--fg-dim, rgba(10, 10, 10, 0.62));   /* 5.3:1 sobre warm */
  --sbv-on-ink:     var(--inv, #FAFAF7);                     /* 18.9:1 sobre ink */
  --sbv-on-ink-dim: var(--inv-dim, rgba(250, 250, 247, 0.7));/* 9.3:1  sobre ink */
  --sbv-line:       var(--line, rgba(10, 10, 10, 0.10));
  --sbv-line-ink:   var(--inv-line, rgba(250, 250, 247, 0.14));
  --sbv-accent:     var(--orange, #FF5E1A);                  /* 6.5:1 sobre ink → OK como texto sobre tinta */
  --sbv-accent-ink: var(--orange-deep, #E04F0F);             /* acentos NO textuales sobre claro: 3.8:1 ✔ 1.4.11 */
  --sbv-accent-2:   var(--yellow, #FFD66B);                  /* marcador: tinta sobre amarillo = 14.2:1 */
  --sbv-r:          var(--radius, 18px);
  --sbv-r-lg:       var(--radius-lg, 28px);
  --sbv-r-pill:     var(--radius-pill, 999px);
  --sbv-display:    var(--display, 'Fraunces', Georgia, serif);
  --sbv-sans:       var(--sans, 'Geist', system-ui, sans-serif);
  --sbv-mono:       var(--mono, 'Geist Mono', ui-monospace, monospace);
  font-family: var(--sbv-sans);
}

/* Utilidad a11y (el tema ya usa .visually-hidden inline; la duplicamos con prefijo) */
.sbv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Punto "en vivo" — mismo lenguaje que .eyebrow .dot y .pulse-dot del tema */
.sbv-live {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sbv-accent);
  flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(255, 94, 26, 0.55);
  animation: sbv-pulse 2.4s ease-in-out infinite;
}
@keyframes sbv-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 94, 26, 0.45); }
  60%      { box-shadow: 0 0 0 7px rgba(255, 94, 26, 0); }
}


/* ==========================================================================
   A · FRANJA DE HOME
   Banda ancha crema (--bg-warm) que corta la página antes del footer negro.
   Grid: mensaje + CTA a la izquierda | panel-contador oscuro a la derecha.
   ========================================================================== */
.sbv-franja {
  position: relative;
  overflow: hidden;
  background: var(--sbv-warm);
  border-top: 1px solid var(--sbv-line);
  padding: 96px 0;           /* = .section del tema */
  color: var(--sbv-text);
}

/* Decoración: mismo recurso que .circle del tema, siempre aria-hidden */
.sbv-franja__circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.sbv-franja__circle--a {
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  border: 1px solid rgba(10, 10, 10, 0.10);
}
.sbv-franja__circle--b {
  width: 220px;
  height: 220px;
  left: -90px;
  bottom: -110px;
  background: var(--sbv-accent);
  opacity: 0.07;
}

.sbv-franja__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 64px;
  align-items: center;
}

/* --- columna izquierda: mensaje ------------------------------------------ */
.sbv-franja__title {
  /* usa .h-display del tema; aquí sólo el tamaño (entre .h3 y .h2) */
  font-size: clamp(34px, 4.2vw, 62px);
  margin: 18px 0 0;
  max-width: 16ch;
}
.sbv-franja__lead {
  font-size: 19px;
  line-height: 1.5;
  color: var(--sbv-text);
  max-width: 48ch;
  margin: 22px 0 0;
}

/* 3 razones — filas cortas, tipografía del cuerpo, nada de iconos pesados */
.sbv-franja__reasons {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 52ch;
}
.sbv-franja__reasons li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: baseline;
  font-size: 15px;
  line-height: 1.5;
  color: var(--sbv-text-dim);
}
.sbv-franja__reasons li b {
  color: var(--sbv-text);
  font-weight: 500;
}
.sbv-franja__check {
  font-family: var(--sbv-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--sbv-text);          /* NO naranja: a 12px sobre crema daría 2.6:1 */
  border-bottom: 2px solid var(--sbv-accent-ink);
  text-align: center;
}

.sbv-franja__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 36px;
}
/* El CTA usa .btn .btn-large del tema (tinta sobre crema = 18.9:1).
   Deliberadamente NO usamos .btn-accent (blanco sobre naranja = 2.9:1, falla AA). */
.sbv-franja__cta {
  box-shadow: 0 14px 34px rgba(10, 10, 10, 0.14);
}
.sbv-franja__note {
  font-family: var(--sbv-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sbv-text-dim);
  margin: 0;
}

/* --- columna derecha: panel contador (oscuro) ----------------------------- */
.sbv-counter {
  background: var(--sbv-ink);
  color: var(--sbv-on-ink);
  border-radius: var(--sbv-r-lg);
  padding: 36px 36px 28px;
  box-shadow: 0 30px 70px rgba(10, 10, 10, 0.18);
}
.sbv-counter__label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sbv-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sbv-on-ink-dim);     /* 9.3:1 — no usamos --inv-mute (4.35:1, falla) */
  margin: 0;
}
.sbv-counter__num {
  font-family: var(--sbv-display);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.92;
  font-size: clamp(56px, 6.4vw, 104px);
  margin: 14px 0 0;
  font-variant-numeric: tabular-nums;
  color: var(--sbv-on-ink);
}
.sbv-counter__cap {
  font-size: 15px;
  line-height: 1.45;
  color: var(--sbv-on-ink-dim);
  margin: 10px 0 0;
  max-width: 24ch;
}
.sbv-counter__cap b {
  color: var(--sbv-on-ink);
  font-weight: 500;
}
.sbv-counter__facts {
  list-style: none;
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--sbv-line-ink);
  display: grid;
  gap: 12px;
}
.sbv-counter__facts li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sbv-on-ink-dim);
}
/* Etiqueta mono: en color de texto (18.9:1). El naranja NO se usa como texto aquí
   porque si el tema conmuta a dark el panel se invierte a claro y bajaría a 2.9:1. */
.sbv-counter__facts b {
  font-family: var(--sbv-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sbv-on-ink);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid var(--sbv-accent);
  padding-bottom: 2px;
}


/* ==========================================================================
   B · BANDA KIT (páginas Kit Digital / Kit Consulting)
   Contenida a propósito: tarjeta con borde, sin fondo de acento, sin display
   grande y con enlace de texto (nunca .btn) para no competir con el CTA
   principal de conversión de esas páginas.
   ========================================================================== */
.sbv-kit {
  position: relative;
  overflow: hidden;                 /* recorta la barra de acento contra el radio */
  max-width: 980px;
  margin: 56px auto;
  padding: 28px 32px;
  background: var(--sbv-paper);
  border: 1px solid var(--sbv-line);
  border-radius: var(--sbv-r);
  color: var(--sbv-text);
}
/* Única nota de color de la pieza: 3.8:1 vs papel ✔ (no textual, SC 1.4.11) */
.sbv-kit::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sbv-accent-ink);
}

.sbv-kit__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.sbv-kit__tag {
  /* = .tag del tema */
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--sbv-r-pill);
  background: var(--sbv-soft);
  font-family: var(--sbv-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sbv-text-dim);       /* 5.35:1 sobre --bg-soft ✔ */
}
.sbv-kit__tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sbv-accent-ink);
  flex: 0 0 auto;
}
.sbv-kit__title {
  font-family: var(--sbv-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-size: 21px;                  /* deliberadamente por debajo de los H2 de la página */
  margin: 14px 0 0;
  flex: 1 1 100%;
}
.sbv-kit__intro {
  font-size: 15px;
  line-height: 1.55;
  color: var(--sbv-text-dim);
  margin: 8px 0 0;
  max-width: 68ch;
}

/* Zona intercambiable: fallback estático ⇄ 3 ayudas reales.
   min-height reserva el alto para que el swap no provoque salto (CLS). */
.sbv-kit__slot {
  margin-top: 20px;
  min-height: 132px;
}

/* --- Estado por defecto servido en HTML (sin JS, sin red) ----------------- */
.sbv-kit__fallback {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
/* OJO: display:grid gana al [hidden]{display:none} del navegador. Imprescindible. */
.sbv-kit__fallback[hidden] { display: none; }
.sbv-kit__fallback li {
  border: 1px solid var(--sbv-line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--sbv-soft);
}
.sbv-kit__fb-k {
  display: block;
  font-family: var(--sbv-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sbv-text-dim);
  margin-bottom: 6px;
}
.sbv-kit__fb-v {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--sbv-text);
}

/* --- 3 ayudas reales (las inyecta embed-lite.js; oculto hasta tener datos) - */
.sbv-kit__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.sbv-kit__list[hidden] { display: none; }

.sbv-ayuda__link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--sbv-line);
  border-radius: 12px;
  background: var(--sbv-paper);
  text-decoration: none;
  color: inherit;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}
.sbv-ayuda__link:hover {
  background: var(--sbv-soft);
  border-color: var(--line-strong, rgba(10, 10, 10, 0.22));
  transform: translateY(-2px);
}
.sbv-ayuda__title {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--sbv-text);
  /* como mucho 3 líneas: las 3 tarjetas quedan a la misma altura */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sbv-ayuda__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: auto;
  font-family: var(--sbv-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sbv-text-dim);
}
.sbv-ayuda__amount {
  color: var(--sbv-text);
  font-weight: 500;
}
.sbv-ayuda__deadline::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sbv-accent-ink);
  margin-right: 6px;
  transform: translateY(-1px);
}

/* --- pie de la banda: enlace de texto, NUNCA botón ------------------------ */
.sbv-kit__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--sbv-line);
}
.sbv-kit__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--sbv-text);                       /* 18.6:1 ✔ */
  text-decoration: underline;
  text-decoration-color: var(--sbv-accent-ink);
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
  min-height: 44px;                              /* área táctil WCAG 2.2 (2.5.8) */
}
.sbv-kit__link .sbv-arr {
  display: inline-block;
  color: var(--sbv-accent-ink);
  transition: transform 220ms ease;
}
.sbv-kit__link:hover .sbv-arr { transform: translateX(3px); }
.sbv-kit__src {
  font-family: var(--sbv-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sbv-text-dim);
  margin: 0;
}

/* Variante sectorial (Kit Consulting, sin geografía) */
.sbv-kit--sector .sbv-kit__fallback { grid-template-columns: repeat(3, 1fr); }


/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .sbv-franja__inner { gap: 44px; }
}

@media (max-width: 900px) {
  .sbv-franja { padding: 72px 0; }
  .sbv-franja__inner { grid-template-columns: 1fr; gap: 36px; }
  .sbv-franja__circle--a { width: 260px; height: 260px; right: -100px; top: -100px; }
  .sbv-franja__circle--b { display: none; }
  .sbv-counter { padding: 28px 26px 24px; }
  .sbv-counter__num { font-size: clamp(52px, 14vw, 84px); }

  .sbv-kit { margin: 40px auto; padding: 24px; }
  .sbv-kit__slot { min-height: 0; }
  .sbv-kit__fallback,
  .sbv-kit__list,
  .sbv-kit--sector .sbv-kit__fallback,
  .sbv-kit--sector .sbv-kit__list { grid-template-columns: 1fr; }
  .sbv-ayuda__title { -webkit-line-clamp: 2; }
}

/* El tema, en ≤480px, machaca con !important:
     p, li { font-size:16px !important; line-height:1.6 !important }
     h2    { font-size:clamp(22px,6vw,32px) !important }
   Eso reventaba el número grande del contador (se quedaba en 16px) y agrandaba el
   título de la banda Kit por encima de los H2 de la página. Lo devolvemos a su sitio. */
@media (max-width: 480px) {
  .sbv-counter__label   { font-size: 11px !important; line-height: 1.4 !important; }
  .sbv-counter__num     { font-size: clamp(52px, 15vw, 84px) !important; line-height: 0.92 !important; }
  .sbv-counter__facts li{ font-size: 13px !important; line-height: 1.45 !important; }
  .sbv-franja__note     { font-size: 11px !important; line-height: 1.4 !important; }
  .sbv-kit__title       { font-size: 19px !important; line-height: 1.25 !important; }
  .sbv-kit__src         { font-size: 10px !important; line-height: 1.4 !important; }
}

@media (max-width: 560px) {
  .sbv-franja { padding: 56px 0; }
  .sbv-franja__title { font-size: clamp(28px, 8vw, 40px); max-width: none; }
  .sbv-franja__lead { font-size: 17px; }
  .sbv-franja__actions { gap: 14px; }
  .sbv-franja__cta { width: 100%; justify-content: center; min-height: 48px; }
  .sbv-kit { border-radius: 14px; padding: 20px; }
  .sbv-kit__foot { align-items: flex-start; flex-direction: column; gap: 8px; }
}


/* ==========================================================================
   Foco, movimiento reducido, impresión
   ========================================================================== */
/* El tema aplica un foco global naranja (*:focus-visible). Sobre el crema de la
   franja da 2.6:1 y sobre el papel 2.9:1 → incumple 1.4.11. Lo sustituimos por
   el color de texto, que se invierte solo con el tema: 16.5:1 (claro) / 16.4:1 (oscuro). */
.sbv-franja a:focus-visible,
.sbv-kit a:focus-visible {
  outline: 3px solid var(--sbv-text);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .sbv-live { animation: none; }
  .sbv-ayuda__link,
  .sbv-kit__link .sbv-arr,
  .sbv-franja__cta { transition: none !important; }
  .sbv-ayuda__link:hover { transform: none; }
}

@media print {
  .sbv-franja { background: #fff; padding: 24px 0; border-top: 1px solid #000; }
  .sbv-franja__circle, .sbv-live { display: none; }
  .sbv-counter { background: #fff; color: #000; box-shadow: none; border: 1px solid #000; }
  .sbv-counter__label, .sbv-counter__cap, .sbv-counter__facts li { color: #000; }
  .sbv-kit { break-inside: avoid; }
  .sbv-kit__link::after { content: " (subvenciones.summummarketing.es)"; font-size: 10px; }
}


/* ==========================================================================
   Modo oscuro del tema (html[data-theme="dark"])
   El tema invierte --bg-ink a claro, así que .sbv-counter pasa a ser una tarjeta
   clara sobre banda oscura (igual que su .section-dark). Dos retoques:
   ========================================================================== */
html[data-theme="dark"] .sbv-counter {
  /* sobre superficie clara el naranja puro cae a 2.9:1 → usamos el profundo (3.8:1) */
  --sbv-accent: var(--orange-deep, #E04F0F);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] .sbv-franja__circle--a { border-color: rgba(250, 250, 247, 0.14); }
html[data-theme="dark"] .sbv-franja__cta { box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); }
/* El marcador amarillo de .underline es para texto tinta; en oscuro el texto es
   crema, así que lo cambiamos por un subrayado naranja translúcido. */
html[data-theme="dark"] .sbv-franja__title .underline {
  background-image: linear-gradient(rgba(255, 94, 26, 0.55), rgba(255, 94, 26, 0.55));
}

/* Linea que devuelve al CTA principal de la pagina Kit: la banda es *ademas del* bono,
   no *en vez del* bono. Deliberadamente discreta: no debe competir con el CTA. */
.sbv-kit__protege {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sbv-text-dim);
  max-width: 46ch;
}
