/* ================================================================
   SONGBILDER – zentrales Stylesheet
   Warme, angenehme Farbwelt + Pergament-Optik
   ================================================================ */

:root {
    --warm-50:  #fdf8ee;
    --warm-100: #f7ecd6;
    --warm-200: #efdcb4;
    --warm-300: #e3c489;
    --warm-400: #d3a45c;
    --warm-500: #c1893f;
    --warm-600: #a86f2f;
    --warm-700: #8a5726;
    --warm-800: #6b4420;
    --warm-900: #4a2f18;

    --accent-500: #c1552c;
    --accent-600: #a8431f;

    --ink: #4a2f18;
    --ink-soft: #6b5238;
    --paper: #fbf3e2;

    --danger-500: #b3492f;
    --danger-600: #963b25;

    --success-500: #4c7a4f;
}

* { box-sizing: border-box; }

body {
    font-family: 'Georgia', 'Iowan Old Style', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    min-height: 100vh;
    background-color: var(--warm-100);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(193, 137, 63, 0.18), transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(168, 111, 47, 0.15), transparent 45%),
        linear-gradient(135deg, #f3e4c2 0%, #e9d1a0 45%, #ddbd85 100%);
}

/* ---------- Pergament-Fläche (für Home / Dokument-Inhalte) ---------- */
.parchment {
    position: relative;
    background-color: #f3e6c6;
    background-image:
        repeating-linear-gradient(0deg, rgba(139, 94, 42, 0.035) 0px, rgba(139, 94, 42, 0.035) 1px, transparent 1px, transparent 3px),
        radial-gradient(ellipse at top left, rgba(255, 250, 235, 0.6), transparent 55%),
        radial-gradient(ellipse at bottom right, rgba(139, 94, 42, 0.12), transparent 55%),
        radial-gradient(ellipse at 30% 90%, rgba(139, 94, 42, 0.10), transparent 50%),
        linear-gradient(160deg, #f6ead0 0%, #eddcb2 55%, #e4cd9c 100%);
    border: 1px solid rgba(139, 94, 42, 0.25);
    box-shadow:
        inset 0 0 60px rgba(139, 94, 42, 0.18),
        inset 0 0 3px rgba(139, 94, 42, 0.35),
        0 10px 30px rgba(74, 47, 24, 0.18);
}

.parchment-content {
    font-family: 'Georgia', 'Iowan Old Style', serif;
    color: var(--ink);
    line-height: 1.75;
}
.parchment-content h1, .parchment-content h2, .parchment-content h3 {
    font-family: 'Georgia', serif;
    color: var(--warm-800);
}
.parchment-content h1 { font-size: 2.1rem; font-weight: 800; margin-bottom: .25rem; }
.parchment-content h2 { font-size: 1.5rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: .5rem; }
.parchment-content h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.25rem; }
.parchment-content p { margin-bottom: .65rem; }
.parchment-content .em-line { font-style: italic; color: var(--ink-soft); }
.parchment-content .quote-line {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-600);
    text-align: center;
    margin: 1.25rem 0;
}
.parchment-content hr {
    border: none;
    border-top: 1px dashed rgba(139, 94, 42, 0.4);
    margin: 1.75rem 0;
}
.parchment-content .lead {
    font-size: 1.15rem;
    color: var(--ink);
}

/* ---------- Glass / Karten ---------- */
.glass-card {
    backdrop-filter: blur(14px) saturate(160%);
    background-color: rgba(255, 250, 240, 0.72);
    border: 1px solid rgba(193, 137, 63, 0.3);
}

/* ---------- Header / Navigation (zentriert) ---------- */
.site-header {
    background-color: rgba(255, 248, 232, 0.82);
    backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid rgba(193, 137, 63, 0.3);
}
.header-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.header-logo {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.header-logo img {
    height: 42px;
    max-width: 160px;
    object-fit: contain;
}
.header-logo-text {
    font-family: Georgia, serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--warm-800);
    letter-spacing: .03em;
}
.header-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    justify-content: center;
}
.header-action {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: .6rem;
}

@media (max-width: 820px) {
    .header-grid { grid-template-columns: 1fr; text-align: center; }
    .header-logo, .header-nav, .header-action { justify-self: center; }
}

.nav-link {
    color: var(--ink-soft);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    transition: background 0.2s, color .2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}
.nav-link:hover {
    background: rgba(193, 137, 63, 0.18);
    color: var(--warm-800);
}
.nav-link.current {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 3px 10px rgba(161, 100, 43, 0.35);
}

/* ---------- Buttons ---------- */
.btn {
    padding: 0.55rem 1.1rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 4px 10px rgba(161, 100, 43, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(to right, var(--warm-600), var(--accent-600));
}
.btn-secondary {
    background: #fffaf0;
    color: var(--ink-soft);
    border: 1px solid rgba(193, 137, 63, 0.4);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.btn-secondary:hover { background: var(--warm-50); }
.btn-danger {
    background: linear-gradient(to right, var(--danger-500), var(--danger-600));
    color: #fff;
}
.btn-danger:hover {
    background: linear-gradient(to right, var(--danger-600), #7c2f1c);
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(74, 47, 24, 0.55);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}
.modal.open { display: flex; }
.avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.2);
}

/* ---------- Formulare ---------- */
.input-group { position: relative; margin-bottom: 1rem; }
.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(193, 137, 63, 0.45);
    border-radius: 0.5rem;
    background: #fffdf7;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--warm-500);
    box-shadow: 0 0 0 3px rgba(193, 137, 63, 0.18);
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 0.3rem;
}

/* Veröffentlichen-Schalter steht VOR dem Feld */
.field-publish {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.35rem;
}
.field-publish input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--warm-500);
    cursor: pointer;
}
.field-publish label {
    margin-bottom: 0;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--ink-soft);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.file-drop {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem;
    border: 1px dashed rgba(193, 137, 63, 0.5);
    border-radius: .6rem;
    background: #fffdf7;
}
.file-drop img, .file-drop .file-drop-placeholder {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: .5rem;
    background: #fff;
    border: 1px solid rgba(193, 137, 63, 0.3);
}
.file-drop .file-drop-placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--warm-400); font-size: 1.3rem;
}
.file-drop input[type="file"] { flex: 1; font-size: .8rem; }

/* ---------- Floating Action ---------- */
.floating-action {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--warm-500), var(--accent-500));
    color: #fff;
    border: none;
    box-shadow: 0 8px 25px rgba(161, 100, 43, 0.45);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 40;
}
.floating-action:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(161, 100, 43, 0.6);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.slide-up { animation: slideUp 0.3s ease; }

/* ---------- Sidebar-Navigation (App) ---------- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--ink-soft);
    font-weight: 600;
}
.nav-item:hover { background: rgba(193, 137, 63, 0.15); }
.nav-item.active {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
    color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.nav-item i { width: 1.5rem; text-align: center; }

/* ---------- Unterstützer-Kacheln ---------- */
.supporter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.supporter-tile {
    background: rgba(255, 250, 240, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 1rem;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(193, 137, 63, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.07);
}
.supporter-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(74, 47, 24, 0.14);
}
.supporter-tile .logo, .supporter-tile .extra-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 0.75rem;
    border-radius: 12px;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(74, 47, 24, 0.1);
}
.supporter-tile .extra-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    padding: 0;
}
.supporter-tile .company {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--warm-800);
    margin-bottom: 0.25rem;
}
.supporter-tile .description {
    font-size: 0.875rem;
    color: var(--ink-soft);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.supporter-tile .homepage a {
    color: var(--accent-600);
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
}
.supporter-tile .homepage a:hover { text-decoration: underline; }

/* ---------- Songbilder-Kacheln ---------- */
.songbilder-tile {
    background: rgba(255, 250, 240, 0.8);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(193, 137, 63, 0.3);
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.08);
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
}
.songbilder-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(74, 47, 24, 0.16);
}
.songbilder-tile img {
    width: 100%;
    height: 170px;
    object-fit: cover;
}
.songbilder-tile .body { padding: 1.1rem; flex: 1; display: flex; flex-direction: column; }
.songbilder-tile h3 { font-weight: 700; font-size: 1.15rem; color: var(--warm-800); margin-bottom: .4rem; }
.songbilder-tile p { font-size: .9rem; color: var(--ink-soft); flex: 1; margin-bottom: .75rem; }
.songbilder-tile a.yt-link {
    color: var(--danger-600);
    font-weight: 600;
    font-size: .875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.songbilder-tile a.yt-link:hover { text-decoration: underline; }

/* ---------- News ---------- */
.news-item {
    background: rgba(255, 250, 240, 0.78);
    border-radius: 1rem;
    padding: 1.5rem;
    border: 1px solid rgba(193, 137, 63, 0.3);
    box-shadow: 0 4px 12px rgba(74, 47, 24, 0.07);
    margin-bottom: 1.25rem;
}
.news-item h3 { font-weight: 700; font-size: 1.2rem; color: var(--warm-800); margin-bottom: .25rem; }
.news-item .news-date { font-size: .8rem; color: var(--ink-soft); margin-bottom: .6rem; }
.news-item .news-content { color: var(--ink); line-height: 1.65; }

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #d8c4a0;
    transition: .3s;
    border-radius: 999px;
}
.toggle-slider:before {
    position: absolute; content: "";
    height: 20px; width: 20px; left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(to right, var(--warm-500), var(--accent-500));
}
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 250, 240, 0.6);
    backdrop-filter: blur(4px);
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--warm-800);
    border: 1px solid rgba(193, 137, 63, 0.3);
}
.visitor-counter i { color: var(--accent-600); }

.page { display: none; }
.page.active { display: block; }
.hidden { display: none !important; }

/* ---------- Quill Rich-Text-Editor ---------- */
.quill-editor {
    background: #fffdf7;
    border-radius: 0.5rem;
    overflow: hidden;
}
.ql-toolbar.ql-snow {
    border-color: rgba(193, 137, 63, 0.45) !important;
    background: var(--warm-50);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}
.ql-container.ql-snow {
    border-color: rgba(193, 137, 63, 0.45) !important;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    font-family: 'Georgia', serif;
    min-height: 140px;
    font-size: 1rem;
    color: var(--ink);
}
.ql-editor.ql-blank::before {
    color: var(--ink-soft);
    font-style: normal;
}
