/**
 * Standard Card (Figma node 2047:1919)
 *
 * - Card default size: w 458px, h 371px, gap 20px
 * - Image: card bg + border-a8
 * - Text: body-3 (16px), regular, line-height 1.2, color content
 *
 * Layout helpers:
 * - Wrap cards in .standard-cards (flex, wrap, gap 24px)
 * - Set width by fraction via modifiers (1/1..1/6)
 */

.standard-cards {
    --standard-cards-col-gap: var(--grid-gap);
    --standard-cards-row-gap: 24px;
    display: flex;
    flex-wrap: wrap;
    column-gap: var(--standard-cards-col-gap);
    row-gap: var(--standard-cards-row-gap);
    align-items: flex-start;
}

/* Spacing between rows demos (multiple blocks one after another) */
.standard-cards + .standard-cards {
    margin-top: 24px;
}

.standard-card {
    height: 371px;
    display: flex;
    flex-direction: column;
    gap: 12px; /* text to card */
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.standard-card__image {
    flex: 1 0 0;
    width: 100%;
    background-color: var(--color-card);
    border: 1px solid var(--color-border-a8);
}

.standard-card__text {
    margin: 0;
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--font-size-body-3-desktop); /* 16px */
    font-weight: 400;
    line-height: var(--line-height-body-3-desktop); /* 120% */
    color: var(--color-content);
    text-align: left;
    text-indent: 0;
    text-decoration-line: underline;
    text-decoration-color: transparent;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition:
        color var(--hover-duration-out) ease,
        text-decoration-color var(--hover-duration-out) ease;
}

/* Optional link hover */
a.standard-card:hover .standard-card__text {
    color: var(--color-subaccent);
    text-decoration-color: var(--color-subaccent-a30);
}


/* Width fractions (exact with fixed gap) */
.standard-card--w-1-1 { flex: 0 0 100%; }
.standard-card--w-1-2 { flex: 0 0 calc((100% - (1 * var(--standard-cards-col-gap))) / 2); }
.standard-card--w-1-3 { flex: 0 0 calc((100% - (2 * var(--standard-cards-col-gap))) / 3); }
.standard-card--w-1-4 { flex: 0 0 calc((100% - (3 * var(--standard-cards-col-gap))) / 4); }
.standard-card--w-1-5 { flex: 0 0 calc((100% - (4 * var(--standard-cards-col-gap))) / 5); }
.standard-card--w-1-6 { flex: 0 0 calc((100% - (5 * var(--standard-cards-col-gap))) / 6); }

@media (max-width: 768px) {
    .standard-cards {
        --standard-cards-col-gap: var(--grid-gap);
        --standard-cards-row-gap: 24px; /* keep rows spacing */
    }

    /* Mobile: keep typography from design system; preserve importance
     * - 1..3 per row => 1 per row
     * - 4..5 per row => 2 per row
     * - 6 per row => 3 per row
     */
    .standard-card {
        height: auto;
    }

    .standard-card__text {
        font-size: var(--font-size-body-3-mobile); /* 14px */
        line-height: var(--line-height-body-3-mobile); /* 120% */
    }

    /* 1..3 in row => 1 per row */
    .standard-card--w-1-1,
    .standard-card--w-1-2,
    .standard-card--w-1-3 {
        flex-basis: 100%;
    }

    /* 4..5 in row => 2 per row */
    .standard-card--w-1-4,
    .standard-card--w-1-5 {
        flex-basis: calc((100% - (1 * var(--standard-cards-col-gap))) / 2);
    }

    /* 6 in row => 3 per row */
    .standard-card--w-1-6 {
        flex-basis: calc((100% - (2 * var(--standard-cards-col-gap))) / 3);
    }

    .standard-card__image {
        min-height: 220px;
        flex: none;
    }
}

