/* ==========================================================================
   Hero del Blog: 6 categorías a pantalla completa (3x2 en escritorio).
   Al hacer hover / focus sobre un cuadro:
     1. el fondo general cambia por la imagen de esa categoría,
     2. ese cuadro se difumina (backdrop-filter),
     3. aparecen el enlace "Voir les articles" y la descripción.
   Todas las transiciones duran 0.4s (var(--bh-speed)).

   Las imágenes NO se declaran aquí: cada capa recibe su ruta desde el HTML
   con la variable --bg, para poder cambiarlas sin tocar el CSS.
   ========================================================================== */

.blog-hero {
    --bh-speed: 0.4s;
    --bh-ease: ease;
    --bh-line: rgba(255, 255, 255, 0.55);
    /* líneas divisorias */
    --bh-veil: rgba(255, 255, 255, 0.14);
    /* velo del cuadro activo */
    --bh-blur: 18px;
    --bh-pad: clamp(20px, 2.4vw, 46px);
    --bh-cols: 3;

    position: relative;
    width: 100%;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--primary-color);
}

/* ------------------------------ Fondos ------------------------------ */

.blog-hero__backdrops {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.blog-hero__bg {
    position: absolute;
    inset: 0;
    display: block;
    background-image: var(--bg);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity var(--bh-speed) var(--bh-ease);
}

/* Imagen visible mientras no hay ningún cuadro activo. */
.blog-hero__bg--default {
    opacity: 1;
}

.blog-hero:has(.blog-hero__item:is(:hover, :focus-visible)) .blog-hero__bg--default {
    opacity: 0;
}

/* Cada categoría enciende su propia capa de fondo. */
.blog-hero:has(.blog-hero__item[data-cat="sourire"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="sourire"],
.blog-hero:has(.blog-hero__item[data-cat="sante"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="sante"],
.blog-hero:has(.blog-hero__item[data-cat="technologie"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="technologie"],
.blog-hero:has(.blog-hero__item[data-cat="longevite"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="longevite"],
.blog-hero:has(.blog-hero__item[data-cat="opal-inside"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="opal-inside"],
.blog-hero:has(.blog-hero__item[data-cat="actualites"]:is(:hover, :focus-visible)) .blog-hero__bg[data-cat="actualites"] {
    opacity: 1;
}

/* Oscurecido sutil para que los títulos blancos siempre tengan contraste. */
.blog-hero__backdrops::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.28) 0%, rgba(0, 0, 0, 0.1) 45%, rgba(0, 0, 0, 0.3) 100%);
}

/* ------------------------------ Rejilla ------------------------------ */

.blog-hero__grid {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(var(--bh-cols), 1fr);
    grid-template-rows: repeat(2, 1fr);
    border: 1px solid var(--bh-line);
    box-sizing: border-box;
}

/* ------------------------------ Cuadro ------------------------------ */

.blog-hero__item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: var(--bh-pad);
    box-sizing: border-box;
    overflow: hidden;
    text-decoration: none !important;
    color: var(--color-white) !important;
    border-right: 1px solid var(--bh-line);
    border-bottom: 1px solid var(--bh-line);
    background-color: transparent;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    transition: background-color var(--bh-speed) var(--bh-ease),
        -webkit-backdrop-filter var(--bh-speed) var(--bh-ease),
        backdrop-filter var(--bh-speed) var(--bh-ease);
}

/* Sin líneas dobles en el borde exterior de la rejilla (3 columnas). */
.blog-hero__item:nth-child(3n) {
    border-right: 0;
}

.blog-hero__item:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.blog-hero__item:is(:hover, :focus-visible) {
    background-color: var(--bh-veil);
    -webkit-backdrop-filter: blur(var(--bh-blur)) saturate(1.05);
    backdrop-filter: blur(var(--bh-blur)) saturate(1.05);
}

.blog-hero__item:focus-visible {
    outline: 1px solid var(--color-white);
    outline-offset: -6px;
}

/* ------------------------------ Textos ------------------------------ */

.blog-hero__title {
    align-self: flex-start;
    margin: 0 !important;
    padding: 0;
    font-family: "Mulish-Medium", var(--body-font);
    font-size: clamp(13px, 1.05vw, 17px);
    line-height: 1.3 !important;
    letter-spacing: var(--letter-spacing);
    text-transform: uppercase;
    color: var(--color-white) !important;
}

/* Enlace y descripción: ocultos hasta el hover. */
.blog-hero__link,
.blog-hero__desc {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--bh-speed) var(--bh-ease),
        transform var(--bh-speed) var(--bh-ease);
}

.blog-hero__item:is(:hover, :focus-visible) .blog-hero__link,
.blog-hero__item:is(:hover, :focus-visible) .blog-hero__desc {
    opacity: 1;
    transform: translateY(0);
}

.blog-hero__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--body-font);
    font-size: var(--btn-txt);
    letter-spacing: var(--letter-spacing-btn);
    text-transform: uppercase;
    color: var(--color-white);
    white-space: nowrap;
}

.blog-hero__link svg {
    width: 14px;
    height: auto;
    flex: 0 0 auto;
    transition: transform var(--bh-speed) var(--bh-ease);
}

.blog-hero__item:hover .blog-hero__link svg {
    transform: translateX(6px);
}

.blog-hero__desc {
    max-width: 30ch;
    margin: 0 !important;
    font-family: var(--body-font);
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: var(--line-height-txt);
    text-align: center;
    color: var(--color-white) !important;
}

.carrusel-entradas {
    .elementor-loop-container{
        padding-top: 40px;
            .swiper-slide {
                transition: var(--all-transition);
                transform: translateY(0px);

                &:hover {
                    transform: translateY(-20px);
                    transition: var(--all-transition);
                }
        }
    }

}

.blog-notice-unit {
    a {
        text-decoration: none !important;
        transition: var(--all-transition);

    }
    
}

/* ------------------------------ Responsive ------------------------------ */

/* Tablet: 2 columnas x 3 filas. */
@media (max-width: 1024px) {
    .blog-hero {
        --bh-cols: 2;
        --bh-blur: 14px;
        height: auto;
        min-height: 100svh;
    }

    /* height: auto → la rejilla puede crecer y el hero crece con ella. */
    .blog-hero__grid {
        height: auto;
        grid-template-rows: repeat(3, minmax(33.333svh, 1fr));
    }

    .blog-hero__item:nth-child(3n) {
        border-right: 1px solid var(--bh-line);
    }

    .blog-hero__item:nth-child(2n) {
        border-right: 0;
    }

    .blog-hero__item:nth-last-child(-n + 3) {
        border-bottom: 1px solid var(--bh-line);
    }

    .blog-hero__item:nth-last-child(-n + 2) {
        border-bottom: 0;
    }
}

/* Móvil: una columna; el enlace se muestra siempre (no hay hover). */
@media (max-width: 640px) {
    .blog-hero {
        --bh-cols: 1;
    }

    .blog-hero__grid {
        grid-template-rows: repeat(6, minmax(200px, 1fr));
    }

    .blog-hero__item {
        border-right: 0 !important;
        border-bottom: 1px solid var(--bh-line) !important;
        justify-content: center;
        gap: 18px;
    }

    .blog-hero__item:last-child {
        border-bottom: 0 !important;
    }

    .blog-hero__title {
        align-self: center;
        max-width: none;
        text-align: center;
    }

    .blog-hero__desc {
        display: none;
    }
}

/* Dispositivos sin hover: el enlace queda visible para poder pulsarlo. */
@media (hover: none) {
    .blog-hero__link {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .blog-hero__link,
    .blog-hero__desc,
    .blog-hero__link svg {
        transform: none !important;
    }
}
