/*
 * Agua Marina Banner
 * Mobile-first. The desktop hero layout kicks in via a container query, so the
 * banner reacts to the width of the column it is dropped into, not the viewport.
 * Browsers without container query support simply keep the stacked layout.
 */

@font-face {
    font-family: "AM Inter";
    src: url(assets/fonts/inter-latin.woff2) format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "AM Inter";
    src: url(assets/fonts/inter-latin.woff2) format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "AM Poppins";
    src: url(assets/fonts/poppins-600-latin.woff2) format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "AM Poppins";
    src: url(assets/fonts/poppins-600-latin-ext.woff2) format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

.am-banner-wrap {
    container-type: inline-size;
    container-name: ambanner;
    margin: 24px 0;
}

.am-banner {
    --am-navy: #0e2a45;
    --am-blue: #006dab;
    --am-muted: #d4dfeb;
    --am-media-h: clamp(180px, 56cqw, 240px);

    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--am-navy);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    font-family: "AM Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #fff;
    isolation: isolate;
}

/* Themes reach into arbitrary descendants (link underlines, forced img sizing,
   content-box). Neutralise that inside the banner only. */
.am-banner,
.am-banner * {
    box-sizing: border-box;
}

/* :where() keeps this at zero specificity, so every rule below still wins. */
:where(.am-banner) :where(a) {
    text-decoration: none;
    border: 0;
    box-shadow: none;
    outline-offset: 3px;
}

/* ---------- photo ---------- */

.am-media {
    position: relative;
    height: var(--am-media-h);
    overflow: hidden;
}

.am-photo {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center 60%;
    border-radius: 0;
}

/* Progressive blur towards the seam, so the headline panel melts into the photo. */
.am-blur {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0%, #000 100%);
}

.am-blur-1 {
    height: 40%;
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}

.am-blur-2 {
    height: 28%;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.am-blur-3 {
    height: 16%;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

/* Ends fully opaque rather than at 0.95, otherwise the last sliver of photo
   leaves a visible hairline against the solid panel below. */
.am-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(14, 42, 69, 0) 45%, rgba(14, 42, 69, 1) 100%);
}

/* ---------- text panel ---------- */

.am-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    padding: 36px 26px 22px;
    text-align: center;
}

.am-headline {
    margin: 0;
    font-family: "AM Poppins", "AM Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 21px;
    line-height: 1.3;
    color: #fff;
    text-wrap: pretty;
}

.am-headline-desktop {
    display: none;
}

.am-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.am-cta,
.am-url,
.am-logo {
    transition: box-shadow 0.25s ease, text-decoration-color 0.25s ease;
}

.am-cta {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--am-blue);
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    padding: 12px 26px;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}

.am-cta:hover,
.am-cta:focus-visible {
    color: var(--am-blue);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
}

.am-url {
    order: 1;
    color: var(--am-muted);
    font-size: 14px;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 3px;
}

.am-url:hover,
.am-url:focus-visible {
    color: var(--am-muted);
    text-decoration-color: var(--am-muted);
}

/* ---------- logo card ---------- */

.am-logo {
    position: absolute;
    left: 50%;
    top: calc(var(--am-media-h) - 20px);
    transform: translate(-50%, -50%);
    z-index: 2;
    display: block;
    background: #fff;
    border-radius: 10px;
    padding: 12px 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
}

.am-logo:hover,
.am-logo:focus-visible {
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.am-logo img {
    display: block;
    width: auto;
    height: 30px;
    max-width: none;
    margin: 0;
}

/* ---------- desktop hero ---------- */

/* 680px keeps the hero layout for the ~700–800px content columns most
   WordPress themes use; below that the stacked layout reads better. */
@container ambanner (min-width: 680px) {
    .am-banner {
        /* 40cqw reproduces the 1000x400 proportion at any column width, capped
           so very wide columns get a shorter banner instead of a huge one.
           Deliberately not aspect-ratio + max-height: that combination makes
           the box shrink its *width* to keep the ratio once the cap bites. */
        height: min(40cqw, 460px);
    }

    .am-media {
        position: absolute;
        inset: 0;
        height: auto;
    }

    .am-photo {
        object-position: center 62%;
    }

    .am-blur {
        display: none;
    }

    .am-scrim {
        background: linear-gradient(
            100deg,
            rgba(14, 42, 69, 0.92) 0%,
            rgba(14, 42, 69, 0.78) 38%,
            rgba(14, 42, 69, 0.32) 62%,
            rgba(14, 42, 69, 0) 82%
        );
    }

    .am-panel {
        position: absolute;
        left: clamp(24px, 5.6cqw, 56px);
        top: 0;
        bottom: 0;
        align-items: flex-start;
        justify-content: center;
        gap: clamp(14px, 2.2cqw, 22px);
        padding: 0;
        max-width: 64cqw;
        text-align: left;
    }

    .am-headline {
        font-size: clamp(22px, 3.4cqw, 34px);
        line-height: 1.28;
    }

    .am-headline-mobile {
        display: none;
    }

    .am-headline-desktop {
        display: inline;
    }

    .am-actions {
        flex-direction: row;
        align-items: center;
        gap: clamp(12px, 2cqw, 20px);
    }

    .am-cta {
        order: 1;
        gap: 10px;
        font-size: clamp(14px, 1.6cqw, 16px);
        padding: clamp(11px, 1.3cqw, 13px) clamp(20px, 2.6cqw, 26px);
    }

    .am-url {
        order: 2;
        font-size: clamp(12px, 1.4cqw, 14px);
    }

    .am-logo {
        left: auto;
        top: auto;
        right: clamp(20px, 3.2cqw, 32px);
        bottom: clamp(18px, 2.8cqw, 28px);
        transform: none;
        padding: clamp(9px, 1.2cqw, 12px) clamp(13px, 1.8cqw, 18px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    }

    .am-logo:hover,
    .am-logo:focus-visible {
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(255, 255, 255, 0.5);
    }

    .am-logo img {
        height: clamp(26px, 3.6cqw, 36px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .am-cta,
    .am-url,
    .am-logo {
        transition: none;
    }
}
