/* ============================================
   SHARED CALENDAR PAGE LAYOUT
   Used by both events-calendar.html and net-calendar.html: the wide
   container, the List/Calendar view toggle, the month-grid calendar, and
   list-view pagination. Page-specific card content (what a list item
   actually shows) lives in each page's own stylesheet.
   ============================================ */

/* Wider than the standard .container — the month grid wants more room than
   a text-focused page does. */
.container-wide {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Title stays centered across the full row (untouched by the toggle's
   presence) — the toggle floats at the right edge instead of sharing a
   flex row with it, which would pull the title off-center. */
.toggle-page-header {
    position: relative;
    margin-bottom: 2rem;
}

.toggle-page-header .section-header {
    margin-bottom: 0;
}

.view-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 0.75rem;
}

@media screen and (max-width: 700px) {
    .toggle-page-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .view-toggle {
        position: static;
        transform: none;
    }
}

.view-toggle-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--color-red);
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-red);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.view-toggle-btn.is-active {
    background: var(--color-red);
    color: var(--color-white);
}

/* -- Month-grid calendar -- */

.calendar-nav-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.calendar-nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-red);
    border-radius: 50%;
    background: var(--color-white);
    color: var(--color-red);
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.calendar-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.calendar-nav-btn:disabled:hover {
    background: var(--color-white);
    color: var(--color-red);
}

.calendar-nav-btn:hover {
    background: var(--color-red);
    color: var(--color-white);
}

.calendar-month-label {
    min-width: 200px;
    text-align: center;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background: var(--border-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.calendar-day-header {
    padding: 0.5rem;
    text-align: center;
    background: var(--color-gold-light);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-height: 140px;
    padding: 0.5rem;
    background: var(--color-white);
}

.calendar-day.is-empty {
    background: var(--color-cream);
}

/* Days with entries are the same background as any other day — the day's
   content shows the actual entries, so a tinted background to flag
   "there's something here" would just be redundant. */
.calendar-day.has-events {
    cursor: pointer;
    transition: background 0.2s ease;
}

.calendar-day.has-events:hover {
    background: var(--color-cream);
}

/* Today gets its own colour so it stands out regardless of whether it has
   anything scheduled. */
.calendar-day.is-today {
    background: rgba(246, 189, 80, 0.25);
}

.calendar-day.is-today:hover {
    background: rgba(246, 189, 80, 0.4);
}

.calendar-day.is-today .calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-red);
    color: var(--color-white);
}

/* Already-elapsed days (including every day of an entirely past month) are
   greyed out to visually separate them from what's still upcoming. */
.calendar-day.is-past {
    background: var(--color-cream);
    opacity: 0.55;
}

.calendar-day.is-past.has-events:hover {
    background: var(--color-cream);
}

.calendar-day-number {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.calendar-day-chips {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow: hidden;
}

.calendar-day-chip {
    display: block;
    padding: 0.25rem 0.5rem;
    background: var(--color-gold-light);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-day-chip-more {
    background: none;
    color: var(--text-secondary);
    font-weight: 700;
}

@media screen and (max-width: 480px) {
    .calendar-day {
        min-height: 100px;
    }

    .calendar-day-chip {
        font-size: 0.78rem;
    }
}

/* The "which entry on this day?" list inside the shared calendar detail
   modal (header.js's openDayEventsModal) — clicking a row swaps the same
   modal over to that entry's full detail. */
.calendar-day-event-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.calendar-day-event-row:last-child {
    border-bottom: none;
}

.calendar-day-event-row:hover .calendar-day-event-title {
    color: var(--color-red);
}

.calendar-day-event-time {
    flex-shrink: 0;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.calendar-day-event-title {
    color: var(--text-primary);
    font-weight: 600;
    transition: color 0.2s ease;
}

/* -- List view pagination -- */

.list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.list-pagination-link {
    padding: 0.6rem 1.25rem;
    border: 2px solid var(--color-red);
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-red);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.list-pagination-link:hover {
    background: var(--color-red);
    color: var(--color-white);
}

.list-pagination-link.is-disabled {
    opacity: 0.4;
}

.list-pagination-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}
