/* ============================================================
   JEvents Theme: Feuerwehr Tarmstedt
   Monatsansicht (month.calendar.php + month.listevents.php)
   ============================================================ */

/* ---------- Wrapper ---------- */
.fw-month {
    font-family: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    color: #1a1a1a;
    max-width: 1200px;
    margin: 1.5rem auto 0;
}

/* ---------- Navigation / Header ---------- */
.fw-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    gap: 12px;
}

.fw-month-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    text-align: center;
}

.fw-nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #555;
    text-decoration: none;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.fw-nav-arrow:hover {
    background: #990000;
    border-color: #990000;
    color: #fff;
}

.fw-nav-today {
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.fw-nav-today:hover {
    background: #f5f5f5;
}

/* ---------- View-Switcher ---------- */
.fw-view-switch {
    display: flex;
    gap: 4px;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 3px;
    margin-bottom: 1.25rem;
    width: fit-content;
}

.fw-view-switch a {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 16px;
    text-decoration: none;
    color: #888;
    transition: background 0.15s, color 0.15s;
}

.fw-view-switch a.active,
.fw-view-switch a:hover {
    background: #fff;
    color: #990000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---------- Kalender-Gitter ---------- */
.fw-cal-grid {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Wochentagsköpfe */
.fw-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #990000;
}

.fw-cal-wday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 10px 4px;
}

/* Wochen-Zeilen */
.fw-cal-body {
    display: grid;
    grid-template-rows: auto;
}

.fw-cal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid #f0f0f0;
}

.fw-cal-week:last-child {
    border-bottom: none;
}

/* Einzelne Zellen */
.fw-cal-day {
    min-height: 90px;
    padding: 6px 6px 4px;
    border-right: 1px solid #f0f0f0;
    vertical-align: top;
    position: relative;
}

.fw-cal-day:last-child {
    border-right: none;
}

.fw-cal-day.fw-other-month {
    background: #fafafa;
}

.fw-cal-day.fw-other-month .fw-day-num {
    color: #ccc;
}

.fw-cal-day.fw-today {
    background: #fff8f8;
}

.fw-cal-day.fw-today .fw-day-num {
    background: #990000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fw-cal-day.fw-weekend .fw-day-num {
    color: #990000;
}

.fw-cal-day.fw-today.fw-weekend .fw-day-num {
    color: #fff;
}

/* Tageszahl */
.fw-day-num {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Termin-Pill in der Zelle */
.fw-event-pill {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #990000;
    border-radius: 4px;
    padding: 2px 5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    line-height: 1.5;
    transition: opacity 0.15s;
}

.fw-event-pill:hover {
    opacity: 0.85;
    color: #fff;
}

/* "+N mehr" Link */
.fw-more-link {
    font-size: 10px;
    color: #aaa;
    text-decoration: none;
    padding: 1px 3px;
}

.fw-more-link:hover {
    color: #990000;
}

/* ---------- Legende ---------- */
.fw-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0.75rem 0 1.25rem;
}

.fw-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #555;
}

.fw-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ---------- Mobile Liste (Desktop: versteckt) ---------- */
.fw-mobile-list {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .fw-month {
        margin-top: 0.75rem;
    }

    .fw-month-title {
        font-size: 17px;
    }

    .fw-nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .fw-nav-today {
        display: none;
    }

    /* Grid + Legende auf Mobil ausblenden */
    .fw-cal-grid,
    .fw-legend {
        display: none;
    }

    /* Listenansicht einblenden */
    .fw-mobile-list {
        display: block;
    }

    .fw-mlist-day {
        border-bottom: 1px solid #eee;
        padding: 12px 0;
    }

    .fw-mlist-day:last-child {
        border-bottom: none;
    }

    .fw-mlist-today {
        background: #fdf5f5;
        margin: 0 -12px;
        padding: 12px 12px;
        border-radius: 8px;
    }

    .fw-mlist-date {
        display: flex;
        align-items: baseline;
        gap: 6px;
        margin-bottom: 8px;
    }

    .fw-mlist-weekday {
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #888;
    }

    .fw-mlist-daynum {
        font-size: 14px;
        font-weight: 700;
        color: #1a1a1a;
    }

    .fw-mlist-today .fw-mlist-daynum {
        color: #990000;
    }

    .fw-mlist-event {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        margin: 4px 0;
        background: #fff;
        border-radius: 8px;
        border: 1px solid #eee;
        text-decoration: none;
        transition: box-shadow 0.15s;
    }

    .fw-mlist-event:hover,
    .fw-mlist-event:active {
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .fw-mlist-color {
        width: 5px;
        min-height: 28px;
        border-radius: 3px;
        flex-shrink: 0;
    }

    .fw-mlist-info {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }

    .fw-mlist-title {
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fw-mlist-time {
        font-size: 12px;
        color: #888;
    }
}
