/*
 * Strategic partner cards (Figma strategic_partner-card, as on /ambassadors-network-v3): the partner's photo with
 * its white logo; hovering shows the summary and, when the card links somewhere, a white button. One card for
 * /ambassadors-network-v3 and /insights/research-surveys-v2 (user, 2026-11-19): markup in
 * resources/views/frontend/partials/strategic-partner-card.blade.php, inside a `.sp-cards` list.
 * Self-contained, for pages without the capability and AN v2 sheets: on AN3 it loads after ambassadors-network-v2.css
 * (whose plain .anw-sp-card rules it overrides) and before ambassadors-network-v3.css.
 */

/* Square, clipped, no link underline (on AN3 the page also squares everything). */
.sp-cards .anw-sp-card {
    overflow: hidden;
    border-radius: 0;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.sp-cards .anw-sp-card:hover,
.sp-cards .anw-sp-card:focus-visible {
    text-decoration: none;
}

/* The button (the design system's "button-small-alt", as cap-btn): Nunito Sans 14, a 16px Material Symbols icon. */
.sp-cards .anw-sp-card__action {
    align-items: center;
    gap: 4px;
    padding: 8px 8px 8px 16px;
    border: 0;
    border-radius: 0;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: 0.28px;
    text-transform: capitalize;
    white-space: nowrap;
}

.sp-cards .anw-sp-card__action .cap-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 16px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* The card's hover, animated (user, 2026-11-16: "un pic mai încet"): instead of v2's jump, the logo is absolutely
   placed so it can move — it slides from the centre to the top left and shrinks (0.6s), then the summary and the
   button fade and rise in (with 0.15s / 0.25s delays on the way in, none on the way out).
   Rectangles, not squares (user, 2026-11-19): the summary and the button sit in the flow under the open logo's room,
   so the card is exactly as tall as its open content (no gap around the summary); the carousel row stretches its
   items, so the three cards share the tallest one's height. They take that room while hidden too: no jump on hover. */
.sp-cards .anw-sp-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    container-type: inline-size;
    height: 100%;
    aspect-ratio: auto;
    padding: 24px 24px 36px;
    border: 0;
    background-color: #013a41;
    background-size: cover;
    /* The photos are square with a colour strip at the bottom: a shorter card crops the top, never the strip. */
    background-position: center bottom;
    color: #fff;
}

.sp-cards .anw-sp-card__logo {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: block;
    width: auto;
    height: calc(100% - 48px);
    transition: height .6s ease;
}

.sp-cards .anw-sp-card__logo img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 309px;
    max-width: 100%;
    height: auto;
    transform: translate(-50%, -50%);
    transform-origin: left center;
    transition: left .6s ease, transform .6s ease;
}

.sp-cards .anw-sp-card--tint .anw-sp-card__logo img {
    width: auto;
    max-width: 260px;
    max-height: 96px;
    filter: brightness(0) invert(1);
}

/* --an3-sp-logo: the open logo's room (the shrunk logo is at most 70px tall). */
.sp-cards .anw-sp-card__text {
    position: static;
    display: block;
    flex: 0 0 auto;
    margin-top: calc(var(--an3-sp-logo, 80px) + 12px);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease;
}

/* Prototype: a white full-width button, dark label, an arrow; it sits above the colour strip. */
.sp-cards .anw-sp-card__action {
    position: static;
    display: inline-flex;
    flex: 0 0 auto;
    align-self: stretch;
    justify-content: center;
    margin-top: 16px;
    background: #fff;
    color: var(--cap-ink, #232e33);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .3s ease, transform .3s ease;
}

.sp-cards .anw-sp-card:hover,
.sp-cards .anw-sp-card:focus-visible {
    border-color: transparent;
    background-color: #013a41;
    box-shadow: none;
    color: #fff;
}

.sp-cards .anw-sp-card:hover .anw-sp-card__logo,
.sp-cards .anw-sp-card:focus-visible .anw-sp-card__logo {
    height: var(--an3-sp-logo, 80px);
}

.sp-cards .anw-sp-card:hover .anw-sp-card__logo img,
.sp-cards .anw-sp-card:focus-visible .anw-sp-card__logo img {
    left: 0;
    width: 309px;
    transform: translate(0, -50%) scale(.725);
}

.sp-cards .anw-sp-card--tint:hover .anw-sp-card__logo img,
.sp-cards .anw-sp-card--tint:focus-visible .anw-sp-card__logo img {
    width: auto;
}

.sp-cards .anw-sp-card:hover .anw-sp-card__text,
.sp-cards .anw-sp-card:focus-visible .anw-sp-card__text {
    display: block;
    opacity: 1;
    transform: none;
    transition: opacity .45s ease .15s, transform .45s ease .15s;
}

.sp-cards .anw-sp-card:hover .anw-sp-card__action,
.sp-cards .anw-sp-card:focus-visible .anw-sp-card__action {
    display: inline-flex;
    opacity: 1;
    transform: none;
    transition: opacity .45s ease .25s, transform .45s ease .25s;
}

/* Touch screens (no hover): the open state, as in v2. */
@media (hover: none) {
    .sp-cards .anw-sp-card .anw-sp-card__logo {
        height: var(--an3-sp-logo, 80px);
    }

    .sp-cards .anw-sp-card .anw-sp-card__logo img {
        left: 0;
        transform: translate(0, -50%) scale(.725);
    }

    .sp-cards .anw-sp-card .anw-sp-card__text,
    .sp-cards .anw-sp-card .anw-sp-card__action {
        opacity: 1;
        transform: none;
    }
}

/* Cards under 340px (narrow laptops, tablets, phones): a smaller summary and a little less room for the logo. */
@container (max-width: 340px) {
    .sp-cards .anw-sp-card__logo,
    .sp-cards .anw-sp-card__text {
        --an3-sp-logo: 72px;
    }

    .sp-cards .anw-sp-card__text {
        font-size: 12px;
        line-height: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-cards .anw-sp-card__logo,
    .sp-cards .anw-sp-card__logo img,
    .sp-cards .anw-sp-card__text,
    .sp-cards .anw-sp-card__action,
    .sp-cards .anw-sp-card:hover .anw-sp-card__text,
    .sp-cards .anw-sp-card:hover .anw-sp-card__action {
        transition: none;
    }
}
