/* ════════════════════════════════════════════
   Features V3 (Bento) — playful V2-family grid
   Cards can be normal / wide / tall, in light,
   gradient (accent) or dark styles, or pure
   image tiles. Same chips, typography, borders
   and radius language as Features V2 / Hero V7.
   Uses grid-auto-flow: dense so tall cards let
   neighbours stack beside them (bento look).
   Depends on scw-base (tokens + .scw-section,
   heading group).
   ════════════════════════════════════════════ */

.scw-features-v3 {
    background: var(--scw-f3-bg, #FFFFFF);
    font-family: var(--scw-font, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.scw-features-v3 *,
.scw-features-v3 *::before,
.scw-features-v3 *::after {
    box-sizing: border-box;
}

/* ── Subtitle override — solid black, regular weight (family rule) ── */
.scw-features-v3 .scw-section-subtitle {
    color: #000000;
    font-weight: 400;
}

/* ── Bento grid ── */
.scw-f3__grid {
    display: grid;
    grid-template-columns: repeat(var(--scw-f3-cols, 2), minmax(0, 1fr));
    grid-auto-rows: minmax(200px, auto);
    grid-auto-flow: dense;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Card base ── */
.scw-f3__card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--scw-f3-radius, 24px);
    overflow: hidden;
    min-height: 200px;
    transition: transform 0.25s var(--scw-ease, cubic-bezier(0.4, 0, 0.2, 1));
}

.scw-f3__card:hover {
    transform: translateY(-4px);
}

.scw-f3__card--wide { grid-column: span 2; }
.scw-f3__card--tall { grid-row: span 2; }

/* ── Card styles ── */
.scw-f3__card--light {
    background: var(--scw-f3-card-bg, #F7F7F9);
    border: 1px solid var(--scw-f3-border, #EAEAF0);
    --scw-f3-c-title: var(--scw-f3-title, #0F0F0F);
    --scw-f3-c-desc: var(--scw-f3-desc, #52525B);
}

.scw-f3__card--gradient {
    background: linear-gradient(135deg, var(--scw-f3-a1, #A855F7) 0%, var(--scw-f3-a2, #EC4899) 100%);
    --scw-f3-c-title: #FFFFFF;
    --scw-f3-c-desc: rgba(255, 255, 255, 0.88);
}

.scw-f3__card--dark {
    background: var(--scw-f3-dark, #08080B);
    --scw-f3-c-title: #FFFFFF;
    --scw-f3-c-desc: #C4C4CC;
}

/* Soft accent glow inside dark cards (echoes Hero V7) */
.scw-f3__card--dark::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 70%;
    height: 90%;
    background: radial-gradient(ellipse at center, var(--scw-f3-a1, #A855F7) 0%, transparent 65%);
    opacity: 0.22;
    pointer-events: none;
}

/* ── Card body ── */
.scw-f3__body {
    position: relative;
    z-index: 1;
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
}

/* ── Icon chip: gradient on light cards, frosted white on gradient/dark cards ── */
.scw-f3__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--scw-f3-a1, #A855F7) 0%, var(--scw-f3-a2, #EC4899) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(15, 15, 15, 0.12);
    flex-shrink: 0;
}

.scw-f3__card--gradient .scw-f3__icon,
.scw-f3__card--dark .scw-f3__icon {
    background: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.scw-f3__icon svg {
    width: 24px;
    height: 24px;
}

/* ── Card text ── */
.scw-f3__title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--scw-f3-c-title, #0F0F0F);
}

.scw-f3__card--wide .scw-f3__title,
.scw-f3__card--tall .scw-f3__title {
    font-size: 24px;
}

.scw-f3__desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--scw-f3-c-desc, #52525B);
    margin: 0;
}

/* ── Media ── */
.scw-f3__media {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
}

.scw-f3__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Text card with an image: text on top, image fills the remainder */
.scw-f3__body + .scw-f3__media {
    min-height: 180px;
    margin: 6px 20px 20px;
    border-radius: calc(var(--scw-f3-radius, 24px) - 8px);
    overflow: hidden;
}

/* Pure image tile: image fills the whole card */
.scw-f3__card--image .scw-f3__media {
    position: absolute;
    inset: 0;
    margin: 0;
}

/* Tall cards give the body room to breathe */
.scw-f3__card--tall .scw-f3__body {
    padding: 34px 32px 26px;
}

/* ════════════════════════════════════════════
   Responsive — Tablet (≤ 1023px): always 2 cols
   ════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .scw-f3__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

/* ════════════════════════════════════════════
   Responsive — Mobile (≤ 767px): single column,
   spans collapse, tiles get natural heights
   ════════════════════════════════════════════ */
@media (max-width: 767px) {
    .scw-f3__grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
        gap: 14px;
    }

    .scw-f3__card--wide,
    .scw-f3__card--tall {
        grid-column: auto;
        grid-row: auto;
    }

    .scw-f3__card {
        min-height: 0;
    }

    .scw-f3__body,
    .scw-f3__card--tall .scw-f3__body {
        padding: 26px 22px;
    }

    .scw-f3__icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .scw-f3__title,
    .scw-f3__card--wide .scw-f3__title,
    .scw-f3__card--tall .scw-f3__title {
        font-size: 18px;
    }

    .scw-f3__desc { font-size: 14px; }

    .scw-f3__body + .scw-f3__media {
        min-height: 0;
        margin: 0 16px 16px;
    }

    /* Image tiles: no absolute fill on mobile — use the image's own aspect ratio */
    .scw-f3__card--image .scw-f3__media {
        position: relative;
        inset: auto;
    }

    .scw-f3__card--image .scw-f3__img {
        height: auto;
        aspect-ratio: 4 / 3;
    }
}

/* ── Elementor Editor Overrides ── */
.elementor-editor-active .scw-features-v3 {
    min-height: 120px;
}
