/* ================================================================
   DQD Pillars / Lista Widget — Estilos frontend  v3.0
   ================================================================ */

/* ── CONTENEDOR ──────────────────────────────────────────────── */
.dqd-pillars {
    width: 100%;
    box-sizing: border-box;
    border-top-style: solid;
    border-top-color: #47aa38;
    border-top-width: 3px;
}

/* ── ÍTEM ─────────────────────────────────────────────────────── */
.dqd-pillar {
    display: grid;
    /* grid-template-columns se inyecta inline desde PHP según qué columnas están activas */
    align-items: center;
    border-bottom-style: solid;
    border-bottom-color: #dde5e5;
    border-bottom-width: 1px;
    padding: 28px 0;
    gap: 28px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    box-sizing: border-box;
}

/* ── ÍCONO ────────────────────────────────────────────────────── */
.dqd-pillar__ico {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 1;
    background-color: transparent; /* sin fondo por default */
    border-radius: 50%;
    padding: 14px;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
    overflow: hidden;
    color: #47aa38; /* color del SVG por default = verde DQD */
}

/* SVG inline embebido — color controlado via currentColor */
.dqd-pillar__svg-inline {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
    color: inherit;
}

/* Fallback <img> SVG */
.dqd-pillar__svg-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* ── BLOQUE DE TEXTO (modo "above": título encima del texto) ──── */
.dqd-pillar__text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.dqd-pillar__text--desc-only {
    gap: 0;
}

/* ── TÍTULO ───────────────────────────────────────────────────── */
.dqd-pillar__title {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    color: #3c3c3c;
    transition: color 0.2s ease;
}

.dqd-pillar:hover .dqd-pillar__title,
.dqd-pillar--no-link:hover .dqd-pillar__title {
    color: #47aa38;
}

/* ── DESCRIPCIÓN ──────────────────────────────────────────────── */
.dqd-pillar__desc {
    font-family: 'Poppins', system-ui, sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: #6b7a6c;
    margin: 0;
    padding: 0;
    transition: color 0.2s ease;
}

/* ── FLECHA ───────────────────────────────────────────────────── */
.dqd-pillar__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #47aa38;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.dqd-pillar__arrow svg {
    width: 100%;
    height: auto;
    display: block;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dqd-pillar:hover .dqd-pillar__arrow {
    transform: translateX(6px);
}

/* ── ALINEACIÓN VERTICAL: modo "beside" ───────────────────────── */
/* Cuando el título está al lado de la descripción,
   alinear columnas hacia arriba para textos largos */
.dqd-pillars--title-beside .dqd-pillar {
    align-items: start;
}

.dqd-pillars--title-beside .dqd-pillar__title {
    padding-top: 2px; /* compensación visual de line-height */
}

.dqd-pillars--title-beside .dqd-pillar__ico {
    align-self: start;
}

/* ── ACCESIBILIDAD ─────────────────────────────────────────────── */
.dqd-pillar:focus-visible {
    outline: 3px solid #47aa38;
    outline-offset: 2px;
}

/* ── MOBILE ────────────────────────────────────────────────────── */
@media (max-width: 640px) {

    /* Una sola columna — colapsa todo sin importar el layout de desktop */
    .dqd-pillar {
        grid-template-columns: 1fr !important;
        align-items: start;
        min-height: 0 !important; /* ignora alto fijo en mobile */
        padding-top: 20px !important;
        padding-bottom: 20px !important;
        gap: 12px !important;
    }

    /* Ícono pequeño en mobile */
    .dqd-pillar__ico {
        width: 48px !important;
        padding: 10px !important;
    }

    /* Tipografía levemente reducida */
    .dqd-pillar__title {
        font-size: 15px !important;
    }

    .dqd-pillar__desc {
        font-size: 14px !important;
    }

    /* Ocultar flecha en mobile para no desperdiciar espacio */
    .dqd-pillar__arrow {
        display: none !important;
    }
}

/* ── ELEMENTOR EDITOR ─────────────────────────────────────────── */
.elementor-editor-active .dqd-pillar,
.elementor-editor-active .dqd-pillar__ico,
.elementor-editor-active .dqd-pillar__title,
.elementor-editor-active .dqd-pillar__desc,
.elementor-editor-active .dqd-pillar__arrow {
    transition: none !important;
}

.elementor-editor-active .dqd-pillar:hover .dqd-pillar__arrow {
    transform: none !important;
}
