/* ═══════════════════════════════════════════════════════════════════════════
   CALENDAR — Side Panel + Calendar Grid
   Panel slides from the LEFT (same side as OTG).
   Navy theme (#1a3a6b) with red (#dc1f34) accents.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.calendar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}
.calendar-overlay.is-open {
    display: block;
}

/* ── Side Panel — slides from LEFT ───────────────────────────────────────── */
.calendar-panel {
    position: fixed;
    top: 0;
    left: -75vw;
    width: 75vw;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: left 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}
.calendar-panel.is-open {
    left: 0;
}
.calendar-panel-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ── Panel Header — navy background ──────────────────────────────────────── */
.calendar-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: #1a3a6b;
    flex-shrink: 0;
}
.calendar-panel-header h3 {
    color: #fff;
    font-size: 50px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}
.calendar-panel-header svg {
    margin-top: 3px;
}
.calendar-panel-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s;
}
.calendar-panel-close:hover {
    opacity: 0.7;
}

/* ── Panel Scrollable Content ────────────────────────────────────────────── */
.calendar-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* ── Month Navigation ────────────────────────────────────────────────────── */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 100px;
}
.calendar-nav-btn {
    background: none;
    border: 2px solid #1a3a6b;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #1a3a6b;
    transition: background 0.2s ease, color 0.2s ease;
}
.calendar-nav-btn:hover {
    background: #1a3a6b;
    color: #fff;
}
.calendar-nav-selects {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ── Custom Dropdowns ────────────────────────────────────────────────────── */
.calendar-dropdown {
    position: relative;
}
.calendar-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    font-weight: 700;
    color: #1a3a6b;
    padding: 4px 0;
    text-transform: uppercase;
}
.calendar-dropdown-btn:hover {
    color: #dc1f34;
}
.calendar-dropdown-btn svg {
    margin-top: 2px;
}
.calendar-dropdown-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 2px solid #1a3a6b;
    border-radius: 5px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 140px;
}
.calendar-dropdown-list.is-open {
    display: block;
}
.calendar-dropdown-item {
    padding: 8px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #1a3a6b;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}
.calendar-dropdown-item:hover {
    background: #1a3a6b;
    color: #fff;
}
.calendar-dropdown-item.is-active {
    background: #dc1f34;
    color: #fff;
}

/* ── Calendar Grid (7-column layout) ─────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}
.calendar-grid-header {
    background: #dc1f34;
    border-radius: 6px 6px 0 0;
}
.calendar-day-header {
    padding: 10px 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.calendar-grid-body {
    border-left: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.calendar-day-cell {
    position: relative;
    min-height: 150px;
    padding: 12px 10px;
    border-top: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    cursor: default;
    transition: background 0.15s ease;
    min-width: 0;
    overflow: hidden;
}
.calendar-day-cell:hover {
    background: #f5f7fa;
}
.calendar-day-number {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    line-height: 1;
}
.calendar-day-cell--empty {
    background: #fafafa;
    cursor: default;
}
.calendar-day-cell--empty:hover {
    background: #fafafa;
}
.calendar-day-cell--empty .calendar-day-number {
    color: #ccc;
}
.calendar-day-cell--today {
    background: rgba(220, 31, 52, 0.08);
}
.calendar-day-cell--today .calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #dc1f34;
    color: #fff;
}
.calendar-day-cell--has-events {
    cursor: pointer;
}
.calendar-day-cell--has-events:hover {
    background: rgba(26, 58, 107, 0.08);
}

/* Event title indicators under the day number */
.calendar-day-dots {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 4px;
    width: 100%;
    overflow: hidden;
}
.calendar-day-event-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #dc1f34;
    padding: 2px 4px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    cursor: pointer;
    transition: background 0.15s ease;
    text-align: left;
}
.calendar-day-event-label:hover {
    background: #1a3a6b;
}
.calendar-day-event-label:nth-child(n+3) {
    display: none;
}
.calendar-day-event-more {
    font-size: 9px;
    font-weight: 700;
    color: #1a3a6b;
    text-align: center;
    cursor: pointer;
}
.calendar-day-event-more:hover {
    color: #dc1f34;
}

/* ── Search Bar ──────────────────────────────────────────────────────────── */
.calendar-search-container {
    position: relative;
    max-width: 100%;
    margin-bottom: 20px;
    margin-top: 70px;
}
.calendar-search-input-wrapper {
    position: relative;
    display: block;
    width: 70%;
    margin: 0 auto;
}
.calendar-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #1a3a6b;
    width: 20px;
    height: 20px;
}
.calendar-search-input {
    width: 100%;
    padding: 12px 15px 12px 46px !important;
    font-size: 14px;
    border: 2px solid #1a3a6b;
    border-radius: 5px;
    outline: none;
}
.calendar-search-input::placeholder {
    color: #6b7280;
}
.calendar-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #1a3a6b;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}
.calendar-search-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}
.calendar-search-card {
    background: rgb(243, 245, 244);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s;
    border-radius: 4px;
    overflow: hidden;
}
.calendar-search-card:hover {
    transform: scale(1.02);
}
.calendar-search-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
}
.calendar-search-card-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #1a3a6b;
}
.calendar-search-card-info {
    padding: 10px;
}
.calendar-search-card-title {
    font-weight: bold;
    font-size: 13px;
    margin: 0 0 3px;
    color: #333;
}
.calendar-search-card-excerpt {
    font-size: 11px;
    color: #666;
    margin: 0 0 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.calendar-search-card-meta {
    font-size: 11px;
    color: #1a3a6b;
    margin: 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.calendar-search-no-results {
    padding: 30px;
    text-align: center;
    color: #666;
}
.calendar-archived-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc1f34;
    color: white;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 10;
}

/* ── Monthly Events Carousel ─────────────────────────────────────────────── */
.calendar-carousel-section {
    margin-top: 32px;
    position: relative;
    padding-bottom: 10px;
}
.calendar-carousel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: #1a3a6b;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}
.calendar-events-swiper {
    overflow: hidden;
    padding: 10px 0;
}
.calendar-carousel-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.calendar-carousel-card:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}
.calendar-carousel-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
}
.calendar-carousel-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.calendar-carousel-card-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #fef2f2 100%);
    color: #1a3a6b;
}
.calendar-carousel-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.calendar-carousel-card-date {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #dc1f34;
}
.calendar-carousel-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.calendar-carousel-card-time {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
}
.calendar-carousel-card-location {
    font-size: 12px;
    color: #6b7280;
}
.calendar-swiper-prev,
.calendar-swiper-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a3a6b;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.calendar-swiper-prev {
    left: -8px;
}
.calendar-swiper-next {
    right: -8px;
}
.calendar-swiper-prev:hover,
.calendar-swiper-next:hover {
    opacity: 0.85;
}
.calendar-swiper-prev svg,
.calendar-swiper-next svg {
    fill: #fff;
}
.calendar-swiper-prev.swiper-button-disabled,
.calendar-swiper-next.swiper-button-disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── Event Detail Modal ──────────────────────────────────────────────────── */
.calendar-modal-container {
    width: 55%;
    max-height: 80vh;
    position: relative;
    background-color: rgb(243, 245, 244);
    overflow-y: auto;
    animation: calendarSlideIn 0.25s linear 1;
    border-radius: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.calendar-modal-container::-webkit-scrollbar {
    display: none;
}
@keyframes calendarSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.calendar-modal-exit {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 10px 10px 8px 10px;
    z-index: 100;
    border-radius: 50px;
    background-color: rgb(243, 245, 244);
    border: none;
    cursor: pointer;
}
.calendar-modal-exit path {
    fill: #dc1f34;
    transition: fill 0.5s ease;
}
.calendar-modal-exit:hover path {
    fill: #1a3a6b;
}
.calendar-modal-image {
    width: 100%;
    height: 500px;
    object-fit: cover;
    display: block;
}
.calendar-modal-info-container {
    padding: 0 50px 30px;
    display: flex;
    flex-direction: column;
    row-gap: 16px;
}
.calendar-modal-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.calendar-modal-date-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #1a3a6b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
}
.calendar-modal-time-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #dc1f34;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
}
.calendar-modal-title {
    font-size: 34px;
    font-weight: 700;
    color: #1a3a6b;
    margin: 0;
}
.calendar-modal-location {
    font-size: 18px;
    color: #dc1f34;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.calendar-modal-desc {
    font-size: 26px;
    color: #444;
    margin: 0;
    line-height: 1.6;
}
.calendar-modal-player {
    width: 100%;
}
.calendar-embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}
.calendar-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.calendar-fallback-link {
    color: #1a3a6b;
    font-size: 14px;
    font-weight: 600;
}

/* ── Selected Day Events List ────────────────────────────────────────────── */
.calendar-day-events {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid #e5e7eb;
    margin-bottom: 120px;
}
.calendar-day-events-title {
    margin: 0 0 12px 0;
    font-size: 22px;
    font-weight: 700;
    color: #1a3a6b;
}
.calendar-day-events-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.calendar-event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f7fa;
    border-left: 4px solid #dc1f34;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}
.calendar-event-card:hover {
    background: #edf0f5;
    transform: translateX(2px);
}
.calendar-event-time {
    font-size: 13px;
    font-weight: 700;
    color: #dc1f34;
    white-space: nowrap;
    min-width: 60px;
}
.calendar-event-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a3a6b;
    margin: 0;
}
.calendar-event-location {
    font-size: 13px;
    color: #6b7280;
    margin: 2px 0 0 0;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .calendar-modal-container {
        width: 80%;
    }
}

@media (max-width: 767px) {
    .calendar-panel {
        width: 100vw;
        left: -100vw;
    }
    .calendar-panel.is-open {
        left: 0;
    }
    .calendar-panel-content {
        padding-bottom: 100px;
    }
    .calendar-panel-header h3 {
        font-size: 30px;
        flex-wrap: wrap;
    }
    .calendar-panel-header svg {
        width: 30px;
        height: 30px;
    }
    .calendar-dropdown-btn {
        font-size: 16px;
    }
    .calendar-dropdown-list {
        min-width: 120px;
    }
    .calendar-dropdown-item {
        font-size: 13px;
        padding: 6px 12px;
    }
    .calendar-nav {
        margin-top: 70px;
    }
    .calendar-nav-btn {
        width: 32px;
        height: 32px;
    }
    .calendar-day-header {
        padding: 8px 2px;
        font-size: 11px;
    }
    .calendar-day-cell {
        min-height: 120px;
        padding: 8px 6px;
    }
    .calendar-day-number {
        font-size: 13px;
    }
    .calendar-day-cell--today .calendar-day-number {
        width: 26px;
        height: 26px;
    }
    .calendar-day-events-title {
        font-size: 18px;
    }
    .calendar-event-title {
        font-size: 14px;
    }
    .calendar-event-time {
        font-size: 12px;
    }
    .calendar-event-location {
        font-size: 12px;
    }
    .calendar-search-container {
        margin-top: 10px;
    }
    .calendar-search-grid {
        grid-template-columns: 1fr;
    }
    .calendar-carousel-title {
        font-size: 18px;
    }
    .calendar-carousel-card-title {
        font-size: 15px;
    }
    .calendar-swiper-prev {
        left: 0;
    }
    .calendar-swiper-next {
        right: 0;
    }
    .calendar-modal-container {
        width: 95%;
    }
    .calendar-modal-info-container {
        padding: 0 20px 24px;
    }
    .calendar-modal-image {
        height: 220px;
    }
    .calendar-modal-title {
        font-size: 26px;
    }
    .calendar-modal-desc {
        font-size: 18px;
    }
}

/* iOS Safari safe area */
@supports (-webkit-touch-callout: none) {
    .calendar-panel-content {
        padding-bottom: 100px;
    }
}