html {
    background-color: #ab3826;
    min-height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, sans-serif;
    margin: 0;
    min-height: 100%;
}

body.no-scroll,
html.no-scroll {
    overflow: hidden;
    height: 100vh;
}

a {
    text-decoration: none;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-flow: column nowrap;
    background-color: #fff;
    overflow-x: hidden;
}

/* Den Header als Flexbox ausrichten */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #ab3826;
    height: 70px;
    position: sticky;
    top: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 1002;
    /* Über dem Menü-Overlay */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.logo {
    z-index: 1002;
}

/* Logo skalieren */
.logo img {
    height: 80px;
    margin: 1vh;
}

/* --- NAVIGATION & HEADER --- */

/* Basis-Stile für die Menüleiste */
.menubar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-grow: 1;
    height: 100%;
    margin: 1vh;
    align-content: center;
}

/* Gemeinsame Stile für Links und den Dropdown-Auslöser */
.menubar a,
.dropdown-trigger {
    color: white;
    font-weight: 400;
    font-size: 20pt;
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.2s;
    margin: 0 3%;
    height: 100%;
}

.menubar a:hover,
.dropdown-trigger:hover {
    opacity: 0.8;
}

/* Dropdown Grundstruktur */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
    text-wrap: nowrap;
    margin: 0 3%;
    height: 100%;
}

.arrow {
    font-size: 0.6em;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s;
}

/* Dropdown-Inhalt (Desktop Default) */
.dropdown-content {
    display: block;
    /* Wir brauchen Block, damit die Transition greift */
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 85px;
    /* Startet etwas tiefer für den Slide-Up Effekt */
    left: 50%;
    transform: translateX(-50%);
    background-color: #ab3826;
    min-width: 240px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 1010;
    border-radius: 0 0 4px 4px;

    transition: opacity 0.3s ease, top 0.3s ease, visibility 0.3s;
}

.dropdown-content a {
    color: white !important;
    padding: 15px 20px !important;
    font-size: 14pt !important;
    display: block !important;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0 !important;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

/* Desktop-Spezifisch (ab 769px) */
@media (min-width: 769px) {
    .dropdown:hover .dropdown-content {
        visibility: visible;
        opacity: 1;
        top: 70px;
        /* Slidet hoch an den Header */
    }

    .dropdown {
        height: 70px;
    }
}

/* --- HAMBURGER BUTTON --- */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    z-index: 1003;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #fff;
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* --- MOBILE NAVIGATION (bis 768px) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .menubar {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #ab3826;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 1001;
        transition: left 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
        margin: 0;
        /* Schiebt die zentrierten flex-Inhalte nach oben */
        overflow-y: auto;
        overflow-x: hidden;
        gap: 0;
    }

    .menubar.active {
        left: 0;
    }

    /* Animation für das Reinsliden der Links & Dropdown */
    .menubar a,
    .menubar .dropdown {
        font-size: 2rem;
        margin: 8px 0;
        padding: 5px 0;
        height: auto;
        /* Überschreibt height: 100% vom Desktop */
        text-transform: uppercase;
        font-weight: 900;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.4s ease-out;
        width: 100%;
        justify-content: center;
    }

    .menubar.active a,
    .menubar.active .dropdown {
        opacity: 1;
        transform: translateY(0);
    }

    /* Gestaffeltes Einblenden - nur Top-Level Items! */
    .menubar.active>a:nth-child(1) {
        transition-delay: 0.1s;
    }

    .menubar.active>a:nth-child(2) {
        transition-delay: 0.2s;
    }

    .menubar.active>.dropdown {
        transition-delay: 0.3s;
    }

    .menubar.active>a:nth-child(4) {
        transition-delay: 0.4s;
    }

    /* Mobiles Dropdown-Akkordeon */
    .dropdown {
        flex-direction: column;
        height: auto;
    }

    .dropdown-trigger {
        font-size: 2rem !important;
        font-weight: 900 !important;
        margin: 0 !important;
        height: auto !important;
        padding: 5px 0 !important;
    }

    .dropdown-content {
        position: static;
        transform: none;
        width: calc(100% - 20px);
        background: transparent;
        box-shadow: none;
        display: block;
        /* Für max-height Animation */
        max-height: 0;
        overflow: hidden;
        margin: 0 0 0 20px;
        /* Expliziter Basis-Margin für sanfte Animation */
        transition:
            max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            margin 0.4s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.4s ease-in-out;
        border-radius: 0;
        border-left: 2px solid rgba(255, 255, 255, 0.2);
    }

    .dropdown-content.show {
        visibility: visible;
        opacity: 1;
        /* Wird jetzt via JS (inline) gesetzt für exaktes Timing */
        margin: 10px 0 10px 20px;
    }

    .dropdown-content a {
        font-size: 1.3rem !important;
        opacity: 1 !important;
        transform: none !important;
        padding: 12px 0 !important;
        height: auto !important;
        text-transform: none;
        /* Unterpunkte nicht ganz so laut schreien lassen */
    }

    /* Synchronisierte Pfeil-Aktion */
    .arrow {
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    .dropdown.open .arrow {
        transform: rotate(180deg);
    }
}

.content {
    flex-grow: 1;
}

.current-play {
    height: 60vh;
    /* Oder fest 500px */
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-play-overlay {
    padding: 20px 40px;
    text-align: center;
    text-shadow: black 0px 0px 15px;
}

.current-play h1 {
    color: white;
    font-size: 48px;
    text-transform: uppercase;
    margin: 0;
    font-weight: 900;
}

.next-event {
    display: flex;
    justify-content: center;
}

.reservix-next-event-box {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 12px;
    /* Etwas runder für den modernen Look */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin: 40px 0;
    align-items: stretch;
    /* Sorgt dafür, dass beide Spalten gleich hoch sind */
    max-width: 1600px;
}

.next-event-image-wrapper {
    flex: 1;
    min-width: 350px;
    /* Etwas breiterer Anker */
    display: flex;
}

.next-event-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Falls das Bild zu unruhig ist, kann man hier einen leichten Overlay drüberlegen */
}

.next-event-content {
    flex: 1.2;
    padding: 40px;
    /* Mehr "Air" zum Atmen */
    min-width: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Vertikale Zentrierung des Inhalts zum Bild */
    text-align: left;
}

.event-meta {
    color: #ab3826;
    font-weight: 800;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.event-title {
    margin: 0 0 20px 0;
    font-size: 2.2em;
    line-height: 1.1;
    color: #222;
}

.event-promo {
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #555;
}

.ticket-button {
    display: inline-block;
    width: fit-content;
    /* Verhindert, dass der Button die volle Breite nimmt */
    background: #ab3826;
    color: #fff;
    padding: 15px 35px;
    text-decoration: none;
    font-weight: 900;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(171, 56, 38, 0.3);
}

.ticket-button:hover {
    background: #8e2e1f;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(171, 56, 38, 0.4);
}

/* Mobile Fix */
@media (max-width: 768px) {
    .next-event-image-wrapper {
        min-width: 100%;
        height: 250px;
        /* Festgelegte Höhe für Mobile damit es nicht zu lang wird */
    }

    .next-event-content {
        padding: 30px 20px;
        text-align: center;
        align-items: center;
        /* Button auf Mobile mittig */
    }

    .ticket-button {
        align-self: center;
    }
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 0 auto 40px auto;
    /* 40px Abstand oben/unten, auto zentriert */
    max-width: 1600px;
    width: 95%;
    /* Fallback für Browser, die fill-available nicht mögen */
    width: -webkit-fill-available;
    width: stretch;
    /* Der zukünftige Standard */
    justify-content: center;
}

.action-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Gleicher Schatten wie Next-Event */
    overflow: hidden;
    display: flex;
    transition: transform 0.3s ease;
    flex-direction: row;
    min-height: 300px;
    justify-content: center;
}

.action-card:hover {
    transform: translateY(-5px);
    /* Minimaler Schwebe-Effekt */
}

.card-image-side {
    flex: 1;
    overflow: hidden;
    border-right: 1px solid #eee;
}

.card-image-side img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Newsletter-Box braucht kein Bild, daher dort den Content zentrieren */
.newsletter-card-new .card-content {
    text-align: center;
    align-items: center;
}

@media (max-width: 1100px) {
    .action-card {
        flex-direction: column;
        /* Bild oben, Text unten auf kleineren Screens */
    }

    .card-image-side {
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

.card-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-meta {
    color: #ab3826;
    font-weight: 800;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.action-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.8em;
}

.card-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Sekundärer Button-Style für die Anfahrt */
.secondary-btn {
    background: #444 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.secondary-btn:hover {
    background: #222 !important;
}

/* Mobile: Untereinander stapeln */
@media (max-width: 850px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .card-form {
        flex-direction: column;
    }
}

/* Anpassung des Newsletter-Buttons an die .standard-input (45px) */
.card-form .ticket-button {
    height: 45px;
    padding: 0 25px;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    cursor: pointer;
}

/* Programmseite */

.month-divider {
    background: #f4f4f4;
    padding: 10px 20px;
    border-left: 5px solid #ab3826;
    margin: 40px 0 20px 0;
}

.program-item {
    display: flex;
    gap: 30px;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.program-media {
    flex: 0 0 30%;
}

.program-media img {
    width: 100%;
    border-radius: 4px;
}

.program-text {
    flex: 0 0 45%;
}

.program-text h3 {
    color: #ab3826;
    margin-top: 0;
}

.program-calendar {
    flex: 0 0 25%;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

.date-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
}

/* Responsive Anpassung */
@media (max-width: 900px) {
    .program-entry {
        flex-direction: column !important;
    }

    .p-image,
    .p-info,
    .p-dates {
        width: 100%;
    }

    .p-image,
    .p-info {
        flex: 0 0 100% !important;
    }
}


/* Stück-Details Seite */

.stueck-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    /* Bild etwas schmaler als Text */
    gap: 50px;
    margin-top: 20px;
}

.stueck-info h1 {
    font-size: 3.5rem;
    color: #ab3826;
    margin: 10px 0 30px 0;
    line-height: 1;
}

.description-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
}

.cast-section {
    padding: 30px;
    background: #fdfdfd;
}

.member-link {
    color: #ab3826;
    font-weight: 600;
}

.member-link:hover {
    text-decoration: underline;
}

.detail-badge {
    margin-top: 15px;
    color: white;
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: bold;
    margin-right: 10px;
}

.detail-badge.premiere {
    background: #444;
}

.detail-badge.gastspiel {
    background: #ab3826;
}

.action-buttons {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .stueck-detail-grid {
        grid-template-columns: 1fr;
    }

    .stueck-info h1 {
        font-size: 2.5rem;
    }
}


/* Wir Seite */

/* Ensemble / Wir Seite */
.ensemble-container {
    max-width: 100vw;
    margin: 40px;
    padding: 0 20px 20px 20px;
}

@media (max-width: 768px) {
    .ensemble-container {
        margin: 10px 10px 40px 10px;
    }
}

.ensemble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 30px;
    align-items: start;
    margin-top: 20px;
    justify-content: center;
}

.member-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0;
    /* Padding moved to inner elements */
    text-align: center;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-card.is-link {
    cursor: pointer;
    padding-top: 12px;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-top-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 25px 0px;
    width: 100%;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.member-card:not(.is-link) .card-top-link:hover {
    background-color: #fcfcfc;
}

/* .member-card.is-link .member-img,
.member-card.is-link .member-name,
.member-card.is-link .member-bio {
    /* If the whole card is a link, we don't need inner hovers */
/* }

/* Base padding for cards without top-link wrapper */
.member-card>.member-img {
    margin-top: 13px;
}

.member-card>.member-name {
    margin-top: 10px;
    margin-block-start: 1em;
}

.member-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #ab3826;
    padding: 3px;
}

.member-name {
    color: #ab3826;
    margin-bottom: 10px;
    font-size: 1.4rem;
}

.member-bio {
    font-size: 0.9rem;
    margin: 0 0 10px;
    font-style: italic;
    line-height: 1.4;
    color: #555;
    width: 100%;
}

/* Fallback Padding für Karten ohne card-top-link (z.B. Vorstand) */
.member-card>.member-bio {
    padding: 0 25px;
    box-sizing: border-box;
}

.member-history {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    border-top: 1px solid #eee;
    padding: 15px 25px 25px;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
    /* Push to bottom */
}

.member-history.is-toggle {
    cursor: pointer;
    transition: background-color 0.2s;
}

.member-history.is-toggle:hover {
    background-color: #f9f9f9;
}

.history-label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    font-weight: bold;
}

.hidden-history {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    /* Leichter Slide-Effekt von oben */
    transition:
        max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease-in-out,
        transform 0.4s ease-in-out;
}

.hidden-history.open {
    opacity: 1;
    transform: translateY(0);
    transition:
        max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.4s ease-in-out,
        transform 0.4s ease-in-out;
}

/* Der Button-Stil */
.show-more-btn {
    background: none;
    border: none;
    color: #ab3826;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 0;
    text-decoration: underline;
    transition: color 0.2s;
}

.show-more-btn:hover {
    color: #333;
}

.section-divider {
    text-align: center;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ab3826;
    color: #ab3826;
    text-transform: uppercase;
}

.board-highlight {
    border: 2px solid #ab3826;
    /* Roter Rahmen für Vorstände */
    background: #fffcfc;
}

.board-role-tag {
    background: #ab3826;
    color: white;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}



.footer {
    background-color: #ab3826;
    padding: 30px 0;
    display: flex;
    flex-direction: column;
    /* Reihen übereinander */
    align-items: center;
    gap: 20px;
    width: 100%;
    box-shadow: top inset rgba(0, 0, 0, 0.3) 0px 0px 20px;
}

/* Social Icons Styling */
.social-row {
    display: flex;
    gap: 25px;
}

.social-row svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.2s ease;
}

.social-row a:hover svg {
    transform: scale(1.2);
    stroke: #ffcccc;
    /* Dezenter Glow-Effekt */
}

/* Legal Links Styling */
.legal-row {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.legal-row a {
    color: white;
    text-decoration: none;
    font-size: 11pt;
    opacity: 0.8;
}

.legal-row a:hover {
    opacity: 1;
}

/* DER HARTE BREAKPOINT */
@media (max-width: 768px) {
    .legal-row {
        flex-direction: column;
        /* Erst hier stapeln wir die Texte */
        align-items: center;
        gap: 12px;
    }

    .social-row {
        gap: 40px;
        /* Mehr Platz für Daumen auf dem Handy */
    }
}


/* --- MITMACHEN SEITE (Recycling vorhandener Klassen) --- */

.content-wrapper {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 20px;

    /* Das drückt den Footer nach ganz unten, egal wie hoch er ist */
    flex: 1 0 auto;

    /* Trotzdem ein kleiner Puffer, falls der Content extrem kurz ist */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Zentriert den Content vertikal, wenn kaum Text da ist */
}

.mitmachen-hero {
    text-align: center;
    margin-bottom: 50px;
}

.hero-text h1 {
    font-size: 3rem;
    color: #ab3826;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    font-weight: 900;
}

.lead-text {
    font-size: 1.25rem;
    color: #444;
    max-width: 850px;
    margin: 0 auto;
    line-height: 1.6;
}

.mitmachen-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

/* Info-Spalte */
.theater-list {
    list-style: none;
    padding: 0;
}

.theater-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 1.1rem;
}

.theater-list li:last-child {
    border-bottom: none;
}

.cta-note {
    background: #f9f9f9;
    padding: 25px;
    border-left: 5px solid #ab3826;
    margin-top: 30px;
    font-style: italic;
    line-height: 1.5;
}

/* Formular-Spalte (Nutzt deine .admin-box!) */
.contact-card {
    border-top: 5px solid #ab3826;
    /* Akzent wie bei den anderen Cards */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mitmachen-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Mobile Anpassung */
@media (max-width: 950px) {
    .mitmachen-grid {
        grid-template-columns: 1fr;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }
}



/* Admin Seite */

.admin-edit-overlay {
    position: relative;
    border: 2px dashed transparent;
    transition: 0.3s;
}

.admin-edit-overlay:hover {
    border-color: #ab3826;
}

/* Der schwebende Button für das Bild */
.img-edit-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(171, 56, 38, 0.9);
    color: white;
    padding: 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 3px;
}

/* Titel-Eingabefeld stylen wie die H1 */
.admin-title-input {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid #fff;
    color: white;
    font-size: 48px;
    text-align: center;
    width: 100%;
    text-transform: uppercase;
    font-weight: 900;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

/* Responsiver Wrapper für Tabellen */
.admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.admin-table th {
    background: #eee;
    padding: 12px;
    text-align: left;
    font-size: 0.9em;
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.table-thumb {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: block;
}

.table-thumb-placeholder {
    width: 45px;
    height: 45px;
    background: #f0f0f0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 20px;
}

.admin-btn-small {
    padding: 5px 10px;
    background: #555;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
}

.admin-btn-small:hover {
    background: #333;
}

.delete-link {
    background: none;
    border: none;
    color: #ab3826;
    cursor: pointer;
    font-weight: bold;
}

.table-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ccc;
    transition: transform 0.2s ease-in-out;
    /* Schöner flüssiger Übergang */
    cursor: zoom-in;
}

.table-thumb:hover {
    transform: scale(4);
    /* 4-fache Vergrößerung */
    position: relative;
    z-index: 10;
    /* Schwebt über dem Text */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    /* Ein bisschen Schatten für den Effekt */
}

/* Der Foto-Upload Button */
label[for="member_image"] {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

label[for="member_image"]:hover {
    background: #333 !important;
    /* Dunkleres Grau */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

label[for="member_image"]:active {
    transform: translateY(0);
}

/* Die Aktions-Buttons (Speichern, Löschen, Abbrechen) */
.admin-box button {
    transition: all 0.2s ease;
    border-radius: 4px;
}

#member-submit-btn:hover {
    background: #8e2e1f !important;
    /* Dunkleres Rot */
    filter: brightness(1.1);
}

#member-delete-btn:hover {
    background: #cc0000 !important;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

#member-reset-btn:hover {
    background: #444 !important;
}

#member-img-preview {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

#member-img-preview:hover {
    transform: scale(1.05);
    /* Minimales Pulsieren beim Drüberfahren */
}

/* --- Ensemble Admin UI --- */

.admin-flex-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.admin-flex-main {
    flex: 2;
}

.admin-flex-sidebar {
    flex: 1;
}

.image-upload-card {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #ddd;
    text-align: center;
}

.standard-input,
.standard-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.standard-textarea {
    height: 110px;
    margin-top: 5px;
}

.hidden-input {
    display: none;
}

.file-status {
    font-size: 0.7em;
    color: #999;
    margin-top: 5px;
    word-break: break-all;
}

.small-label {
    font-size: 0.75em;
    color: #666;
    margin-top: 5px;
}

.form-actions {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 15px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.checkbox-label {
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin-bottom: 5px;
}

/* Foto-Upload Button & Preview */
.upload-label {
    background: #555;
    color: white;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.upload-label:hover {
    background: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.member-preview-img {
    width: 100%;
    max-width: 120px;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #ab3826;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.member-preview-img:hover {
    transform: scale(1.05);
}

/* Simple card used for admin-like forms on public pages */
.admin-box {
    background: #fff;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    margin: 0;
    text-align: left;
}

/* Vorstands-Badge im Admin */
.board-settings-box {
    margin-top: 15px;
    background: #ddd;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #ab3826;
}

/* Buttons */

.btn-save {
    background: #ab3826;
    color: white;
}

.btn-save:hover {
    background: #8e2e1f;
    filter: brightness(1.1);
}

.btn-delete {
    background: #ff4444;
    color: white;
}

.btn-delete:hover {
    background: #cc0000;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.2);
}

.btn-cancel {
    background: #666;
    color: white;
}

.btn-cancel:hover {
    background: #444;
}

/* Rollen-Verwaltung Spezifisch */
.role-grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr auto;
    gap: 15px;
    align-items: end;
    /* Sorgt dafür, dass Labels oben und Inputs unten bündig sind */
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.role-actions {
    display: flex;
    gap: 10px;
    /* Keine zusätzliche Höhe hier, die Buttons regeln das über .admin-btn */
}

.status-message {
    margin-top: 10px;
    font-size: 0.9em;
    font-weight: bold;
    min-height: 1.2em;
}

/* Responsive Fix für kleinere Bildschirme */
@media (max-width: 900px) {
    .role-grid-form {
        grid-template-columns: 1fr;
    }

    .role-actions {
        flex-direction: column;
        width: 100%;
    }

    .role-actions button {
        width: 100%;
    }
}

/* --- Globale Formular-Standards --- */

/* Reset für Safari/Chrome & Einheitsgröße */
.standard-input,
select.standard-input,
.role-grid-form input,
.role-grid-form select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 45px;
    /* Feste Höhe für alles */
    padding: 10px 15px;
    font-size: 16px;
    /* Verhindert Auto-Zoom auf Mobile */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Custom Pfeil für Selects (da wir Safari-Standard gekillt haben) */
select.standard-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%3C333' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.standard-input:focus {
    border-color: #ab3826;
    outline: none;
    box-shadow: 0 0 0 3px rgba(171, 56, 38, 0.1);
}

/* Buttons auf die exakt gleiche Höhe zwingen */
.admin-btn {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 25px;
    /* Padding nur links/rechts */
    line-height: 45px;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
    border: none;
    transition: all 0.2s ease;
}

/* Textarea darf natürlich höher sein */
textarea.standard-textarea {
    height: auto;
    min-height: 110px;
}


/* =============================================================================
   NEUE KLASSEN (ersetzt ehem. inline-styles)
   ============================================================================= */

/* --- Allgemein --- */

/* Link-Klasse für Stück-/Event-Titel (color: inherit, no underline) */
.event-title-link {
    color: inherit;
    text-decoration: none;
}

/* --- Login-Seite (admin.php) --- */

.admin-login-page {
    background: #1a1a1a;
}

.login-box {
    max-width: 400px;
    margin: 100px auto;
    padding: 30px;
    background: #fff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

@media (max-width: 500px) {
    .login-box {
        margin: 50px 20px;
        padding: 20px;
    }
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    box-sizing: border-box;
}

.error {
    color: #ab3826;
    font-weight: bold;
}

.login-back-link {
    color: #666;
    font-size: 0.8em;
}

/* --- Admin Dashboard --- */

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

@media (max-width: 768px) {
    .admin-dashboard {
        padding: 10px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .admin-flex-container {
        flex-direction: column;
    }

    .admin-flex-main,
    .admin-flex-sidebar {
        width: 100%;
        max-width: 100%;
    }

    .admin-box {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
        padding: 15px;
    }

    .admin-search-input {
        width: 100%;
        margin-top: 10px;
    }

    .mapping-list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions button {
        width: 100%;
        margin: 0 !important;
    }

    .admin-table-wrapper {
        width: 100%;
        max-width: 100vw;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        display: block;
    }

    .admin-table {
        min-width: 650px;
        /* Force horizontal scroll for readability */
        width: 100%;
    }

    .admin-table th,
    .admin-table td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .td-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-end;
    }

    .admin-btn-small {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .inline-delete-form {
        margin-left: 0;
        width: 100%;
    }

    .delete-link {
        display: block;
        width: 100%;
        text-align: right;
        padding: 5px 0;
    }
}

.admin-hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #eee;
}

.mapping-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-search-input {
    width: 300px;
}

.th-right {
    text-align: right;
}

.td-actions {
    text-align: right;
    white-space: nowrap;
}

.inline-delete-form {
    display: inline;
    margin-left: 10px;
}

.admin-member-list {
    margin-top: 20px;
}

/* Member-Chip: kleine klickbare Mitgliederkacheln im Admin */
.member-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 600px) {
    .member-chip-list {
        justify-content: center;
    }

    .member-chip {
        width: 100%;
        max-width: 250px;
    }
}

.member-chip {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.member-chip:hover {
    border-color: #ab3826;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.member-chip--board {
    border: 2px solid #ab3826;
}

.member-chip-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.member-chip-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd;
}

/* Formular-Felder mit Extra-Abstand oben */
.input-group--mt {
    margin-top: 10px;
}

/* --- ADMIN TABLE BADGES --- */
.badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.badge-gastspiel {
    background: #ab3826;
    color: white;
}

.badge-hidden {
    background: #eee;
    color: #444;
}

/* Footer Admin Links */
/* Footer: gedimmter Admin-Link für nicht eingeloggte Besucher */
.footer-admin-link--dimmed {
    opacity: 0.2;
}

/* --- Programmseite (programm.php) --- */

.programm-main {
    max-width: 1100px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    overflow-x: hidden;
}

.program-month-heading {
    border-bottom: 2px solid #ab3826;
    padding-bottom: 5px;
    margin-top: 60px;
}

.program-item-name {
    margin-top: 0;
    color: #ab3826;
}

.program-description {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Die Zeilenzahl wird dynamisch via JS (main.js) gesetzt */
}


/* --- Stück-Detail-Seite (programm_details.php) --- */

.stueck-image-box {
    padding: 0;
    width: 100%;
    border-radius: 12px;
}

.fallback-image {
    background-color: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 3/4;
}

.fallback-image img {
    width: 60%;
    opacity: 0.15;
    filter: grayscale(100%);
}

/* Admin: Stück-Vorschaubild (Breite und Aspect-Ratio) */
.piece-preview-img {
    border-radius: 4px;
    aspect-ratio: auto;
    width: 100%;
}

/* Mitmachen: Kartenüberschrift ohne oberen Abstand */
.contact-card-title {
    margin-top: 0;
}

/* Mitmachen/Submit: Button auf volle Breite */
.btn-full-width {
    width: 100%;
}

/* Mitmachen: Erfolgsmeldung nach Absenden */
.contact-success-message {
    color: green;
    text-align: center;
    padding: 20px;
    font-weight: bold;
}

/* Startseite: Newsletter-Statusmeldung */
.newsletter-status-message {
    color: #ab3826;
    margin-bottom: 15px;
    text-align: center;
    font-weight: bold;
}

/* --- Layout-Klassen für programm.php --- */

.program-row {
    display: flex;
    gap: 25px;
    margin-bottom: 50px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
    align-items: flex-start;
    /* Verhindert, dass der Text den Bildrahmen zieht */
}

.p-img {
    flex: 0 0 250px;
}

.p-img img {
    width: 100%;
    border-radius: 4px;
    object-fit: cover;
    /* Stabilisiert die Höhe für das JS-Clamping, falls kein Bild da ist */
    background: #f4f4f4;
    min-height: 150px;
    display: block;
}

.p-img.is-placeholder {
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border-radius: 4px;
    padding: 20px;
    box-sizing: border-box;
    max-width: 250px;
}

.p-img.is-placeholder img {
    object-fit: contain !important;
    max-height: 140px;
    /* width: auto !important; */
    opacity: 0.3;
    filter: grayscale(1);
    min-height: 0;
    /* Override */
}

.p-content {
    flex: 1;
}

.p-dates {
    flex: 0 0 200px;
}

.date-badge {
    display: block;
    background: #f4f4f4;
    border-radius: 5px;
    padding: 8px;
    margin-bottom: 8px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
    border-left: 3px solid #ab3826;
}

.date-badge:hover {
    background: #e8e8e8;
}

.date-badge .day {
    font-weight: bold;
    color: #ab3826;
    margin-right: 5px;
}

@media (max-width: 700px) {
    .program-row {
        flex-direction: column;
        align-items: stretch;
    }

    .p-img,
    .p-dates,
    .p-content {
        flex: 0 0 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .p-img {
        max-width: 450px;
        align-self: center;
    }
}

/* --- Rechtliche Seiten (Impressum, Datenschutz, AGB) --- */

.legal-content {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    line-height: 1.8;
    color: #444;
    flex: 1;
    /* Pushed den Footer nach unten */
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.error-page {
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.error-page h1 {
    border-bottom: none !important;
    font-size: 5rem !important;
    margin: 0 !important;
}

.error-page h2 {
    margin-top: 0 !important;
}


.legal-content h1 {
    color: #ab3826;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 2.5rem;
    border-bottom: 2px solid #ab3826;
    padding-bottom: 10px;
}

.legal-content h2 {
    color: #ab3826;
    margin-top: 40px;
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.legal-content p {
    margin-bottom: 20px;
}

.legal-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.legal-content li {
    margin-bottom: 10px;
}

.legal-content strong {
    color: #222;
}

/* --- Bildergalerie / Karussell (programm_details.php) --- */
.stueck-carousel-container {
    width: 100%;
    margin-bottom: 30px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 15px;
    /* Etwas Luft nach außen */
    box-sizing: border-box;
}

.stueck-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;

    /* Scrollbar verstecken */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.stueck-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-img {
    height: 350px;
    width: auto;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 900px) {
    .stueck-carousel-container {
        padding: 10px;
        margin-bottom: 0;
    }

    .carousel-img {
        height: 250px;
    }

    .desktop-hide-img {
        display: none !important;
    }
}

.gallery-grid {
    display: none;
}

@media (min-width: 901px) {
    .mobile-only-img {
        display: none !important;
    }
}

/* =========================================
   Upcoming Dates (Programm Details)
   ========================================= */
.upcoming-dates-container {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.upcoming-dates-container h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary-color, #ab3826);
}

.calendar-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    align-items: start;
}

.calendar-month-name {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: #444;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-header {
    text-align: center;
    font-weight: bold;
    color: #666;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.calendar-cell {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.calendar-cell.empty {
    background: transparent;
    border-color: transparent;
}

.calendar-cell.has-event {
    border-color: var(--primary-color, #ab3826);
    background: #fffaf9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.calendar-cell.has-event:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.calendar-date-num {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.calendar-cell.has-event .calendar-date-num {
    color: var(--primary-color, #ab3826);
}

.calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}

.calendar-event-link {
    display: flex;
    flex-direction: column;
    background: var(--primary-color, #ab3826);
    color: #fff;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-align: center;
    transition: background 0.2s;
}

.calendar-event-link:hover {
    background: #8e2e1f;
    color: #fff;
}

.calendar-time {
    font-weight: bold;
}

.calendar-ticket-icon {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
    }

    .calendar-cell {
        padding: 4px;
        min-height: 60px;
    }

    .calendar-day-header {
        font-size: 0.75rem;
    }

    .calendar-date-num {
        font-size: 0.9rem;
    }

    .calendar-event-link {
        font-size: 0.7rem;
        padding: 2px 4px;
    }

    .calendar-ticket-icon {
        display: none;
    }
}