/* Home "Optional Expert Help" section (template-parts/home/expert-help.php). Fonts, buttons and --amh-* colours:
   home-hero.css. */

.ame-section {
    --ame-navy: #021a62;
    --ame-blue: #0a72f5;
    --ame-eyebrow: #0f6ef5;
    --ame-icon: #1f86f7;
    --ame-text: #31477c;
    /* The page margin beside .ame-inner: the photo reaches into it, up to the window's edge. */
    --ame-gutter: max(32px, (100vw - 1510px) / 2);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(45% 70% at 100% 0%, rgba(203, 223, 241, .75), rgba(203, 223, 241, 0) 70%),
        linear-gradient(180deg, #f5f9fe 0%, #edf5fd 100%);
    color: var(--ame-text);
}

/* Soft light waves behind the texts, as in the design. */
.ame-section::before,
.ame-section::after {
    position: absolute;
    border-radius: 50%;
    content: '';
    pointer-events: none;
}

.ame-section::before {
    bottom: -55%;
    left: -18%;
    width: 75%;
    height: 110%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .75), rgba(255, 255, 255, 0));
    transform: rotate(-14deg);
}

.ame-section::after {
    top: 18%;
    left: -30%;
    width: 70%;
    height: 50%;
    border: 1px solid rgba(255, 255, 255, .8);
    transform: rotate(-10deg);
}

.ame-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(0, 13fr) minmax(0, 42fr);
    align-items: center;
    width: min(100% - 64px, 1510px);
    margin-inline: auto;
}

/* Texts: over the faded left edge of the photo. */
.ame-copy {
    position: relative;
    z-index: 2;
    grid-column: 1 / 3;
    grid-row: 1;
    padding-block: clamp(56px, 4.4vw, 84px);
}

.ame-eyebrow {
    margin: 0 0 clamp(8px, .7vw, 12px);
    color: var(--ame-eyebrow);
    font-size: clamp(14px, 1.05vw, 19px);
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.ame-title {
    /* Wider than the text column: the first line reaches over the light top of the photo, as in the design. */
    width: max-content;
    max-width: 155%;
    margin: 0;
    padding: 0;
    color: var(--ame-navy);
    font-family: inherit;
    font-size: clamp(30px, 2.9vw, 56px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.1;
}

.ame-description {
    max-width: 820px;
    margin: clamp(14px, 1.1vw, 20px) 0 0;
    font-size: clamp(16px, 1.05vw, 20px);
    line-height: 1.55;
}

/* Services */
.ame-features {
    display: grid;
    gap: clamp(12px, .9vw, 18px);
    max-width: 680px;
    margin: clamp(22px, 1.7vw, 32px) 0 0;
    padding: 0;
    list-style: none;
}

.ame-feature {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 1.3vw, 26px);
    margin: 0;
}

.ame-feature-icon {
    display: grid;
    width: clamp(56px, 4.1vw, 80px);
    height: clamp(56px, 4.1vw, 80px);
    place-items: center;
    border: clamp(6px, .45vw, 9px) solid #fff;
    border-radius: 16px;
    background: #e1eefd;
    box-shadow: 0 8px 22px rgba(1, 33, 106, .08);
    color: var(--ame-icon);
}

.ame-feature-icon svg {
    width: 58%;
    height: 58%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ame-feature-icon .ame-dot {
    stroke-width: 2.6;
}

.ame-feature-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.ame-feature-title {
    color: #0a1b4f;
    font-size: clamp(16px, 1.05vw, 20px);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.ame-feature-text {
    font-size: clamp(14px, .9vw, 17px);
    line-height: 1.45;
}

/* Button: the hero's .amh-button in blue. */
.ame-button {
    margin-top: clamp(24px, 1.9vw, 36px);
    padding-inline: clamp(24px, 2.6vw, 50px);
    background: var(--ame-blue);
    box-shadow: 0 12px 26px rgba(10, 114, 245, .28);
    font-size: clamp(15px, 1vw, 19px);
}

.ame-button:hover,
.ame-button:focus-visible {
    background: #0661d4;
}

.ame-button:focus-visible {
    outline: 3px solid var(--ame-navy);
    outline-offset: 3px;
}

.ame-button-arrow {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

/* Photo: from under the texts to the window's edge, at the bottom of the section. */
.ame-visual {
    position: relative;
    z-index: 1;
    grid-column: 2 / 4;
    grid-row: 1;
    align-self: end;
    min-width: 0;
    margin-right: calc(-1 * var(--ame-gutter));
}

.ame-photo {
    position: relative;
    aspect-ratio: 1083 / 793;
    container-type: inline-size;
}

.ame-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fades into the background on the left (under the texts) and at the top (the texts are often taller). */
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24%), linear-gradient(180deg, transparent 0%, #000 16%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0%, #000 24%), linear-gradient(180deg, transparent 0%, #000 16%);
    mask-composite: intersect;
}

.ame-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: #8db1ee;
    stroke-dasharray: 8 7;
    stroke-linecap: round;
    stroke-width: 2.2;
    vector-effect: non-scaling-stroke;
}

.ame-lines path {
    vector-effect: non-scaling-stroke;
}

/* Labels: at least the size the design gave them (in % of the photo), anchored to their side; on a small photo
   they grow with their text instead of shrinking below a readable size. */
.ame-badges {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ame-badge {
    position: absolute;
    box-sizing: border-box;
    top: var(--ame-y);
    display: flex;
    min-width: var(--ame-w);
    min-height: var(--ame-h);
    align-items: center;
    gap: clamp(8px, 1.6cqi, 18px);
    margin: 0;
    padding: clamp(6px, 1.5cqi, 16px) clamp(8px, 1.8cqi, 20px);
    border-radius: clamp(8px, 1.2cqi, 14px);
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 12px 30px rgba(2, 26, 98, .1);
    color: #0a1d55;
    font-size: clamp(11px, 1.72cqi, 19px);
    font-weight: 600;
    line-height: 1.3;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.ame-badge-left {
    left: var(--ame-x);
}

.ame-badge-right {
    right: var(--ame-x);
}

.ame-badge-icon {
    display: grid;
    width: clamp(26px, 5.8cqi, 64px);
    height: clamp(26px, 5.8cqi, 64px);
    flex: 0 0 auto;
    place-items: center;
    border-radius: clamp(6px, 1cqi, 12px);
    background: #dcecfd;
    color: #077dfa;
}

.ame-badge-icon svg {
    width: 58%;
    height: 58%;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.ame-badge-text {
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .ame-button {
        transition: none;
    }
}

@media (max-width: 1439px) {
    .ame-inner {
        grid-template-columns: minmax(0, 48fr) minmax(0, 12fr) minmax(0, 40fr);
    }
}

@media (max-width: 1179px) {
    .ame-inner {
        grid-template-columns: minmax(0, 50fr) minmax(0, 12fr) minmax(0, 38fr);
    }
}

/* Texts above the photo; the photo stays inside the page width, with rounded corners. */
@media (max-width: 899px) {
    .ame-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .ame-copy {
        grid-column: 1;
        padding-bottom: clamp(28px, 4vw, 40px);
    }

    .ame-title {
        width: auto;
        max-width: 100%;
    }

    .ame-description {
        max-width: 760px;
    }

    .ame-visual {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: 760px;
        margin: 0 0 clamp(48px, 7vw, 72px);
    }

    .ame-image {
        border-radius: 18px;
        -webkit-mask-image: none;
        mask-image: none;
    }
}

@media (max-width: 780px) {
    .ame-inner {
        width: min(100% - 36px, 660px);
    }

    .ame-button {
        width: 100%;
    }

    .ame-lines {
        display: none;
    }
}

/* Phones: the line breaks typed in the panel would leave a single word on a line ("Experienced / Experts"); the heading
   wraps on its own, balanced. */
@media (max-width: 520px) {
    .ame-title {
        text-wrap: balance;
    }

    .ame-title br {
        display: none;
    }
}
