:root {
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --modal-overlay-bg: rgba(0, 0, 0, 0.85);
    --modal-surface: var(--bg-surface);
}

.dark {
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.6);
}



.events-container {
    padding-top: calc(var(--header-height) + 2rem);
    min-height: 100vh;
    padding-bottom: 5rem;
}



.events-hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
    position: relative;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-weight: 500;
}



.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 0.75rem 0;
    border-bottom: 2px solid var(--border-light);
    flex-wrap: nowrap;
}


.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    color: var(--text-main);
    background: var(--bg-body);
}

.filter-btn.active {
    color: var(--text-main);
    background: var(--bg-body);
    font-weight: 700;
}

.filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -0.95rem;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--text-main);
}

.filter-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    height: 20px;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.filter-btn.active .count {
    background: var(--text-main);
    color: var(--bg-body);
}


.mobile-filter-dropdown {
    display: none;
    position: relative;
    width: 100%;
}

.dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-trigger:hover {
    border-color: var(--text-main);
}

.dropdown-trigger svg {
    transition: transform 0.3s;
}

.dropdown-trigger.active svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
    overflow: hidden;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-light);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-body);
}

.dropdown-item.active {
    background: var(--text-main);
    color: var(--bg-body);
    font-weight: 700;
}

.dropdown-item .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    height: 20px;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.dropdown-item.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bg-body);
}


.sort-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-control:hover {
    background: var(--bg-body);
}

.btn-control svg {
    transition: transform 0.3s;
}



.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}


.event-card {
    min-height: 380px;
}


@media (min-width: 769px) {
    .events-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem;
    }


    .event-card:nth-child(1) {
        grid-column: span 3 !important;
        min-height: 500px;
    }


    .event-card:nth-child(2) {
        grid-column: span 2 !important;
        min-height: 420px;
    }


    .event-card:nth-child(3) {
        grid-column: span 1 !important;
        min-height: 420px;
    }


    .event-card:nth-child(4) {
        grid-column: span 1 !important;
        min-height: 400px;
    }


    .event-card:nth-child(5) {
        grid-column: span 2 !important;
        min-height: 400px;
    }


    .event-card:nth-child(6) {
        grid-column: span 2 !important;
        min-height: 380px;
    }

    .event-card:nth-child(7) {
        grid-column: span 1 !important;
        min-height: 380px;
    }

    .event-card:nth-child(8) {
        grid-column: span 1 !important;
        min-height: 380px;
    }

    .event-card:nth-child(9) {
        grid-column: span 2 !important;
        min-height: 380px;
    }
}




.event-card {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--card-shadow);
}

.event-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}


.card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.event-card:hover .card-image img {
    transform: scale(1.05);
}


.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 2;
    transition: background 0.3s;
}

.event-card:hover .card-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.3) 100%);
}


.card-date-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    text-align: center;
    z-index: 3;
    min-width: 70px;
}

.dark .card-date-badge {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-date-badge .day {
    display: block;
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text-main);
}

.card-date-badge .month {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    opacity: 0.7;
    color: var(--text-main);
}


.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}


.event-category-pill {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.45rem 0.95rem;
    border-radius: 100px;
}


.event-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin: 0;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.event-card:first-child .event-title {
    font-size: 2.5rem;
    -webkit-line-clamp: 3;
}


.event-desc-short {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.event-card:first-child .event-desc-short {
    display: -webkit-box;
}


.event-card:not(:first-child) .event-desc-short {
    display: none;
}


.event-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.meta-item svg {
    width: 16px;
    height: 16px;
}


.card-footer {
    display: none;
}



.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.active {
    display: grid;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    background: var(--bg-surface);
    border-radius: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 450px;
}


.modal-visuals {
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-main-image {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    object-fit: contain;
    transition: opacity 0.3s;
    cursor: zoom-in;
}


.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(8px);
    z-index: 100;
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 2rem;
}

.modal-next {
    right: 2rem;
}


.modal-info {
    padding: 3rem;
    overflow-y: auto;
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 1.5rem;
}


.modal-close,
.modal-close-new {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    font-size: 1.5rem;
    transition: all 0.3s;
    z-index: 20;
}

.modal-close:hover,
.modal-close-new:hover {
    background: var(--text-main);
    color: var(--bg-body);
    transform: rotate(90deg);
}


.modal-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-headline {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.2;
    margin: 0 0 2rem 0;
    color: var(--text-main);
}

.modal-meta-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 2rem;
}

.meta-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-row svg {
    width: 20px;
    height: 20px;
    color: var(--text-main);
    flex-shrink: 0;
}

.modal-desc-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}


.modal-thumbs {
    margin-top: auto;
    padding-top: 2rem;
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
}

.modal-thumb {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.modal-thumb:hover {
    transform: scale(1.05);
}

.modal-thumb.active {
    border-color: var(--text-main);
    transform: scale(1.1);
}

.modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}



.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(10px);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    line-height: 1;
}

.lightbox-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
}

.lightbox-prev,
.lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 24px;
    color: white;
    font-size: 32px;
    background: rgba(0, 0, 0, 0.4);
    user-select: none;
}

.lightbox-next {
    right: 0;
}

.lightbox-prev {
    left: 0;
}



.loading-overlay {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-light);
    border-top-color: var(--text-main);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 6rem 1rem;
}




@media (max-width: 1200px) {
    .filter-bar {
        gap: 0.85rem;
    }

    .filter-btn {
        padding: 0.55rem 0.95rem;
        font-size: 0.88rem;
    }

    .btn-control {
        padding: 0.55rem 0.95rem;
        font-size: 0.85rem;
    }
}


@media (max-width: 1024px) {

    .events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }


    .desktop-only {
        display: none !important;
    }

    .mobile-filter-dropdown {
        display: block;
        order: 2;
        flex: 1;
        min-width: 0;
    }

    .sort-group {
        order: 1;
        width: auto;
        flex-shrink: 0;
    }

    .filter-bar {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: nowrap;
    }



    .btn-control {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.9rem !important;
    }

    .event-card {
        min-height: 350px !important;
    }


    .event-card:first-child {
        grid-column: span 2;
        min-height: 450px !important;
    }


    .modal-content {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-visuals {
        height: auto;
        min-height: 40vh;
        max-height: 60vh;
        width: 100%;
        flex-shrink: 0;
    }

    .modal-info {
        height: auto;
        overflow: visible;
        padding: 1.5rem 1.5rem 6rem;
        gap: 1.25rem;
    }


    .modal-close-new {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: rgba(0, 0, 0, 0.5);
        color: white;
        border-color: rgba(255, 255, 255, 0.3);
        z-index: 50;
    }


    .modal-thumbs {
        order: -10 !important;
        margin-top: 0;
        margin-bottom: 1.5rem;
        padding-top: 0;
    }

    .modal-category {
        order: 0;
    }


    .modal-nav-btn,
    .lightbox-prev,
    .lightbox-next {
        display: flex !important;
        opacity: 0 !important;
    }


    .lightbox-content {
        max-width: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        width: 100% !important;
    }


    .lightbox-content-wrapper {
        padding: 0;
    }


    .filter-bar {
        gap: 0.6rem;
    }



    .btn-control svg {
        width: 18px;
        height: 18px;
    }
}


@media (max-width: 900px) {
    .filter-bar {
        gap: 0.5rem;
    }



    .btn-control {
        padding: 0.85rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
}


@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }


    .filter-bar {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
        padding: 1rem 0;
        flex-wrap: nowrap;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-filter-dropdown {
        display: block;
        order: 2;
        flex: 1;
        min-width: 0;
    }

    .sort-group {
        order: 1;
        width: auto;
        flex-shrink: 0;
    }


    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .event-card {
        min-height: 320px !important;
    }

    .event-card:first-child {
        grid-column: span 1;
        min-height: 400px !important;
    }

    .event-title {
        font-size: 1.5rem;
    }

    .event-card:first-child .event-title {
        font-size: 2rem;
    }


    .modal-content {
        grid-template-columns: 1fr;
        grid-template-rows: 45vh 1fr;
    }

    .modal-info {
        padding: 1.75rem 1.25rem;
    }

    .modal-headline {
        font-size: 1.5rem;
    }

    .modal-nav-btn {
        width: 40px;
        height: 40px;
    }

    .modal-prev {
        left: 1rem;
    }

    .modal-next {
        right: 1rem;
    }
}


@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .event-card {
        min-height: 300px !important;
    }

    .event-card:first-child {
        min-height: 380px !important;
    }

    .card-content {
        padding: 1.5rem;
    }

    .card-date-badge {
        top: 1rem;
        right: 1rem;
        padding: 0.6rem 0.85rem;
        min-width: 60px;
    }

    .card-date-badge .day {
        font-size: 1.5rem;
    }

    .event-title {
        font-size: 1.35rem;
    }

    .event-card:first-child .event-title {
        font-size: 1.85rem;
    }

    .event-category-pill {
        font-size: 0.7rem;
        padding: 0.4rem 0.8rem;
    }
}


@media (max-width: 360px) {
    .events-container {
        padding-top: calc(var(--header-height) + 1rem);
    }

    .events-hero {
        padding: 2rem 0 1.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .event-card {
        min-height: 280px !important;
    }

    .event-card:first-child {
        min-height: 350px !important;
    }

    .card-content {
        padding: 1.25rem;
    }

    .event-title {
        font-size: 1.2rem;
    }

    .event-card:first-child .event-title {
        font-size: 1.65rem;
    }
}