/* Activity category cards: deliberately independent of the original flip cards. */
.afb-category-section {
    --afb-gradient-start: #005bb2;
    --afb-gradient-end: #002542;
    --afb-wave-color: #fff;
    --afb-accent: #005db4;
    --afb-card-gap: 24px;
    --afb-cards-visible: 1;
    position: relative;
    isolation: isolate;
    padding: 72px 0 64px;
    overflow: hidden;
    background: linear-gradient(110deg, var(--afb-gradient-start), var(--afb-gradient-end));
    color: #fff;
    text-align: left;
}

.afb-category-section *,
.afb-category-section *::before,
.afb-category-section *::after {
    box-sizing: border-box;
}

.afb-category-section [hidden] {
    display: none !important;
}

.afb-category-section .afb-category-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    /* Match the content container and gutters used by the other PGL sections. */
    max-width: 1450px;
    margin: 0 auto;
    padding: 0 clamp(28px, 4.5vw, 72px);
}

.afb-category-section .afb-section-wave {
    position: absolute;
    left: 0;
    width: 100%;
    height: 22px;
    display: block;
    fill: var(--afb-wave-color);
    pointer-events: none;
}

.afb-category-section .afb-section-wave--top {
    top: -1px;
    fill: var(--afb-wave-top-color, var(--afb-wave-color));
}

.afb-category-section .afb-section-wave--bottom {
    bottom: -1px;
    fill: var(--afb-wave-bottom-color, var(--afb-wave-color));
}

.afb-category-section .afb-section-header {
    text-align: center;
}

.afb-category-section .afb-section-header--left {
    text-align: left;
}

.afb-category-section .afb-section-header--right {
    text-align: right;
}

.afb-category-section .afb-section-header--center .afb-section-intro {
    margin-left: auto;
    margin-right: auto;
}

.afb-category-section .afb-section-header--right .afb-section-intro {
    margin-left: auto;
}

.afb-category-section .afb-section-heading {
    text-align: inherit;
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(26px, 2.8vw, 38px);
    line-height: 1.2;
}

.afb-category-section .afb-section-intro {
    text-align: inherit;
    max-width: 850px;
    margin: 0 0 32px;
    color: #fff;
    font-size: 15px;
    line-height: 1.65;
}

.afb-category-section .afb-section-intro > :last-child {
    margin-bottom: 0;
}

.afb-category-section .afb-category-carousel {
    position: relative;
    margin-top: 28px;
}

.afb-category-section .afb-category-track {
    display: flex;
    align-items: stretch;
    gap: var(--afb-card-gap);
    margin: 0;
    padding: 4px 2px 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.afb-category-section .afb-category-track::-webkit-scrollbar {
    display: none;
}

.afb-category-section .afb-category-card {
    display: flex;
    flex: 0 0 calc((100% - (var(--afb-cards-visible) - 1) * var(--afb-card-gap)) / var(--afb-cards-visible));
    flex-direction: column;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    background: #fff;
    color: #323943;
    box-shadow: 0 3px 8px rgb(0 0 0 / 9%);
    scroll-snap-align: start;
}

.afb-category-section .afb-card-image {
    display: block;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 2;
    margin: 0;
    overflow: hidden;
    background: #e9f0f5;
}

.afb-category-section .afb-card-image img {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    object-fit: cover;
}

.afb-category-section .afb-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    padding: 22px;
}

.afb-category-section .afb-card-title {
    margin: 0 0 12px;
    color: var(--afb-accent);
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
}

.afb-category-section .afb-card-activities {
    margin: 0;
    padding: 0 0 0 18px;
    list-style: disc outside;
    color: #424953;
    font-size: 14px;
    line-height: 1.65;
}

.afb-category-section .afb-card-activities li {
    margin: 0;
    padding: 0;
    list-style: inherit;
}

.afb-category-section .afb-card-activities button {
    display: inline;
    width: auto;
    min-height: 28px;
    margin: 0;
    padding: 2px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.afb-category-section .afb-card-activities button:hover {
    color: var(--afb-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.afb-category-section .afb-card-more {
    font-style: italic;
    margin: 2px 0 16px;
    padding-left: 18px;
    color: #424953;
    font-size: 14px;
    line-height: 1.65;
}

.afb-category-section .afb-card-cta,
.afb-category-section [data-afb-cta] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: auto 0 0;
    padding: 11px 24px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--afb-accent);
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.afb-category-section .afb-card-cta {
    width: 100%;
    margin-top: auto;
}

.afb-category-section .afb-card-activities + .afb-card-cta {
    margin-top: 20px;
}

.afb-category-section .afb-card-cta:hover,
.afb-category-section [data-afb-cta]:hover {
    background: #004683;
    color: #fff;
    text-decoration: none;
}

.afb-category-section [data-afb-card-prev],
.afb-category-section [data-afb-card-next],
.afb-category-section [data-afb-prev],
.afb-category-section [data-afb-next],
.afb-category-section [data-afb-close] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background: #0078b4;
    box-shadow: none;
    color: #fff;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, opacity 160ms ease;
}

.afb-category-section [data-afb-card-prev],
.afb-category-section [data-afb-card-next] {
    position: absolute;
    top: 43%;
    z-index: 2;
    transform: translateY(-50%);
}

.afb-category-section [data-afb-card-prev] {
    left: -22px;
}

.afb-category-section [data-afb-card-next] {
    right: -22px;
}

.afb-category-section button:disabled {
    opacity: 0.38;
    cursor: default;
}

.afb-category-section [data-afb-card-prev]:hover:not(:disabled),
.afb-category-section [data-afb-card-next]:hover:not(:disabled),
.afb-category-section [data-afb-prev]:hover:not(:disabled),
.afb-category-section [data-afb-next]:hover:not(:disabled) {
    background: #005f94;
}

.afb-category-section button svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.afb-category-section [data-afb-card-dots] {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    margin: 20px 0 0;
    padding: 0;
}

.afb-category-section .afb-carousel-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.afb-category-section .afb-carousel-dot::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgb(255 255 255 / 45%);
    content: "";
}

.afb-category-section .afb-carousel-dot[aria-current="true"]::before {
    background: #fff;
}

.afb-category-section button:focus-visible,
.afb-category-section a:focus-visible,
.afb-category-section select:focus-visible,
.afb-category-section .afb-category-track:focus-visible {
    outline: 3px solid #ffc72c;
    outline-offset: 3px;
}

/* Native dialog sits above theme headers and WPBakery stacking contexts. */
.afb-category-section .afb-activity-dialog {
    --afb-category-color: #589fc2;
    --afb-category-text: #fff;
    position: fixed;
    inset: 0;
    width: min(1200px, calc(100% - 48px));
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 20px 80px rgb(0 0 0 / 25%);
    color: #323943;
    font-family: inherit;
    text-align: left;
}

.afb-category-section .afb-activity-dialog:not([open]) {
    display: none;
}

.afb-category-section .afb-activity-dialog::backdrop {
    background: rgb(5 20 36 / 64%);
}

.afb-category-section .afb-modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    padding: 18px 84px;
    background: var(--afb-category-color);
    color: var(--afb-category-text);
    transition: background-color 180ms ease;
}

.afb-category-section .afb-picker {
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.afb-category-section button .afb-picker-chevron {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.afb-category-section .afb-picker-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 4px 0;
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    border-radius: 4px;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: 400;
    line-height: 1.25;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    cursor: pointer;
}

.afb-category-section .afb-picker-trigger:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}

.afb-category-section .afb-category-picker {
    font-family: "lunchbox-reg", var(--afb-heading-font, sans-serif);
    font-size: clamp(24px, 3.2vw, 40px);
    color: var(--afb-category-text);
}

.afb-category-section .afb-category-picker .afb-picker-trigger {
    text-align: center;
}

.afb-category-section .afb-picker-menu {
    /* Positioned against the viewport to avoid clipping within the scrolling dialog. */
    position: fixed;
    z-index: 20;
    padding: 8px;
    border: 1px solid #dce3e8;
    border-radius: 12px;
    background: #fff;
    color: #26343e;
    box-shadow: 0 8px 32px rgb(5 20 36 / 22%);
    overflow: auto;
    overscroll-behavior: contain;
    font-family: Poppins, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
}

.afb-category-section .afb-picker-option {
    display: block;
    width: 100%;
    height: auto;
    min-height: 44px;
    margin: 0;
    padding: 10px 32px 10px 12px;
    position: relative;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #26343e;
    box-shadow: none;
    font: inherit;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    white-space: normal;
    cursor: pointer;
}

.afb-category-section .afb-picker-option:hover,
.afb-category-section .afb-picker-option:focus,
.afb-category-section .afb-picker-option[aria-selected="true"] {
    background: #e7f2fa;
    color: #004b91;
}

.afb-category-section .afb-picker-option:focus-visible {
    outline: 2px solid #005eb8;
    outline-offset: -2px;
}

.afb-category-section .afb-picker-option[aria-selected="true"]::after {
    position: absolute;
    right: 12px;
    top: 15px;
    width: 6px;
    height: 10px;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: "";
}

.afb-category-section .afb-picker-group {
    margin: 4px 0;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--afb-picker-group-color, #005eb8);
    color: var(--afb-picker-group-text, #fff);
    font: inherit;
    font-weight: 600;
}

.afb-category-section [data-afb-close] {
    position: absolute;
    top: 50%;
    right: 24px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    transform: translateY(-50%);
    background: #f0f4eb;
    color: var(--afb-accent);
}

.afb-category-section [data-afb-close]:hover {
    background: #fff;
}

.afb-category-section .afb-modal-main {
    position: relative;
    display: block;
    padding: 64px 92px 40px;
    touch-action: pan-y pinch-zoom;
}

.afb-category-section .afb-modal-main [data-afb-prev],
.afb-category-section .afb-modal-main [data-afb-next] {
    position: absolute;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
}

.afb-category-section .afb-modal-main [data-afb-prev] { left: 24px; }
.afb-category-section .afb-modal-main [data-afb-next] { right: 24px; }

.afb-category-section .afb-modal-activity {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: start;
    gap: 36px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    min-width: 0;
}

.afb-category-section .afb-modal-activity.afb-no-image {
    grid-template-columns: minmax(0, 1fr);
}

.afb-category-section [data-afb-image] {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 24px;
    background: #edf3f6;
    object-fit: cover;
    object-position: center;
    /* The external SVG keeps soft waves at every edge at any image size. */
    -webkit-mask-image: url("activity-image-wave-mask.svg");
    mask-image: url("activity-image-wave-mask.svg");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.afb-category-section .afb-modal-copy {
    min-width: 0;
    padding-top: 10px;
    overflow-wrap: anywhere;
}

.afb-category-section .afb-modal-activity-title {
    margin: 0 0 20px;
    color: var(--afb-accent);
    font-size: 30px;
    font-weight: 400;
    line-height: 1.25;
}

.afb-category-section [data-afb-description],
.afb-category-section [data-afb-description-preview] {
    color: #424953;
    font-size: 16px;
    line-height: 1.5;
}

.afb-category-section [data-afb-description] > :first-child {
    margin-top: 0;
}

.afb-category-section [data-afb-description] > :last-child {
    margin-bottom: 0;
}

.afb-category-section [data-afb-description] img,
.afb-category-section [data-afb-description] iframe {
    max-width: 100%;
}

.afb-category-section .afb-description-toggle {
    scroll-margin-top: 128px;
    scroll-margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 8px 0 0;
    padding: 6px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--afb-accent);
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.afb-category-section .afb-description-toggle:hover {
    background: transparent;
    color: #004683;
}

.afb-category-section .afb-modal-footer {
    padding: 0 72px 42px;
    text-align: center;
}

.afb-category-section [data-afb-cta] {
    width: auto;
    max-width: 100%;
    margin: 0;
    min-height: 46px;
    padding: 12px 32px;
}

.afb-category-section [data-afb-counter] {
    /* Preserve slide announcements without the extra visible footer in the design. */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Only used by older browsers that do not implement HTMLDialogElement. */
.afb-category-section .afb-activity-dialog.afb-dialog-fallback {
    z-index: 2147483646;
}

.afb-dialog-fallback-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    background: rgb(5 20 36 / 64%);
}

@media (min-width: 768px) {
    .afb-category-section {
        --afb-cards-visible: 2;
        padding: 76px 0 60px;
    }
}

@media (min-width: 1024px) {
    .afb-category-section {
        --afb-cards-visible: 3;
    }
}

@media (max-width: 767px) {
    .afb-category-section {
        --afb-card-gap: 18px;
        padding: 50px 0 34px;
    }

    .afb-category-section .afb-category-inner {
        padding-right: 20px;
        padding-left: 20px;
    }

    .afb-category-section .afb-section-heading {
        font-size: 27px;
    }

    .afb-category-section .afb-section-intro {
        margin-bottom: 22px;
        font-size: 14px;
    }

    .afb-category-section .afb-category-carousel {
        margin-top: 20px;
    }

    .afb-category-section .afb-card-body {
        padding: 20px;
    }

    .afb-category-section [data-afb-card-prev] {
        /* Keep the button and its focus outline inside the narrower gutters. */
        left: -10px;
    }

    .afb-category-section [data-afb-card-next] {
        right: -10px;
    }

    .afb-category-section [data-afb-card-dots] {
        margin-top: 10px;
    }

    .afb-category-section .afb-activity-dialog {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 15px;
    }

    .afb-category-section .afb-modal-header {
        min-height: 82px;
        padding: 14px 58px;
    }

    .afb-category-section .afb-category-picker {
        font-size: clamp(20px, 5.6vw, 28px);
    }

    .afb-category-section [data-afb-close] {
        right: 10px;
        width: 38px;
        height: 38px;
        min-width: 38px;
        min-height: 38px;
        padding: 9px;
    }

    .afb-category-section .afb-modal-main {
        position: relative;
        display: block;
        padding: 28px 32px 28px;
    }

    .afb-category-section .afb-modal-activity {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    .afb-category-section [data-afb-image] {
        aspect-ratio: 4 / 3;
        max-height: none;
    }

    .afb-category-section .afb-modal-copy {
        padding-top: 0;
    }

    .afb-category-section .afb-modal-main [data-afb-prev],
    .afb-category-section .afb-modal-main [data-afb-next] {
        position: absolute;
        /* Half the 4:3 image height plus its top padding. */
        top: calc(28px + (100vw - 88px) * .375);
        z-index: 1;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }

    .afb-category-section .afb-modal-main [data-afb-prev] {
        left: 4px;
    }

    .afb-category-section .afb-modal-main [data-afb-next] {
        right: 4px;
    }

    .afb-category-section .afb-modal-main.afb-no-image {
        padding: 28px 56px;
    }

    .afb-category-section .afb-modal-main.afb-no-image [data-afb-prev],
    .afb-category-section .afb-modal-main.afb-no-image [data-afb-next] {
        top: 48px;
    }

    .afb-category-section .afb-modal-activity-title {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .afb-category-section .afb-modal-footer {
        padding: 0 28px 30px;
    }
}

@media (max-width: 420px) {
    .afb-category-section .afb-category-inner {
        padding-right: 16px;
        padding-left: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .afb-category-section *,
    .afb-category-section *::before,
    .afb-category-section *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}
