/*
 * Membership sign-up progress tracker (markup: aa_get_enrollment_steps_html() in custom-functions.php).
 * Idealogic design v1 (2026-11-16). The layout follows the tracker's own width (container query),
 * not the screen: compact bar under 600px, full stepper from 600px.
 */

.aa-progress {
    --aa-navy: #002856;     /* 12.9:1 on the #EEF1F5 panel */
    --aa-red: #A32035;      /* 6.6:1 on the panel */
    --aa-red-ring: rgba(163, 32, 53, 0.16);
    --aa-text-muted: #566070; /* 5.6:1 on the panel, 6.4:1 on white */
    --aa-track: #B9C2CD;    /* decorative; progress is also given as text */
    --aa-outline: #767C87;  /* upcoming circle: 3.7:1 on the panel (design's #8A919C is 2.8:1) */
    --aa-divider: #D3DAE2;
    --aa-surface: #FFFFFF;

    container-type: inline-size;
    container-name: aa-progress;
    box-sizing: border-box;
    margin: 0 0 24px;
    padding: 24px 0 22px;   /* no side padding: aligns with the form or page content it sits in */
    background: transparent;
    border-bottom: 1px solid var(--aa-divider);
    font-family: inherit;
    color: var(--aa-navy);
}

.aa-progress *,
.aa-progress *::before,
.aa-progress *::after {
    box-sizing: border-box;
}

.aa-progress__sr,
.aa-progress__step .aa-progress__marker,
.aa-progress__step .aa-progress__label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.aa-progress__eyebrow {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--aa-text-muted);
}

.aa-progress__current {
    margin: 6px 0 16px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--aa-navy);
}

.aa-progress__next {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.4;
    color: var(--aa-text-muted);
}

.aa-progress__next-tag {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* List reset (The7 and WooCommerce style ol/li). */
.aa-progress .aa-progress__list {
    width: 100%;
    max-width: none;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
}

.aa-progress__list>li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.aa-progress__list > li::marker {
    content: none;
}

/* ---------- Compact (default; also the fallback without container query support) ---------- */
.aa-progress__list {
    display: flex;
    gap: 6px;
}

.aa-progress__list > .aa-progress__step {
    flex: 1 1 0;
    height: 6px;
    border-radius: 3px;
    background: var(--aa-track);
}

.aa-progress__list > .aa-progress__step.is-complete,
.aa-progress__list > .aa-progress__step.is-current {
    background: var(--aa-red);
}

/* ---------- Full stepper (tracker 600px and wider) ---------- */
@container aa-progress (min-width: 600px) {
    .aa-progress {
        padding: 32px 0 28px;
    }

    .aa-progress__eyebrow {
        margin-bottom: 24px;
        text-align: center;
    }

    .aa-progress__current,
    .aa-progress__next {
        display: none;
    }

    .aa-progress__list {
        position: relative;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
    }
    .aa-progress .aa-progress__list {
        max-width: 880px;
        margin: 0 auto !important;
    }

    /* One 2px line from the centre of column 1 to the centre of column 4, through every circle. */
    .aa-progress__list::before,
    .aa-progress__list::after {
        content: "";
        position: absolute;
        top: 19px;          /* 40px marker / 2 - 2px line / 2 */
        left: 12.5%;
        height: 2px;
    }

    .aa-progress__list::before {
        right: 12.5%;
        background: var(--aa-track);
    }

    .aa-progress__list::after {
        width: 0;
        background: var(--aa-red);
    }

    /* Red fill to the current step (no script: set from data-step). */
    .aa-progress[data-step="2"] .aa-progress__list::after { width: 25%; }
    .aa-progress[data-step="3"] .aa-progress__list::after { width: 50%; }
    .aa-progress[data-step="4"] .aa-progress__list::after,
    .aa-progress[data-step="complete"] .aa-progress__list::after { width: 75%; }

    .aa-progress__list > .aa-progress__step {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 0;
        height: auto;
        padding: 0 8px;
        border-radius: 0;
        background: none !important;
    }

    .aa-progress__step .aa-progress__marker,
    .aa-progress__step .aa-progress__label {
        position: relative !important;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
    }

    .aa-progress__step .aa-progress__marker {
        z-index: 1;
        display: flex;
        flex: 0 0 40px;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: 2px solid var(--aa-outline);
        border-radius: 50%;
        background: var(--aa-surface);
        font-size: 15px;
        font-weight: 700;
        line-height: 1;
        color: var(--aa-text-muted);
    }

    .aa-progress__step .aa-progress__label {
        margin-top: 12px;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.35;
        letter-spacing: 0.08em;
        text-align: center;
        text-transform: uppercase;
        color: var(--aa-text-muted);
        overflow-wrap: break-word;
    }

    .aa-progress__check {
        display: block;
        width: 18px;
        height: 18px;
    }

    /* Completed */
    .aa-progress__step.is-complete .aa-progress__marker {
        border-color: var(--aa-red);
        background: var(--aa-red);
        color: #FFFFFF;
    }

    .aa-progress__step.is-complete .aa-progress__label {
        color: var(--aa-navy);
    }

    /* Current */
    .aa-progress__step.is-current .aa-progress__marker {
        border-color: var(--aa-red);
        background: var(--aa-red);
        color: #FFFFFF;
        box-shadow: 0 0 0 5px var(--aa-red-ring);
    }

    .aa-progress__step.is-current .aa-progress__label,
    .aa-progress[data-step="complete"] .aa-progress__step:last-child .aa-progress__label {
        color: var(--aa-red);
    }
}

/* Windows High Contrast / forced colors: backgrounds are dropped, so draw outlines. */
@media (forced-colors: active) {
    .aa-progress__list > .aa-progress__step {
        border: 1px solid CanvasText;
    }

    .aa-progress__list > .aa-progress__step.is-complete,
    .aa-progress__list > .aa-progress__step.is-current {
        background: Highlight;
        forced-color-adjust: none;
    }

    @container aa-progress (min-width: 600px) {
        .aa-progress__list > .aa-progress__step {
            border: 0;
        }

        .aa-progress__step .aa-progress__marker {
            border-color: CanvasText;
        }

        .aa-progress__step.is-current .aa-progress__marker {
            border-width: 4px;
            border-color: Highlight;
        }

        .aa-progress__list::before,
        .aa-progress__list::after {
            background: CanvasText;
        }
    }
}
