/**
 * Programs page – page-specific styles
 * Builds on style.css (layout, nav, contact bar, footer, newsletter).
 */

/* ===== Hero (Programs) ===== */
.hero--programs {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-bg--programs {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #374758;
    background-image: url('img/program_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero--programs .hero-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.5) 100%);
}

.hero-content--programs {
    margin-left: 0;
    margin-right: 0;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-right: calc(24px + var(--contact-bar-width));
}

.section-newsletter-wrapper {
    background-color: #FFFFFF;
}

.main-site-container {
    height: 505px;
}

.hero-content {
    margin-top: 54px!important;
}

.hero-title--programs {
    font-size: clamp(48px, 10vw, 120px);
    line-height: 1.1;
    margin-bottom: 16px;
    width: 100%;
}

.hero-subtitle--programs {
    font-size: clamp(18px, 2.5vw, 32px);
    font-weight: 300;
    margin-bottom: 24px;
}

.programs-hero-cta {
    display: inline-block;
}

.hero--programs .hero-accessibility {
    background: linear-gradient(135deg, #40B56C 0%, #2db8a8 100%);

}

.hero--programs .hero-accessibility-icon {
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ===== Programs section layout ===== */
.section-programs {
    padding: 48px 0 80px;
    background: #ffffff;
}

.container--programs {
    display: grid;
    grid-template-columns: 317px 1fr;
    gap: 48px;
    align-items: start;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Sidebar filters ===== */
.programs-sidebar {
    position: sticky;
    top: 24px;
}

.programs-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.programs-sidebar-title {
    font-size: 32px;
    font-weight: 400;
    color: #2C3E50;
    letter-spacing: 0.02em;
}

.programs-sidebar-clean {
    display: none;
    font-size: 20px;
    color: #007A58;
    cursor: pointer;
    font-weight: 300;
}

.programs-sidebar-clean.is-visible {
    display: block;
}

.programs-filters {
    margin-bottom: 24px;
}

.programs-filter-group {
    border-bottom: 1px solid #e0e4e8;
}

.programs-filter-group[open] .programs-filter-summary::after {
    transform: rotate(90deg);
}

.programs-filter-summary {
    list-style: none;
    font-size: 24px;
    font-weight: 400;
    color: #2C3E50;
    padding: 12px 28px 12px 0;
    cursor: pointer;
    position: relative;
}

.programs-filter-summary::-webkit-details-marker {
    display: none;
}

.programs-filter-summary::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    margin-top: -12px;
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='27' viewBox='0 0 24 27' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.75 12C16.75 12.1918 16.6767 12.3838 16.5303 12.5302L9.0303 20.0302C8.73723 20.3233 8.26267 20.3233 7.9698 20.0302C7.67692 19.7371 7.67673 19.2626 7.9698 18.9697L14.9395 12L7.9698 5.0302C7.67673 4.73714 7.67673 4.26258 7.9698 3.9697C8.26286 3.67683 8.73742 3.67664 9.0303 3.9697L16.5303 11.4697C16.6767 11.6161 16.75 11.8081 16.75 12Z' fill='%238D9EAE'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.programs-filter-options {
    padding: 0 0 16px;
}

.programs-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    color: #2C3E50;
    font-weight: 300;
    padding: 8px 0;
    cursor: pointer;
}

.programs-filter-option input[type="checkbox"] {
    width: 32px;
    height: 32px;
    accent-color: #ffffff;
    border: 1px solid #B8C4D0;
    border-radius: 0;
    -webkit-appearance: none;
}

.programs-filter-option input[type="checkbox"]:checked {
    background: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='%23007A58' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

.programs-show-results {
    width: 100%;
    padding: 14px 20px;
    font-size: 24px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #2C3E50;
    background: #ffffff;
    border: 2px solid #007A58;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.programs-show-results:hover {
    background: #f0f9f4;
    border: 2px solid #007A58;
    color: #007A58;
}

.programs-results-count {
    font-weight: 400;
    font-size: 24px;
}

/* ===== Programs list ===== */
.programs-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.programs-list-title {
    font-size: 48px;
    font-weight: 400;
    color: #2C3E50;
    margin: 0;
}

.programs-found {
    font-weight: 300;
    color: #576B7E;
    font-size: 24px;
}

.programs-sort {
    display: flex;
    align-items: center;
    gap: 12px;
}

.programs-sort-label {
    font-weight: 300;
    font-size: 24px;
    color: #576B7E;
    text-wrap-mode: nowrap;
}

.programs-sort-select {
    padding: 4px 44px 4px 24px;
    font-size: 20px;
    color: #8D9EAE;
    background: #ffffff;
    border: 1px solid #d1d5d8;
    border-radius: 0;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 16.5C11.8082 16.5 11.6162 16.4267 11.4698 16.2803L3.9698 8.7803C3.67673 8.48723 3.67673 8.01267 3.9698 7.7198C4.26286 7.42692 4.73742 7.42673 5.0303 7.7198L12 14.6895L18.9698 7.7198C19.2629 7.42673 19.7374 7.42673 20.0303 7.7198C20.3232 8.01286 20.3234 8.48742 20.0303 8.7803L12.5303 16.2803C12.3839 16.4267 12.1919 16.5 12 16.5Z' fill='%23576B7E'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    height: 61px;
    width: 234px;
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

/* ===== Program card ===== */
.program-card {
    background: #F4F6F8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.program-card:hover {
    border-color: #c0c8ce;
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.08);
}

.program-card-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-decoration: none;
    color: inherit;
}

.program-card-link:hover .program-card-title {
    color: #00924D;
}

.program-card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #e8ecf0;
    overflow: hidden;
    height: 249px;
}

.program-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.program-card-tag {
    position: absolute;
    right: 0;
    bottom: 0;
    left: auto;
    top: auto;
    padding: 2px 8px;
    font-size: 20px;
    font-weight: 300;
    color: #fff;
}

.program-card-tag--green {
    background: #4CAF50;
}

.program-card-tag--red {
    background: #FF0000;
}

.program-card-tag--blue {
    background: #127DFD;
}

.program-card-body {
    padding: 12px 32px 12px 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px
}

.program-card-title {
    font-size: 28px;
    font-weight: 400;
    color: #2C3E50;
    line-height: 1.25;
    padding: 0;
}

.program-card-desc {
    font-size: 20px;
    line-height: normal;
    color: #576B7E;
    flex-grow: 1;
    padding: 0 0 12px 0;
    border-bottom: 1px solid #B8C4D0;
}

.program-card-meta-wrapper .program-card-meta-item {
    width: 100%;
    font-size: 20px;
    font-weight: 300;
    color: #2C3E50;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.program-card-meta-item-icon {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-right: 8px;
}

.program-card-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #576B7E;
}

.program-card-meta-item {
    white-space: nowrap;
}

.program-card-flags {
    font-size: 18px;
    line-height: 1;
    margin-left: auto;
    position: relative;
    top: 35px;
}

.program-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
    padding: 0 20px 32px 20px;
}

.program-card-actions a {
    width: 100%;
    font-size: 24px;
    font-weight: 400;
}

.program-card-btn {
    padding: 8px 24px;
    text-transform: uppercase;
    color: #2C3E50;
    background: transparent;
    border: 2px solid #007A58;
    border-radius: 0;
    transition: background 0.2s, color 0.2s;
}

.program-card-btn:hover {
    color: #007A58;
    border: 2px solid #007A58;
}

.program-card-btn-cta {
    padding: 12px 20px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(90deg, #40B56C 0%, #223F99 100%);
    border: none;
    border-radius: 0;
    transition: opacity 0.2s;
    height: 60px;
}

.program-card-btn-cta svg {
    display: none;
}

.program-card-btn-cta:hover {
    background: linear-gradient(90deg, #40B56C 0%, #223F99 100%);
    color: #FFFFFF;
}

.program-card-btn-cta:hover svg {
    display: inline-block;
    transition: ease 1s;
}

.filter-trigger-mobile {
    height: 61px;
    width: 61px;
    background: linear-gradient(90deg, #40B56C 0%, #223F99 100%);
    align-items: center;
    justify-content: center;
    display: none;
}

.fullscreen-program-filter {
    display: none;
}

.nav--hero .nav--hero-aside {
    display: none;
}

.section-newsletter {
    max-width: 1300px;
    margin: 0 auto;
}

.program-card {
    width: 443px;
}

@media(max-width: 1919px) {
    .program-card {
        width: unset;
    }

    .hero-content {
        max-width: calc(100vw - 144px);
    }

    .hero-accessibility {
        top: 48%;
    }

    .hero-content--programs, .hero-content {
        margin-top: 0!important;
    }

    .hero-title {
        margin-top: 146px;
    }

    .section-programs {
        max-width: calc(100vw - 188px);
        padding-left: 72px;
    }

    .program-card-btn {
        padding: 8px 10px;
    }

    .program-card-btn-cta {
        padding: 8px 0;
    }

    .section-newsletter {
        max-width: calc(100vw - 285px);
        margin: 0 0 0 72px;
    }

    .newsletter-content {
        width: 68%;
    }

    .newsletter-form input {
        min-width: 60%;
    }

    .footer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr 1fr;
        column-gap: 72px;
        padding-bottom: 40px;
    }

}

@media (max-width: 1399px) {
    .hero-content {
        max-width: calc(100vw - 144px);
    }

    .hero-accessibility {
        top: 48%;
    }

    .hero-content--programs, .hero-content {
        margin-top: 0!important;
    }

    .hero-title {
        margin-top: 146px;
        display: inherit;
    }

    .hero-subtitle--programs {
        margin-bottom: 84px;
    }

    .hero-title-mobile {
        margin-top: 184px;
    }

    .container--programs {
        max-width: unset;
        padding: 0;
    }

    .hero-accessibility {
        left: 12px;
        right: unset;
    }

    .section-newsletter {
        max-width: calc(100vw - 144px);
        margin-left: 72px;
    }

    .newsletter-content {
        width: 68%;
    }

    .section-programs {
        max-width: calc(100vw - 72px);
        padding-left: 72px;
    }
}

/* ===== Fullscreen program filter modal (mobile) ===== */
@media (max-width: 1365px) {
    .fullscreen-program-filter {
        position: fixed;
        inset: 0;
        display: none; /* hidden by default */
        align-items: center;
        justify-content: center;
        z-index: 1200;
        padding: 24px;
    }

    /* When opened (script should set aria-hidden="false"), show overlay and blur background */
    .fullscreen-program-filter[aria-hidden="false"] {
        display: flex;
        background: rgba(0, 0, 0, 0.45); /* darker translucent overlay so the white modal is visible */
        -webkit-backdrop-filter: blur(8px);
        backdrop-filter: blur(8px);
    }

    /* When script toggles class .is-open also show overlay */
    .fullscreen-program-filter.is-open {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(0, 0, 0, 0.45) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        backdrop-filter: blur(8px) !important;
        pointer-events: auto !important;
    }

    .fullscreen-program-filter__inner {
        width: 375px;
        max-width: calc(100% - 48px);
        max-height: calc(100vh - 48px);
        background: #ffffff;
        box-shadow: 0 32px 80px rgba(0,0,0,0.48);
        position: fixed; /* fix to viewport so it's always above overlay */
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 10011; /* sit above the overlay */
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border: 3px solid #007A58;
    }

    .fullscreen-program-filter__content {
        overflow: auto;
        padding: 0 20px;
    }

    .fullscreen-program-filter__content::-webkit-scrollbar-track {
        box-shadow: inset 0 0 1px #FFFFFF;
        border-radius: 6px;
        width: 3px;
    }

    /* Handle */
    .fullscreen-program-filter__content::-webkit-scrollbar-thumb {
        background: #F4F6F8;
        border-radius: 0;
    }

    .fullscreen-program-filter__content::-webkit-scrollbar {
        height: 5px;
        width: 6px;
    }

    .fullscreen-program-filter__footer {
        padding: 12px;
    }

    /* Ensure inner header/footer areas don't scroll away awkwardly */
    .fullscreen-program-filter__header {
        padding: 12px 20px;
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
    }

    .fullscreen-program-filter__close {
        align-self: end;
        cursor: pointer;
    }

    .fullscreen-program-filter__header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .reset-filters {
        font-size: 20px;
        color: #007A58;
        cursor: pointer;
    }

    .fullscreen-program-filter.is-open .fullscreen-program-filter__inner {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) !important;
        pointer-events: auto !important;
        border: 2px solid rgba(0,0,0,0.08) !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    .programs-sidebar {
        top: unset;
    }

    .hero-title--programs {
        font-size: 72px;
        width: 100%;
    }

    .hero-subtitle {
        padding-left: 0;
        margin-bottom: 137px;
    }

    .hero-title {
        margin-top: 175px;
    }


    .hero-accessibility {
        top: 43%;
    }

    .programs-sort-select {
        width: 722px;
    }

    .container--programs {
        max-width: calc(100vw - 144px);
        width: calc(100vw - 144px);

    }

    .section-programs {
        padding-left: unset;
        margin-left: 72px;
    }

    .section-newsletter {
        max-width: calc(100vw - 144px);
        margin-left: 72px;
    }

    .newsletter-title {
        margin-bottom: 12px;
    }

    .newsletter-title {
        max-width: calc(100vw - 144px);
    }

    .newsletter-form {
        width: unset;
    }

    .newsletter-form input {
        width: 300px;
        min-width: 300px;
    }

    .newsletter-legal {
        width: 310px;
    }

    .footer-grid {
        grid-template-columns: 1fr 2fr;
        grid-template-rows: max-content;
        row-gap: 48px;
    }

    .footer-col:last-child a {
        font-size: 24px;
    }

    .footer-info {
        padding: 12px 72px 48px 72px;
    }

    .footer-grid {
        padding-bottom: 0;
    }
}

/* ===== Responsive ===== */
@media screen and (max-width: 1365px) {
    .container {
        max-width: 880px;
    }

    .container--programs .programs-sidebar {
        display: none;
    }

    .filter-trigger-mobile {
        display: flex;
        min-width: 61px;
        cursor: pointer;
    }

    .container--programs {
        grid-template-columns: 1fr;
    }

    .programs-sort {
        display: flex;
        width: 100%;
        gap: 18px;
        align-items: center;
    }

    .programs-sort .visually-hidden {
        height: unset;
        min-width: 70px;
        position: unset;
        font-weight: 300;
        color: #576B7E;
        font-size: 24px;
        overflow: unset;
    }

    .programs-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .programs-sort-select {
        height: 61px;
    }

    .program-card-btn {
        padding: 8px 18px;
    }
}

@media (max-width: 1023px) {
    .container {
        max-width: 624px;
    }

    .hero {
        height: 505px;
    }

    .hero-subtitle--programs {
        font-size: 32px;
    }

    .hero-subtitle {
        margin-bottom: 103px;
    }

    .container--programs {
        grid-template-columns: 1fr;
    }

    .programs-sidebar {
        position: static;
    }

    .programs-grid {
        grid-template-columns: 1fr 1fr;
    }

    .program-card-actions a {
        width: 100%;
    }

    .programs-sort-select {
        width: 479px;
        height: 48px;
    }

    .programs-sort {
        gap: 18px;
    }

    .filter-trigger-mobile {
        height: 48px;
        width: 48px;
        min-width: unset;
    }

    .contact-bar {
        right: 24px;
    }

    .hero-content--programs {
        padding-right: unset;
    }

    .btn--ai-match .btn--ai-match-desc {
        display: none;
        max-width: 0;
    }

    .btn--ai-match {
        width: 250px;
    }

    .program-card-btn-cta svg {
        display: inherit;
    }

    .program-card-meta-wrapper {
        max-width: 85%;
    }

    .program-card-meta-wrapper span {
        text-wrap: wrap;
    }

    .footer-grid {
        column-gap: 48px;
    }

    .btn--ai-match {
        left: 72px;
    }
}

@media (max-width: 767px) {
    .container {
        max-width: unset;
    }
    .programs-sort-select {
        width: 267px;
    }

    .hero-content--programs {
        margin-top: 106px!important;
    }

    .programs-sort {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        grid-column-gap: 12px;
        grid-row-gap: 0px;
    }

    .programs-sort label{ grid-area: 1 / 1 / 2 / 3; }
    .programs-sort select { grid-area: 2 / 1 / 3 / 2; }
    .programs-sort .filter-trigger-mobile { grid-area: 2 / 2 / 3 / 3; }

    .contact-bar {
        display: none;
    }

    ,nav--hero .contact-bar-whatsapp, .nav--hero #contact-language-switcher, .nav--hero .nav-burger {
        display: inherit;
    }

    .hero-title {
        font-size: 36px;
        margin-top: 120px;
    }

    .hero-content {
        max-width: calc(100vw - 48px);
    }

    .hero-subtitle {
        font-size: 24px;
        margin-bottom: 207px;
    }

    .programs-list-title {
        font-size: 48px;
    }

    .section-programs {
        max-width: calc(100vw - 48px);
        margin: 0 auto;
        padding: 72px 0;
    }

    .container--programs {
        width: unset;
    }

    .programs-grid {
        grid-template-columns: 1fr;
    }

    .visually-hidden {
        grid-column: span 2;
    }

    .program-card-actions {
        flex-direction: column;
    }

    .program-card-btn,
    .program-card-btn-cta {
        width: 100%;
        text-align: center;
    }

    .program-card {
        width: 327px;
    }

    .programs-list .program-card .program-card-image {
        max-width: 327px;
    }

    .section-newsletter-wrapper {
        padding: 36px 0 144px 0;
    }

    .section-newsletter {
        max-width: calc(100vw - 48px);
        margin: 0 auto;
        padding: 48px 24px;
    }

    .newsletter-title {
        max-width: unset;
    }

    .newsletter-form input {
        min-width: 279px;
        width: 279px;
        height: 48px!important;
    }

    .newsletter-button {
        height: 48px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        column-gap: 24px;
        row-gap: 24px;
    }

    .footer-col:last-child a {
        font-size: 20px;
    }

    .footer-bottom {
        padding: 24px 20px;
    }

    .btn--ai-match {
        left: 24px;
    }
}
