/* ===== Campus Calendar (shared) ===== */
/* Prevent page-level horizontal scroll on mobile. iOS Safari ignores
   overflow-x when applied only to a descendant of body — the rule must
   live on html/body. This stylesheet is only loaded when one of our
   shortcodes renders, so applying it globally is effectively scoped. */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
}
@supports (overflow-x: clip) {
    html, body {
        overflow-x: clip !important;
    }
}

.hhs-scheduler-calendar-wrap {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow-x: clip;
    box-sizing: border-box;
}
@media (min-width: 1101px) {
    .hhs-scheduler-calendar-wrap { max-width: 1100px; }
}

/* Default style filter */
.hhs-scheduler-calendar-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hhs-scheduler-calendar-filter:only-child {
    margin-bottom: 20px;
}
.hhs-scheduler-calendar-filter label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* Custom header */
.hhs-scheduler-calendar-header {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

/* Color legend */
.hhs-scheduler-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f9f9fb;
    border: 1px solid #e8e8ee;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}
.hhs-scheduler-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 0;
    flex: 0 1 auto;
}
@media (max-width: 600px) {
    .hhs-scheduler-calendar-legend {
        justify-content: center;
    }
    .hhs-scheduler-legend-item {
        white-space: normal;
    }
}
.hhs-scheduler-legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* ===== DEFAULT STYLE ===== */
.hhs-style-default #hhs-fullcalendar {
    background: #fff;
    border-radius: 4px;
}
.hhs-style-default .fc-toolbar-title {
    font-size: 20px;
    color: #222;
}
.hhs-style-default .fc-button {
    background: #2E6DA4;
    border-color: #2E6DA4;
    font-size: 13px;
    padding: 6px 12px;
}
.hhs-style-default .fc-button:hover {
    background: #245a8a;
    border-color: #245a8a;
}
.hhs-style-default .fc-button-active {
    background: #1d4d73 !important;
    border-color: #1d4d73 !important;
}
.hhs-style-default .fc-daygrid-event {
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 12px;
    cursor: pointer;
}
.hhs-style-default .fc-list-event {
    cursor: pointer;
}

/* ===== HHS STYLE ===== */

/* Title */
.hhs-cal-top-bar {
    margin-bottom: 16px;
}
.hhs-cal-title {
    font-size: 28px;
    font-weight: 800;
    color: #2d2d6b;
    letter-spacing: 1px;
    margin: 0;
    text-transform: uppercase;
}

/* Filters row — term filter left, campus toggles right */
.hhs-cal-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

/* Campus toggle buttons (multi-select) */
.hhs-cal-campus-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.hhs-cal-campus-toggle {
    background: #fff;
    color: #2d2d6b;
    border: 2px solid #2d2d6b;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 44px;
}
.hhs-cal-campus-toggle:hover {
    background: #f0f0fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(45,45,107,0.15);
}
.hhs-cal-campus-toggle-active {
    background: #2d2d6b;
    color: #fff;
    box-shadow: 0 2px 8px rgba(45,45,107,0.3);
}
.hhs-cal-campus-toggle-active:hover {
    background: #4a4a8a;
}
.hhs-cal-campus-clear {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 12px;
    text-decoration: underline;
}
.hhs-cal-campus-clear:hover {
    color: #666;
}

/* Term filter */
.hhs-cal-term-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hhs-cal-term-filter label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
}
.hhs-cal-term-filter .hhs-scheduler-filter-select {
    min-width: 180px;
}

/* FullCalendar HHS overrides */
.hhs-style-hhs #hhs-fullcalendar,
#hhs-fullcalendar {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 100%;
    box-sizing: border-box;
}

/* Constrain FullCalendar's internal scrollgrid so it never exceeds the
   container. FullCalendar computes column widths from content and can
   overflow by a few pixels (or, in list view on mobile, by a lot) causing
   the centered content to clip on BOTH sides. Force fixed layout. */
#hhs-fullcalendar .fc-scrollgrid,
#hhs-fullcalendar .fc-scrollgrid-sync-table,
#hhs-fullcalendar table.fc-col-header,
#hhs-fullcalendar table.fc-daygrid-body,
#hhs-fullcalendar .fc-list-table,
#hhs-fullcalendar table.fc-list-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
}
#hhs-fullcalendar .fc-view-harness,
#hhs-fullcalendar .fc-view,
#hhs-fullcalendar .fc-scroller,
#hhs-fullcalendar .fc-scroller-harness,
#hhs-fullcalendar .fc-list {
    max-width: 100% !important;
    width: 100% !important;
    overflow-x: clip;
    box-sizing: border-box;
}
/* List view rows: wrap long titles instead of letting the table widen */
#hhs-fullcalendar .fc-list-event-title,
#hhs-fullcalendar .fc-list-event-title a {
    white-space: normal !important;
    word-break: break-word;
    overflow-wrap: anywhere;
}
#hhs-fullcalendar .fc-list-event-time {
    white-space: nowrap;
    width: auto !important;
    max-width: 110px;
}
/* Day header in list view can be long (e.g. "Wednesday, April 1, 2026") —
   allow it to wrap on narrow screens */
#hhs-fullcalendar .fc-list-day-cushion {
    white-space: normal !important;
    word-break: break-word;
}

/* Toolbar: prev/next + title */
.hhs-style-hhs .fc-toolbar {
    margin-bottom: 0 !important;
    padding: 20px 24px !important;
    background: #f4f4f8;
    border-bottom: 1px solid #e0e0e8;
}
.hhs-style-hhs .fc-toolbar-title {
    font-size: 22px !important;
    font-weight: 800 !important;
    color: #2d2d6b !important;
    text-transform: uppercase !important;
    letter-spacing: 3px !important;
}

/* Prev/Next buttons */
.hhs-style-hhs .fc-hhsPrev-button,
.hhs-style-hhs .fc-hhsNext-button {
    background: #2d2d6b !important;
    border: none !important;
    color: #fff !important;
    padding: 12px 28px !important;
    border-radius: 25px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    box-shadow: 0 2px 6px rgba(45,45,107,0.25) !important;
}
.hhs-style-hhs .fc-hhsPrev-button:hover,
.hhs-style-hhs .fc-hhsNext-button:hover {
    background: #4a4a8a !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(45,45,107,0.3) !important;
}
.hhs-style-hhs .fc-hhsPrev-button:active,
.hhs-style-hhs .fc-hhsNext-button:active {
    transform: translateY(0) !important;
}

/* Day header row */
.hhs-style-hhs .fc-col-header {
    background: #2d2d6b;
}
.hhs-style-hhs .fc-col-header-cell {
    background: #2d2d6b;
    padding: 12px 0 !important;
    border: 1px solid #3a3a7a;
}
.hhs-style-hhs .fc-col-header-cell-cushion {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    text-transform: uppercase;
    text-decoration: none !important;
    letter-spacing: 1px;
}

/* Day cells */
.hhs-style-hhs .fc-daygrid-day {
    border: 1px solid #e8e8ee;
    min-height: 130px;
    overflow: hidden;
    transition: background 0.15s;
}
.hhs-style-hhs .fc-daygrid-day:hover {
    background: #fafaff !important;
}
.hhs-style-hhs .fc-daygrid-day-frame {
    overflow: hidden;
    min-height: 130px;
}
.hhs-style-hhs .fc-daygrid-day-events {
    overflow: hidden;
    padding: 0 2px;
}
.hhs-style-hhs .fc-daygrid-day-top {
    padding: 8px 10px 4px;
}
.hhs-style-hhs .fc-daygrid-day-number {
    font-weight: 700;
    font-size: 16px;
    color: #2d2d6b;
    text-decoration: none !important;
}

/* Other month days */
.hhs-style-hhs .fc-day-other {
    background: #f7f7fa !important;
}
.hhs-style-hhs .fc-day-other .fc-daygrid-day-number {
    color: #bbb;
}

/* Event cards inside day cells */
.hhs-style-hhs .fc-daygrid-event {
    border: none !important;
    border-radius: 6px !important;
    background: transparent !important;
    margin: 2px 2px !important;
    padding: 0 !important;
    cursor: pointer;
    overflow: hidden;
    white-space: normal !important;
}
.hhs-style-hhs .fc-daygrid-event .fc-event-main {
    padding: 0;
    color: #333;
    overflow: hidden;
}
.hhs-cal-event-card {
    padding: 5px 8px 5px 10px;
    line-height: 1.35;
    background: #f5f5fa;
    overflow: hidden;
    border-left: 4px solid #2E6DA4;
    border-radius: 6px;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.hhs-cal-event-card:hover {
    background: #eeeef8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.hhs-cal-event-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.hhs-cal-event-online {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #5a8a6a;
    padding: 1px 8px;
    border-radius: 10px;
    margin: 2px 0;
    line-height: 1.4;
}
.hhs-cal-event-time {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}
.hhs-cal-event-more {
    font-size: 11px;
    font-weight: 600;
    color: #4a6cf7;
    cursor: pointer;
    margin-top: 1px;
}
.hhs-cal-event-more:hover {
    text-decoration: underline;
}
.hhs-cal-event-links {
    margin-top: 4px;
}
.hhs-cal-event-view {
    font-size: 10px;
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s;
}
.hhs-cal-event-view:hover {
    color: #2d2d6b;
    border-bottom-color: #2d2d6b;
}

/* Today highlight */
.hhs-style-hhs .fc-day-today {
    background: #f0f0ff !important;
}
.hhs-style-hhs .fc-day-today .fc-daygrid-day-number {
    background: #2d2d6b;
    color: #fff;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

/* Remove default event dot */
.hhs-style-hhs .fc-daygrid-event-dot {
    display: none;
}

/* More events popover link */
.hhs-style-hhs .fc-daygrid-more-link {
    font-size: 11px;
    color: #6249C0;
    font-weight: 700;
    padding: 3px 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.hhs-style-hhs .fc-daygrid-more-link:hover {
    color: #2d2d6b;
}

/* ===== List View Styles ===== */
.hhs-style-hhs .fc-list {
    border: 1px solid #e0e0e8;
    border-radius: 8px;
    overflow: hidden;
}
.hhs-style-hhs .fc-list-day-cushion {
    background: #2d2d6b !important;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 16px;
    letter-spacing: 0.5px;
}
.hhs-style-hhs .fc-list-day-cushion a {
    color: #fff !important;
    text-decoration: none !important;
}
.hhs-style-hhs .fc-list-event {
    cursor: pointer;
    transition: background 0.15s;
}
.hhs-style-hhs .fc-list-event:hover td {
    background: #f4f4fa !important;
}
.hhs-style-hhs .fc-list-event td {
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.hhs-style-hhs .fc-list-event-time {
    color: #555;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    width: 140px;
    min-width: 0;
}
.hhs-style-hhs .fc-list-event-title {
    font-size: 15px;
}
.hhs-style-hhs .fc-list-event-title a {
    color: #2d2d6b !important;
    font-weight: 700;
    text-decoration: none !important;
}
.hhs-style-hhs .fc-list-event-title a:hover {
    color: #6249C0 !important;
}
.hhs-style-hhs .fc-list-event-dot {
    border-radius: 50%;
    width: 12px;
    height: 12px;
    border: none !important;
}
.hhs-style-hhs .fc-list-empty-cushion {
    padding: 40px 16px;
    font-size: 15px;
    color: #888;
    text-align: center;
}

/* Popover */
.hhs-style-hhs .fc-popover {
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e8;
}
.hhs-style-hhs .fc-popover-header {
    background: #2d2d6b;
    color: #fff;
    border-radius: 8px 8px 0 0;
    padding: 8px 12px;
    font-weight: 700;
}

/* Scrollgrid border */
.hhs-style-hhs .fc-scrollgrid {
    border: none;
    border-radius: 8px;
    overflow: hidden;
}
.hhs-style-hhs .fc-scrollgrid-section > td {
    border: none;
}

/* ===== Course Detail Card (matches hhs.edu style) ===== */
.hhs-course-detail-container {
    animation: hhs-fade-in 0.2s ease;
}
@keyframes hhs-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.hhs-detail-card {
    position: relative;
    padding: 4px 0 0;
}
.hhs-detail-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #6a7a3a;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background 0.15s;
}
.hhs-detail-close-btn:hover {
    background: #556630;
}
.hhs-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #2d2d6b;
    margin: 0 80px 8px 0;
    line-height: 1.3;
}
.hhs-detail-divider {
    height: 3px;
    background: linear-gradient(90deg, #6a7a3a, #a0b860);
    border: none;
    margin: 12px 0;
    border-radius: 2px;
}
.hhs-detail-divider-top {
    margin-top: 4px;
}
.hhs-detail-rows {
    padding: 4px 0;
}
.hhs-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px dotted #ccc;
}
.hhs-detail-row:last-child {
    border-bottom: none;
}
.hhs-detail-label {
    font-size: 14px;
    color: #666;
}
.hhs-detail-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: right;
}
.hhs-detail-schedule {
    font-size: 15px;
    color: #333;
    margin: 8px 0 4px;
}
.hhs-detail-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 8px 0;
}
.hhs-detail-notes {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin: 4px 0 12px;
}
.hhs-detail-special-notes {
    background: #fef9e7;
    border-left: 4px solid #f0c929;
    padding: 10px 14px;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    border-radius: 0 4px 4px 0;
}
.hhs-detail-special-notes strong {
    color: #8a6d00;
}
.hhs-detail-register-by {
    font-size: 13px;
    color: #555;
    margin: 8px 0;
}
.hhs-detail-register-by-passed {
    color: #c0392b;
}
.hhs-detail-online-badge {
    display: inline-block;
    background: #17a2b8;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 4px;
}
/* Detail image */
.hhs-detail-image {
    margin-bottom: 12px;
    border-radius: 6px;
    overflow: hidden;
}
.hhs-detail-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.hhs-detail-add-btn {
    display: block;
    width: 100%;
    background: #2d2d6b;
    color: #fff;
    border: 2px solid #2d2d6b;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    margin-top: 12px;
    transition: all 0.15s;
}
.hhs-detail-add-btn:hover {
    background: #4a4a8a;
    border-color: #4a4a8a;
}
.hhs-detail-add-btn.hhs-scheduler-btn-added {
    background: #46b450;
    border-color: #46b450;
    cursor: default;
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 900px) {
    .hhs-cal-campus-toggles {
        justify-content: flex-end;
    }
    .hhs-cal-campus-toggle {
        font-size: 10px;
        padding: 7px 14px;
    }
}

/* ===== Responsive — Small Tablet / Large Phone ===== */
@media (max-width: 768px) {
    .hhs-cal-title {
        font-size: 18px;
        text-align: center;
        letter-spacing: 0.5px;
    }
    .hhs-cal-campus-toggles {
        justify-content: center;
        gap: 6px;
    }
    .hhs-cal-campus-toggle {
        font-size: 9px;
        padding: 6px 12px;
    }
    .hhs-style-hhs .fc-toolbar {
        padding: 14px 12px !important;
    }
    .hhs-style-hhs .fc-hhsPrev-button,
    .hhs-style-hhs .fc-hhsNext-button {
        padding: 10px 18px !important;
        font-size: 11px !important;
        border-radius: 20px !important;
    }
    .hhs-style-hhs .fc-toolbar-title {
        font-size: 16px !important;
        letter-spacing: 1px !important;
    }
    .hhs-style-hhs .fc-daygrid-day {
        min-height: 80px;
    }
    .hhs-style-hhs .fc-daygrid-day-frame {
        min-height: 80px;
    }
    .hhs-style-hhs .fc-col-header-cell-cushion {
        font-size: 11px;
    }
    .hhs-cal-event-title {
        font-size: 10px;
    }
    .hhs-cal-event-time {
        font-size: 9px;
    }
    .hhs-cal-event-more {
        display: none;
    }
    .hhs-cal-event-links {
        display: none;
    }
    .hhs-scheduler-calendar-legend {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 12px;
    }

    /* Detail card */
    .hhs-detail-title {
        font-size: 17px;
        margin-right: 60px;
    }
    .hhs-detail-close-btn {
        padding: 5px 10px;
        font-size: 10px;
    }

    /* Modal */
    .hhs-scheduler-modal-checkout {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }
}

/* ===== Responsive — Phone ===== */
@media (max-width: 600px) {
    .hhs-cal-top-bar {
        margin-bottom: 10px;
    }
    .hhs-cal-title {
        font-size: 16px;
    }
    .hhs-cal-campus-toggles {
        gap: 5px;
        margin-bottom: 14px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 100%;
    }
    .hhs-cal-campus-toggle {
        font-size: 10px;
        padding: 8px 12px;
        min-height: 40px;
        flex: 0 1 auto;
        min-width: 0;
        white-space: nowrap;
    }

    /* Toolbar stacks vertically */
    .hhs-style-hhs .fc-toolbar {
        flex-direction: column;
        gap: 8px;
        padding: 12px 10px !important;
        text-align: center;
    }
    .hhs-style-hhs .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    .hhs-style-hhs .fc-hhsPrev-button,
    .hhs-style-hhs .fc-hhsNext-button {
        padding: 10px 20px !important;
        font-size: 11px !important;
        min-height: 44px !important;
    }
    .hhs-style-hhs .fc-toolbar-title {
        font-size: 15px !important;
        letter-spacing: 0.5px !important;
    }

    /* List view compact on phone */
    .hhs-style-hhs .fc-list {
        border-radius: 0;
    }
    .hhs-style-hhs .fc-list-day-cushion {
        font-size: 12px;
        padding: 8px 12px;
    }
    .hhs-style-hhs .fc-list-event td {
        padding: 10px 12px;
    }
    .hhs-style-hhs .fc-list-event-time {
        font-size: 11px;
        width: auto;
    }
    .hhs-style-hhs .fc-list-event-title {
        font-size: 14px;
    }

    /* Legend compact */
    .hhs-scheduler-calendar-legend {
        gap: 8px;
        padding: 8px 10px;
        font-size: 11px;
    }
    .hhs-scheduler-legend-dot {
        width: 10px;
        height: 10px;
    }

    /* Default style */
    .hhs-style-default .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .hhs-scheduler-calendar-filter {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Detail card compact */
    .hhs-detail-title {
        font-size: 16px;
        margin-right: 50px;
    }
    .hhs-detail-label,
    .hhs-detail-value {
        font-size: 13px;
    }
    .hhs-detail-row {
        padding: 6px 0;
    }
    .hhs-detail-schedule {
        font-size: 14px;
    }

    /* Prevent horizontal overflow. 100vw includes the scrollbar on some
       mobile browsers which causes the wrap to extend past the viewport. */
    .hhs-scheduler-calendar-wrap {
        max-width: 100%;
        padding: 0 10px;
        overflow-x: clip;
    }
    .hhs-style-hhs #hhs-fullcalendar {
        border-radius: 0;
    }

    /* Filters row stacked on phone */
    .hhs-cal-filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .hhs-cal-term-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .hhs-cal-term-filter .hhs-scheduler-filter-select {
        width: 100%;
    }

    /* Modal full-width on phone */
    .hhs-scheduler-modal-checkout {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
        padding: 16px;
    }
    .hhs-scheduler-modal-overlay {
        align-items: flex-start;
    }
}

/* ===== Responsive — Very Small Phone ===== */
@media (max-width: 400px) {
    .hhs-cal-title {
        font-size: 14px;
    }
    .hhs-cal-campus-toggles {
        gap: 4px;
    }
    .hhs-cal-campus-toggle {
        font-size: 8px;
        padding: 5px 8px;
    }
    .hhs-style-hhs .fc-toolbar-title {
        font-size: 13px !important;
    }
    .hhs-style-hhs .fc-hhsPrev-button,
    .hhs-style-hhs .fc-hhsNext-button {
        padding: 7px 12px !important;
        font-size: 9px !important;
    }
}

/* ===== Landscape phone ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hhs-cal-top-bar {
        margin-bottom: 8px;
    }
    .hhs-cal-title {
        font-size: 16px;
    }
    .hhs-cal-campus-toggles {
        margin-bottom: 10px;
        gap: 5px;
    }
    .hhs-cal-campus-toggle {
        padding: 6px 12px;
        font-size: 10px;
        min-height: 36px;
    }
    .hhs-cal-filters-row {
        margin-bottom: 8px;
    }
    .hhs-scheduler-calendar-legend {
        padding: 6px 10px;
        font-size: 11px;
        margin-bottom: 8px;
    }
    .hhs-style-hhs .fc-toolbar {
        padding: 10px 14px !important;
    }
    .hhs-style-hhs .fc-daygrid-day {
        min-height: 70px;
    }
    .hhs-style-hhs .fc-daygrid-day-frame {
        min-height: 70px;
    }
    .hhs-cal-event-title {
        font-size: 10px;
    }
    .hhs-cal-event-time {
        font-size: 8px;
    }
}

/* ===== Safe area for notched phones ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .hhs-scheduler-calendar-wrap {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ===== Divi ancestor clamp =====
   Divi sections/rows can render wider than the viewport on mobile when the
   page uses custom gutter/padding settings or the newer et_flex_ grid mode.
   When our calendar shortcode lives inside a Divi builder page, neutralize
   the ancestor widths and horizontal margins so the row/section cannot
   exceed the viewport. :has() is iOS Safari 15.4+; a JS fallback in
   campus-calendar.js handles older browsers. */
@media (max-width: 768px) {
    .et_pb_section:has(.hhs-scheduler-calendar-wrap),
    .et_pb_row:has(.hhs-scheduler-calendar-wrap),
    .et_pb_column:has(.hhs-scheduler-calendar-wrap),
    .et_pb_code:has(.hhs-scheduler-calendar-wrap),
    .et_pb_code_inner:has(.hhs-scheduler-calendar-wrap) {
        max-width: 100% !important;
        width: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }
}
