/* ==============================
    PROGRAM GRID
 ============================== */

.program-loop-inner {
    display: flex;
    gap: 20px;
    align-items: stretch;

    margin: 0 auto;
    padding: 20px;
    min-height: 600px;
    min-width: 0; /* allow swiper column to shrink without page overflow */
    max-width: 100%;
}


/* ==============================
    HEADER
 ============================== */

.program-loop-header {
    display: flex;
    flex-flow: column nowrap;
    gap: 20px;

    padding: 80px 0 0 10px;
    width: 220px;
}

.program-type-title,
.program-type-title-mobile {
    color: #fff;
    margin: 0;

    font-size: 30px;
}

.program-loop-header-mobile {
    display: none;
}

/* ==============================
    PROGRAM SWIPER
 ============================== */

.program-loop-swiper {
    position: relative;
    flex: 1;
    padding-bottom: 40px; /* extra space for pagination bullets */
    min-width: 0; /* allow flexbox to shrink without overflow */
    max-width: 100%;
}

.program-loop-swiper .swiper-wrapper {
    padding: 10px 0 10px;
    align-items: stretch; /* equal-height slides */
}

.program-loop-swiper .swiper-slide {
    max-width: 280px;
    width: 100%;
    flex-shrink: 0;
    height: auto;
    display: flex; /* let card stretch to wrapper height */
    box-sizing: border-box;
}

.program-loop-swiper .swiper-slide > .program-loop-item {
    height: 100%;
}

.program-loop-swiper .swiper-button-prev,
.program-loop-swiper .swiper-button-next {
    color: #40527b;
    background: #ffffff;
    border-radius: 999px;
    width: 38px;
    height: 38px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.program-loop-swiper--no-overflow .swiper-button-prev,
.program-loop-swiper--no-overflow .swiper-button-next,
.program-loop-swiper--no-overflow .swiper-pagination {
    display: none;
}

.program-loop-swiper .swiper-button-prev::after,
.program-loop-swiper .swiper-button-next::after {
    font-size: 16px;
}

.program-loop-swiper .swiper-pagination {
    bottom: 0;
}

.program-loop-swiper .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.4);
    opacity: 1;
}

.program-loop-swiper .swiper-pagination-bullet-active {
    background: #ffffff;
}


/* ==============================
    PROGRAM CARD
 ============================== */

.program-loop-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;

    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 12px;
    overflow: hidden;

    text-decoration: none;
    color: inherit;

    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.program-loop-item:hover {
    z-index: 10;
    box-shadow: 0 6px 10px rgba(0,0,0,0.08);
    transform: translateY(-6px);
}

.program-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    text-decoration: none;
    color: inherit;
}


/* ==============================
    CARD IMAGE
 ============================== */

.program-card-image {
    position: relative;
    height: 130px;
    overflow: hidden;
}

.program-card-image img {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
}

.program-card-vrsta-badge {
    position: absolute;
    top: 10px;
    right: 10px;

    padding-inline: 12px;

    /* Fallback background if --badge-color is not provided */
    background-color: rgba(0, 0, 0, 0.7);
    /* Slightly opaque version of the taxonomy color when available */
    background: color-mix(in srgb, var(--badge-color) 85%, transparent);

    color: white;
    border-radius: 4px;

    font-size: 12px;
    font-weight: 600;
}


/* ==============================
    CARD CONTENT
 ============================== */

.program-card-content {
    overflow: hidden;

    display: flex;
    flex-direction: column;
    flex: 1;

    padding: 0.9rem 0.9rem 1rem;
}

.program-card-title {
    font-size: 24px !important;
    line-height: 28px !important;
    font-weight: 600;

    margin: 8px 0 0.75rem 0 !important;

}

.program-card-description {
    color: #333;

    font-size: 16px;
    line-height: 24px;
}

/* Program card meta list (price, date, duration) */
.program-card-meta {
    list-style: none;
    margin: 0;
    padding: 0;
}

.program-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.program-card-meta-item:last-child {
    margin-bottom: 0;
}

.program-card-meta-icon {
    display: inline-flex;
    flex-shrink: 0;
    color: inherit;
    opacity: 0.85;
}

.program-card-meta-icon svg {
    display: block;
}

/* Program card footer with button */
.program-card-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0.9rem 0.9rem;
    margin-top: auto;
}

.program-card-footer .my-button {
    margin: 0;
}

/* ==============================
    RESPONSIVENESS
 ============================== */

@media(max-width: 1300px) {
    .program-loop-header {
        display: none;
    }

    .program-loop-header-mobile {
        display: block;
    }

    .program-loop-inner {
        flex-direction: column;
        min-width: 0;
    }

    /* Prevent the carousel from bleeding outside the section on smaller widths */
    .program-loop-swiper.swiper {
        overflow: hidden;
    }

    .program-loop-swiper .swiper-button-next,
    .program-loop-swiper .swiper-button-prev {
        display: none;
    }
}
