.xrl-events,
.xrl-events *,
.xrl-events *::before,
.xrl-events *::after {
    box-sizing: border-box;
}

.xrl-events {
    direction: rtl;
    padding: 30px 16px 60px;
    font-family: var(--font-sans, inherit);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.xrl-events * {
    margin: 0;
    padding: 0;
}

.xrl-events .container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.events-search-bar {
    margin-bottom: 22px;
}

.events-search-bar .search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.events-search-bar .search-wrap i {
    position: absolute;
    right: 18px;
    font-size: 18px;
    color: #b8bcc6;
    pointer-events: none;
}

.events-search-bar .search-wrap input {
    width: 100%;
    height: 50px;
    border-radius: 26px;
    border: 1px solid #cfd2da;
    background: #fff;
    font-size: 13px;
    padding: 0 50px 0 20px;
    outline: none;
    color: #202020;
    direction: rtl;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.events-search-bar .search-wrap input:focus {
    border-color: #303a5e;
    box-shadow: 0 0 0 3px rgba(48, 58, 94, 0.08);
}

.events-search-bar .search-wrap input::placeholder {
    color: #b8bcc6;
}

.events-search-bar .search-wrap input:disabled {
    cursor: default;
    background: #fafbfc;
}

.ev-inner {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    width: 100%;
    max-width: 100%;
}

.years-sidebar {
    width: 120px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #cfd2da;
    overflow: hidden;
    position: sticky;
    top: 16px;
}

body.nav-fixed .years-sidebar {
    top: 130px;
}

.years-sidebar h3 {
    position: relative;
    font-size: 15px;
    font-weight: 700;
    color: #0a0f1c;
    padding: 16px 8px 18px;
    text-align: center;
}

.years-sidebar h3::after {
    content: "";
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 46px;
    height: 2px;
    background: #303a5e;
    border-radius: 2px;
}

.year-item {
    display: block;
    text-align: center;
    padding: 12px 10px;
    font-size: 13px;
    color: #333533;
    text-decoration: none;
    border-top: 1px solid #eeeff0;
    transition:
        background 0.15s,
        color 0.15s;
    cursor: pointer;
}

.year-item:hover {
    background: #f5f4f7;
}

.year-item.active {
    background: #303a5e;
    color: #fff;
    font-weight: 600;
}

.events-main {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.event-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #cfd2da;
    height: 100%;
    padding: 10px;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        border-color 0.2s;
}

.event-card__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(48, 58, 94, 0.12);
    border-color: #303a5e;
}

.event-card__collage {
    display: grid;
    gap: 3px;
    aspect-ratio: 16 / 10;
    background: #e8e9ec;
    border-radius: 8px;
    overflow: hidden;
}

.event-card__collage--0,
.event-card__collage--1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.event-card__collage--2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.event-card__collage--3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.event-card__collage--3 .event-card__cell:first-child {
    grid-column: 1 / -1;
}

.event-card__collage--4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.event-card__cell {
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #e8e9ec;
    transition: transform 0.35s ease;
}

.event-card__link:hover .event-card__cell {
    transform: scale(1.03);
}

.event-card__cell--empty {
    background: #e8e9ec;
}

.event-card__body {
    background: #303a5e;
    color: #fff;
    padding: 14px 16px;
    min-height: 62px;
    margin-top: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.event-card__title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.7;
    color: #fff;
}

.event-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #0a0f1c;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 8px;
}

.event-detail-date {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #8a8f99;
    margin-bottom: 20px;
}

.event-detail-desc {
    background: #fff;
    border: 1px solid #cfd2da;
    border-radius: 12px;
    padding: 20px 24px;
    font-size: 14px;
    color: #3a3d44;
    line-height: 2.1;
    margin-bottom: 18px;
}

.event-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.event-gallery__item {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: #f5f4f7;
    overflow: hidden;
    border: 1px solid #cfd2da;
    cursor: zoom-in;
    transition:
        transform 0.2s,
        box-shadow 0.2s,
        border-color 0.2s;
}

.event-gallery__item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(48, 58, 94, 0.15);
    border-color: #303a5e;
}

.event-gallery__item img:not(.event-gallery__logo) {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.event-gallery__item:hover img:not(.event-gallery__logo) {
    transform: scale(1.05);
}

.event-gallery__item::before {
    content: "";
    position: absolute;
    top: 40px;
    right: 40px;
    bottom: 0;
    left: 40px;
    background: radial-gradient(
        circle at top left,
        rgba(117, 68, 152, 0.55) 0%,
        rgba(117, 68, 152, 0.18) 35%,
        transparent 65%
    );
    pointer-events: none;
    z-index: 1;
}

.event-gallery__item::after {
    content: "";
    position: absolute;
    top: 40px;
    right: 40px;
    bottom: 0;
    left: 40px;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.75) 15%,
        rgba(255, 255, 255, 0.25) 25%,
        transparent 65%
    );
    border: 1px solid #fff;
    border-bottom: none;
    pointer-events: none;
    z-index: 2;
}

.event-gallery__item .event-gallery__logo {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    height: 26px;
    width: auto;
    max-width: none;
    max-height: none;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
    transition: none;
}

.event-detail-footer {
    text-align: center;
    margin-top: 8px;
}

.events-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #fff;
    background: #303a5e;
    text-decoration: none;
    padding: 10px 22px 10px 18px;
    border-radius: 8px;
    transition: background 0.15s;
}

.events-back-btn:hover {
    background: #3f4c78;
}

.events-back-btn::before {
    content: "";
    width: 14px;
    height: 14px;
    background-image: url("/images/arrow.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: scaleX(-1);
    filter: invert(1);
}

.events-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.events-pagination__btn {
    display: inline-block;
    border: 1px solid #cfd2da;
    background: #fff;
    color: #333533;
    padding: 8px 22px;
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition:
        border-color 0.15s,
        color 0.15s;
}

.events-pagination__btn:hover:not(:disabled) {
    border-color: #303a5e;
    color: #303a5e;
}

.events-pagination__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.events-pagination__page {
    font-size: 12px;
    color: #666;
}

.no-result {
    text-align: center;
    padding: 70px 20px;
    background: #fff;
    border: 1px solid #cfd2da;
    border-radius: 12px;
    color: #555964;
    font-size: 13px;
}

.no-result i {
    display: block;
    font-size: 42px;
    color: #cfd2da;
    margin-bottom: 12px;
}

.event-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 15, 28, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: lbFade 0.2s ease;
}

@keyframes lbFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.event-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.event-lightbox__close {
    position: absolute;
    top: 20px;
    left: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition:
        opacity 0.15s,
        transform 0.15s;
}

.event-lightbox__close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.event-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s;
}

.event-lightbox__nav::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("/images/arrow.png");
    background-size: 18px 18px;
    background-repeat: no-repeat;
    background-position: center;
    filter: invert(1);
}

.event-lightbox__nav:hover {
    background-color: rgba(255, 255, 255, 0.22);
}

.event-lightbox__nav--prev {
    right: 24px;
}

.event-lightbox__nav--prev::before {
    transform: scaleX(-1);
}

.event-lightbox__nav--next {
    left: 24px;
}

.event-lightbox__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 16px;
    border-radius: 20px;
}

@media (max-width: 768px) {
    .ev-inner {
        flex-direction: column;
        gap: 14px;
    }

    .years-sidebar {
        width: 100%;
        position: static;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        border-radius: 10px;
    }

    .years-sidebar h3 {
        width: 100%;
        text-align: right;
        padding: 4px 6px 12px;
        font-size: 13px;
    }

    .years-sidebar h3::after {
        left: 6px;
        transform: none;
        width: 40px;
    }

    .year-item {
        border-top: none;
        border: 1px solid #cfd2da;
        border-radius: 16px;
        padding: 6px 16px;
        margin: 3px;
        font-size: 12px;
    }

    .year-item.active {
        border-color: #303a5e;
    }

    .events-grid {
        gap: 12px;
    }

    .event-detail-title {
        font-size: 16px;
    }

    .event-gallery {
        gap: 10px;
    }

    .event-gallery__item::before,
    .event-gallery__item::after {
        top: 20px;
        right: 20px;
        left: 20px;
    }

    .event-gallery__item .event-gallery__logo {
        height: 22px;
    }

    .event-lightbox {
        padding: 16px;
    }

    .event-lightbox__nav {
        width: 40px;
        height: 40px;
    }

    .event-lightbox__nav::before {
        background-size: 14px 14px;
    }

    .event-lightbox__nav--prev {
        right: 8px;
    }

    .event-lightbox__nav--next {
        left: 8px;
    }

    .event-lightbox__close {
        top: 10px;
        left: 14px;
        font-size: 32px;
    }
}

@media (max-width: 640px) {
    .events-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .event-card__collage {
        aspect-ratio: 16 / 9;
    }

    .event-card__body {
        margin-top: 10px;
        min-height: 60px;
        padding: 12px 14px;
    }

    .event-card__title {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .xrl-events {
        padding: 20px 10px 40px;
    }

    .event-detail-desc {
        padding: 14px 16px;
        font-size: 13px;
    }

    .event-gallery {
        grid-template-columns: 1fr;
    }

    .event-gallery__item::before,
    .event-gallery__item::after {
        top: 16px;
        right: 16px;
        left: 16px;
    }
}
@media (max-width: 768px) {
    .ev-inner {
        flex-direction: column;
        gap: 14px;
    }

    .events-main {
        width: 100%;
    }

    .years-sidebar {
        width: 100%;
        position: static;
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        border-radius: 10px;
    }

}
