/* Home "How Amerlink works" section (template-parts/home/how-it-works.php). Fonts and --amh-* colours: home-hero.css. */

/* Thin step numbers (Montserrat Light from the theme's fonts/, the other weights come with home-hero.css). */
@font-face {
    font-family: 'Amerlink Montserrat';
    src: url('../../fonts/Montserrat-Light.ttf') format('truetype');
    font-style: normal;
    font-weight: 300;
    font-display: swap;
}

.amw-section {
    --amw-navy: #01216a;
    --amw-blue: #0381f8;
    --amw-number: #2a95fb;
    --amw-icon: #0a7cf2;
    --amw-text: #1f3768;
    --amw-green: #06a487;
    --amw-gap: clamp(44px, 5.6vw, 108px);
    position: relative;
    overflow: hidden;
    padding: clamp(56px, 4.4vw, 84px) 0 clamp(64px, 5vw, 96px);
    background:
        radial-gradient(60% 50% at 4% 96%, rgba(196, 223, 250, .75), rgba(196, 223, 250, 0) 70%),
        radial-gradient(55% 50% at 97% 96%, rgba(198, 225, 252, .8), rgba(198, 225, 252, 0) 70%),
        linear-gradient(180deg, #f6fafe 0%, #eff6fe 55%, #deedfc 100%);
    color: var(--amw-text);
}

.amw-inner {
    position: relative;
    width: min(100% - 64px, 1510px);
    margin-inline: auto;
}

.amw-header {
    position: relative;
    z-index: 1;
}

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

.amw-title {
    margin: 0;
    padding: 0;
    color: var(--amw-navy);
    font-family: inherit;
    font-size: clamp(32px, 3.1vw, 60px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.1;
}

/* Handwritten note with the dashed trail and the cap (top right), reaching into the page margin when there is one. */
.amw-decor {
    position: absolute;
    top: clamp(-36px, -1.8vw, -16px);
    right: clamp(-100px, calc(779px - 50vw), -8px);
    width: clamp(380px, 31vw, 590px);
    aspect-ratio: 710 / 200;
    pointer-events: none;
}

.amw-trail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.amw-note {
    position: absolute;
    top: 2%;
    left: 40%;
    margin: 0;
    color: #0b2a66;
    font-family: 'Segoe Print', 'Bradley Hand', cursive;
    font-size: clamp(15px, 1.3vw, 25px);
    font-style: italic;
    line-height: 1.38;
    white-space: nowrap;
    transform: rotate(-8deg);
    transform-origin: left top;
}

.amw-note::after {
    display: block;
    width: 62%;
    height: 4px;
    margin: 8px 0 0 22%;
    border-radius: 100%;
    background: var(--amh-pink);
    content: '';
    transform: rotate(-3deg);
}

/* Steps: heads in the first row, panels in the second (subgrid keeps the panels level). */
.amw-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: auto auto;
    column-gap: var(--amw-gap);
    margin: clamp(36px, 3.3vw, 64px) 0 0;
    padding: 0;
    list-style: none;
}

.amw-step {
    display: grid;
    grid-row: span 2;
    grid-template-rows: subgrid;
    row-gap: clamp(24px, 2.1vw, 40px);
    min-width: 0;
    margin: 0;
    padding: 0;
}

.amw-step-head {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(14px, 1.4vw, 26px);
}

/* As in the design, the heads of steps 2 and 3 start before their panels; the line sits between. */
.amw-step + .amw-step .amw-step-head {
    margin-left: calc(var(--amw-gap) * -.35);
}

.amw-step + .amw-step .amw-step-head::before {
    position: absolute;
    top: 6px;
    bottom: 0;
    left: calc(var(--amw-gap) * -.325);
    width: 1px;
    background: linear-gradient(180deg, rgba(204, 225, 247, 0), #d9e9f9 25%, #d9e9f9 75%, rgba(204, 225, 247, 0));
    content: '';
}

.amw-step-number {
    color: var(--amw-number);
    font-size: clamp(64px, 5.6vw, 108px);
    font-weight: 300;
    letter-spacing: -.04em;
    line-height: .82;
}

.amw-step-title {
    margin: 0;
    padding: 0;
    color: var(--amw-navy);
    font-family: inherit;
    font-size: clamp(22px, 1.65vw, 32px);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.amw-step-description {
    margin: clamp(10px, .9vw, 16px) 0 0;
    color: var(--amw-text);
    font-size: clamp(15px, 1vw, 19px);
    line-height: 1.45;
}

/* Panels */
.amw-panel-wrap {
    position: relative;
    display: flex;
    min-width: 0;
}

.amw-panel {
    width: 100%;
    padding: clamp(20px, 1.5vw, 28px) clamp(16px, 1.25vw, 24px) clamp(22px, 1.6vw, 30px);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(1, 33, 106, .07);
}

.amw-panel-title {
    margin: 0 0 clamp(14px, 1.2vw, 22px);
    color: var(--amw-navy);
    font-size: clamp(17px, 1.15vw, 21px);
    font-weight: 800;
    letter-spacing: -.01em;
    line-height: 1.25;
}

.amw-arrow {
    position: absolute;
    top: 50%;
    left: 100%;
    width: clamp(36px, 2.9vw, 56px);
    height: auto;
    transform: translate(calc(var(--amw-gap) / 2 - 50%), -50%);
}

.amw-list {
    display: grid;
    gap: clamp(14px, 1.45vw, 28px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.amw-list-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(14px, 2vw, 40px);
    margin: 0;
    padding: 0 0 0 clamp(4px, .55vw, 12px);
    color: var(--amw-text);
    font-size: clamp(14px, .92vw, 17px);
    font-weight: 500;
    line-height: 1.3;
}

.amw-list-icon {
    width: clamp(24px, 1.6vw, 30px);
    height: clamp(24px, 1.6vw, 30px);
    color: var(--amw-icon);
}

/* 1. Profile: list and round photo. */
.amw-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.amw-profile .amw-list {
    gap: clamp(18px, 2vw, 38px);
}

.amw-profile-photo {
    display: block;
    width: clamp(112px, 9.2vw, 176px);
    height: auto;
    aspect-ratio: 1;
    margin-top: clamp(-34px, -1.6vw, -12px);
    border: clamp(3px, .25vw, 5px) solid #fff;
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(1, 33, 106, .16);
    object-fit: cover;
}

/* Several photos take turns in the same circle (assets/js/home-motion.js adds .amw-rotating); without the script only
 * the first one shows. */
.amw-profile-photos {
    display: grid;
}

.amw-profile-photos > .amw-profile-photo {
    grid-area: 1 / 1;
}

.amw-profile-photos:not(.amw-rotating) > .amw-profile-photo:not(:first-child) {
    opacity: 0;
}

/* 2. Best-fit colleges. */
.amw-colleges {
    display: grid;
    gap: clamp(8px, .7vw, 13px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.amw-college {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(10px, .75vw, 14px);
    margin: 0;
    padding: 2px clamp(10px, .75vw, 14px) 2px 2px;
    border: 1.5px solid #e1edfb;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(1, 33, 106, .04);
}

.amw-college-image {
    display: block;
    width: clamp(64px, 4.4vw, 84px);
    height: auto;
    aspect-ratio: 98 / 63;
    border-radius: 6px;
    object-fit: cover;
}

.amw-college-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.amw-college-name {
    color: var(--amw-navy);
    font-size: clamp(13.5px, .85vw, 16px);
    font-weight: 800;
    line-height: 1.2;
}

.amw-college-match {
    color: var(--amw-green);
    font-size: clamp(13px, .82vw, 15px);
    font-weight: 600;
    line-height: 1.2;
}

.amw-chevron {
    width: 18px;
    height: 18px;
    color: var(--amw-icon);
}

/* 3. Recruitment plan: icon, label, check. */
.amw-plan .amw-list-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.amw-check {
    width: clamp(24px, 1.55vw, 30px);
    height: clamp(24px, 1.55vw, 30px);
    color: var(--amw-green);
}

@media (max-width: 1440px) {
    .amw-note {
        left: 34%;
    }
}

/* Tablets: one step per row (head beside its panel), arrows pointing down between the panels. */
@media (max-width: 1180px) {
    .amw-decor {
        position: relative;
        top: auto;
        right: auto;
        width: auto;
        margin: clamp(18px, 2.5vw, 28px) 0 0;
        aspect-ratio: auto;
    }

    .amw-trail {
        display: none;
    }

    .amw-note {
        position: static;
        font-size: clamp(16px, 2.2vw, 22px);
        white-space: normal;
        transform: rotate(-2deg);
    }

    .amw-note br {
        display: none;
    }

    .amw-note::after {
        width: 140px;
        margin-left: 40px;
    }

    .amw-steps {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        row-gap: 80px;
    }

    .amw-step {
        grid-row: auto;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
        grid-template-rows: auto;
        align-items: center;
        column-gap: clamp(28px, 4vw, 56px);
    }

    .amw-step + .amw-step .amw-step-head {
        margin-left: 0;
    }

    /* Steps one under another: the same number width keeps the titles in line ("1" is narrower). */
    .amw-step-number {
        min-width: .58em;
    }

    .amw-step + .amw-step .amw-step-head::before {
        display: none;
    }

    .amw-arrow {
        top: 100%;
        left: 50%;
        transform: translate(-50%, 26px) rotate(90deg);
    }
}

/* Phones: the head above its panel. */
@media (max-width: 780px) {
    .amw-inner {
        width: min(100% - 36px, 660px);
    }

    .amw-step {
        grid-template-columns: minmax(0, 1fr);
        row-gap: clamp(20px, 4vw, 28px);
    }
}

@media (max-width: 520px) {
    .amw-step-head {
        gap: 14px;
    }

    .amw-step-number {
        font-size: 58px;
    }

    .amw-panel {
        padding-inline: 16px;
    }

    .amw-list-item {
        gap: 14px;
        padding-left: 0;
    }

    .amw-profile-photo {
        width: 104px;
        margin-top: 0;
    }

    .amw-college {
        padding-right: 10px;
    }
}
