/* Styles specific to the Digiforma archive. */

.df-archive-category-description {
    margin: 20px auto;
    width: 100%;
    max-width: 820px;
    text-wrap: balance;
    color: #fff;
    text-align: center;
}

/* ==============================
   VIEW
   ============================== */

.df-archive-view {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 32px;
}

.df-archive-view-item {
    display: flex;
    align-items: center;
    gap: 6px;
    accent-color: var(--df-brand-color);
    cursor: pointer;
}

.df-archive-view label {
    margin: 0 !important;
    padding: 0 !important;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-grid {
    grid-template-columns: repeat(1, 1fr);
}

.df-main--archive:has(#df-archive-view-grid:checked) .df-archive-grid .df-archive-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-grid :where(.df-post-thumbnail, .df-archive-subtitle, .df-post-sessions-title, .df-post-sessions),
.df-main--archive:has(#df-archive-view-list:checked) .df-archive-grid p:has(.df-button) {
    display: none;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-grid .df-archive-content {
    display: contents;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-title {
    order: -1;
    text-align: left;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-tags {
    position: static;
    margin-left: auto;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-item {
    position: relative;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid var(--df-brand-color);
    padding: 12px 0;
    display: flex;
    flex-direction: row;
    background: transparent;
    align-items: center;
    grid-gap: 16px;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-item:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--df-brand-color);
    transition: width 0.3s ease;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-archive-item:hover:after {
    width: 100%;
}

.df-main--archive:has(#df-archive-view-list:checked) .df-program-duration {
    white-space: nowrap;
}

@media (max-width: 768px) {
    .df-main--archive:has(#df-archive-view-list:checked) .df-archive-item {
        flex-wrap: wrap;
        gap: 5px;
    }
    .df-main--archive:has(#df-archive-view-list:checked) .df-archive-content {
        flex-direction: column;
        gap: 5px;
    }
}

/* ==============================
   FILTERS
   ============================== */
 
.df-archive-filters-form {
    display: flex;
    gap: 16px;
    padding: 32px 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
}

.df-archive-filters .df-archive-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.df-archive-filters .df-archive-field--reset {
    min-width: 100%;
}

.df-archive-filters .df-archive-filters-form .df-link.df-link--reset {
    display: block;
    width: fit-content;
    margin: 0 0 0 auto;
    border: none;
    padding: 0;
    background: none;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    color: var(--df-brand-color);
}

.df-archive-filters .df-archive-field label {
    margin: 0;
    padding: 0;
    line-height: 1.2;
    font-size: 1rem;
    font-weight: 600;
}

.df-archive-filters .df-archive-field button {
    background: var(--df-brand-color);
    color: var(--df-brand-text);
}

.df-archive-filters .df-archive-field input,
.df-archive-filters .df-archive-field select,
.df-archive-filters .df-archive-field button:not(.df-link) {
    padding: 8px 16px;
    border-radius: var(--df-border-radius-xs);
    font-size: 1rem;
    height: 42px;
    line-height: 1.25;
}


.df-archive-filters .df-archive-field select option[disabled] {
    color: #aaa;
}

.df-formation-filter-btn {
    display: flex;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
    gap: 6px;
    color: #fff;
    background-color: var(--df-brand-color);
    padding: 12px 16px;
    border: none;
    border-radius: var(--df-border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.df-formation-filter-btn span {
    display: block;
    line-height: 1;
}

.df-formation-filter-toggle {
    opacity: 0;
    width: 0;
    height: 0;
    width: 100%;
    height: 1px;
    opacity: 0;
    border: none;
}

@media (max-width: 767px) {
    .df-archive-filters {
        margin: 16px 0;
    }
    .df-archive-filters:has(#filter-toggle:checked) .df-archive-filters-form {
        display: block; 
    }
    .df-archive-field {
        margin-top: 16px;
    }
    .df-archive-filters-form {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 16px;
        top: 16px;
        box-sizing: border-box;
        width: calc(100vw - 32px);
        height: calc(100vh - 32px);
        overflow-y: auto;
        background-color: var(--white, #fff);
        box-shadow: 0 0 20px 20px rgba(0, 0, 0, 0.5);
        padding: 24px;
        border-radius: var(--df-border-radius);
    }
    .df-formation-filter-close {
        border: none;
        display: block;
        width: 100%;
        background-color: transparent;
        font-size: 2rem;
        cursor: pointer;
        color: var(--df-brand-color);
        font-weight: 600;
        text-align: right;
    }
}

@media (min-width: 768px) {
    .df-formation-filter-close {
        display: none;
    }
    .df-formation-filter-btn {
        display: none;
    }
    .df-archive-filters .df-archive-field {
        flex-grow: 1;
    }

    .df-archive-filters .df-archive-field--reset {
        margin-top: -6px;
    }
}

/* ==============================
   CONTENT
   ============================== */

.df-main + .section {
    margin-top: 100px;
}