/* =========================================================
   Veranstaltungskalender – Cornelia Kille
   Markenfarben aus dem Logo:
   Bordeaux #901030 · Grün #90c010 · Anthrazit #2b2b2b
   ========================================================= */

:root {
    --bordeaux:      #901030;
    --bordeaux-dark: #6f0c25;
    --bordeaux-soft: #f5e6ea;
    --green:         #7fae12;
    --green-soft:    #eef5db;
    --ink:           #2b2b2b;
    --muted:         #6b6b6b;
    --line:          #e7e4e4;
    --bg:            #faf9f8;
    --card:          #ffffff;
    --radius:        14px;
    --shadow:        0 6px 24px rgba(43, 15, 22, .07);
    --font-body:     'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-head:     'Sen', 'Roboto', sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); font-weight: 800; color: var(--ink); line-height: 1.2; }
a { color: var(--bordeaux); }

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

/* ---------- Kopfbereich ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.site-header .container {
    display: flex; align-items: center; gap: 18px;
    padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap;
}
.site-header img.logo { height: 54px; width: auto; }
.header-titles { flex: 1 1 auto; min-width: 200px; }
.header-titles h1 { margin: 0; font-size: 1.25rem; }
.header-titles h1 .ht-name::before { content: " – "; color: var(--muted); font-weight: 400; }
.header-titles p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--bordeaux); color: #fff; border: 0;
    padding: 11px 18px; border-radius: 999px; font-weight: 600;
    font-family: var(--font-body); font-size: .95rem;
    cursor: pointer; text-decoration: none; transition: background .15s, transform .05s;
    white-space: nowrap;
}
.btn:hover { background: var(--bordeaux-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: #fff; color: var(--bordeaux); border: 1.5px solid var(--bordeaux); }
.btn.secondary:hover { background: var(--bordeaux-soft); }
.btn.green { background: var(--green); }
.btn.green:hover { background: #6f9a0f; }
.btn.ghost  { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn.small  { padding: 7px 13px; font-size: .85rem; }

/* ---------- Karten / Layout ---------- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 22px;
}
main.container { padding-top: 26px; padding-bottom: 60px; }

.toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.toolbar h2 { margin: 0; font-size: 1.35rem; }

/* ---------- FullCalendar Feinschliff ---------- */
#calendar { --fc-border-color: var(--line); }
.fc { font-family: var(--font-body); }
.fc .fc-toolbar-title { font-family: var(--font-head); font-size: 1.15rem; color: var(--ink); }
.fc .fc-button-primary {
    background: #fff; border: 1.5px solid var(--line); color: var(--ink);
    text-transform: none; font-weight: 600; box-shadow: none;
}
.fc .fc-button-primary:not(:disabled):hover { background: var(--bordeaux-soft); border-color: var(--bordeaux); color: var(--bordeaux); }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--bordeaux); border-color: var(--bordeaux); color: #fff; }
.fc .fc-daygrid-day.fc-day-today { background: var(--green-soft); }
/* Monatsansicht: Termine als Bordeaux-Blöcke mit weißer Schrift */
.fc .fc-daygrid-event {
    background: var(--bordeaux); border: 0; border-radius: 6px;
    padding: 2px 6px; font-size: .82rem; cursor: pointer;
}
.fc .fc-daygrid-event .fc-event-title,
.fc .fc-daygrid-event .fc-event-time { color: #fff !important; font-weight: 600; }
.fc .fc-daygrid-event .fc-event-title { white-space: normal; line-height: 1.2; }
.fc .fc-daygrid-event:hover { background: var(--bordeaux-dark); }
.fc .fc-daygrid-event-dot { display: none; }
/* Desktop-Monatsansicht: Uhrzeit (fett) + Titel im Termin-Block */
.fc .fc-daygrid-event .fc-ev-time { color: #fff; font-weight: 700; font-size: .8rem; line-height: 1.15; }
.fc .fc-daygrid-event .fc-ev-title { color: #fff; font-weight: 600; font-size: .8rem; line-height: 1.2; white-space: normal; margin-top: 1px; }

/* Listenansicht: heller Hintergrund, farbiger Punkt, gut lesbar */
.fc .fc-list-event { cursor: pointer; }
.fc .fc-list-event:hover td { background: var(--bordeaux-soft) !important; }
.fc .fc-list-event-dot { border-color: var(--bordeaux); }
.fc .fc-list-event-title { color: var(--ink); font-weight: 600; }
.fc .fc-list-event-time { color: var(--muted); }
.fc .fc-list-day-cushion { background: var(--bordeaux-soft); }
.fc .fc-list-day-text, .fc .fc-list-day-side-text { color: var(--bordeaux); }
.fc a { text-decoration: none; }

/* ---------- Mobile Monatsansicht: Punkte + Tages-Liste ---------- */
.day-details { display: none; }
.mini-dot {
    display: block; width: 8px; height: 8px; border-radius: 50%;
    background: var(--bordeaux); margin: 2px auto 0;
}
.dd-head { font-family: var(--font-head); font-size: 1.05rem; color: var(--bordeaux); margin: 4px 0 12px; }
.dd-empty {
    display: flex; align-items: center; gap: 11px; width: 100%;
    background: #fff; border: 1px solid var(--line); border-left: 5px solid #d9d4d4;
    border-radius: 12px; padding: 15px 15px; margin: 0;
    color: var(--muted); font-size: 1rem;
    box-shadow: 0 2px 8px rgba(43,15,22,.05);
}
.dd-empty-ic { font-size: 1.15rem; line-height: 1; }
.dd-item {
    display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
    background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--bordeaux);
    border-radius: 12px; padding: 13px 15px; margin-bottom: 10px; cursor: pointer;
    font-family: var(--font-body); box-shadow: 0 2px 8px rgba(43,15,22,.05);
    transition: background .12s, transform .05s;
}
.dd-item:hover { background: var(--bordeaux-soft); }
.dd-item:active { transform: scale(.99); }
.dd-time  { color: var(--bordeaux); font-weight: 700; font-size: .9rem; }
.dd-title { color: var(--ink); font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.dd-loc   { color: var(--muted); font-weight: 400; }

/* ---------- Abo-Box ---------- */
.subscribe-note {
    margin-top: 22px; background: var(--green-soft);
    border: 1px solid #dce9bf; border-radius: var(--radius); padding: 18px 20px;
}
.subscribe-note h3 { margin: 0 0 6px; font-size: 1.05rem; }
.subscribe-note p  { margin: 0 0 12px; color: #4b5a2a; font-size: .92rem; }
.subscribe-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.subscribe-row input {
    flex: 1 1 260px; min-width: 0; padding: 10px 12px; border: 1px solid #cdd9ad;
    border-radius: 8px; font-size: .85rem; background: #fff; color: var(--muted);
}

/* ---------- Modal (Termin-Details) ---------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(30, 10, 15, .45);
    display: none; align-items: center; justify-content: center; z-index: 100; padding: 18px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #fff; border-radius: var(--radius); max-width: 460px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden;
    animation: pop .16s ease-out;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { background: var(--bordeaux); color: #fff; padding: 18px 22px; }
.modal-head h3 { color: #fff; margin: 0; font-size: 1.2rem; }
.modal-head .when { margin-top: 4px; font-size: .9rem; opacity: .9; }
.modal-body { padding: 20px 22px; }
.modal-body .row { display: flex; gap: 10px; margin-bottom: 12px; font-size: .95rem; }
.modal-body .row .ic { color: var(--bordeaux); flex: 0 0 22px; text-align: center; }
.modal-body .row .lbl { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.modal-foot { padding: 0 22px 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.modal-close {
    position: absolute; top: 14px; right: 16px; background: rgba(255,255,255,.2);
    border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px;
}

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
label .opt { color: var(--muted); font-weight: 400; }
input[type=text], input[type=date], input[type=time], input[type=password], input[type=email], textarea, select {
    width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px;
    font-family: var(--font-body); font-size: 1rem; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--bordeaux); box-shadow: 0 0 0 3px var(--bordeaux-soft); }
textarea { min-height: 88px; resize: vertical; }
.help { color: var(--muted); font-size: .82rem; margin-top: 5px; }

.alert { padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; font-size: .95rem; }
.alert.ok   { background: var(--green-soft); border: 1px solid #cfe29a; color: #40591a; }
.alert.err  { background: #fdecec; border: 1px solid #f3c2c2; color: #a12626; }
.alert.info { background: var(--bordeaux-soft); border: 1px solid #eccdd5; color: var(--bordeaux-dark); }

/* ---------- Verwaltung (Tabelle) ---------- */
.events-table { width: 100%; border-collapse: collapse; }
.events-table th, .events-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
.events-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.badge.pending  { background: #fff3d6; color: #8a5a00; }
.badge.approved { background: var(--green-soft); color: #40591a; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }

.page-narrow { max-width: 720px; }
.brandbar { height: 5px; background: linear-gradient(90deg, var(--bordeaux) 0%, var(--bordeaux) 62%, var(--green) 62%, var(--green) 100%); }
footer.site-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 30px 20px 40px; }
footer.site-footer p { margin: 4px 0; }
footer.site-footer a { color: var(--muted); }
.footer-links a { color: var(--bordeaux); font-weight: 600; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Rechtsseiten (Impressum / Datenschutz) ---------- */
.legal h2 { font-size: 1.12rem; margin: 26px 0 8px; color: var(--bordeaux); }
.legal h2:first-child { margin-top: 4px; }
.legal p { margin: 0 0 12px; }
.legal a { color: var(--bordeaux); word-break: break-word; }
.legal .note-todo {
    background: #fff3d6; border: 1px solid #ecd08a; border-radius: 10px;
    padding: 12px 14px; color: #7a5600; font-size: .92rem;
}
.legal .legal-updated { color: var(--muted); font-size: .85rem; margin-top: 22px; }

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    /* Kopfzeile: alles zentriert stapeln, auf dem Handy nicht fixiert (sonst verdeckt sie beim Scrollen den Kalender) */
    .site-header { position: static; }
    .site-header .container { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .site-header img.logo { height: 60px; margin: 2px auto 0; }
    .header-titles { width: 100%; }
    .header-titles h1 { font-size: 1.2rem; line-height: 1.25; }
    .header-titles h1 .ht-main,
    .header-titles h1 .ht-name { display: block; }
    .header-titles h1 .ht-name { color: var(--bordeaux); }
    .header-titles h1 .ht-name::before { content: none; }
    .btn-subscribe { margin: 2px auto 0; }

    .toolbar { justify-content: center; }

    /* Kalender-Kopf: Monat/Jahr prominent oben, darunter Pfeile links + Umschalter rechts */
    .fc .fc-toolbar { flex-wrap: wrap; gap: 12px 8px; align-items: center; }
    .fc .fc-toolbar.fc-header-toolbar { margin-bottom: 16px; }
    .fc .fc-toolbar-chunk { display: flex; align-items: center; gap: 8px; }
    .fc .fc-toolbar-chunk:nth-child(2) { order: -1; flex-basis: 100%; justify-content: center; }
    .fc .fc-toolbar-chunk:nth-child(3) { margin-left: auto; }
    .fc .fc-toolbar-title { font-size: 1.2rem; }

    /* Buttons: größere Tap-Ziele, schön abgerundete Segmente */
    .fc .fc-button { padding: 8px 12px; }
    .fc .fc-icon { font-size: 1.3em; }
    .fc .fc-button-group > .fc-button:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; padding-left: 15px; }
    .fc .fc-button-group > .fc-button:last-child { border-top-right-radius: 999px; border-bottom-right-radius: 999px; padding-right: 15px; }
    /* "Heute" auf dem Handy ausblenden: Kalender startet ohnehin im aktuellen Monat,
       die Tages-Liste steht schon auf heute -> Pfeile + Umschalter passen in eine Zeile */
    .fc .fc-today-button { display: none; }

    .card { padding: 16px; }

    .day-details { display: block; margin: 2px 0 18px; }

    /* Monatsansicht: nur Punkte, kompaktere Tageszellen */
    .fc .fc-daygrid-event,
    .fc .fc-daygrid-event:hover { background: transparent !important; padding: 0 !important; margin: 0 !important; }
    .fc .fc-daygrid-day-events { min-height: 0 !important; margin: 0 !important; }
    .fc .fc-daygrid-day-frame { min-height: 54px; }
    .fc .fc-daygrid-day-top { justify-content: center; }
    .fc .fc-daygrid-day-number { font-size: .9rem; padding: 4px 2px 2px; }
    .fc .fc-daygrid-day.fc-day-selected .fc-daygrid-day-frame {
        background: var(--bordeaux-soft); box-shadow: inset 0 0 0 2px var(--bordeaux); border-radius: 6px;
    }
    .fc .fc-daygrid-more-link { font-size: .72rem; }
    .events-table thead { display: none; }
    .events-table, .events-table tbody, .events-table tr, .events-table td { display: block; width: 100%; }
    .events-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; padding: 6px; }
    .events-table td { border: 0; padding: 6px 8px; }
}
