/*
 * Portada del blog (template-parts/portada/). CSS propio, no Tailwind: solo
 * se carga en la portada cuando el diseno nuevo esta activo o en vista previa.
 * Usa .container/.mx-auto/.px-4 del style.css global para alinear con la
 * cabecera del sitio.
 */

.hp,
.hp-previa {
    --hp-verde: #496d05;
    --hp-verde-osc: #2f4704;
    --hp-titular: #22340a;
    --hp-verde-suave: #f2f6ea;
    --hp-verde-borde: #dce6c7;
    --hp-texto: #374151;
    --hp-gris: #5f6672;
    --hp-borde: #e6e8e1;
    --hp-fondo-img: #eceee6;
    --hp-radio: 14px;
    --hp-sombra: 0 1px 2px rgba(16, 24, 8, .05), 0 6px 18px rgba(16, 24, 8, .06);
}

.hp-previa {
    background: #fff6d5;
    border-bottom: 1px solid #efdf9f;
    color: #5b4900;
    font-size: .875rem;
    padding: .5rem 1rem;
    text-align: center;
}

.hp-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.hp a:focus-visible,
.hp button:focus-visible {
    outline: 3px solid var(--hp-verde);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ── Cabecera / carrusel ─────────────────────────────────────────────── */

.hp-hero {
    position: relative;
    background: var(--hp-fondo-img);
}

.hp-hero__pista {
    position: relative;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.hp-hero__pista::-webkit-scrollbar {
    display: none;
}

.hp-slide {
    position: relative;
    flex: 0 0 100%;
    display: flex;
    align-items: center;
    min-height: clamp(460px, 37vw, 590px);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.hp-slide--sinfoto {
    background: linear-gradient(135deg, #f6f3ec, #e6eed6);
}

.hp-slide__foto {
    position: absolute;
    inset: 0;
}

.hp-slide__foto picture,
.hp-slide__foto img {
    display: block;
    width: 100%;
    height: 100%;
}

.hp-slide__foto img {
    object-fit: cover;
    object-position: center;
}

.hp-slide__marco {
    position: relative;
    z-index: 1;
    padding-top: 40px;
    padding-bottom: 40px;
}

.hp-slide__caja {
    max-width: 620px;
    padding: 32px 36px 34px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .84);
    -webkit-backdrop-filter: blur(6px) saturate(1.05);
    backdrop-filter: blur(6px) saturate(1.05);
    box-shadow: 0 10px 30px rgba(20, 30, 8, .14);
}

.hp-slide__titulo {
    margin: 0 0 16px;
    color: var(--hp-titular);
    font-size: clamp(1.75rem, 1.05rem + 1.45vw, 2.45rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.015em;
    text-wrap: balance;
}

.hp-slide__texto {
    color: #2c331f;
    font-size: 1rem;
    line-height: 1.55;
}

.hp-slide__texto p + p {
    margin-top: .7em;
}

.hp-slide__texto a {
    color: var(--hp-verde-osc);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.hp-boton {
    display: inline-flex;
    align-items: center;
    margin-top: 20px;
    padding: 12px 22px;
    border-radius: 999px;
    background: var(--hp-verde);
    color: #fff;
    font-weight: 600;
    transition: background-color .2s;
}

.hp-boton:hover {
    background: var(--hp-verde-osc);
    color: #fff;
}

.hp-hero__controles-marco {
    position: absolute;
    z-index: 2;
    right: 0;
    bottom: 20px;
    left: 0;
    display: flex;
    justify-content: flex-end;
    pointer-events: none;
}

/* Con carrusel, hueco abajo para que los controles no tapen el recuadro. */
.hp-hero--carrusel .hp-slide__marco {
    padding-bottom: 84px;
}

.hp-hero__controles {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 14px rgba(20, 30, 8, .12);
}

.hp-hero__flecha {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--hp-titular);
    cursor: pointer;
}

.hp-hero__flecha:hover {
    color: var(--hp-verde);
}

.hp-hero__flecha[hidden] {
    display: none;
}

.hp-hero__puntos {
    display: flex;
    gap: 0;
    padding: 0 4px;
}

.hp-hero__punto {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hp-hero__punto::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #7a866a;
    transition: width .25s, background-color .25s;
}

.hp-hero__punto[aria-current="true"]::before {
    width: 22px;
    background: var(--hp-verde);
}

.hp-hero__pausa .hp-ico-play,
.hp-hero__pausa.is-parado .hp-ico-pausa {
    display: none;
}

.hp-hero__pausa.is-parado .hp-ico-play {
    display: block;
}

/* ── Secciones ────────────────────────────────────────────────────────── */

.hp-seccion {
    padding-top: 48px;
}

.hp-seccion__cab {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 20px;
}

.hp-h2 {
    margin: 0;
    color: var(--hp-titular);
    font-size: clamp(1.5rem, 1.2rem + .9vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
}

.hp-vertodos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--hp-verde);
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.hp-vertodos:hover {
    color: var(--hp-verde-osc);
}

.hp-vertodos svg {
    transition: transform .2s;
}

.hp-vertodos:hover svg {
    transform: translateX(3px);
}

.hp-etiqueta {
    display: inline-block;
    align-self: flex-start;
    padding: 5px 10px;
    border: 1px solid var(--hp-verde-borde);
    border-radius: 999px;
    background: var(--hp-verde-suave);
    color: var(--hp-verde-osc);
    font-size: .6875rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .05em;
    text-transform: uppercase;
}

/* ── Articulos destacados ────────────────────────────────────────────── */

.hp-tarjetas {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hp-tarjeta__art {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--hp-borde);
    border-radius: var(--hp-radio);
    background: #fff;
    box-shadow: var(--hp-sombra);
    transition: box-shadow .25s, transform .25s;
}

.hp-tarjeta__art:hover {
    box-shadow: 0 12px 30px rgba(16, 24, 8, .13);
    transform: translateY(-2px);
}

.hp-tarjeta__art:has(a:focus-visible) {
    outline: 3px solid var(--hp-verde);
    outline-offset: 2px;
}

.hp-tarjeta__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--hp-fondo-img);
}

.hp-tarjeta__media picture,
.hp-tarjeta__media img,
.hp-tarjeta__sinfoto {
    display: block;
    width: 100%;
    height: 100%;
}

.hp-tarjeta__media img {
    object-fit: cover;
    transition: transform .5s;
}

.hp-tarjeta__art:hover .hp-tarjeta__media img {
    transform: scale(1.04);
}

.hp-tarjeta__cuerpo {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 0 20px 18px;
}

.hp-tarjeta__cuerpo--sinetiqueta {
    padding-top: 16px;
}

/* La pastilla de categoria se monta sobre el borde de la foto. El cuerpo no
   va posicionado: si lo fuera, el enlace extendido del titulo solo cubriria
   el texto y no la foto. */
.hp-tarjeta__cuerpo .hp-etiqueta {
    position: relative;
    z-index: 1;
    top: -13px;
    margin-bottom: -2px;
}

.hp-tarjeta__titulo {
    margin: 0 0 8px;
    color: var(--hp-titular);
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.3;
}

.hp-tarjeta__titulo a {
    color: inherit;
}

.hp-tarjeta__titulo a:focus-visible {
    outline: none;
}

/* Toda la tarjeta es clicable: el enlace del titulo la cubre. */
.hp-tarjeta__titulo a::after,
.hp-fila__titulo a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
}

.hp-tarjeta__art:hover .hp-tarjeta__titulo a {
    color: var(--hp-verde-osc);
}

.hp-tarjeta__extracto {
    display: -webkit-box;
    margin: 0 0 14px;
    overflow: hidden;
    color: var(--hp-gris);
    font-size: .9375rem;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hp-leermas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    color: var(--hp-verde);
    font-size: .9375rem;
    font-weight: 600;
}

.hp-leermas svg {
    transition: transform .2s;
}

.hp-tarjeta__art:hover .hp-leermas svg {
    transform: translateX(3px);
}

/* ── Explora nuestras guias ──────────────────────────────────────────── */

.hp-guias {
    padding: 28px 28px 22px;
    border: 1px solid var(--hp-verde-borde);
    border-radius: 18px;
    background: var(--hp-verde-suave);
}

.hp-guias .hp-h2 {
    margin-bottom: 16px;
}

.hp-guias__lista {
    display: grid;
    grid-template-columns: repeat(var(--hp-guias, 6), minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.hp-guias__lista li + li {
    border-left: 1px solid var(--hp-verde-borde);
}

.hp-guia {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 12px 10px;
    border-radius: 12px;
    color: var(--hp-titular);
    font-size: .9375rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    transition: background-color .2s;
}

.hp-guia:hover {
    background: rgba(255, 255, 255, .85);
    color: var(--hp-verde-osc);
}

.hp-guia:hover .hp-guia__texto {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hp-guia__texto {
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hp-guia__icono {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    color: var(--hp-verde);
}

.hp-guia__icono svg {
    width: 36px;
    height: 36px;
}

/* ── Ultimos articulos ───────────────────────────────────────────────── */

.hp-ultimos {
    padding-bottom: 8px;
}

.hp-lista {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--hp-borde);
    list-style: none;
}

.hp-fila {
    border-bottom: 1px solid var(--hp-borde);
}

.hp-fila__art {
    position: relative;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 32px;
    gap: 24px;
    align-items: center;
    padding: 16px 0;
}

.hp-fila__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    background: var(--hp-fondo-img);
}

.hp-fila__media picture,
.hp-fila__media img {
    display: block;
    width: 100%;
    height: 100%;
}

.hp-fila__media img {
    object-fit: cover;
    transition: transform .5s;
}

.hp-fila__art:hover .hp-fila__media img {
    transform: scale(1.04);
}

.hp-fila__fecha {
    display: block;
    margin-bottom: 4px;
    color: var(--hp-gris);
    font-size: .8125rem;
}

.hp-fila__titulo {
    margin: 0 0 6px;
    color: var(--hp-titular);
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
}

.hp-fila__titulo a {
    color: inherit;
}

.hp-fila__titulo a:focus-visible {
    outline: none;
}

.hp-fila__art:has(a:focus-visible) {
    outline: 3px solid var(--hp-verde);
    outline-offset: 4px;
    border-radius: 8px;
}

.hp-fila__art:hover .hp-fila__titulo a {
    color: var(--hp-verde-osc);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hp-fila__extracto {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    color: var(--hp-gris);
    font-size: .9375rem;
    line-height: 1.5;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hp-fila__flecha {
    justify-self: end;
    color: var(--hp-verde);
    transition: transform .2s;
}

.hp-fila__art:hover .hp-fila__flecha {
    transform: translateX(4px);
}

.hp-mas-zona {
    display: flex;
    justify-content: center;
    padding: 28px 0 4px;
}

.hp-mas {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    border: 1.5px solid var(--hp-verde);
    border-radius: 999px;
    color: var(--hp-verde);
    font-weight: 600;
    transition: background-color .2s, color .2s;
}

.hp-mas:hover {
    background: var(--hp-verde);
    color: #fff;
}

.hp-mas.is-cargando {
    opacity: .6;
    pointer-events: none;
}

.hp-h1-paginado {
    margin: 32px 0 0;
    color: var(--hp-titular);
    font-size: 1.75rem;
    font-weight: 800;
}

.hp-h1-paginado span {
    color: var(--hp-gris);
    font-weight: 400;
}

/* ── Tablet ──────────────────────────────────────────────────────────── */

@media (max-width: 1023px) {
    .hp-tarjetas {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hp-guias__lista {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .hp-guias__lista li + li {
        border-left: 0;
    }

    .hp-guia {
        border: 1px solid var(--hp-verde-borde);
        background: #fff;
    }
}

/* ── Movil ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .hp-hero {
        background: transparent;
    }

    .hp-slide {
        display: block;
        min-height: 0;
    }

    .hp-slide__foto {
        position: relative;
        aspect-ratio: 4 / 3;
        background: var(--hp-fondo-img);
    }

    .hp-slide__marco {
        margin-top: -56px;
        padding-top: 0;
        padding-bottom: 16px;
    }

    .hp-slide--sinfoto .hp-slide__marco {
        margin-top: 0;
        padding-top: 16px;
    }

    .hp-slide__caja {
        padding: 20px 20px 22px;
        border-radius: 16px;
        background: #fff;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: 0 8px 24px rgba(20, 30, 8, .13);
    }

    .hp-slide__titulo {
        margin-bottom: 12px;
        font-size: 1.5rem;
    }

    .hp-slide__texto {
        font-size: .9375rem;
    }

    .hp-hero--carrusel .hp-slide__marco {
        padding-bottom: 16px;
    }

    .hp-hero__controles-marco {
        position: static;
        justify-content: center;
    }

    .hp-hero__controles {
        justify-content: center;
        padding: 0 0 4px;
        background: none;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }

    .hp-hero__flecha {
        background: var(--hp-verde-suave);
    }

    .hp-seccion {
        padding-top: 36px;
    }

    /* Destacados: fila deslizable con la siguiente tarjeta asomando. */
    .hp-tarjetas {
        grid-auto-flow: column;
        grid-auto-columns: 84%;
        grid-template-columns: none;
        gap: 14px;
        margin: 0 -16px;
        padding: 4px 16px 16px;
        overflow-x: auto;
        scroll-padding: 0 16px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .hp-tarjetas::-webkit-scrollbar {
        display: none;
    }

    .hp-tarjeta {
        scroll-snap-align: start;
    }

    .hp-tarjeta__art:hover {
        transform: none;
    }

    .hp-guias {
        padding: 22px 16px 16px;
    }

    .hp-fila__art {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 14px;
        align-items: start;
        padding: 14px 0;
    }

    .hp-fila__media {
        aspect-ratio: 1 / 1;
    }

    .hp-fila__titulo {
        font-size: 1rem;
    }

    .hp-fila__extracto {
        font-size: .875rem;
    }

    .hp-fila__flecha {
        display: none;
    }
}

@media (max-width: 479px) {
    .hp-guias__lista {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hp-fila__extracto {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp *,
    .hp *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
