/**
 * Archive & Taxonomy Pages — Events Grid
 *
 * Migrated from: Smart Grid v48.1 shortcode
 * @package Timelapse
 */

/* ── Wrapper ── */
.tl-archive-wrapper {
    max-width: var(--tl-container-max);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* ── Header & Breadcrumb ── */
.tl-archive-header {
    margin-bottom: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: tlFadeIn 0.8s ease forwards;
}

.tl-archive-breadcrumb {
    display: flex;
    gap: 10px;
    font-family: var(--tl-font-primary);
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 15px;
    font-weight: 600;
    justify-content: center;
}

.tl-archive-breadcrumb a {
    color: var(--tl-white);
    text-decoration: none;
    transition: color 0.3s;
    opacity: 0.9;
}

.tl-archive-breadcrumb a:hover {
    color: var(--tl-neon);
    opacity: 1;
}

.tl-archive-breadcrumb__sep {
    color: var(--tl-white);
    opacity: 0.4;
    font-weight: 400;
}

.tl-archive-breadcrumb__current {
    color: var(--tl-white);
    opacity: 0.5;
    font-weight: 400;
    pointer-events: none;
}

.tl-archive-title {
    font-family: var(--tl-font-primary);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--tl-white);
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.tl-archive-desc {
    font-family: var(--tl-font-primary);
    font-size: 1rem;
    color: var(--tl-gray-200);
    line-height: 1.4;
    max-width: 800px;
    margin: 0;
}

.tl-highlight {
    color: var(--tl-neon);
    font-weight: 700;
}

/* ── Filters Root ── */
.tl-filters {
    width: 100%;
    margin-bottom: 3rem;
    position: relative;
    z-index: 20;
}

.tl-filter-group__label {
    display: block;
    font-family: var(--tl-font-primary);
    font-size: 0.7rem;
    color: var(--tl-gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    margin: 0 0 6px;
}

.tl-filter-group__label--mobile {
    display: none;
}

/* ── Filter Buttons ── */
.tl-filter-btn {
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--tl-white);
    padding: 6px 14px;
    border-radius: var(--tl-radius-pill);
    font-family: var(--tl-font-primary);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: tlPopIn 0.4s ease forwards;
    flex-shrink: 0;
}

.tl-filter-btn:hover {
    border-color: var(--tl-white);
    background-color: rgba(255, 255, 255, 0.1);
}

.tl-filter-btn.is-active {
    background-color: var(--tl-white);
    color: var(--tl-black);
    border-color: var(--tl-white);
    transform: scale(1.05);
}

.tl-filter-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    display: block;
}

.tl-filter-btn--dynamic.is-hidden {
    display: none;
}

/* ── Highlight (Neon) Button ── */
.tl-filter-btn--highlight {
    border-color: var(--tl-neon);
    color: var(--tl-neon);
    font-weight: 700;
    animation: tlPulseNeon 2s infinite;
}

.tl-filter-btn--highlight:hover,
.tl-filter-btn--highlight.is-active {
    background-color: var(--tl-neon);
    color: var(--tl-black);
}

.tl-filter-btn--highlight svg {
    fill: var(--tl-neon);
}

.tl-filter-btn--highlight:hover svg,
.tl-filter-btn--highlight.is-active svg {
    fill: var(--tl-black);
}

@keyframes tlPulseNeon {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 102, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 102, 0); }
}

/* ── Toggle "Ver Mais" ── */
.tl-filter-toggle {
    background: transparent;
    border: none;
    color: var(--tl-white);
    padding: 0;
    font-family: var(--tl-font-primary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.tl-filter-toggle:hover {
    opacity: 1;
    color: var(--tl-neon);
}

.tl-filter-toggle svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
    display: block;
}

.tl-filter-toggle.is-close {
    color: var(--tl-red);
    opacity: 0.8;
}

/* ── Months Sub-filter ── */
.tl-filter-months {
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tl-filter-months.is-visible {
    opacity: 1;
}

/* ── Results Counter ── */
.tl-archive-counter {
    text-align: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
    font-family: var(--tl-font-primary);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    opacity: 0;
    animation: tlFadeIn 0.8s ease forwards;
}

.tl-archive-counter strong,
.tl-archive-counter span {
    color: var(--tl-white);
}

/* ── Grid ── */
.tl-archive-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols-desktop, 6), 1fr);
    gap: 40px 30px;
    width: 100%;
    margin-top: 10px;
    z-index: 1;
}

.tl-grid-item {
    display: block;
    opacity: 0;
}

.tl-grid-item--hidden,
.tl-grid-item--filtered {
    display: none;
}

.tl-grid-item.is-revealed {
    animation: tlFadeUp 0.8s var(--tl-ease-out) forwards;
}

/* ── Grid uses shared evt-card component ── */
.tl-archive-grid .tl-evt-card {
    max-width: 100%;
}

/* ── Load More ── */
.tl-archive-load-more {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: tlFadeIn 0.5s ease 1s forwards;
}

.tl-btn-load-more {
    background: transparent;
    border: 1px solid var(--tl-white);
    color: var(--tl-white);
    padding: 0.75rem 2rem;
    border-radius: var(--tl-radius-pill);
    font-family: var(--tl-font-primary);
    font-weight: 900;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.tl-btn-load-more:hover {
    background: var(--tl-white);
    color: var(--tl-black);
}

/* ── No Results ── */
.tl-archive-no-results {
    display: none;
    color: var(--tl-gray-500);
    text-align: center;
    margin-top: 2rem;
    font-family: var(--tl-font-primary);
}

.tl-archive-empty {
    text-align: left;
    padding: 2rem 0;
    color: var(--tl-gray-200);
    font-family: var(--tl-font-primary);
}

/* ── Animations ── */
@keyframes tlPopIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ── Desktop ── */
@media (min-width: 769px) {
    .tl-filters {
        display: grid;
        grid-template-columns: repeat(var(--filter-cols, 1), 1fr);
        gap: 2rem;
        align-items: start;
    }

    .tl-filters[data-active-count="1"] { --filter-cols: 1; }
    .tl-filters[data-active-count="2"] { --filter-cols: 2; }
    .tl-filters[data-active-count="3"] { --filter-cols: 3; }

    .tl-filters__mobile-top,
    .tl-filters__drawer {
        display: contents;
    }

    .tl-filters__mobile-trigger {
        display: none;
    }

    .tl-filter-group {
        display: flex;
        flex-direction: column;
        min-width: 0;
        position: relative;
    }

    .tl-filter-group__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .tl-filter-group__buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
        padding-bottom: 4px;
        padding-right: 2px;
    }

    .tl-filter-group__scroll {
        width: 100%;
        overflow: visible;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .tl-archive-wrapper {
        padding: 1.5rem 1rem 3rem;
    }

    .tl-filters {
        display: block;
    }

    .tl-filters__mobile-top {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    /* Date group: horizontal scroll on mobile */
    .tl-filter-group--date {
        width: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .tl-filter-group--date .tl-filter-group__header--desktop {
        display: none;
    }

    .tl-filter-group__label--mobile {
        display: block;
        margin-bottom: 6px;
    }

    .tl-filter-group--date .tl-filter-group__buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        padding-right: 20px;
        gap: 8px;
        align-items: center;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tl-filter-group--date .tl-filter-group__buttons::-webkit-scrollbar {
        display: none;
    }

    /* Mobile trigger button */
    .tl-filters__mobile-trigger {
        display: flex;
        width: 100%;
        height: 36px;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: var(--tl-radius-tiny);
        color: var(--tl-white);
        font-family: var(--tl-font-primary);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.3s ease;
        flex-shrink: 0;
        gap: 6px;
    }

    .tl-filters__mobile-trigger.is-active {
        background: rgba(255, 77, 77, 0.15);
        border-color: var(--tl-red);
        color: var(--tl-red);
    }

    .tl-filters__mobile-trigger svg {
        width: 12px;
        height: 12px;
        fill: currentColor;
    }

    /* Drawer */
    .tl-filters__drawer {
        display: none;
        flex-direction: column;
        gap: 1.5rem;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        animation: tlFadeUp 0.4s ease;
    }

    .tl-filters__drawer.is-open {
        display: flex;
    }

    .tl-filters__drawer .tl-filter-group__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 8px;
        margin-bottom: 8px;
    }

    .tl-filters__drawer .tl-filter-group__buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .tl-filters__drawer .tl-filter-btn {
        padding: 5px 12px;
        font-size: 10px;
    }

    .tl-filters__drawer .tl-filter-toggle {
        font-size: 9px;
        padding: 4px 8px;
    }

    .tl-filters__drawer .tl-filter-toggle svg {
        width: 8px;
        height: 8px;
    }

    /* Grid mobile */
    .tl-archive-grid {
        grid-template-columns: repeat(var(--grid-cols-mobile, 3), 1fr);
        gap: 30px 12px;
    }

    .tl-archive-title {
        font-size: 1.8rem;
    }
}
