/**
 * Widget: Card Visual — BajoNalón
 * Replica de .card-square del mockup v2
 */

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */

.bn-card-square {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 24px;       /* sobreescrito por selector de Elementor */
    height: 420px;             /* sobreescrito por selector responsive de Elementor */
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateZ(0);  /* GPU layer — evita flicker en el zoom */
    text-decoration: none;     /* variante <a> */
    color: inherit;
    isolation: isolate;
}

.bn-card-square__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: inherit;
    line-height: 0;
}

/* ============================================================
   IMAGEN DE FONDO
   ============================================================ */

.bn-card-square__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: inherit;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: scale(1.01);
    transition: transform 0.6s ease;
}

/* Zoom solo cuando la clase modificadora está presente */
.bn-card-square--zoom:hover .bn-card-square__image {
    transform: scale(1.1);
}

/* ============================================================
   OVERLAY DE COLOR
   ============================================================ */

.bn-card-square__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(56, 73, 89, 0.55); /* sobreescrito por Elementor */
    transition: background-color 0.35s ease;
    pointer-events: none;
}

/* ============================================================
   CUERPO — icono + título
   ============================================================ */

.bn-card-square__body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    z-index: 2;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    /* Gradiente bajo el texto para máxima legibilidad */
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.45) 0%,
        transparent 100%
    );
}

/* ── Icono ── */

.bn-card-square__icon {
    font-size: 3.5rem;         /* sobreescrito por Elementor */
    color: #fff;               /* sobreescrito por Elementor */
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1;
    display: flex;
    align-items: center;
}

/* Compatibilidad con iconos SVG de Elementor */
.bn-card-square__icon svg {
    width: 3.5rem;
    height: 3.5rem;
    fill: #fff;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

/* ── Título ── */

.bn-card-square__title {
    font-size: 1.625rem;       /* ≈ 26px, sobreescrito por Elementor */
    font-weight: 700;          /* sobreescrito por Elementor */
    color: #fff;               /* sobreescrito por Elementor */
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
    line-height: 1.2;
}

/* ============================================================
   RESPONSIVE — fallbacks (Elementor genera sus propios
   breakpoints con mayor especificidad vía {{WRAPPER}})
   ============================================================ */

@media (max-width: 1024px) {
    .bn-card-square {
        height: 380px;
    }
}

@media (max-width: 767px) {
    .bn-card-square {
        height: 300px;
    }

    .bn-card-square__body {
        padding: 18px;
        gap: 8px;
    }

    .bn-card-square__icon {
        font-size: 2.5rem;
    }

    .bn-card-square__icon svg {
        width: 2.5rem;
        height: 2.5rem;
    }

    .bn-card-square__title {
        font-size: 1.25rem;
    }
}

/* ============================================================
   ACCESIBILIDAD — reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .bn-card-square__image,
    .bn-card-square__overlay {
        transition: none;
    }

    .bn-card-square--zoom:hover .bn-card-square__image {
        transform: none;
    }
}
