/**
 * Calendar Module Stylesheet
 * --------------------------
 * This stylesheet defines the layout and visual appearance of the custom
 * event calendar module. It includes:
 * - Base layout for month view
 * - Weekday headers and week numbers
 * - Event list styling
 * - Category-based color coding
 * - Responsive behavior for mobile devices
 *
 * Author: Johan + Copilot
 * File: child-module-event-listing-calendar.css
 */

/* Wrapper */
.storstugan-calendar {
    width: 100%;
    margin: 20px 0;
}

/* Header with month navigation */
.calendar-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    font-size: var( --fs-h5 );
}

.calendar-header .nav {
    padding: 0 15px;
}

/* Weekday header row */
.calendar-weekdays {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    margin-bottom: 5px;
    font-size: var( --fs-h6 );
}

.weeknum-title {
    text-align: center;
    font-size: var( --fs-h6 );
}

.weekday {
    text-align: center;
}

/* Calendar grid (8 columns: week number + 7 days) */
.calendar-grid {
    display: grid;
    grid-template-columns: 50px repeat(7, 1fr);
    gap: 6px;
}

/* Week number column */
.weeknum {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var( --fs-small );
    font-weight: bold;
    background: var( --lightGrey );
    border: 1px solid #ddd;
}

/* Day cells */
.calendar-cell {
    border: 1px solid #ddd;
    min-height: 100px;
    padding: 6px;
    background: #fafafa;
    position: relative;
}

.day-number {
    font-size: var( --fs-small );
    font-weight: bold;
    margin-bottom: 4px;
}

/* Event list */
.event-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-list li {
    font-size: var( --fs-small );
    margin-bottom: 3px;
}

.event-list a {
    text-decoration: none;
    color: #333;
}

.event-list .time {
    color: #777;
    font-size: var( --size-10 );
    margin-left: 4px;
}

/* ---------------------------------------------------
   CATEGORY COLOR CODING
   ---------------------------------------------------
   Add category slugs here. Example:
   .event-category-konsert
   .event-category-mote
   .event-category-barn
   --------------------------------------------------- */

.event-list li.event-category-foreningen a {
    color: #b30000;
    font-weight: 600;
}

.event-list li.event-category-styrelsen a {
    color: #0055aa;
    font-weight: 600;
}

.event-list li.event-category-studie-och-fritid a {
    color: #008800;
    font-weight: 600;
}

/* Generic fallback for unknown categories */
.event-list li[class^="event-category-"] a {
    border-left: 3px solid #ccc;
    padding-left: 4px;
}

/* ---------------------------------------------------
   RESPONSIVE BEHAVIOR
   --------------------------------------------------- */

/* Tablet */
@media (max-width: 900px) {
    .calendar-grid {
        grid-template-columns: 40px repeat(7, 1fr);
    }
    .calendar-weekdays {
        grid-template-columns: 40px repeat(7, 1fr);
    }
}

/* Mobile: show one week per row */
@media (max-width: 600px) {

    .calendar-weekdays {
        display: none; /* Hide weekday header on mobile */
    }

    .calendar-grid {
        grid-template-columns: 1fr; /* One column */
    }

    .weeknum {
        display: none; /* Hide week numbers on mobile */
    }

    .calendar-cell {
        min-height: auto;
        padding: 10px;
        border-left: 4px solid #ddd;
    }

    .day-number {
        font-size: 18px;
        margin-bottom: 6px;
    }
}
