/* Home "Explore USA" section (template-parts/home/explore-usa.php). Fonts, buttons and --amh-* colours: home-hero.css. */

.amu-section {
    --amu-navy: #01216a;
    --amu-blue: #0381f8;
    --amu-pin: #1677ee;
    --amu-text: #2b416c;
    --amu-line: #e1eaf6;
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 4.6vw, 88px) 0 clamp(60px, 4.8vw, 92px);
    background:
        radial-gradient(38% 60% at 55% 55%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
        radial-gradient(30% 55% at 100% 20%, rgba(214, 232, 252, .9), rgba(214, 232, 252, 0) 70%),
        radial-gradient(30% 50% at 0% 90%, rgba(221, 236, 253, .9), rgba(221, 236, 253, 0) 70%),
        linear-gradient(180deg, #f3f8fe 0%, #eaf2fc 100%);
    color: var(--amu-text);
}

/* Elements with a display of their own still hide with the attribute. */
.amu-section [hidden] {
    display: none !important;
}

.amu-inner {
    display: grid;
    grid-template-columns: minmax(0, 30fr) minmax(0, 50fr) minmax(0, 19fr);
    align-items: center;
    gap: clamp(24px, 2.4vw, 48px);
    width: min(100% - 64px, 1510px);
    margin-inline: auto;
}

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

.amu-title {
    margin: 0;
    padding: 0;
    color: var(--amu-navy);
    font-family: inherit;
    font-size: clamp(28px, 1.9vw, 40px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.14;
}

.amu-description {
    max-width: 520px;
    margin: clamp(14px, 1vw, 18px) 0 0;
    font-size: clamp(16px, 1.02vw, 20px);
    line-height: 1.5;
}

.amu-button {
    margin-top: clamp(22px, 1.8vw, 34px);
}

/* Map */
.amu-map {
    position: relative;
    min-width: 0;
}

.amu-stage {
    position: relative;
    aspect-ratio: 763.1 / 462;
}

/* Soft shadow on the "ground" under the map. */
.amu-stage::before {
    position: absolute;
    right: 6%;
    bottom: -5%;
    left: 6%;
    height: 16%;
    border-radius: 50%;
    background: radial-gradient(50% 50% at 50% 50%, rgba(1, 33, 106, .13), rgba(1, 33, 106, 0));
    content: '';
    pointer-events: none;
}

.amu-svg {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    filter: drop-shadow(0 5px 0 #b4ceee);
}

.amu-state {
    fill: url(#amu-land-fill);
    stroke: #fff;
    stroke-width: 1.1;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    transition: fill .2s ease;
}

.amu-state:hover {
    fill: #a9cef7;
}

.amu-state.is-region {
    fill: #b9d8f9;
}

.amu-states:has(.is-selected) .amu-state:not(.is-selected) {
    fill: #e5eefa;
}

.amu-state.is-selected,
.amu-states:has(.is-selected) .amu-state.is-selected {
    fill: #62a9f6;
    stroke-width: 1.6;
}

.amu-dots circle {
    fill: #fff;
    stroke: #a9c7ec;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.amu-dots {
    transition: opacity .3s ease;
}

/* A zoomed map fades out at its edges instead of ending in a straight cut. */
.amu-section.is-zoomed .amu-svg {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%), linear-gradient(180deg, transparent 0, #000 9%, #000 91%, transparent 100%);
    mask-composite: intersect;
}

.amu-section.is-zoomed .amu-dots,
.amu-section.is-moving .amu-dots {
    opacity: 0;
}

/* Pins: a college (tip on its place), or a group of colleges (centred on them). */
/* Pins of a zoomed map stay inside it (room above for the pins of the top row). */
.amu-pins {
    position: absolute;
    inset: 0;
    pointer-events: none;
    clip-path: inset(-44px -16px 0 -16px);
}

.amu-section.is-zoomed .amu-pins {
    clip-path: inset(0);
}

.amu-pin,
.amu-group {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    pointer-events: auto;
}

.amu-pin {
    width: 30px;
    height: 38px;
    margin: -38px 0 0 -15px;
    background: none;
}

.amu-pin svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 4px 4px rgba(1, 33, 106, .28));
    transform-origin: 50% 100%;
    transition: transform .18s ease;
}

.amu-pin:hover svg,
.amu-pin:focus-visible svg,
.amu-pin.is-active svg {
    transform: translateY(-3px) scale(1.12);
}

.amu-pin-shape {
    fill: var(--amu-pin);
    stroke: #fff;
    stroke-width: 1.6;
    transition: fill .18s ease;
}

.amu-pin.is-top .amu-pin-shape {
    fill: #0b2a66;
}

.amu-pin.is-active {
    z-index: 3;
}

.amu-pin.is-active .amu-pin-shape {
    fill: var(--amh-pink);
}

.amu-pin-core {
    fill: rgba(255, 255, 255, .16);
}

.amu-pin-icon {
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.amu-pin.is-dropping svg {
    animation: amu-drop .5s cubic-bezier(.2, .9, .3, 1.3) var(--amu-delay, 0ms) backwards;
}

.amu-group {
    z-index: 1;
    display: grid;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--amu-navy);
    box-shadow: 0 0 0 5px rgba(3, 129, 248, .2), 0 6px 14px rgba(1, 33, 106, .28);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    transition: scale .18s ease, background-color .18s ease;
}

.amu-group:hover,
.amu-group:focus-visible {
    background: var(--amu-blue);
    scale: 1.1;
}

.amu-group.is-dropping {
    animation: amu-pop .45s cubic-bezier(.2, .9, .3, 1.3) var(--amu-delay, 0ms) backwards;
}

.amu-pin:focus-visible,
.amu-group:focus-visible {
    outline: 3px solid var(--amu-blue);
    outline-offset: 2px;
    border-radius: 8px;
}

.amu-group:focus-visible {
    border-radius: 50%;
}

/* A thin moving bar above the map while colleges load. */
.amu-section.is-loading .amu-stage::after {
    position: absolute;
    top: -14px;
    right: 18%;
    left: 18%;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(3, 129, 248, 0), var(--amu-blue), rgba(3, 129, 248, 0)) 0 0 / 50% 100% no-repeat;
    content: '';
    animation: amu-load 1s linear infinite;
}

.amu-zoom-out {
    position: absolute;
    z-index: 4;
    top: 4px;
    right: 4px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(1, 33, 106, .14);
    color: var(--amu-navy);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.amu-zoom-out svg {
    width: 15px;
    height: 15px;
}

.amu-zoom-out:hover,
.amu-zoom-out:focus-visible {
    color: var(--amu-blue);
}

/* State tip (as on the Divi map): colleges, with sports programs, Amerlink students. */
.amu-tip {
    position: absolute;
    z-index: 5;
    top: 0;
    left: 0;
    min-width: 186px;
    padding: 12px 15px 13px;
    border-radius: 12px;
    background: var(--amu-navy);
    box-shadow: 0 14px 30px rgba(1, 33, 106, .28);
    color: #fff;
    font-size: 13px;
    line-height: 1.35;
    pointer-events: none;
    animation: amu-rise .16s ease-out backwards;
}

.amu-tip::after {
    position: absolute;
    bottom: -6px;
    left: var(--amu-tail, 50%);
    width: 12px;
    height: 12px;
    background: inherit;
    content: '';
    transform: translateX(-50%) rotate(45deg);
}

.amu-tip.is-docked {
    top: 6px;
    left: 6px;
    transform: none !important;
    animation: none;
}

.amu-tip.is-docked::after {
    display: none;
}

.amu-tip-name {
    margin: 0 0 7px;
    font-size: 15px;
    font-weight: 800;
}

.amu-tip-stats {
    display: grid;
    gap: 3px;
    margin: 0;
}

.amu-tip-stats div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.amu-tip-stats dt {
    color: rgba(255, 255, 255, .78);
    font-weight: 400;
}

.amu-tip-stats dd {
    margin: 0;
    font-weight: 700;
}

/* College card */
.amu-card {
    position: absolute;
    z-index: 6;
    top: 0;
    left: 0;
    width: min(350px, 100%);
    box-sizing: border-box;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 50px rgba(1, 33, 106, .22), 0 2px 6px rgba(1, 33, 106, .06);
    color: var(--amu-text);
    animation: amu-rise .2s ease-out backwards;
}

.amu-card:focus {
    outline: none;
}

.amu-card:focus-visible {
    outline: 3px solid var(--amu-blue);
    outline-offset: 2px;
}

.amu-card::after {
    position: absolute;
    bottom: -7px;
    left: var(--amu-tail, 50%);
    width: 14px;
    height: 14px;
    background: #fff;
    box-shadow: 4px 4px 8px rgba(1, 33, 106, .06);
    content: '';
    transform: translateX(-50%) rotate(45deg);
}

.amu-card.is-below::after {
    top: -7px;
    bottom: auto;
    box-shadow: -3px -3px 6px rgba(1, 33, 106, .04);
}

.amu-card-school {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.amu-card-media {
    position: relative;
    display: grid;
    overflow: hidden;
    aspect-ratio: 132 / 104;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #f1f7ff 0%, #dceafb 100%);
}

.amu-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 12px;
    object-fit: contain;
}

.amu-card-media.is-photo img {
    padding: 0;
    object-fit: cover;
}

.amu-card-initials {
    display: none;
    color: var(--amu-blue);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.amu-card-media.is-empty .amu-card-initials {
    display: block;
}

.amu-card-name {
    margin: 0 26px 5px 0;
    padding: 0;
    color: var(--amu-navy);
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.amu-card-meta {
    margin: 0;
    padding: 0;
    font-size: 13.5px;
    line-height: 1.5;
}

.amu-card-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    color: var(--amu-blue);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.amu-card-link svg {
    width: 16px;
    height: 16px;
    transition: transform .18s ease;
}

.amu-card-link:hover,
.amu-card-link:focus-visible {
    color: var(--amu-navy);
}

.amu-card-link:hover svg,
.amu-card-link:focus-visible svg {
    transform: translateX(3px);
}

.amu-card-close {
    position: absolute;
    z-index: 1;
    top: 8px;
    right: 8px;
    display: grid;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f0f5fc;
    color: var(--amu-navy);
    cursor: pointer;
}

.amu-card-close svg {
    width: 14px;
    height: 14px;
}

.amu-card-close:hover,
.amu-card-close:focus-visible {
    background: #dfeafa;
}

.amu-card-list {
    max-height: 230px;
    margin: 6px 0 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.amu-card-list li {
    margin: 0;
    padding: 0;
}

.amu-card-list button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--amu-navy);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
}

.amu-card-list button span {
    display: block;
    color: var(--amu-text);
    font-size: 12.5px;
    font-weight: 400;
}

.amu-card-list button:hover,
.amu-card-list button:focus-visible {
    background: #f0f5fc;
}

/* Filters (the search box needs the id to win over style.css's input:not(…) rule) */
.amu-filters {
    display: grid;
    align-content: center;
    gap: 10px;
    margin: 0;
}

.amu-field {
    position: relative;
    display: block;
    margin: 0;
}

#explore-usa .amu-field input,
.amu-field select {
    display: block;
    width: 100%;
    height: 50px;
    box-sizing: border-box;
    margin: 0;
    padding: 0 42px 0 16px;
    border: 1px solid var(--amu-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(1, 33, 106, .06);
    color: var(--amu-navy);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.amu-field select {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2301216a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13.5 6.5 19 12l-5.5 5.5'/%3E%3C/svg%3E") no-repeat right 16px center / 15px;
    cursor: pointer;
    text-overflow: ellipsis;
}

#explore-usa .amu-field-search input {
    padding: 0 16px 0 44px;
}

.amu-field-search svg {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    color: #8aa2c4;
    pointer-events: none;
    transform: translateY(-50%);
}

#explore-usa .amu-field input::placeholder {
    color: #8aa2c4;
    font-weight: 500;
    opacity: 1;
}

#explore-usa .amu-field input::-webkit-search-cancel-button {
    cursor: pointer;
}

#explore-usa .amu-field input:focus,
.amu-field select:focus {
    border-color: var(--amu-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(3, 129, 248, .18), 0 6px 16px rgba(1, 33, 106, .06);
}

.amu-status {
    min-height: 38px;
    font-size: 13px;
    line-height: 1.45;
    transition: opacity .2s ease;
}

.amu-status p {
    margin: 0;
    padding: 0;
}

.amu-status strong {
    color: var(--amu-navy);
}

.amu-section.is-loading .amu-status {
    opacity: .55;
}

.amu-reset {
    justify-self: start;
    margin: -4px 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--amu-blue);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* What the pin colours mean. */
.amu-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    margin: clamp(14px, 1.2vw, 22px) 0 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.4;
    list-style: none;
}

.amu-legend li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.amu-legend li::before {
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--amu-pin);
    box-shadow: 0 1px 4px rgba(1, 33, 106, .3);
    content: '';
}

.amu-legend .is-top::before {
    background: #0b2a66;
}

/* Results as a list: phones only (pins are too small to tap there). */
.amu-results {
    display: none;
}

@keyframes amu-drop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(.6);
    }
}

@keyframes amu-pop {
    from {
        opacity: 0;
        scale: .4;
    }
}

@keyframes amu-rise {
    from {
        opacity: 0;
        translate: 0 6px;
    }
}

@keyframes amu-load {
    from {
        background-position: -100% 0;
    }

    to {
        background-position: 200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .amu-state,
    .amu-dots,
    .amu-pin svg,
    .amu-group,
    .amu-card-link svg {
        transition: none;
    }

    .amu-pin.is-dropping svg,
    .amu-group.is-dropping,
    .amu-tip,
    .amu-card,
    .amu-section.is-loading .amu-stage::after {
        animation: none;
    }
}

/* Two rows: texts, then the map with the filters at its side. */
@media (max-width: 1180px) {
    .amu-inner {
        grid-template-columns: minmax(0, 70fr) minmax(220px, 26fr);
        row-gap: clamp(28px, 3vw, 44px);
    }

    .amu-copy {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
        column-gap: 48px;
    }

    .amu-copy .amu-eyebrow,
    .amu-copy .amu-title,
    .amu-copy .amu-description {
        grid-column: 1;
    }

    .amu-button {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: end;
        white-space: nowrap;
    }
}

/* One column: texts, map, filters in rows under it. */
@media (max-width: 1080px) {
    .amu-inner {
        grid-template-columns: minmax(0, 1fr);
        max-width: 860px;
    }

    .amu-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .amu-field-search,
    .amu-status {
        grid-column: 1 / -1;
    }
}

/* Phones: filters above the map, the card and the results under it. */
@media (max-width: 780px) {
    .amu-inner {
        width: min(100% - 36px, 660px);
    }

    .amu-copy {
        display: block;
    }

    .amu-copy {
        order: 1;
    }

    .amu-filters {
        order: 2;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .amu-map {
        order: 3;
    }

    #explore-usa .amu-field input,
    .amu-field select {
        height: 46px;
        font-size: 14px;
    }

    .amu-field select {
        padding-right: 34px;
        background-position: right 12px center;
    }

    .amu-card {
        position: relative;
        width: auto;
        margin-top: 22px;
        transform: none !important;
    }

    .amu-card::after {
        display: none;
    }

    .amu-tip {
        top: 4px;
        left: 4px;
        min-width: 0;
        max-width: calc(100% - 8px);
        padding: 8px 11px;
        font-size: 12px;
        transform: none !important;
    }

    .amu-tip::after {
        display: none;
    }

    .amu-tip-name {
        margin-bottom: 3px;
        font-size: 13px;
    }

    .amu-tip-stats {
        display: flex;
        flex-wrap: wrap;
        column-gap: 12px;
    }

    .amu-tip-stats div {
        gap: 5px;
    }

    .amu-section.has-card .amu-tip {
        display: none;
    }

    .amu-zoom-out {
        top: auto;
        bottom: -6px;
        padding: 7px 12px;
    }

    .amu-results {
        display: grid;
        gap: 8px;
        max-height: 420px;
        margin: 22px 0 0;
        padding: 0;
        overflow: auto;
        list-style: none;
    }

    .amu-results li {
        margin: 0;
        padding: 0;
    }

    .amu-results button {
        display: grid;
        width: 100%;
        gap: 2px;
        margin: 0;
        padding: 11px 14px;
        border: 1px solid var(--amu-line);
        border-radius: 10px;
        background: #fff;
        color: var(--amu-text);
        cursor: pointer;
        font-family: inherit;
        font-size: 13px;
        line-height: 1.35;
        text-align: left;
    }

    .amu-results strong {
        color: var(--amu-navy);
        font-size: 14.5px;
    }
}

@media (max-width: 420px) {
    .amu-card-school {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 12px;
    }

    .amu-button {
        width: 100%;
    }
}

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

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

/* The narrowest phones: two filter buttons per row cut their labels ("Select Re…", "All Divisio…"). */
@media (max-width: 374px) {
    .amu-filters {
        grid-template-columns: minmax(0, 1fr);
    }
}
