/* Sektion */
.ov-service-cards {
    --ov-card-background: #f0e6e5;
    --ov-card-heading: #4b2740;
    --ov-card-text: #4d4b4b;
    --ov-card-accent: #ffa08c;

    padding-block: clamp(40px, 5vw, 80px);
}

.ov-service-cards,
.ov-service-cards *,
.ov-service-cards *::before,
.ov-service-cards *::after {
    box-sizing: border-box;
}

.ov-service-cards .ov-service-cards__heading {
    margin: 0 0 32px;
    color: var(--ov-card-heading);
    font-size: clamp(30px, 3vw, 44px);
    font-weight: 600;
    line-height: 1.15;
}

/* En kolumn som grund */
.ov-service-cards .ov-service-cards__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

/* Kort */
.ov-service-cards .ov-service-card {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--ov-card-background);
    isolation: isolate;
}

/* Text */
.ov-service-cards .ov-service-card__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    padding: clamp(24px, 2.5vw, 36px);
}

.ov-service-cards .ov-service-card__title {
    margin: 0 0 20px;
    color: var(--ov-card-heading);
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: break-word;
}

.ov-service-cards .ov-service-card__description {
    margin: 0 0 28px;
    color: var(--ov-card-text);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    white-space: pre-line;
    overflow-wrap: break-word;
}

/* Knapp */
.ov-service-cards .ov-service-card__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    max-width: 100%;
    margin-top: auto;
    padding: 12px 20px;
    border: 1px solid var(--ov-card-accent);
    border-radius: 6px;
    background: var(--ov-card-accent);
    color: var(--ov-card-heading);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.ov-service-cards .ov-service-card__button:hover {
    border-color: #ff8c76;
    background: #ff8c76;
    color: var(--ov-card-heading);
    text-decoration: none;
}

.ov-service-cards .ov-service-card__button:focus-visible {
    outline: 2px solid var(--ov-card-heading);
    outline-offset: 4px;
}

/* Bild */
.ov-service-cards .ov-service-card__media {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 0;
    width: 68%;
    pointer-events: none;
}

.ov-service-cards .ov-service-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        var(--ov-card-background) 0%,
        rgba(240, 230, 229, 0.96) 18%,
        rgba(240, 230, 229, 0.55) 40%,
        rgba(240, 230, 229, 0) 68%
    );
}

.ov-service-cards .ov-service-card__image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
}

/* Desktop: två kolumner */
@media (min-width: 1024px) {
    .ov-service-cards .ov-service-cards__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ov-service-cards .ov-service-card {
        min-height: 360px;
    }

    .ov-service-cards
    .ov-service-card--has-image
    .ov-service-card__content {
        width: 66%;
    }
}

/* Mobil och tablet: bild ovanför text */
@media (max-width: 1023px) {
    .ov-service-cards .ov-service-card {
        flex-direction: column;
    }

    .ov-service-cards .ov-service-card__media {
        position: relative;
        inset: auto;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .ov-service-cards .ov-service-card__media::after {
        background: linear-gradient(
            to bottom,
            rgba(240, 230, 229, 0) 55%,
            var(--ov-card-background) 100%
        );
    }

    .ov-service-cards .ov-service-card__title {
        font-size: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ov-service-cards .ov-service-card__button {
        transition: none;
    }
}