/*---*\
    Quick Link Cards
    Homepage quick-nav cards with image accents and hover CTAs

    KEY FEATURES:
    - Patterned section background
    - Text left / yellow accent / image right card layout
    - CTA buttons always visible on mobile/tablet; hover/focus-within on desktop
    - Tertiary button style for rental CTA

    IMPLEMENTATION NOTES:
    - Mobile-first; breakpoints 768px / 1200px
    - Background pattern is white dots on transparent — surface color underneath
\*---*/

.quick-link-cards {
    padding: 24px 0;
    overflow: visible;
    background-color: var(--color-surface-white);
    background-image: url("/wp-content/themes/fx/assets/img/background-pattern-50-opacity.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

@media (max-width: 1199px) {
    .quick-link-cards {
        background-repeat: repeat;
        background-size: 200%;
    }
}

@media (max-width: 767px) {
    .quick-link-cards {
        background-repeat: repeat;
        background-size: 300%;
    }
}

.quick-link-cards__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-link-cards__card {
    display: flex;
    overflow: visible;
    min-height: 148px;
    background-color: var(--color-surface-white);
    border-radius: 8px;
    filter: drop-shadow(0 4px 23.5px rgb(0 0 0 / 15%));
}

.quick-link-cards__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 20px 16px;
    border-right: 4px solid var(--color-primary);
    background-color: #fff;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
}

.quick-link-cards__title {
    margin: 0;
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.quick-link-cards__subtitle {
    margin: 0;
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-size: 19px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
}

.quick-link-cards__actions {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.quick-link-cards__actions .btn {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
}

.quick-link-cards__actions .btn + .btn {
    margin-top: 0;
    margin-left: 0;
}

.quick-link-cards__media {
    position: relative;
    flex: 0 0 110px;
    width: 110px;
    align-self: stretch;
    overflow: hidden;
    border-radius: 0 8px 8px 0;
}

.quick-link-cards__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) {
    .quick-link-cards {
        padding: 36px 0;
    }

    .quick-link-cards__list {
        gap: 20px;
    }

    .quick-link-cards__card {
        min-height: 172px;
    }

    .quick-link-cards__body {
        padding: 28px 24px;
    }

    .quick-link-cards__title {
        font-size: 32px;
    }

    .quick-link-cards__subtitle {
        font-size: 24px;
    }

    .quick-link-cards__actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 16px;
    }

    .quick-link-cards__actions .btn {
        width: auto;
        padding: 12px 20px;
        font-size: 16px;
    }

    .quick-link-cards__media {
        flex-basis: 180px;
        width: 180px;
    }
}

@media (min-width: 1200px) {
    .quick-link-cards {
        padding: 52px 0 76px;
    }

    .quick-link-cards__list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: stretch;
        gap: 20px;
    }

    .quick-link-cards__card {
        position: relative;
        flex: 0 0 calc((100% - 40px) / 3);
        min-height: 0;
        width: 0;
        overflow: visible;
        z-index: 1;
        transition: transform 0.25s ease, box-shadow 0.25s ease, height 0.3s ease-in-out, max-height 0.3s ease-in-out;
    }

    .quick-link-cards__card:hover,
    .quick-link-cards__card:focus-within {
        z-index: 2;
        box-shadow: 0 8px 28px rgb(0 0 0 / 22%);
    }

    .quick-link-cards__body {
        position: static;
        z-index: 1;
        min-width: 0;
        min-height: 0;
        padding: 28px 24px;
        overflow: visible;
        height: 100%;
        transition: padding 0.3s ease-in-out, height 0.3s ease-in-out, max-height 0.3s ease-in-out;
    }

    .quick-link-cards__title {
        font-size: 36px;
    }

    .quick-link-cards__subtitle {
        font-size: 28px;
    }

    .quick-link-cards__actions {
        position: absolute;
        right: auto;
        bottom: -30px;
        left: 24px;
        z-index: 3;
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        width: max-content;
        max-width: none;
        height: auto;
        margin: 0;
        gap: 10px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(50%);
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .quick-link-cards__actions .btn {
        flex: 0 0 auto;
        width: auto;
        padding: 16px 25px;
        font-size: 18px;
        white-space: nowrap;
    }

    .quick-link-cards__actions .btn:hover {
        background-color: var(--color-surface-white);
    }

    .quick-link-cards__card:hover .quick-link-cards__actions,
    .quick-link-cards__card:focus-within .quick-link-cards__actions {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .quick-link-cards__media {
        flex: 0 0 42%;
        width: 42%;
        max-width: none;
        height: 100%;
        transition: transform 0.3s ease-in-out, height 0.3s ease-in-out, max-height 0.3s ease-in-out;
    }

    .quick-link-cards__card:hover,
    .quick-link-cards__card:focus-within {
        .quick-link-cards__body {
            padding-top: 20px;
            padding-bottom: 20px;
        }

        .quick-link-cards__media,
        .quick-link-cards__body {
            height: calc(100% + 30px);
        }
    }
}

@media (min-width: 1200px) and (hover: none) {
    .quick-link-cards {
        padding-bottom: 52px;
    }

    .quick-link-cards__card:hover,
    .quick-link-cards__card:focus-within {
        transform: none;
        box-shadow: 0 4px 23.5px rgb(0 0 0 / 15%);
    }

    .quick-link-cards__actions {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        margin-top: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-link-cards__card,
    .quick-link-cards__actions {
        transition: none;
    }

    .quick-link-cards__card:hover,
    .quick-link-cards__card:focus-within {
        transform: none;
    }
}

/*
 * Spanish (Weglot): longer titles (e.g. Equipamiento) overflow the image,
 * and longer copy wraps so the text column looks cramped. Give the body
 * more width, slightly smaller type, and clip so text cannot paint over the photo.
 */
@media (min-width: 1200px) {
    html:lang(es) .quick-link-cards__body {
        overflow: hidden;
        padding: 24px 18px;
    }

    html:lang(es) .quick-link-cards__title {
        font-size: 28px;
        overflow-wrap: break-word;
    }

    html:lang(es) .quick-link-cards__subtitle {
        font-size: 20px;
    }

    html:lang(es) .quick-link-cards__media {
        flex: 0 0 32%;
        width: 32%;
    }
}
