* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #000000;
    --secondary-color: #333333;
    --accent-color: #666666;
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #e0e0e0;
    --hover-color: #f5f5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Navigation */
nav {
    background-color: var(--secondary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav .container {
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s, background-color 0.2s;
    padding: 0.35em 0.75em;
    border-radius: 6px;
    display: inline-block;
    min-height: 1.4em;
    box-sizing: border-box;
}

nav a:hover {
    opacity: 0.8;
}

nav a.nav-highlight {
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

nav a.nav-highlight:hover {
    background-color: rgba(255, 255, 255, 0.28);
    opacity: 1;
}

/* Kalender-Link verschmilzt mit Dropdown, wenn offen */
nav a.nav-calendar-toggle.is-open {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    -moz-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom-color: transparent;
    border-radius: 6px 6px 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Kalender-Dropdown – schwebt über dem Seiteninhalt, dahinter wird Inhalt geblurt */
.calendar-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    -moz-backdrop-filter: blur(14px);
    isolation: isolate;
    border-radius: 0 0 12px 12px;
    z-index: 50;
}

.calendar-dropdown.is-open {
    display: block;
    margin-top: 0;
}

.calendar-dropdown[aria-hidden="false"] {
    display: block;
}

.calendar-dropdown[aria-hidden="true"] {
    display: none;
}

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

.calendar-month-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.calendar-prev,
.calendar-next {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 6px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.calendar-prev:hover,
.calendar-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-width: 560px;
    margin: 0 auto;
}

.calendar-weekday {
    padding: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.calendar-day {
    aspect-ratio: 1;
    min-height: 48px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day-num {
    position: absolute;
    top: 0.25rem;
    left: 0.35rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.calendar-day-count,
.calendar-day-link {
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
}

.calendar-day-link {
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
}

.calendar-day-link:hover {
    text-decoration: underline;
    color: rgba(255, 255, 255, 0.95);
}

/* Main Content */
main {
    padding: 3rem 0;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--accent-color);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Events Grid */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.event-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    /* Beim Scrollen (z. B. aus Kalender) Platz für sticky Nav lassen */
    scroll-margin-top: 5.5rem;
}

.event-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--hover-color);
    position: relative;
}

/* Glas-Look (Blur, 50 % Opazität, Linseneffekt) für alle Overlays über dem Bild */
.event-image-container .event-date-badges {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-image-container .event-date-badge {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.event-image-container .event-time-overlay {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    -moz-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.event-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1.5rem;
}

.event-card:not(:has(.event-image-container)) .event-header {
    padding-top: 1.5rem;
}

.event-date-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 60px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-day {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    display: block;
}

.event-month {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.9;
    margin-top: 0.25rem;
    display: block;
}

.event-date-time {
    flex: 1;
}

.event-date {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.event-time {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.event-title-wrap {
    overflow: hidden;
    padding: 1.5rem 1.5rem 0 1.5rem;
    margin-bottom: 0.75rem;
    /* Weiche Ränder links und rechts: unsichtbar 0–0.5rem, Übergang 0.5–1.5rem, sichtbar, dann rechts 1.5–0.5rem vor Ende ausblenden */
    -webkit-mask-image: linear-gradient(to right, transparent 0, transparent 0.5rem, black 1.5rem, black calc(100% - 1.5rem), transparent calc(100% - 0.5rem), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, transparent 0.5rem, black 1.5rem, black calc(100% - 1.5rem), transparent calc(100% - 0.5rem), transparent 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

.event-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin: 0;
    color: var(--primary-color);
    line-height: 1.3;
    white-space: nowrap;
}

.event-title-text {
    display: inline-block;
    min-width: 100%;
}

.event-title-wrap.scroll-title .event-title-text {
    min-width: auto;
    /* Animation per JS (Web Animations API) für korrektes Scroll-Ende */
}

.event-description {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
}

.event-location {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-group {
    font-size: 0.85rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-icon {
    font-size: 1rem;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 1.5rem;
}

.group-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
}

.tag {
    background-color: var(--hover-color);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-weight: 500;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: var(--border-color);
}

.no-events {
    text-align: center;
    color: var(--accent-color);
    font-style: italic;
    padding: 2rem;
}

/* Groups Grid */
.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.group-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.group-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.group-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.group-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1.3;
}

.group-badge {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-family: monospace;
}

.group-stats {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.group-event-count {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 500;
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-content p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-color);
}

/* Weiteres Section & Button */
.weiteres-section {
    margin-bottom: 4rem;
}

.btn-weiteres {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: opacity 0.3s, transform 0.2s;
}

.btn-weiteres:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .events-grid,
    .groups-grid {
        grid-template-columns: 1fr;
    }

    nav ul {
        gap: 1rem;
    }

    /* Bei zweizeiliger Nav mehr Abstand, damit Karten beim Kalender-Scroll nicht dahinter verschwinden */
    .event-card {
        scroll-margin-top: 10.5rem;
    }
}

@media (max-width: 992px) {
    .event-card {
        scroll-margin-top: 8rem;
    }
}
