.programs-listings-container {
    padding: 2.5rem 5rem 0 5rem;
    overflow-x: clip;
    overflow-y: visible;

    @media screen and (max-width: 1024px) {
        padding-top: 2.5rem;
    }

    @media (width >=768px) and (width < 1024px) {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .activity-tabs-wrapper {
        display: flex;
        justify-content: center;
        margin-bottom: 10rem;

        @media screen and (max-width: 767px) {
            margin-bottom: 6rem;
        }

        .activity-tabs-inner {
            width: 100%;
            position: relative;
        }
    }

    .program-details {
        margin-top: 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        font-size: clamp(1rem, 2vw, 1.25rem);
    }

    .filter-button-wrapper.destination,
    .filter-button-wrapper.activity-type,
    .filter-button-wrapper.activity {
        .filter-dropdown-inner {
            gap: 1rem;

            input {
                display: none;
            }

            label {
                cursor: pointer;
            }
            label:hover:not(:has(input[type="radio"]:checked)) {
                opacity: 0.6;
            }

            label.filter-subcategory:has(input[type="radio"]:checked) span {
                color: #6e6e6e !important;
                cursor: default;
            }
        }
    }

    .programs-filter-dropdown.calendar-dropdown {
        display: flex;
        flex-direction: column;
        align-items: center !important;
    }

    .filter-button-wrapper.category,
    .filter-button-wrapper.date {
        .cta-button {
            display: flex;
            margin-left: auto;
            margin-right: 0;
            background-color: transparent;
            box-shadow: none;
            color: rgb(var(--text-white));
            padding: 1rem 0 0;
            align-self: flex-end !important;
            width: auto;
        }
    }

    .calendar-grid {
        gap: 0;
    }

    @media screen and (max-width: 767px) {
        .pill-dropdown-button {
            margin: 0;
            color: #000;
        }
    }

    .calendar-dropdown .calendar-nav {
        filter: none !important;
        opacity: 1 !important;

        img {
            filter: invert(1) brightness(2) !important;
        }

        &.calendar-nav-disabled {
            opacity: 0.5 !important;
            cursor: default;
        }
    }
}

.programs-listings.block {
    width: 100%;
    position: relative;
}

.programs-listings {
    .programs-types {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        row-gap: 5rem;
        column-gap: 1.5rem;

        @media screen and (max-width: 1024px) {
            grid-template-columns: repeat(3, 1fr);
            padding: 0;
        }

        @media screen and (max-width: 767px) {
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 1rem;
            row-gap: 3rem;
        }
    }
}

.programs-listings-wrapper {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    p.activity-tag {
        margin: 0;
        font-size: 0.75rem;
        position: absolute;
        right: 1rem;
        top: 1rem;
        padding: 0.5rem 1rem;
        border-radius: 55px;
        z-index: 1;

        @media screen and (max-width: 767px) {
            right: 0.5rem;
            top: 0.5rem;
        }
    }

    /* .programs-banner {
        p.activity-tag {
            bottom: 1rem;
            top: auto;
            right: 50%;
            transform: translateX(50%);
        }
    } */

    .programs-section-title {
        .container {
            display: flex;
            flex-direction: column;
            max-width: 56.25rem;
            text-align: center;
            gap: 2rem;
            margin: 0 auto;

            p {
                max-width: 33.5rem;
                margin: 0 auto;
            }
        }
    }

    .programs-banner {
        width: 100%;
        height: 28.4375rem;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        border-radius: 10px;
        cursor: pointer;

        @media screen and (max-width: 480px) {
            aspect-ratio: 1/1;
            height: auto;
        }

        &:hover {
            img {
                transform: scale(1.07);
            }
        }

        .container {
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;

            &::before {
                content: "";
                position: absolute;
                inset: 0;
                background: rgba(0, 0, 0, 0.1);
                z-index: 1;
                pointer-events: none;
            }

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                z-index: 0;
                position: relative;
                transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
            }

            .text-content {
                position: absolute;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                text-align: center;
                display: flex;
                flex-direction: column;
                gap: 1rem;
                max-width: 60%;
                width: 100%;
                z-index: 1;
            }
        }
    }
}

.program-card {
    .program-desc {
        margin-top: 1rem !important;
    }

    .program-card-date {
        display: block;
        margin-top: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
    img {
        width: 100%;
        border-radius: 6px;
        margin-bottom: 1rem;
    }
}

.program-title {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
    cursor: pointer;
    position: relative;
    display: inline !important;
    transition-property: all;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.program-title::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 1px;
    width: 0;
    background-color: currentColor;
    transition-property: width;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    content: "";
}

.program-card:hover .program-title::after,
.program-image-wrapper:hover ~ .program-title::after {
    width: 100%;
}

.program-category {
    margin-bottom: 0.5rem !important;
    margin-top: 1rem !important;
}
.program-desc {
    margin-bottom: 0.5rem;
}

.program-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
}

.program-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.program-image-wrapper:hover img,
.program-title:hover ~ .program-image-wrapper img,
.program-title:focus ~ .program-image-wrapper img,
.program-card:hover .program-image-wrapper img,
.program-card:focus-within .program-image-wrapper img {
    transform: scale(1.07);
}

.program-date-wrapper {
    position: absolute;
    z-index: 1;
    top: 1rem;
    left: 1rem;
    background-color: rgb(var(--brand-white));
    width: 62px;
    height: 62px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.program-cta {
    color: rgb(var(--text-black));
    margin-top: 2rem;
}

.program-date {
    font-size: clamp(0.8125rem, 1.5vw, 0.9375rem);
    margin: 0;
}

html[lang="ko"] body .program-date.text-l2,
html[lang="kr"] body .program-date.text-l2 {
    font-size: 100% !important;
}

.program-day {
    font-size: 0.8rem;
    margin: 0;
}

.programs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;

    @media (max-width: 767px) {
        gap: 0;
    }
}

.programs-pagination button {
    padding: 0.5em 1em;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgb(var(--text-black));
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    font-size: clamp(0.8125rem, 1.5vw, 0.9375rem);
    line-height: 1.25rem;
    font-family: var(--font-gill-sans), "Cabin", sans-serif;
}
.programs-pagination button.active {
    background: rgb(var(--brand-tan));
    color: #fff;
    cursor: default;
}
.programs-pagination button:disabled {
    cursor: default;
    opacity: 0.5;
}
.programs-pagination button:not(.active):not(:disabled):hover {
    background: #f3f4f6;
    color: rgb(var(--text-black));
}
.programs-pagination span {
    padding: 0 0.3rem 0.6rem 0.3rem;
    font-family: var(--font-gill-sans), "Cabin", sans-serif;
    color: rgb(var(--text-black));
    user-select: none;
    font-size: 1.3rem;
}
.programs-pagination svg {
    display: inline-block;
    vertical-align: middle;
}

/* --- Filter pill and dropdown styles --- */

.filter-button-wrapper {
    display: flex;
    width: fit-content;
    position: relative;
}
.programs-filter-container .programs-filter-pill {
    margin-bottom: 0;
    margin-top: 0;
}

.programs-filter-dropdown {
    position: absolute;
    z-index: 100;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: rgba(0, 0, 0, 0.3);
    color: rgb(var(--text-white));
    font-family: var(--font-gill-sans), "Cabin", sans-serif;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    padding: 1.5rem;
    width: 272px;
    height: auto;
    left: 0;
    top: 4.5rem;
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.programs-filter-dropdown[aria-open="true"] {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.filter-dropdown-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.filter-category {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    .filter-subcategory {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
        margin-left: 0.5rem;
        padding-left: 1rem;
        gap: 0.5em;
        justify-content: space-between;
        cursor: pointer;
    }
    .filter-subcategory input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 16px;
        height: 16px;
        border: 1px solid rgb(var(--surface-white));
        border-radius: 4px;
        background: transparent;
        outline: none;
        cursor: pointer;
        position: relative;
        transition: background 0.2s, border 0.2s;
        display: inline-block;
    }
    .filter-subcategory input[type="checkbox"]:checked {
        background: rgb(var(--surface-white));
        border-color: rgb(var(--surface-white));
    }
    .filter-subcategory input[type="checkbox"]:checked::after {
        content: "";
        display: block;
        position: absolute;
        left: 3px;
        top: -1px;
        width: 5px;
        height: 11px;
        border: solid rgb(var(--brand-sage));
        border-width: 0 3px 3px 0;
        border-radius: 1px;
        transform: rotate(45deg);
    }
}
.filter-category-title {
    font-weight: 400;
    color: rgb(var(--border-grey));
}
.programs-filter-dropdown.calendar-dropdown .programs-filter-select-all-btn {
    color: rgb(var(--border-grey));
}

.filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgb(var(--border-grey));
    padding-bottom: 0.5rem;
    width: 100%;
}

.filter-dropdown-header .text-l2 {
    margin: 0;
}

.programs-filter-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: center;
    gap: 1rem;
    overflow-x: visible;

    .pill-dropdown-button {
        width: 320px;
    }
}

/* --- Calendar Styles (refactored & deduped) --- */
.programs-listings-container {
    .calendar-date-btn,
    .calendar-day-label,
    .calendar-date-blank {
        width: 40px;
        height: 40px;
        font-size: clamp(0.8125rem, 1.5vw, 0.9375rem);
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .calendar-date-btn,
    .calendar-date-blank {
        color: rgb(var(--text-white));
    }
    .calendar-date-btn:not(.calendar-date-selected):not(
            .calendar-date-disabled
        ):not(.calendar-date-inrange):hover,
    .calendar-date-blank:not(.calendar-date-selected):not(
            .calendar-date-disabled
        ):not(.calendar-date-inrange):hover {
        background-color: rgb(var(--surface-white), 0.1);
    }

    .calendar-date-disabled {
        opacity: 0.5;
        cursor: default;
    }
    .calendar-date-selected,
    .calendar-date-inrange {
        background-color: rgb(var(--brand-tan)) !important;
    }
    .calendar-days-row {
        display: flex;
    }

    .calendar-dropdown .programs-filter-done-btn {
        margin-top: 1rem;
    }

    .calendar-date-today,
    .calendar-date-start {
        background-color: rgb(var(--surface-white), 0.1);
    }
}

.calendar-nav-disabled {
    cursor: default;
}

@media (max-width: 767px) {
    .programs-listings-container {
        padding: 2rem 1.5rem 0 1.5rem;
    }

    .programs-filter-container {
        flex-direction: column;
        align-items: center;
    }

    .program-date-wrapper {
        scale: 0.9;
    }
}

@media (max-width: 640px) {
    .program-date-wrapper {
        scale: 0.75;
        top: 0.5rem;
        left: 0.5rem;
    }
}

/* ------------------------------- program Modal ------------------------------ */
.program-modal {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem;
    box-sizing: border-box;
    opacity: 0;
    transition: all 0.7s ease;
    display: flex;

    @media screen and (max-width: 480px) {
        overflow-y: visible;
        background-color: white;
        padding: 0 1.5rem;
        height: 100vh;
        box-sizing: border-box;
    }

    /* @media screen and (max-height: 600px) {
        padding: 0;
    } */

    .program-modal-content {
        position: relative;
        display: flex;
        flex-direction: row;
        background: white;
        border-radius: 10px;
        overflow: hidden;
        margin: auto;
        padding: 112px 48px 88px 48px;
        gap: 3rem;
        max-width: 900px;
        width: fit-content;
        max-height: 90vh;
        overflow-y: auto;
        box-sizing: border-box;
        justify-content: center;

        @media screen and (max-width: 767px) {
            .program-modal-content {
                padding: 104px 24px 44px 24px !important;
            }
        }

        @media screen and (max-width: 480px) {
            background: transparent;
            display: flex;
            flex-direction: column !important;
            width: 100vw;
            height: 100vh;
            border-radius: 0;
            box-sizing: border-box;
            gap: 1.5rem;
            margin: 0;
            max-height: none !important;
            border-radius: 0 !important;
            margin: 0;
            padding: 0;
            padding-top: 4rem;
            justify-content: start;
            /* Hide scrollbar for modal content */
            &::-webkit-scrollbar {
                display: none;
            }
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        .program-modal-image {
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            width: 100%;
            height: 100%;
            max-width: 360px;
            max-height: 360px;
            aspect-ratio: 1 / 1;
            overflow: hidden;
            flex: 1;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                aspect-ratio: 1 / 1;
                border-radius: 10px;
                overflow: hidden;
            }
        }
        .program-modal-text {
            overflow-y: auto;
            display: flex;
            flex: 1;
            flex-direction: column;
            justify-content: start;
            box-sizing: border-box;
            max-width: 396px;

            @media screen and (max-width: 480px) {
                overflow-y: visible;
            }

            .program-modal-category {
                margin-bottom: 0.5rem !important;
            }

            .program-modal-title {
                margin-bottom: 1.5rem !important;
            }

            .program-modal-desc {
                margin-bottom: 2rem !important;
            }

            .program-modal-details {
                display: flex;
                flex-direction: column;
                gap: 1rem;
                margin-bottom: 2.5rem;
            }

            .cta-link {
                width: fit-content;
            }
        }

        .close-icon.icon-left {
            padding-left: 2em;
            padding-right: 0;
        }

        .program-modal-close {
            position: absolute;
            top: 2rem;
            left: 3rem;
            z-index: 10;
            display: flex;
            align-items: center;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;

            padding-left: 0 !important;
            padding-right: 0 !important;

            &.desktop {
                display: flex;

                @media screen and (max-width: 480px) {
                    display: none;
                }
            }

            img {
                width: 21px;
                height: 21px;
                margin-right: 0.5rem;
                flex-shrink: 0;
            }

            .animate-underline {
                font-family: var(--font-gill-sans), "Cabin", sans-serif;
                font-size: inherit;
                color: inherit;
            }
        }

        .program-modal-close.mobile {
            display: none;

            @media screen and (max-width: 480px) {
                display: flex !important;
                position: absolute;
                top: 3.5rem;
                left: 1.5rem;
            }
        }

        .program-modal-close.icon-left {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
    }
    .program-modal-close.mobile {
        display: none;

        @media screen and (max-width: 480px) {
            display: block !important;
        }
    }
}

.program-modal-close img {
    filter: brightness(0);
}

.program-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.program-modal.inactive {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 767px) {
    .program-modal-content {
        gap: 1.5rem !important;
    }

    .program-modal-close .animate-underline {
        display: none !important;
    }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .program-modal {
        .program-modal-text {
            padding: 0 !important;
        }

        .program-modal-image {
            max-width: none !important;
            max-height: none !important;
            width: 100% !important;
            height: auto !important;
            aspect-ratio: 1 / 1 !important;
            flex-shrink: 0 !important;
            flex: none !important;
        }

        .program-modal-text {
            padding: 24px;
        }

        .program-modal-close {
            position: absolute !important;
            top: 1rem !important;
            left: 1rem !important;
            width: 24px !important;
            height: 24px !important;
        }
    }
}

@media (max-height: 600px) {
    .program-modal {
        padding: 0;

        .program-modal-content {
            padding: 3rem 1.5rem 1.5rem 1.5rem !important;
            align-items: center;
            width: 100vw !important;
            height: 100vh !important;
            max-width: none !important;
            max-height: none !important;
            border-radius: 0 !important;

            .program-modal-image {
                flex: 0.7 !important;
            }
            .program-modal-text {
                flex: 1.5 !important;
            }
        }
    }
}

@media (max-width: 420px) {
    section.program-card {
        width: 41.5vw;
    }
}
