.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 12px;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.weekdays {
    display: contents;
}

.weekday {
    background-color: #2e2e2e;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    font-size: 16px;
}

.day {
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-height: 100px;
    padding: 10px;
    font-size: 14px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

.day.empty {
    background: transparent;
    border: none;
    box-shadow: none;
}

.event {
    background-color: #e1ecf4;
    color: #333;
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 12px;
    margin-top: 6px;
    transition: background 0.3s;
    border-left: 4px solid #007BFF;
}

.event:hover {
    background-color: #d2e4f1;
}

.month-navigation {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem auto;
}

.month-navigation a {
    padding: 8px 16px;
    background-color: #333;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s;
}

.month-navigation a:hover {
    background-color: #555;
}

form fieldset {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    background-color: #333;
    color: white;
    padding: 1rem;
    border-radius: 10px;
    border: none;
    max-width: 900px;
    margin: 1rem auto;
}

form label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 16px;
}

form button {
    padding: 8px 16px;
    background-color: #007BFF;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
}

form button:hover {
    background-color: #0056b3;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
    margin: auto;
    padding: 1rem;
}

.weekday {
    text-align: center;
    font-weight: bold;
    background-color: #3d3d3d;
    padding: 0.5rem 0;
    flex-wrap: wrap;
    border-bottom: 1px solid #ccc;
}

.day {
    min-height: 80px;
        padding: 0 10px; /* Added padding for better responsiveness */
    padding: 0.5rem;
    border: 1px solid #ccc;
    background-color: #fefefe;
}

.day.empty {
    background-color: transparent;
    border: none;
}

.event {
    margin-top: 0.25rem;
    font-size: 0.9em;
    background: #ffd;
    padding: 0.2rem;
    border-radius: 4px;
}

.day {
    height: 70px; /* alle gleich hoch */
    overflow: hidden;
    position: relative;
}

.event {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    color: #000;
    text-decoration: none;
}

.event:hover {
    text-decoration: underline;
}

/* Farben pro Kategorie */
.event[data-category="Aktive"]     { border-left: 4px solid red; }
.event[data-category="Atemschutz"] { border-left: 4px solid gold; }
.event[data-category="Verein"]     { border-left: 4px solid blue; }
.event[data-category="Jugend"]     { border-left: 4px solid orange; }

.calendar-heading {
    scroll-margin-top: 140px;
}

.calendar-list {
    display: none;
    max-width: 800px;
    margin: 1rem auto 2rem;
    padding: 0 1rem;
}

.calendar-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.calendar-list-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.calendar-list-link {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem 1rem;
    text-decoration: none;
    color: #111;
}

.calendar-list-date {
    font-weight: 700;
    color: #b91c1c;
}

.calendar-list-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.calendar-list-meta {
    font-size: 0.95rem;
    color: #444;
}

.calendar-list-category {
    display: inline-block;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111;
    width: fit-content;
}

.calendar-list-empty {
    text-align: center;
    color: #555;
}

@media (max-width: 700px) {
    .calendar {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-grid {
        display: none;
    }

    .calendar-list {
        display: block;
    }
}

@media (max-width: 500px) {
    .calendar {
        grid-template-columns: 1fr;
    }
}
