/**
 * Componentes de la Home.
 *
 * Criterio de reparto: la estructura y los textos principales son widgets de
 * Elementor, para que el administrador los edite con el editor visual. Aquí
 * solo va el tratamiento visual que Elementor no sabe hacer con sus controles
 * (bordes en degradado, círculos numerados, chips) y los componentes repetidos
 * cuyo marcado tiene que ser idéntico de una tarjeta a otra.
 */

/* Titular del hero "máquina de escribir" (assets/hero-rotador.js). Todas las
   frases ocupan la MISMA celda de grid, así el titular mide lo que mide la
   frase más alta y pasar de una a otra no descuadra el bloque ni necesita
   medir alturas por JS. Lo mismo para los subtítulos. */
.hds-hero-rotador,
.hds-hero-subs {
    display: grid;
}

.hds-hero-subs { max-width: 680px; margin: 0 auto; }

.hds-hero-rotador .hds-hero-frase,
.hds-hero-subs .hds-hero-sub {
    grid-area: 1 / 1;
    visibility: hidden;
}

.hds-hero-rotador .hds-hero-frase.is-activa,
.hds-hero-subs .hds-hero-sub.is-activo {
    visibility: visible;
}

/* Con el script en marcha cada letra es un <span>: las que aún no se han
   escrito ocupan su sitio pero no se ven, así los saltos de línea no bailan
   mientras la frase se escribe. */
.hds-hero-rotador.is-escribiendo .hds-tw-l {
    position: relative;
    visibility: hidden;
}

.hds-hero-rotador.is-escribiendo .hds-hero-frase.is-activa .hds-tw-l.is-visible {
    visibility: visible;
}

/* Cursor: absoluto y pegado a la última letra escrita, para que no ocupe
   ancho ni cree un punto de corte de línea nuevo. */
.hds-hero-rotador .hds-tw-l.is-cursor::after,
.hds-hero-rotador .hds-tw-l.is-cursor-inicio::before {
    content: "";
    position: absolute;
    top: 0.12em;
    bottom: 0.08em;
    width: 0.06em;
    background: var(--hds-green);
    visibility: visible;
    animation: hds-cursor 0.9s steps(1) infinite;
}

.hds-hero-rotador .hds-tw-l.is-cursor::after { left: 100%; margin-left: 0.04em; }
.hds-hero-rotador .hds-tw-l.is-cursor-inicio::before { left: 0; }

@keyframes hds-cursor {
    50% { opacity: 0; }
}

/* El subtítulo cambia con un fundido corto; con visibility sola saltaría. */
.hds-hero-subs .hds-hero-sub {
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.hds-hero-subs .hds-hero-sub.is-activo {
    opacity: 1;
}

/* Indicador de frase de la maqueta del cliente. */
.hds-hero-puntos {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cada punto es un botón de 24 px (área de toque cómoda) con el punto de
   7 px pintado en ::before. Se anula todo lo que el tema y Elementor ponen a
   los <button>. */
.hds-hero-puntos button {
    all: unset;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 16px;
    height: 24px;
    cursor: pointer;
}

/* Hello Elementor pinta [type=button]:hover/:focus de #c36 y el kit global
   (.elementor-kit-4 button:hover) de navy, ambos con más o igual
   especificidad que la regla de arriba: aquí solo cambia el punto. El body
   del selector es solo para ganarles. */
body .hds-hero-puntos button:hover,
body .hds-hero-puntos button:focus,
body .hds-hero-puntos button:active {
    background: transparent;
    color: inherit;
    border: 0;
    box-shadow: none;
}

.hds-hero-puntos button::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hds-blue-soft);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.hds-hero-puntos button:hover::before {
    background: var(--hds-blue);
}

.hds-hero-puntos button.is-activo::before {
    background: var(--hds-blue);
    transform: scale(1.45);
}

.hds-hero-puntos button:focus-visible {
    outline: 2px solid var(--hds-blue);
    outline-offset: 0;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    .hds-hero-subs .hds-hero-sub,
    .hds-hero-puntos button::before { transition: none; }
}

/* --- Hero de Home ("Nueva versión - Home.png") --------------------------- */
/* Hero v3: halo arriba + retícula difuminada, en capas de fondo (Elementor ocupa el ::before). */
.e-con:has(.hds-hero-rotador):not(.e-con .e-con):not(.hds-fondo-oscuro) {
    --hds-reticula: color-mix(in srgb, var(--hds-blue) 6%, transparent);
    background:
        /* Centro por encima del borde: sin línea bajo la cabecera. */
        radial-gradient(ellipse 70% 75% at 50% -20%, var(--hds-blue-chip), transparent 75%),
        radial-gradient(ellipse 60% 70% at 50% 25%, transparent 15%, var(--hds-white) 70%),
        linear-gradient(var(--hds-reticula) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, var(--hds-reticula) 1px, transparent 1px) 0 0 / 56px 56px,
        var(--hds-white);
}

/* Oculto a la vista, no a Google ni a lectores de pantalla (h1 del hero). */
.hds-solo-lector {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* --- Hero de Home v3 (solo .hds-hero-home: Solución integral comparte rotador) --- */

/* Degradado en las letras; text-fill-color porque Elementor fija color con más especificidad. */
.hds-hero-home .hds-hero-frase__texto {
    background: var(--hds-degradado-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hds-hero-home .hds-hero-rotador em { font-style: normal; }

.hds-hero-home .hds-hero-rotador .hds-tw-l.is-cursor::after,
.hds-hero-home .hds-hero-rotador .hds-tw-l.is-cursor-inicio::before { background: var(--hds-green-boton); }

.hds-hero-home .hds-hero-antetitulo { color: var(--hds-blue); }

.hds-hero-home .hds-hero-antetitulo::before,
.hds-hero-home .hds-hero-antetitulo::after {
    height: 1.5px;
    background: var(--hds-green-boton);
}

.hds-hero-home .hds-hero-puntos button { width: auto; padding: 0 4px; }

.hds-hero-home .hds-hero-puntos button::before {
    width: 8px;
    height: 8px;
    border-radius: var(--hds-radio-pildora);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.hds-hero-home .hds-hero-puntos button.is-activo::before {
    width: 26px;
    transform: none;
}

/* Brillo verde, también en hover (interaccion.css lo cambiaría por sombra navy). */
.hds-hero-home .hds-hero-boton-principal .elementor-button,
.hds-hero-home .hds-hero-boton-principal .elementor-button:hover,
.hds-hero-home .hds-hero-boton-principal .elementor-button:focus-visible {
    box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--hds-green-boton) 70%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .hds-hero-home .hds-hero-puntos button::before { transition: none; }
}

/* Antetítulo en versalitas entre dos filetes verdes. */
.hds-hero-antetitulo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--hds-cyan-marca);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hds-hero-antetitulo::before,
.hds-hero-antetitulo::after {
    content: "";
    flex: 0 0 28px;
    height: 2px;
    background: var(--hds-green);
}

@media (max-width: 767px) {
    .hds-hero-antetitulo { font-size: 11px; letter-spacing: 0.1em; gap: 8px; text-align: center; }
    .hds-hero-antetitulo::before,
    .hds-hero-antetitulo::after { flex-basis: 16px; }
}

/* Titular: negro y 700, con el mismo tamaño, interlineado y peso que el
   resto de cabeceras (los pone el widget, ver HDS_El::titulo). Solo cambia
   el color: la palabra destacada va en azul en vez de en verde. */
.hds-hero-rotador em { color: var(--hds-blue); }

.hds-hero-rotador .hds-tw-l.is-cursor::after,
.hds-hero-rotador .hds-tw-l.is-cursor-inicio::before { background: var(--hds-blue); }

/* Ancho para que el subtítulo más largo (el 2.º, y en catalán) quepa en dos
   líneas en escritorio. */
.hds-hero-subs { max-width: 840px; }

/* Píldora de antetítulo sobre fondo claro ("Sector sanitario y sociosanitario"). */
.hds-pildora {
    display: inline-block;
    background: var(--hds-mint);
    color: var(--hds-navy);
    font-size: var(--hds-fs-small);
    padding: 7px 18px;
    border-radius: var(--hds-radio-pildora);
}

/* --- El problema no es la formación (propuesta v3, colores de la maqueta) - */
/* Cabeceras .hds-v3: verde de la maqueta y distancias más prietas que HDS_Tokens::CABECERA. */
.hds-v3 .elementor-heading-title em { color: var(--hds-green); }

.e-con.hds-v3 .elementor-widget.elementor-widget.hds-antetitulo {
    margin-block-end: calc(10px - var(--row-gap, 0px));
}

.hds-v3 .hds-entradilla {
    margin-top: calc(14px - var(--row-gap, 0px));
    text-wrap: balance;
}

/* Selector largo para ganar al max-width:100% de Elementor. */
.e-con.hds-v3 > .e-con-inner > .elementor-widget.hds-entradilla { max-width: 760px; }

.hds-problemas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    margin-top: 34px;
}

/* Franja «Con HDS» con margin-top:auto: alineada abajo en las cuatro. */
.hds-problema {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 28px 0;
    background: var(--hds-white);
    border: 1px solid var(--hds-linea-hero);
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.25s ease;
}

.hds-problema:hover { box-shadow: 0 20px 40px -25px color-mix(in srgb, var(--hds-blue) 35%, transparent); }

.hds-problema__icono {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: var(--hds-mint-hero);
    color: var(--hds-green-hero);
}

.hds-problema__ambito {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hds-blue);
}

.hds-problema h3 {
    margin: 0.45em 0 0.4em;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--hds-navy-hero);
}

.hds-problema p {
    margin: 0 0 22px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--hds-gray-hero);
}

.hds-problema .hds-problema__con {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: stretch;
    min-height: 96px;
    margin: auto -28px 0;
    padding: 16px 28px;
    background: linear-gradient(90deg, var(--hds-mint-hero), var(--hds-mint-hero-claro));
    border-top: 1px solid var(--hds-mint-hero-borde);
    font-size: 14px;
    line-height: 1.45;
    color: var(--hds-navy-hero);
}

.hds-problema__ok {
    display: grid;
    place-items: center;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--hds-verde-menta);
    color: var(--hds-white);
}

/* Verde de marca un 10 % más oscuro: texto sobre menta (franja, etiquetas) con ≥4,5:1. */
.hds-v3 { --hds-verde-menta: color-mix(in srgb, var(--hds-green) 90%, black); }

.hds-problema__con small {
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--hds-verde-menta);
}

.hds-problema__con b { font-weight: 700; }

/* Alto fijo de etiqueta + 2 líneas: «CON HDS» y el check alineados entre tarjetas. */
.hds-problema__con > span:last-child { min-height: calc(11px * 1.2 + 2px + 2 * 1.45em); }

@media (prefers-reduced-motion: reduce) {
    .hds-problema { transition: none; }
}

/* --- Rutas: "¿qué parte quieres externalizar?" (propuesta v3) ----------- */

.hds-rutas {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    /* Ancho explícito: el widget se encoge a su contenido. */
    width: 1160px;
    max-width: 100%;
    margin: 24px 0 14px;
}

/* Gana al color de enlace del kit global. */
.hds-rutas a.hds-ruta,
.hds-rutas a.hds-ruta:hover {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 300px;
    border-radius: 18px;
    overflow: hidden;
    text-align: left;
    text-decoration: none;
    color: var(--hds-white);
    box-shadow: 0 20px 40px -28px color-mix(in srgb, var(--hds-navy-hero) 60%, transparent);
}

/* Doble clase: `.elementor img { height: auto }` es más específico que una sola. */
.hds-ruta .hds-ruta__foto {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hds-ruta:hover .hds-ruta__foto,
.hds-ruta:focus-visible .hds-ruta__foto { transform: scale(1.06); }

.hds-ruta::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Más denso que la maqueta: con fotos claras no se leía. */
    background: linear-gradient(180deg, transparent 25%,
        color-mix(in srgb, var(--hds-navy-hero) 55%, transparent) 55%,
        color-mix(in srgb, var(--hds-navy-hero) 92%, transparent));
    transition: opacity 0.3s ease;
}

.hds-ruta::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, color-mix(in srgb, var(--hds-blue) 15%, transparent), color-mix(in srgb, var(--hds-navy-hero) 95%, transparent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hds-ruta:hover::before,
.hds-ruta:focus-visible::before { opacity: 1; }

.hds-ruta__texto {
    position: relative;
    z-index: 2;
    display: block;
    padding: 20px;
}

.hds-ruta__texto small {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    border-radius: var(--hds-radio-pildora);
    background: color-mix(in srgb, var(--hds-white) 18%, transparent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.hds-ruta__frase {
    display: block;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
}

.hds-ruta__ir {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hds-mint-enlace);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hds-ruta:hover .hds-ruta__ir,
.hds-ruta:focus-visible .hds-ruta__ir { opacity: 1; transform: none; }

.hds-ruta:focus-visible { outline: 3px solid var(--hds-blue); outline-offset: 3px; }

@media (hover: none) {
    .hds-ruta__ir { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hds-ruta__foto,
    .hds-ruta::before,
    .hds-ruta__ir { transition: none; }
}

@media (max-width: 767px) {
    .hds-rutas a.hds-ruta { min-height: 240px; }
}

/* --- Formaciones destacadas (propuesta v3) ------------------------------ */
/* Ancho explícito: el widget del shortcode se encoge a su contenido. */
.hds-destacadas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 1160px;
    max-width: 100%;
    margin: 24px 0 18px;
}

.hds-destacadas a.hds-destacada,
.hds-destacadas a.hds-destacada:hover {
    display: flex;
    flex-direction: column;
    text-align: left;
    text-decoration: none;
    color: inherit;
}

.hds-destacada__img {
    display: block;
    aspect-ratio: 3 / 2;
    border-radius: 16px;
    overflow: hidden;
    background: var(--hds-blue-chip);
}

/* Doble clase: `.elementor img { height: auto }` es más específico que una sola. */
.hds-destacada .hds-destacada__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hds-destacada:hover .hds-destacada__img img,
.hds-destacada:focus-visible .hds-destacada__img img { transform: scale(1.05); }

.hds-destacada__cat {
    margin: 16px 0 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--hds-green);
}

body .hds-destacada h3 {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--hds-navy-hero);
    transition: color 0.2s ease;
}

.hds-destacada:hover h3,
.hds-destacada:focus-visible h3 { color: var(--hds-blue); }

.hds-destacada__ir {
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--hds-blue);
}

.hds-destacada__ir span { display: inline-block; transition: transform 0.2s ease; }

.hds-destacada:hover .hds-destacada__ir span,
.hds-destacada:focus-visible .hds-destacada__ir span { transform: translateX(4px); }

.hds-destacada:focus-visible { outline: 3px solid var(--hds-blue); outline-offset: 4px; border-radius: 16px; }

@media (prefers-reduced-motion: reduce) {
    .hds-destacada .hds-destacada__img img,
    .hds-destacada h3,
    .hds-destacada__ir span { transition: none; }
}

/* --- SimulaCare, versión compacta (propuesta v3) ------------------------ */
/* Doble clase: `.elementor img { height: auto }` es más específico que una sola. */
.hds-sim-sec .hds-sim-logo { display: block; height: 40px; width: auto; margin-bottom: 4px; }

.hds-sim-antetitulo {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--hds-blue);
}

/* Doble clase: `.elementor img { height: auto }` es más específico que una sola. */
.hds-sim-sec .hds-sim-maqueta {
    display: block;
    width: 100%;
    border-radius: 22px;
    box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--hds-navy-hero) 55%, transparent);
    transition: transform 0.5s ease;
}

.hds-sim-sec .hds-sim-maqueta:hover { transform: translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
    .hds-sim-sec .hds-sim-maqueta { transition: none; }
    .hds-sim-sec .hds-sim-maqueta:hover { transform: none; }
}

/* --- Cumplimiento normativo (propuesta v3) ------------------------------- */

.hds-norma-foto {
    position: relative;
    margin: 0;
}

/* Doble clase: `.elementor img { height: auto }` es más específico que una sola. */
.hds-norma-foto img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 24px;
    box-shadow: 0 40px 70px -40px color-mix(in srgb, var(--hds-navy-hero) 50%, transparent);
}

.hds-norma-foto .hds-norma-foto__tarjeta {
    position: absolute;
    right: -32px;
    bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 270px;
    padding: 16px 18px;
    background: var(--hds-white);
    border-radius: 18px;
    box-shadow: 0 24px 50px -22px color-mix(in srgb, var(--hds-navy-hero) 45%, transparent);
    font-style: normal; /* el tema pone las figcaption en cursiva */
    text-align: left;
}

.hds-norma-foto__icono {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--hds-mint-hero);
    color: var(--hds-green-hero);
}

.hds-norma-foto__tarjeta b { display: block; font-size: 15px; line-height: 1.25; color: var(--hds-navy-hero); }
.hds-norma-foto__tarjeta b + span { display: block; font-size: 12px; line-height: 1.35; color: var(--hds-gray-hero); }

/* Línea entre el primer y el último círculo; los círculos la tapan. */
.hds-progreso {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    max-width: 440px;
    margin: 10px 0 6px;
    padding: 0;
    list-style: none;
}

.hds-progreso::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 16.6%;
    right: 16.6%;
    height: 2px;
    background: linear-gradient(90deg, var(--hds-blue), var(--hds-green-boton));
}

.hds-progreso li {
    position: relative;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--hds-navy-hero);
}

.hds-progreso i {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
    border: 2px solid var(--hds-green-hero);
    border-radius: 50%;
    background: var(--hds-white);
    font-style: normal;
    font-weight: 700;
    color: var(--hds-green-hero);
}

.hds-normas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 28px;
    margin: 4px 0 8px;
    padding: 22px 0;
    list-style: none;
    border-top: 1px solid var(--hds-linea-hero);
    border-bottom: 1px solid var(--hds-linea-hero);
}

.hds-normas li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--hds-navy-hero);
}

.hds-normas__icono {
    display: grid;
    place-items: center;
    flex: none;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--hds-mint-hero);
    color: var(--hds-green-hero);
}

@media (max-width: 767px) {
    .hds-norma-foto img { aspect-ratio: 4 / 3; }
    .hds-norma-foto .hds-norma-foto__tarjeta { right: 12px; bottom: -20px; }
    .hds-norma-foto { margin-bottom: 24px; }
    .hds-normas { grid-template-columns: 1fr; }
    .hds-progreso li { font-size: 12px; }
}

/* --- Blog: últimos artículos (propuesta v3) ------------------------------ */
/* Sin artículos el shortcode no pinta nada: fuera también cabecera y botón. */
.hds-blog-sec:not(:has(.hds-blog-ultimo)) { display: none !important; }

.hds-blog-home {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 1160px; /* ancho explícito: el widget se encoge a su contenido */
    max-width: 100%;
    margin: 20px 0 18px;
}

.hds-blog-home a.hds-blog-ultimo,
.hds-blog-home a.hds-blog-ultimo:hover {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--hds-white);
    box-shadow: 0 2px 14px rgba(29, 40, 84, 0.07);
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hds-blog-home a.hds-blog-ultimo:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -22px rgba(29, 40, 84, 0.4); }
.hds-blog-ultimo:focus-visible { outline: 3px solid var(--hds-blue); outline-offset: 3px; }

.hds-blog-ultimo__img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hds-blue-chip); }
.hds-blog-ultimo .hds-blog-ultimo__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.hds-blog-ultimo:hover .hds-blog-ultimo__img img { transform: scale(1.06); }

.hds-blog-ultimo__cuerpo { display: block; padding: 18px 18px 22px; }
.hds-blog-ultimo__meta { display: block; font-size: 12px; font-weight: 600; color: var(--hds-green); }

body .hds-blog-ultimo h3 { margin: 8px 0 6px; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--hds-navy-hero); }

.hds-blog-ultimo__resumen {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.55;
    color: var(--hds-gray-hero);
}

@media (prefers-reduced-motion: reduce) {
    .hds-blog-home a.hds-blog-ultimo,
    .hds-blog-ultimo .hds-blog-ultimo__img img { transition: none; }
    .hds-blog-home a.hds-blog-ultimo:hover { transform: none; }
}

/* --- Pasos "Cómo trabajamos" (propuesta v3, colores de la maqueta) ------- */
.hds-pasos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 22px;
    /* Sin esto, abrir un paso estiraría también el de al lado, cerrado. */
    align-items: start;
    width: 900px; /* ver .hds-rutas: el widget se encoge a su contenido */
    max-width: 100%;
    margin: 28px 0 18px;
}

.hds-paso {
    background: var(--hds-white);
    border: 1px solid var(--hds-mint-paso-borde);
    border-radius: 16px;
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.hds-paso:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -22px color-mix(in srgb, var(--hds-blue) 50%, transparent);
}

.hds-paso[open] {
    border-color: var(--hds-blue);
    box-shadow: 0 18px 36px -24px color-mix(in srgb, var(--hds-blue) 55%, transparent);
}

.hds-paso__cabecera {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
}

.hds-paso__cabecera::-webkit-details-marker { display: none; }

.hds-paso__cabecera:focus-visible { outline: 2px solid var(--hds-blue); outline-offset: -2px; border-radius: 16px; }

.hds-paso__num {
    flex: 0 0 40px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--hds-blue);
    color: var(--hds-white);
    font-weight: 700;
    font-size: 15px;
    display: grid;
    place-items: center;
    transition: background-color 0.25s ease;
}

.hds-paso[open] .hds-paso__num { background: var(--hds-green); }

body .hds-paso h3 {
    margin: 0;
    flex: 1 1 auto;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--hds-blue);
}

.hds-paso__flecha {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin: 0 4px 4px 0;
    border-right: 2px solid var(--hds-gray-hero);
    border-bottom: 2px solid var(--hds-gray-hero);
    transform: rotate(45deg);
    transition: transform 0.25s ease, margin 0.25s ease;
}

.hds-paso[open] .hds-paso__flecha { transform: rotate(-135deg); margin: 4px 4px 0 0; }

/* 74 = número (40) + hueco (14) + relleno (20). */
.hds-paso__cuerpo { padding: 0 20px 20px 74px; }

.hds-paso[open] .hds-paso__cuerpo { animation: hds-paso-abre 0.35s ease; }

@keyframes hds-paso-abre {
    from { opacity: 0; transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
    .hds-paso,
    .hds-paso__num,
    .hds-paso__flecha { transition: none; }
    .hds-paso:hover { transform: none; }
    .hds-paso[open] .hds-paso__cuerpo { animation: none; }
}

.hds-paso p { margin: 0 0 12px; color: var(--hds-gray-hero); font-size: 15px; line-height: 1.6; }
.hds-paso p:last-of-type { margin-bottom: 14px; }
.hds-paso p strong { color: var(--hds-navy-hero); font-weight: 600; }

.hds-chips {
    margin: 0;
    padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }

/* 11 px para que los tres chips de un paso quepan en una sola fila
   (pedido del cliente). */
.hds-chips li {
    list-style: none;
    background: var(--hds-mint-pale);
    color: var(--hds-navy);
    font-size: 11px;
    line-height: 1.4;
    padding: 6px 12px;
    border-radius: var(--hds-radio-pildora);
}

/* Solo las de los pasos (Solución integral usa .hds-chips). */
.hds-paso .hds-chips { gap: 6px; }

.hds-paso .hds-chips li {
    background: var(--hds-mint-hero);
    color: var(--hds-verde-menta);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
}

/* --- Métricas ---------------------------------------------------------- */
.hds-metricas {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
    position: relative;
}

/* Los cuatro iconos van unidos por una línea, como en el diseño. Empieza y
   acaba en el centro de la primera y la última columna (de ahí el 12.5 %), y
   queda por debajo de los iconos, que la tapan con su propio fondo. */
.hds-metricas::before {
    content: "";
    position: absolute;
    top: 37px;
    left: 12.5%;
    right: 12.5%;
    height: 2px;
    background: var(--hds-green);
    z-index: 0;
}

.hds-metricas > div { position: relative; z-index: 1; }

/* El fondo del icono es el que tapa la línea por detrás. Se recorta en
   círculo al tamaño del aro que ya dibuja el propio icono (los PNG del cliente
   traen 17 px de margen transparente sobre 200, así que el aro ocupa el
   41,5 % del radio): con el recuadro entero, o con relleno lateral, la línea
   se cortaba antes de llegar al círculo (pedido del cliente, imagen 8 de
   «Comentarios web.docx»). */
.hds-metricas img {
    height: 74px;
    width: 74px;
    background: var(--hds-cyan-pale);
    padding: 0;
    object-fit: contain;
    clip-path: circle(41.5%);
    margin: 0 auto 18px;
    display: block;
}

.hds-metricas > div { display: flex; flex-direction: column; }
.hds-metricas > div > b { margin-top: auto; }
.hds-metricas b { display: block; font-size: 34px; color: var(--hds-navy); line-height: 1.1; }
.hds-metricas span { color: var(--hds-navy); font-size: var(--hds-fs-small); line-height: 1.4; }

/* Propuesta v3: colores y ancho de la maqueta; los iconos del cliente, sobre blanco. */
.hds-v3 .hds-metricas { width: 100%; max-width: 1000px; margin: 0 auto; }
.hds-v3 .hds-metricas::before { background: color-mix(in srgb, var(--hds-green-hero) 60%, transparent); }
/* Recorte en el filete del propio icono (r=78 de 100): con 41,5 % quedaba un halo blanco. */
.hds-v3 .hds-metricas img { background: var(--hds-white); clip-path: circle(39.5%); }
.hds-v3 .hds-metricas b { font-size: 32px; color: var(--hds-navy-hero); }
.hds-v3 .hds-metricas span { color: var(--hds-gray-hero); }
.hds-v3 .hds-metricas > div > b { margin-top: 0; }

@media (max-width: 1024px) {
    .hds-v3 .hds-metricas::before { display: none; }
}

/* --- Avales ------------------------------------------------------------ */
.hds-avales {
    display: flex;
    justify-content: center;
    overflow: hidden;
}

/* Sin JS (o con prefers-reduced-motion, ver interaccion.css) esto es una
   fila normal que envuelve y se centra. Con JS, avales-marquee.js duplica
   su contenido y la desplaza sola hacia la izquierda: por eso `nowrap` y
   `width: max-content`, para que quepan todos los logos en una sola línea
   en vez de saltar a la de abajo. */
.hds-avales__track {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 28px 52px;
    width: max-content;
    max-width: 100%;
}

/* Franjas de clientes en lista (<ul>/<li>). */
ul.hds-avales__track { margin: 0; padding: 0; list-style: none; }
.hds-avales__track > li { display: flex; flex: 0 0 auto; align-items: center; }

/* Home: logos en gris que toman color al pasar el ratón. */
.hds-avales.hds-logos-gris img { filter: grayscale(1); opacity: 0.6; transition: filter 0.2s ease, opacity 0.2s ease; }
.hds-avales.hds-logos-gris img:hover { filter: none; opacity: 1; }

/* `is-marquee` la pone avales-marquee.js solo cuando ha duplicado el
   contenido y arrancado la animación: si el script no llega a ejecutarse,
   la fila se queda envolviendo con normalidad en vez de desbordar oculta. */
.hds-avales.is-marquee .hds-avales__track {
    flex-wrap: nowrap;
    max-width: none;
    will-change: transform;
}

/* Bordes difuminados solo en marcha: en la fila estática borraría los extremos. */
.hds-avales.is-marquee {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

/* Línea separadora difuminada en los extremos. */
.hds-avales-sec {
    border-bottom: 1px solid var(--hds-linea-hero);
    border-image: linear-gradient(90deg, transparent, var(--hds-linea-hero) 10%, var(--hds-linea-hero) 90%, transparent) 1;
}

.hds-avales img { max-height: 46px; width: auto; flex: 0 0 auto; }

/* El logo de Epic es un letrero apaisado sin margen: a 46 px de alto abultaba
   el doble que los demás. */
.hds-avales img[src*="aval-epic"] { max-height: 28px; }
/* El círculo y el eslogan de AMADE le comen alto: a 46 px su nombre quedaba diminuto. */
.hds-avales img[src*="aval-amade"] { max-height: 58px; }

/* Franja de logos de centros clientes (Home y Contacto): la misma mecánica
   que la de avales, con los 69 logos sueltos del cliente. Sin JS enseña solo
   la primera fila (los 8 grandes grupos van primero), no un muro de 69. */
.hds-logos-franja {
    width: 1160px; /* ver .hds-rutas: el widget se encoge a su contenido */
    max-width: 100%;
    margin: 0 auto;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.hds-logos-franja.is-marquee { justify-content: flex-start; }

.hds-logos-franja img { height: 40px; max-height: none; }

.hds-logos-franja:not(.is-marquee) .hds-avales__track {
    max-height: 40px;
    overflow: hidden;
}

/* Home: dos filas de clientes seguidas. */
.hds-logos-franja + .hds-logos-franja { margin-top: 22px; }

/* --- Casos de éxito ---------------------------------------------------- */
.hds-casos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.hds-caso {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Filete de color en el borde superior: distingue un caso de otro sin
       añadir otra tarjeta con sombra. */
    border-top: 3px solid var(--hds-caso-color, var(--hds-green));
}

.hds-caso img { width: 100%; aspect-ratio: 3 / 1; object-fit: cover; }
.hds-caso__cuerpo { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.hds-caso__cliente { color: var(--hds-blue); font-weight: 600; font-size: var(--hds-fs-small); }
.hds-caso__ambito { color: var(--hds-gray); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
body .hds-caso h3 { margin: 0; font-size: var(--hds-fs-body); color: var(--hds-navy); line-height: 1.35; }
.hds-caso p { margin: 0; color: var(--hds-gray); font-size: var(--hds-fs-caption); line-height: 1.6; }

.hds-caso__resultado {
    display: flex;
    gap: 9px;
    background: var(--hds-mint-pale);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--hds-navy);
    font-size: 12px;
    line-height: 1.45;
}

.hds-caso__enlace { margin-top: auto; color: var(--hds-navy); font-size: var(--hds-fs-caption); font-weight: 600; text-decoration: none; }
.hds-caso__enlace:hover { color: var(--hds-blue); }

/* --- Testimonios ------------------------------------------------------- */
.hds-testimonios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.hds-testimonio {
    background: #FAFAFA;
    border-radius: 12px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hds-testimonio__estrellas { color: #F5B841; letter-spacing: 2px; font-size: 13px; }
.hds-testimonio__persona { display: flex; align-items: center; gap: 12px; }

/* Doble clase para ganar a `.hds-testimonio__persona span`, que la dejaba
   en gris y a tamaño de pie. */
.hds-testimonio__persona .hds-testimonio__inicial {
    width: 40px; height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: var(--hds-green);
    color: var(--hds-white); /* el navy no se lee sobre el verde #00843D */
    font-weight: 700;
    font-size: 14px;
    display: grid;
    place-items: center;
}

.hds-testimonio__persona b { display: block; color: var(--hds-navy); font-size: var(--hds-fs-small); }
.hds-testimonio__persona span { color: var(--hds-gray); font-size: var(--hds-fs-caption); }
.hds-testimonio blockquote { margin: 0; color: var(--hds-navy); font-size: var(--hds-fs-caption); line-height: 1.65; }
.hds-testimonio footer { margin-top: auto; padding-top: 14px; border-top: 1px solid #ECECEC; color: var(--hds-gray); font-size: 11px; }

/* --- Lista de garantías del bloque de contacto ------------------------- */
.hds-checks {
    margin: 0;
    padding: 0; display: flex; flex-direction: column; gap: 11px; }

.hds-checks li {
    list-style: none;
    display: flex;
    /* Arriba y no centrado: en un punto de dos líneas el círculo va con la
       primera, no a media altura (el ::before lo centra en esa línea). */
    align-items: flex-start;
    gap: 11px;
    color: var(--hds-navy);
    font-size: var(--hds-fs-small);
}

.hds-checks li::before {
    /* El glifo "✓" de texto no queda centrado dentro del círculo: su métrica
       de fuente deja más hueco arriba que abajo. Un SVG de fondo sí se centra
       de forma exacta, sin depender de la fuente del navegador. */
    content: "";
    flex: 0 0 21px;
    width: 21px; height: 21px;
    margin-top: calc((1lh - 21px) / 2);
    border-radius: 50%;
    background: var(--hds-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M3 8.5 6.5 12 13 4.5'/%3E%3C/svg%3E") no-repeat center / 10px 10px;
}

/* ---------------------------------------------------------------------- */
/* Responsive: no hay diseño móvil en Canva, estas decisiones son nuestras */
/* ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .hds-rutas,
    .hds-destacadas,
    .hds-blog-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hds-problemas,
    .hds-casos,
    .hds-testimonios { grid-template-columns: repeat(2, 1fr); }
    .hds-metricas { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

@media (max-width: 767px) {
    /* Tarjetas compactas (revisión prelanzamiento): icono a la izquierda de ámbito y título. */
    .hds-problemas { grid-template-columns: 1fr; gap: 12px; margin-top: 24px; }
    .hds-problema {
        display: grid;
        grid-template-columns: 40px 1fr;
        column-gap: 14px;
        align-items: center;
        padding: 18px 18px 0;
        border-radius: 16px;
    }
    .hds-problema__icono { grid-row: span 2; width: 40px; height: 40px; margin: 0; }
    .hds-problema__ambito { align-self: end; }
    .hds-problema h3 { align-self: start; margin: 3px 0 0; font-size: 17px; }
    .hds-problema p { grid-column: 1 / -1; margin: 10px 0 14px; font-size: 14px; line-height: 1.5; }
    .hds-problema .hds-problema__con { grid-column: 1 / -1; min-height: 0; margin: 0 -18px; padding: 10px 18px; }
    .hds-problema__con > span:last-child { min-height: 0; } /* una columna: nada que alinear */
    .hds-rutas,
    .hds-destacadas,
    .hds-blog-home { grid-template-columns: 1fr; }
    .hds-pasos,
    .hds-casos,
    .hds-testimonios {
    margin: 0;
    padding: 0; grid-template-columns: 1fr; }
    .hds-metricas b { font-size: 28px; }
    .hds-paso__cabecera { padding: 16px 18px; }
    .hds-paso__cuerpo { padding: 0 20px 20px; }
}

/* --- Aviso de consultores (bloque de contacto) ------------------------- */
.hds-consultores {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 18px rgba(29, 40, 84, 0.06);
}

.hds-consultores__caras { display: flex; flex: 0 0 auto; }

.hds-consultores__caras img {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Se solapan ligeramente, como en el diseño. */
.hds-consultores__caras img + img { margin-left: -12px; }

.hds-consultores p {
    margin: 0;
    color: var(--hds-navy);
    font-size: var(--hds-fs-small);
    line-height: 1.45;
}

/* Contacto v3: checks y textos con los colores de la maqueta, y teléfono/email visibles. */
.hds-v3 .hds-checks li,
.hds-v3 .hds-consultores p { color: var(--hds-navy-hero); }
.hds-v3 .hds-checks li::before { background-color: var(--hds-green-hero); }

.hds-contacto-directo { margin: 0; font-size: 14px; color: var(--hds-gray-hero); }
.hds-contacto-directo a { font-weight: 600; color: var(--hds-blue); text-underline-offset: 3px; }
.hds-contacto-directo a:is(:hover, :focus-visible) { text-decoration: underline; }
