/* =========================================================
   CALENDAR PAGE
   ========================================================= */

.page-hero {

    min-height: 170px;

    display: flex;

    align-items: center;

    background:
        linear-gradient(
            90deg,
            rgba(0, 27, 61, 0.88),
            rgba(0, 27, 61, 0.55)
        ),
        url("../images/campus/rog-background.png")
        center / cover no-repeat;

}

.page-hero h1 {

    color: var(--white);

    font-size: clamp(2.5rem, 5vw, 4rem);

}


/* ---------------------------------------------------------
   BREADCRUMB
   --------------------------------------------------------- */

.breadcrumb-bar {

    background: var(--light-blue);

    padding: 18px 0;

    font-size: 14px;

}

.breadcrumb-bar .container {

    display: flex;

    align-items: center;

    gap: 8px;

}

.breadcrumb-bar strong {

    color: #1260b5;

}

.breadcrumb-separator {

    color: var(--gray-500);

}


/* ---------------------------------------------------------
   CALENDAR SECTION
   --------------------------------------------------------- */

.calendar-section {

    padding: 20px 0 70px;

}

.calendar-layout {

    display: grid;

    grid-template-columns: 245px 1fr;

    gap: 22px;

    align-items: start;

}


/* ---------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------- */

.calendar-panel {

    border: 1px solid #c8cdd3;

    border-radius: 5px;

    padding: 20px 16px;

    margin-bottom: 20px;

    background: var(--white);

}

.calendar-panel h2 {

    font-family: "Playfair Display", serif;

    font-size: 19px;

    text-transform: uppercase;

    letter-spacing: 0.5px;

    margin-bottom: 18px;

}


/* ---------------------------------------------------------
   LEGEND
   --------------------------------------------------------- */

.legend-item {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 13px;

    font-size: 14px;

}

.legend-color {

    width: 18px;

    height: 18px;

    flex-shrink: 0;

}


/* Event category colors */

.school-events {
    --event-background: #001b3d;
    --event-foreground: #ffffff;
    --event-tint: #edf3fb;
}

.holidays {
    --event-background: #f5a019;
    --event-foreground: #172033;
    --event-tint: #fff4df;
}

.special-observances {
    --event-background: #286b38;
    --event-foreground: #ffffff;
    --event-tint: #edf6ef;
}

.examinations {
    --event-background: #754095;
    --event-foreground: #ffffff;
    --event-tint: #f5eef9;
}

.other-activities {
    --event-background: #a9c8ee;
    --event-foreground: #172033;
    --event-tint: #eef5fd;
}

.legend-color,
.calendar-event,
.calendar-event-date {
    background: var(--event-background, #a9c8ee);
    color: var(--event-foreground, #172033);
}


/* ---------------------------------------------------------
   FILTERS
   --------------------------------------------------------- */

.calendar-filter {

    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 12px;

    font-size: 14px;

    cursor: pointer;

}

.calendar-filter input {

    appearance: none;

    width: 18px;

    height: 18px;

    background: var(--navy);

    border: 1px solid var(--navy);

    position: relative;

    cursor: pointer;

}

.calendar-filter input:checked::after {

    content: "✓";

    color: white;

    position: absolute;

    left: 3px;

    top: -1px;

    font-size: 14px;

}


/* ---------------------------------------------------------
   CALENDAR MAIN
   --------------------------------------------------------- */

.calendar-main {

    border: 1px solid #c8cdd3;

    border-radius: 5px;

    background: var(--white);

    padding: 15px;

}


/* ---------------------------------------------------------
   CALENDAR HEADER
   --------------------------------------------------------- */

.calendar-header {

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    border-bottom: 1px solid #c8cdd3;

    padding-bottom: 8px;

    margin-bottom: 0;

}

.calendar-header h2 {

    font-family: "Playfair Display", serif;

    font-size: 28px;

    text-transform: uppercase;

    text-align: center;

    color: #111;

}

.calendar-controls {

    display: flex;

    align-items: center;

    gap: 10px;

}

.calendar-nav-button,
.calendar-today-button {

    height: 34px;

    border: 1px solid #c5cbd2;

    background: white;

    border-radius: 4px;

    cursor: pointer;

    font-family: inherit;

}

.calendar-nav-button {

    width: 50px;

    font-size: 25px;

    line-height: 1;

    color: var(--navy);

}

.calendar-today-button {

    padding: 0 14px;

}

.calendar-nav-button:hover,
.calendar-today-button:hover {

    background: var(--gray-100);

}


/* ---------------------------------------------------------
   VIEW SWITCHER
   --------------------------------------------------------- */

.calendar-view-switcher {

    justify-self: end;

    display: flex;

    border: 1px solid #c5cbd2;

    border-radius: 4px;

    overflow: hidden;

}

.calendar-view {

    border: 0;

    border-right: 1px solid #c5cbd2;

    background: white;

    padding: 7px 11px;

    font-size: 13px;

    cursor: pointer;

}

.calendar-view:last-child {

    border-right: 0;

}

.calendar-view.active {

    background: var(--navy);

    color: white;

}


/* ---------------------------------------------------------
   WEEKDAYS
   --------------------------------------------------------- */

.calendar-weekdays {

    display: grid;

    grid-template-columns: repeat(7, 1fr);

    border-bottom: 1px solid #c8cdd3;

}

.calendar-weekdays div {

    padding: 8px 7px;

    text-align: center;

    font-family: "Playfair Display", serif;

    font-size: 17px;

    font-weight: 700;

    text-transform: uppercase;

}


/* ---------------------------------------------------------
   MONTH GRID
   --------------------------------------------------------- */

.calendar-grid {

    display: grid;

    grid-template-columns: repeat(7, 1fr);

}

.calendar-day {

    min-height: 105px;

    border-right: 1px solid #d0d4d8;

    border-bottom: 1px solid #d0d4d8;

    padding: 5px;

    position: relative;

    overflow: hidden;

}

.calendar-day:nth-child(7n) {

    border-right: 0;

}

.calendar-day-number {

    font-size: 16px;

    font-weight: 700;

    margin-bottom: 5px;

}

.calendar-day.other-month {

    color: #999;

    background: #fafafa;

}

.calendar-day.sunday .calendar-day-number {

    color: #e32626;

}


/* ---------------------------------------------------------
   EVENTS INSIDE CALENDAR
   --------------------------------------------------------- */

.calendar-event {

    display: block;

    width: 100%;

    padding: 5px 6px;

    margin-bottom: 4px;

    border-radius: 2px;

    font-size: 10px;

    line-height: 1.2;

    color: var(--event-foreground, #172033);

    overflow: hidden;

    cursor: pointer;

}

.calendar-event strong {

    display: block;

    font-size: 10px;

}



/* ---------------------------------------------------------
   EVENT CARDS
   --------------------------------------------------------- */

.calendar-event-cards {

    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 14px;

    margin-top: 20px;

}

.calendar-event-card {

    border: 1px solid #c8cdd3;

    border-radius: 5px;

    display: flex;

    align-items: center;

    overflow: hidden;

    min-height: 62px;

    background: white;

}

.calendar-event-date {

    width: 68px;

    min-height: 100%;

    padding: 8px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: center;

    color: var(--event-foreground, #172033);

    flex-shrink: 0;

}

.calendar-event-date span {

    font-size: 12px;

    font-weight: 700;

}

.calendar-event-date strong {

    font-size: 16px;

}

.calendar-event-info {

    padding: 8px 10px;

}

.calendar-event-info h3 {

    font-family: "DM Sans", sans-serif;

    color: #222;

    font-size: 12px;

    line-height: 1.25;

    margin-bottom: 4px;

}

.calendar-event-info p {

    font-size: 9px;

    color: #888;

    line-height: 1.2;

}


/* ---------------------------------------------------------
   LIST VIEW
   --------------------------------------------------------- */

.calendar-list-view {

    padding: 20px 5px;

}

.calendar-list-item {

    display: grid;

    grid-template-columns: 100px 1fr;

    gap: 20px;

    padding: 15px;

    border-bottom: 1px solid #ddd;

}

.calendar-list-date {

    font-weight: 700;

    color: var(--navy);

}

.calendar-list-item h3 {

    font-family: "DM Sans", sans-serif;

    font-size: 16px;

    margin-bottom: 4px;

}

.calendar-list-item p {

    font-size: 13px;

    color: var(--gray-500);

}


/* ---------------------------------------------------------
   WEEK VIEW
   --------------------------------------------------------- */

.calendar-week-view {

    padding: 20px 0;

}

.week-view-title {

    font-family: "Playfair Display", serif;

    font-size: 22px;

    margin-bottom: 15px;

}

.week-event-item {

    display: flex;

    gap: 15px;

    background: var(--event-tint, #eef5fd);

    color: #172033;

    border: 1px solid #dce3eb;

    border-left: 4px solid var(--event-background, #a9c8ee);

    border-radius: 8px;

    margin-bottom: 12px;

    padding: 16px;

}

.week-event-date {

    width: 100px;

    flex-shrink: 0;

    font-weight: 700;

    color: #172033;

}

.week-event-content h3 {

    color: #172033;

    font-weight: 700;

    line-height: 1.5;

    overflow-wrap: anywhere;

    font-family: "DM Sans", sans-serif;

    font-size: 15px;

}

.week-event-content p {

    color: #43516a;

    font-size: 13px;

}

.week-event-content {
    min-width: 0;
}

@media (max-width: 480px) {
    .week-event-item {
        flex-direction: column;
        gap: 8px;
    }

    .week-event-date {
        width: auto;
    }
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 1000px) {

    .calendar-layout {

        grid-template-columns: 1fr;

    }

    .calendar-sidebar {

        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 20px;

    }

    .calendar-panel {

        margin-bottom: 0;

    }

    .calendar-event-cards {

        grid-template-columns: repeat(2, 1fr);

    }

}

@media (max-width: 700px) {

    .calendar-header {

        grid-template-columns: 1fr;

        gap: 12px;

    }

    .calendar-header h2 {

        order: -1;

    }

    .calendar-controls {

        justify-content: center;

    }

    .calendar-view-switcher {

        justify-self: center;

    }

    .calendar-sidebar {

        grid-template-columns: 1fr;

    }

    .calendar-day {

        min-height: 75px;

    }

    .calendar-weekdays div {

        font-size: 11px;

    }

    .calendar-event {

        font-size: 8px;

    }

    .calendar-event-cards {

        grid-template-columns: 1fr;

    }

}


/* Readable calendar dialogs and compact mobile date cells. */
.calendar-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; padding: 16px; }
.calendar-header h2 { margin: 0; }
.calendar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.calendar-expand-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; white-space: nowrap; border: 1px solid #001b3d; border-radius: 9px; color: #fff; background: #001b3d; padding: 10px 15px; font-family: inherit; font-size: 13px; font-weight: 600; box-shadow: 0 3px 8px rgba(0,27,61,.1); transition: background 180ms ease; }
.calendar-expand-button:hover { background: #173b63; }
.calendar-expand-button svg { flex-shrink: 0; }
.calendar-day { cursor: pointer; min-width: 0; }
.calendar-day:focus-visible, .calendar-expand-button:focus-visible { outline: 3px solid #b48221; outline-offset: -3px; }
.calendar-day-count { display: none; }
.calendar-dialog { border: 0; border-radius: 18px; padding: 24px; width: min(600px, calc(100vw - 28px)); max-height: 85vh; max-height: 85dvh; color: #172b43; background: white; overflow-y: auto; box-shadow: 0 24px 70px rgba(0, 20, 45, .3); }
.calendar-dialog::backdrop { background: rgba(0, 20, 45, .65); }
.calendar-dialog { position: fixed; inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; box-sizing: border-box; }
.calendar-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.calendar-dialog-header h2 { font-size: 23px; margin: 0; color: #001b3d; }
.calendar-dialog-close { width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: #eef2f6; color: #001b3d; font-size: 28px; line-height: 1; }
.calendar-popup-event { padding: 20px; margin-bottom: 14px; border-radius: 12px; border-left: 4px solid var(--event-background, #001b3d); background: var(--event-tint, #eef5fd); }
.calendar-popup-event h3 { margin: 0 0 10px; font-size: 18px; line-height: 1.5; color: #172033; overflow-wrap: anywhere; }
.calendar-popup-event p { margin: 4px 0; color: #43516a; font-size: 14px; line-height: 1.6; }
.calendar-expanded-dialog { width: min(1300px, calc(100vw - 28px)); }
.calendar-expanded-content { overflow-x: auto; }
.calendar-expanded-dialog .calendar-month-view { min-width: 1000px; }
.calendar-expanded-dialog .calendar-day { min-height: 150px; }
.calendar-expanded-dialog .calendar-event, .calendar-expanded-dialog .calendar-event strong { font-size: 15px; line-height: 1.5; }
.calendar-expanded-dialog .week-event-content h3 { font-size: 20px; }
@media (max-width: 1200px) {
    .calendar-header { grid-template-columns: auto minmax(0, 1fr); }
    .calendar-header h2 { grid-column: 1 / -1; grid-row: 1; }
    .calendar-actions { justify-self: end; }
}
@media (max-width: 600px) {
    .calendar-header { grid-template-columns: minmax(0, 1fr); padding: 16px 12px; gap: 14px; }
    .calendar-header h2 { grid-column: 1; }
    .calendar-header .calendar-controls { justify-content: center; }
    .calendar-actions { justify-self: stretch; justify-content: center; flex-wrap: wrap; gap: 10px; }
    .calendar-expand-button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .calendar-expand-button { transition: none; } }
@media (max-width: 767px) {
    .calendar-grid .calendar-day { min-height: 74px; padding: 8px 3px; text-align: center; }
    .calendar-day-number { font-size: 16px; margin-bottom: 8px; }
    .calendar-weekdays div { font-size: 11px; padding: 12px 2px; font-family: "DM Sans", sans-serif; }
    .calendar-grid .calendar-event { display: none; }
    .calendar-day-count { display: block; color: #43516a; font-size: 9px; font-weight: 600; }
    .calendar-dialog { padding: 20px; }
    .calendar-expanded-dialog .calendar-event { display: block; text-align: left; }
    .calendar-expanded-dialog .calendar-day-count { display: none; }
    .calendar-expanded-dialog .calendar-day { min-height: 150px; }
    .calendar-view-switcher { flex-shrink: 0; }
    .calendar-controls { flex-wrap: wrap; gap: 12px; }
}
