/**
 * Styles for Events Archive page (archive-events.php)
 *
 * @package CitadelChild
 */

/* Events archive header titles */
.icons-column {
    display: none;
}

.titles-column {
    flex-basis: 100%;
    justify-content: center;
}

.titles-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 60px;
}

.titles-column .main-title {
    font-size: 76px;
    line-height: 120%;
}

.titles-column .sub-title {
    font-size: 18px;
    line-height: 28px;
    display: flex;
    justify-content: center;
    width: 37%;
    text-align: center;
    font-weight: 300;
}

@media (max-width: 767px) {
    .titles-column .main-title {
        font-size: 32px;
        font-style: normal;
        font-weight: 400;
        line-height: 135%;
        text-transform: uppercase;
    }

    .titles-column .sub-title {
        width: 82%;
        font-size: 14px;
    }

    .titles-container {
        row-gap: 2em;
    }
}

/* Section 2: Calendar */
.event-sec2 {
    padding: 60px 0 80px 0;
}

.event-sec2-title {
    font-family: 'TenorSans', sans-serif;
    font-size: 36px;
    line-height: 1.35;
    color: #C09472;
    text-align: center;
    text-transform: uppercase;
    margin: 0 0 50px 0;
    font-weight: 400;
}

/* Calendar Layout */
.events-calendar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.events-calendar {
    width: 738px;
    max-width: 100%;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-month-title {
    font-family: 'TenorSans', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.35;
    text-transform: uppercase;
    color: #1A1A1A;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 17px;
}

.calendar-nav-btn {
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

.calendar-nav-btn:hover {
    opacity: 0.6;
    background: transparent;
}

/* Weekdays */
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 32px;
}

.calendar-weekday {
    font-family: 'TenorSans', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.35;
    text-transform: uppercase;
    color: #C09472;
    text-align: center;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 32px;
}

/* Day Cell */
.calendar-day {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 56px;
}

.calendar-day .day-number {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #1A1A1A;
    text-align: center;
    line-height: 1.2;
}

/* Other month day */
.calendar-day.other-month .day-number {
    color: #C9C9C9;
}

/* Day Circle */
.day-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 100px;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Active event circle */
.calendar-day.has-event .day-circle {
    background-color: #C09472;
}

.calendar-day.has-event .day-number {
    color: #FFFFFF;
}

/* Inactive event circle */
.calendar-day.has-event-inactive .day-circle {
    background-color: #D9D9D9;
}

.calendar-day.has-event-inactive .day-number {
    color: #5C5C5C;
}

/* Multiple events badge indicator */
.day-badge {
    position: absolute;
    top: -10px;
    right: 27px;
    width: 18px;
    height: 18px;
    border-radius: 100px;
    background-color: #F2EAE3;
    color: #C09472;
    font-family: 'TenorSans', sans-serif;
    font-size: 12px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Hover for event days */
.calendar-day.has-event,
.calendar-day.has-multiple-events {
    cursor: pointer;
}

.calendar-day.has-event:hover .day-circle,
.calendar-day.has-multiple-events:hover .day-circle {
    opacity: 0.85;
}

/* Legend (Slot Wrapper) */
.calendar-legend {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 242px;
    margin-top: 159px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 22px;
}

.legend-dot {
    width: 36px;
    height: 36px;
    border-radius: 200px;
    flex-shrink: 0;
}

.legend-dot.active {
    background-color: #C09472;
}

.legend-dot.inactive {
    background-color: #D9D9D9;
}

.legend-text {
    font-family: 'TenorSans', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    color: #1A1A1A;
    white-space: nowrap;
}

/* Popup Overlay */
.calendar-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9998;
}

.calendar-popup-overlay.active {
    display: block;
}

/* Popup Container */
.calendar-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #FFFFFF;
    padding: 32px;
    z-index: 9999;
    width: 610px;
    max-width: 90%;
    box-sizing: border-box;
}

.calendar-popup.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.calendar-popup-close {
    position: absolute;
    top: 32px;
    right: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-popup-title {
    font-family: 'TenorSans', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    color: #1A1A1A;
    margin: 0;
    width: 100%;
    text-align: left;
}

.calendar-popup-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-height: 360px;
    overflow-y: auto;
}

.calendar-popup-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border: 1px solid #F2EAE3;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-popup-card.selected,
.calendar-popup-card:hover {
    background-color: #F2EAE3;
    border-color: #C09472;
}

.calendar-popup-card-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.calendar-popup-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.calendar-popup-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-popup-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: #1A1A1A;
}

.calendar-popup-card-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.2;
    color: #5C5C5C;
    text-transform: uppercase;
}

.calendar-popup-btn {
    width: 256px;
    height: 48px;
    background-color: #C09472;
    color: #FFFFFF;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    border: none;
    cursor: pointer;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

.calendar-popup-btn:hover {
    opacity: 0.9;
    background-color: #C09472;
}

/* Mobile Adaptive Styles */
@media (max-width: 767px) {
    .event-sec2 {
        padding: 40px 0 50px 0;
    }

    .event-sec2-title {
        font-size: 24px;
        margin-bottom: 32px;
    }

    .events-calendar-wrapper {
        flex-direction: column;
        gap: 32px;
        align-items: center;
    }

    .events-calendar {
        width: 100%;
    }

    .calendar-header {
        margin-bottom: 17px;
    }

    .calendar-month-title {
        font-size: 16px;
    }

    .calendar-weekdays {
        margin-bottom: 24px;
    }

    .calendar-weekday {
        font-size: 16px;
    }

    .calendar-grid {
        row-gap: 24px;
    }

    .calendar-day {
        height: 36px;
    }

    .calendar-day .day-number {
        font-size: 16px;
    }

    .calendar-nav-btn {
        width: 30px;
    }

    .day-circle {
        width: 36px;
        height: 36px;
    }

    .day-badge {
        width: 14px;
        height: 14px;
        font-size: 10px;
        top: -5px;
        right: 6px;
    }

    .calendar-legend {
        width: 100%;
        margin-top: 0;
        gap: 12px;
    }

    .legend-item {
        gap: 16px;
    }

    .legend-dot {
        width: 24px;
        height: 24px;
    }

    .legend-text {
        font-size: 16px;
    }

    .calendar-popup {
        padding: 24px 16px;
        width: 343px;
    }

    .calendar-popup-title {
        font-size: 18px;
    }

    .calendar-popup-btn {
        width: 100%;
    }

    .calendar-popup-close {
        top: 20px;
        right: 15px;
    }
}