/* ─── Cards block — full-width gradient background ───────────── */

.wp-block-headless-cards {
    position: relative;
    display: block;
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.wp-block-headless-cards::before {
    display: none;
}

.cards-grid {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
}

/* ─── Icon card ──────────────────────────────────────────────── */

.cards-item {
    flex: 1 1 0;
    min-width: 0;
    padding: 24px;
    border-radius: 32px;
    background: #ffffff;
}

.cards-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 16px;
    background: rgba(60, 141, 199, 0.1);
    overflow: hidden;
}

.cards-icon i {
    font-size: 22px;
    color: #5a7a96;
}

.cards-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.cards-icon span {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cards-icon span svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.cards-item-title {
    margin: 0 0 10px;
    color: #161e23;
    font-family: 'Urbanist', sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.cards-item-subtitle {
    margin: 0 0 8px;
    color: #161e23;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.cards-item-description {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: rgba(22, 30, 35, 0.75);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

/* ─── Image card variant (product cards) ─────────────────────── */

.cards-grid:has(.cards-item--image) {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.wp-block-headless-cards:has(.cards-item--image) {
    padding: 0;
}

.wp-block-headless-cards:has(.cards-item--image)::before {
    display: none;
}

.cards-item--image {
    display: flex;
    flex-direction: column;
    border-radius: 32px;
    overflow: hidden;
    padding: 0;
}

.cards-item-media {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.cards-item-media img {
    height: 133%;
    width: auto;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.cards-item-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 34px;
    background: #fff;
    flex: 1;
}

.cards-item--image .cards-item-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: #365072;
    margin: 0;
}

.cards-item--image .cards-item-subtitle {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #161e23;
    margin: 0;
}

.cards-item--image .cards-item-description {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(22, 30, 35, 0.75);
    margin: 0;
}

/* ─── Responsive: Tablet ──────────────────────────────────────── */

@media (max-width: 1100px) {
    .wp-block-headless-cards {
        padding: 40px 32px;
    }

    .cards-grid {
        flex-wrap: wrap;
    }

    .cards-item {
        flex: 1 1 calc(50% - 4px);
        min-width: calc(50% - 4px);
    }

    .cards-grid:has(.cards-item--image) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards-item-media {
        height: 300px;
    }

    .cards-item--image .cards-item-title {
        font-size: 20px;
    }

    .cards-item--image .cards-item-subtitle {
        font-size: 16px;
    }
}

/* ─── Responsive: Mobile ──────────────────────────────────────── */

@media (max-width: 600px) {
    .wp-block-headless-cards {
        padding: 32px 16px;
    }

    .cards-grid {
        flex-direction: column;
        gap: 8px;
    }

    .cards-item {
        flex: none;
        width: 100%;
        padding: 20px;
        border-radius: 24px;
    }

    .cards-grid:has(.cards-item--image) {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .cards-item--image {
        border-radius: 24px;
    }

    .cards-item-media {
        height: 260px;
    }

    .cards-item-body {
        padding: 20px 24px;
    }

    .cards-item--image .cards-item-title {
        font-size: 18px;
    }

    .cards-item--image .cards-item-subtitle {
        font-size: 15px;
    }

    .cards-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 14px;
        border-radius: 14px;
    }

    .cards-icon i {
        font-size: 18px;
    }

    .cards-icon img {
        width: 22px;
        height: 22px;
    }
}
