/**
 * ARX Programme - Frontend Styles (Normalized)
 */

/* Container */
.arx-programme-list-container {
    width: 100%;
}

/* Filters */
.arx-programme-filters {
    margin-bottom: 50px;
}

.arx-programme-filters-title {
    margin: 0 0 1rem 0;
}

.arx-programme-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.arx-programme-filter-item {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.arx-programme-filter-item:hover {
    opacity: 0.8;
}

.arx-programme-filter-item.active {
    font-weight: 600;
}

/* Loading */
.arx-programme-loading {
    text-align: center;
    padding: 2rem;
}

/* Results */
.arx-programme-results {
    transition: opacity 0.3s ease;
}

/* Grid Layout */
.arx-programme-grid {
    display: grid;
    gap: 2rem;
}

/* Default columns if CSS variables not set */
.arx-programme-grid {
    grid-template-columns: repeat(var(--columns-mobile, 1), 1fr);
}

/* Tablet */
@media (min-width: 768px) {
    .arx-programme-grid {
        grid-template-columns: repeat(var(--columns-tablet, 2), 1fr);
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .arx-programme-grid {
        grid-template-columns: repeat(var(--columns-desktop, 3), 1fr);
    }
}

/* List Layout */
.arx-programme-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Programme Card */
.arx-programme-card {
    border: 1px solid;
    overflow: visible;
    display: flex;
    flex-direction: column;
    cursor:default !important;
}

.arx-programme-grid .arx-programme-card {
    height: 100%;
}

.arx-programme-list .arx-programme-card {
    flex-direction: row;
}

.arx-programme-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    /* overflow: hidden; */
}

.arx-programme-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    flex-wrap :wrap;
}

.arx-programme-card-category-name  {
    width:100%;
    font-size:16px !important;
    color:#ca7b2e;
}

.arx-programme-card-title {
    margin: 0;
    line-height: 1.3;
    flex: 1;
    position: relative;
}

.arx-programme-card-title-clickable {
       cursor:default !important;
    transition: opacity 0.2s ease;
}

.arx-programme-card-title-clickable:hover {
    opacity: 0.8;
}

.arx-programme-card-new {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 14px;
    position: absolute;
    top: -30px;
    right: 0;
    background-color: #579f87;
    color: #ffffff;
}

.arx-programme-card-excerpt {
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.arx-programme-card-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    cursor: pointer;
}

.arx-programme-card-button-text {
    display: inline-block;
}

.arx-programme-card-button-icon {
    display: inline-flex;
    align-items: center;
    width: 11px;
    height: 11px;
}

.arx-programme-card-button-icon img {
    width: 100%;
    height: 100%;
    display: block;
}

.arx-programme-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.arx-programme-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

/* No Results */
.arx-programme-no-results {
    text-align: center;
    padding: 3rem;
}

/* Popup Styles */
.arx-programme-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.arx-programme-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.arx-programme-popup-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    width: 75%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.arx-programme-popup-close {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    transition: opacity 0.3s ease;
}

.arx-programme-popup-close:hover {
    opacity: 0.7;
}

.arx-programme-popup-close svg {
    width: 20px;
    height: 20px;
}

.arx-programme-popup-body {
    padding: 40px;
    overflow-y: auto;
    max-height: calc(70vh);
}

/* Popup Header */
.arx-programme-popup-header {
    margin-bottom: 2rem;
    position: relative;
    transition: all 0.3s ease;
    background: #fff;
    z-index: 100;
}

.arx-programme-popup-close-mobile {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 10;
    display: none;
    align-items: center;
    transition: opacity 0.3s ease;
}

.arx-programme-popup-close-mobile:hover {
    opacity: 0.7;
}

.arx-programme-popup-title {
    margin: 0;
    line-height: 1.3;
    position: relative;
}

.arx-programme-popup-categories {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

.arx-programme-popup-category {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.arx-programme-popup-category-separator {
    margin: 0 0.25rem;
}

.arx-programme-popup-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

.arx-programme-popup-share {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    transition: opacity 0.3s ease;
}

.arx-programme-popup-share:hover {
    opacity: 0.7;
}

.arx-programme-popup-share svg {
    width: 11px;
    height: 11px;
}

/* Popup Content */
.arx-programme-popup-content-text {
font-size: 18px;
}

.arx-programme-popup-section {
    margin-top: 2rem;
    overflow: hidden;
}

.arx-programme-popup-section-header {
    display: flex;
    align-items: center;
}

.arx-programme-loading,
.arx-programme-error {
    text-align: center;
    padding: 2rem;
}

/* Popup Header Scrolled State (Mobile) */
@media (max-width: 767px) {
    .arx-programme-popup-header {
        position: sticky;
        top: 0;
        padding-top: 1rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .arx-programme-popup-header.scrolled {
        margin-bottom: 0.5rem;
    }

    .arx-programme-popup-header.scrolled .arx-programme-popup-categories {
        max-height: 0;
        margin-bottom: 0;
        opacity: 0;
        transform: translateY(-10px);
    }

    .arx-programme-popup-header.scrolled .arx-programme-popup-actions {
        max-height: 0;
        margin-bottom: 0;
        opacity: 0;
        transform: translateY(-10px);
    }

    .arx-programme-popup-header.scrolled .arx-programme-popup-title-wrapper {
        margin-bottom: 0;
    }

    .arx-programme-popup-header.scrolled .arx-programme-popup-title {
        margin: 0;
    }

    .arx-programme-popup-close-mobile {
        display: flex;
    }
}

/* Responsive */
@media (max-width: 767px) {
    .arx-programme-list .arx-programme-card {
        flex-direction: column;
    }

    .arx-programme-list .arx-programme-card-image {
        width: 100%;
        min-width: auto;
        height: 200px;
    }

    .arx-programme-filter-item {
        width: fit-content;
    }

    .arx-programme-filters-list {
        gap: 0.5rem;
    }

    .arx-programme-popup-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .arx-programme-popup-header {
        padding: 30px 25px 0;
    }

    .arx-programme-popup-content-text {
        padding: 0 25px 30px;
    }

    .arx-programme-popup-body {
        max-height: 100vh;
        padding: 0;
    }

    .arx-programme-card-new {
        right: unset;
        left: 0;
        top: -35px;
    }

    .arx-programme-popup-title.reduced {
        line-height: 1;
        font-size: 22px;
        animation: titleReduced 0.3s ease;
        padding-bottom: 20px;
    }

    @keyframes titleReduced {
        from {
            font-size: 28px;
            line-height: 1.3;
            padding-bottom: 10px;
        }
        to {
            font-size: 22px;
            line-height: 1;
            padding-bottom: 20px;
        }
    }
}
