/* Card Grid Block Styles */

.en-card-grid {
    --card-gap: 1.5rem;
    display: grid;
    gap: var(--card-gap);
    width: 100%;
}

/* Column layouts */
.en-card-grid--cols-1 {
    grid-template-columns: 1fr;
}

.en-card-grid--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.en-card-grid--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Card item styling - matches sticky-content-cards */
.en-card-grid__card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid #e9ecef;
    border-radius: var(--en-border-radius, 15px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    padding: 2rem;
    height: 100%;
    box-sizing: border-box;
}

/* Default white background when no color is set */
.en-card-grid__card:not(.has-background) {
    background: #ffffff;
}

.en-card-grid__card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
    border-color: #007cba;
}

/* Theme color support - when background is set */
.en-card-grid__card.has-background {
    border-color: transparent;
}

.en-card-grid__card.has-background:hover {
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Typography within cards */
.en-card-grid__card h1,
.en-card-grid__card h2,
.en-card-grid__card h3,
.en-card-grid__card h4,
.en-card-grid__card h5,
.en-card-grid__card h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.en-card-grid__card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.en-card-grid__card p {
    margin: 0;
    line-height: 1.6;
}

.en-card-grid__card p + p {
    margin-top: 1rem;
}

.en-card-grid__card .wp-block-button {
    margin-top: auto;
}

.en-card-grid__card > *:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .en-card-grid--cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .en-card-grid--cols-2,
    .en-card-grid--cols-3 {
        grid-template-columns: 1fr;
    }

    .en-card-grid__card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .en-card-grid__card {
        padding: 1.25rem;
    }

    .en-card-grid__card h3 {
        font-size: 1.25rem;
    }
}
