/*
 * Media cards (shared component, 2026-11-06): 3 columns at desktop, 2 at tablet, 1 on phones; equal height; one resting
 * style; lift only on a real hover of a linked card. Property-owned, loaded by themes/blocks/media-cards.blade.php.
 * Colours only through the theme/brand tokens of w2p-theme.css.
 */
.w2p-mcards {
    padding: clamp(3.5rem, 2.5rem + 3.5vw, 6rem) 0;
}

.w2p-mcards__head {
    max-width: 46rem;
    margin: 0 auto clamp(2rem, 1.5rem + 1.5vw, 3rem);
    text-align: center;
}

.w2p-mcards .w2p-mcards__title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 1.35rem + 1.3vw, 2.375rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: var(--w2p-text, #1E2433);
}

.w2p-mcards__lead {
    margin: 0;
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--w2p-text-body, #3d4556);
}

.w2p-mcards__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1rem, 0.75rem + 1vw, 1.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .w2p-mcards__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .w2p-mcards__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.w2p-mcard {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: var(--w2p-surface, #fff);
    border: 1px solid var(--w2p-border-color, #e3e7ee);
    border-radius: 16px;
    box-shadow: var(--w2p-shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.w2p-mcard__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--w2p-surface-muted, #F5F6F8);
    border-bottom: 1px solid var(--w2p-border-color, #e3e7ee);
}

.w2p-mcard__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.w2p-mcard__body {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 2.25rem 1.5rem 1.5rem;
}

.w2p-mcard__icon {
    position: absolute;
    top: -1.5rem;
    left: 1.5rem;
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    color: var(--w2p-brand-night, #0F1B2D);
    background: var(--w2p-brand-accent, #F29A21);
    border: 3px solid var(--w2p-surface, #fff);
    border-radius: 12px;
    box-shadow: 0 6px 16px -8px rgba(15, 27, 45, 0.45);
}

.w2p-mcard__icon svg {
    width: 1.375rem;
    height: 1.375rem;
}

.w2p-mcards .w2p-mcard__name {
    margin: 0 0 0.5rem;
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--w2p-text, #1E2433);
}

.w2p-mcard__link {
    color: inherit;
    text-decoration: none;
}

/* The whole card is the link target. */
.w2p-mcard__link::after {
    position: absolute;
    inset: 0;
    content: "";
}

.w2p-mcard__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--w2p-text-body, #3d4556);
}

.w2p-mcard__more {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--w2p-brand-navy, #0B3A7E);
}

.w2p-mcard__more svg {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.w2p-mcard__link:focus-visible {
    outline: none;
}

.w2p-mcard--link:focus-within {
    box-shadow: var(--w2p-focus-ring), var(--w2p-shadow-card);
}

@media (hover: hover) {
    .w2p-mcard--link:hover {
        transform: translateY(-4px);
        box-shadow: var(--w2p-shadow-card-hover);
    }

    .w2p-mcard--link:hover .w2p-mcard__more svg {
        transform: translateX(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .w2p-mcard,
    .w2p-mcard__more svg {
        transition: none;
    }

    .w2p-mcard--link:hover {
        transform: none;
    }
}
