/*
 * blog.css – Blog-spezifische Stile
 *
 * Integration in deine bestehende CSS-Datei:
 * Option A (empfohlen): Diese Datei separat einbinden:
 *   <link rel="stylesheet" href="/css/deine-main.css">
 *   <link rel="stylesheet" href="/blog.css">
 *
 * Option B: Inhalt dieser Datei ans Ende deiner CSS-Datei kopieren.
 *   Achtung: die Google Fonts @import-Zeile muss ganz oben stehen!
 *
 * Konflikt-Prävention: Alle Blog-Selektoren sind scoped auf
 *   .site-header, .blog-layout, .feed-section, .blog-sidebar,
 *   .post-card, .post-full, .single-post, .admin-* usw.
 *   Sie sollten deine bestehenden Stile nicht überschreiben.
 */

/* ============================================================
   Mein Blog – Stylesheet
   Ästhetik: Editorial / Literarisch – warme Crème-Töne,
   Serif-Überschriften, klare Struktur
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;1,300&display=swap');

:root {
    --bg:         #f5f0e8;
    --surface:    #faf7f2;
    --border:     #d8cfc0;
    --text:       #2c2416;
    --text-muted: #7a6e5f;
    --accent:     #8b3a2a;
    --accent-lt:  #c4614e;
    --tag-bg:     #e8dfd0;
    --header-bg:  #2c2416;
    --header-fg:  #f5f0e8;
    --radius:     4px;
    --shadow:     0 2px 12px rgba(44,36,22,.10);
}

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

html { font-size: 16px; }

body {
    font-family: 'Source Serif 4', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-lt); text-decoration: underline; }

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header ─────────────────────────────────────────── */

.site-header {
    background: var(--header-bg);
    color: var(--header-fg);
    padding: .9rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--accent);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--header-fg);
    white-space: nowrap;
    letter-spacing: .02em;
    text-decoration: none;
}
.logo:hover { color: #e8c9a0; text-decoration: none; }

.search-form {
    display: flex;
    gap: .4rem;
    flex: 1;
    min-width: 200px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: .45rem .75rem;
    border: 1px solid #5a4a3a;
    border-radius: var(--radius);
    background: #3d3025;
    color: var(--header-fg);
    font-family: inherit;
    font-size: .9rem;
}
.search-form input[type="text"]::placeholder { color: #9a8a7a; }
.search-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-lt);
    background: #4a3c2e;
}

.search-form button {
    padding: .45rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: .9rem;
    transition: background .2s;
}
.search-form button:hover { background: var(--accent-lt); }

.reset-btn {
    color: #c4a888;
    font-size: .85rem;
    white-space: nowrap;
    align-self: center;
}
.reset-btn:hover { color: #e8c9a0; text-decoration: none; }

.btn-new {
    white-space: nowrap;
    padding: .45rem 1.1rem;
    background: transparent;
    color: var(--header-fg);
    border: 1px solid #5a4a3a;
    border-radius: var(--radius);
    font-size: .9rem;
    transition: background .2s, border-color .2s;
    text-decoration: none;
}
.btn-new:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* ── Main Layout ─────────────────────────────────────── */

.main-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
    align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────── */

.sidebar {
    position: sticky;
    top: 90px;
}

.sidebar h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.category-list a {
    display: block;
    padding: .3rem .6rem;
    border-radius: var(--radius);
    color: var(--text);
    font-size: .92rem;
    transition: background .15s;
    text-decoration: none;
}
.category-list a:hover { background: var(--tag-bg); text-decoration: none; }
.category-list a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

/* ── Post List ───────────────────────────────────────── */

.filter-info {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding: .6rem 1rem;
    background: var(--tag-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--accent);
}

.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform .15s, box-shadow .15s;
}
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44,36,22,.13);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .6rem;
}

.category-badge {
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--accent);
    color: #fff;
    padding: .15rem .55rem;
    border-radius: 2px;
    text-decoration: none;
}
.category-badge:hover { background: var(--accent-lt); text-decoration: none; color: #fff; }

time {
    font-size: .82rem;
    color: var(--text-muted);
}

.post-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: .5rem;
}
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--accent); }

.excerpt {
    color: var(--text-muted);
    font-size: .95rem;
    margin-bottom: .75rem;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-bottom: .75rem;
}

.tag {
    background: var(--tag-bg);
    color: var(--text-muted);
    padding: .15rem .55rem;
    border-radius: 20px;
    font-size: .78rem;
    border: 1px solid var(--border);
}

.read-more {
    font-size: .88rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}
.read-more:hover { color: var(--accent-lt); text-decoration: underline; }

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}
.empty-state p { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Single Post ─────────────────────────────────────── */

.single-post {
    max-width: 760px;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

.breadcrumb {
    font-size: .88rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

.post-full {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow);
}

.post-full h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    line-height: 1.25;
    margin: .75rem 0 1.5rem;
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
    margin-bottom: 1.5rem;
}

.post-full .keywords { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.post-full .keywords strong { font-size: .85rem; color: var(--text-muted); margin-right: .4rem; }

.post-actions {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
}

.btn-edit, .btn-delete {
    padding: .5rem 1.1rem;
    border-radius: var(--radius);
    font-size: .88rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}
.btn-edit {
    background: var(--tag-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-edit:hover { background: var(--border); text-decoration: none; color: var(--text); }

.btn-delete {
    background: transparent;
    color: #9a2a1a;
    border: 1px solid #c4a0a0;
}
.btn-delete:hover { background: #f5e8e8; color: #7a1a0a; text-decoration: none; }

/* ── Forms ───────────────────────────────────────────── */

.form-page {
    max-width: 700px;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

.form-page h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin-bottom: 1.75rem;
}

.post-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.post-form label {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .03em;
}

.hint {
    font-weight: 400;
    color: var(--text-muted);
}

.post-form input[type="text"],
.post-form textarea {
    width: 100%;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 1rem;
    transition: border-color .15s;
}
.post-form input:focus,
.post-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139,58,42,.1);
}

.post-form textarea {
    resize: vertical;
    line-height: 1.7;
}

.form-actions {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-top: .5rem;
}

.btn-submit {
    padding: .65rem 1.75rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s;
}
.btn-submit:hover { background: var(--accent-lt); }

.btn-cancel {
    color: var(--text-muted);
    font-size: .9rem;
    text-decoration: none;
}
.btn-cancel:hover { color: var(--accent); }

.error-box {
    background: #fce8e8;
    border: 1px solid #e8b0b0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.error-box p {
    color: #7a1a1a;
    font-size: .9rem;
    margin-bottom: .25rem;
}
.error-box p:last-child { margin-bottom: 0; }

/* ── Footer ──────────────────────────────────────────── */

.site-footer {
    margin-top: auto;
    padding: 1.25rem 0;
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 680px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: static;
        display: flex;
        flex-direction: row;
        gap: 1rem;
        align-items: center;
        flex-wrap: wrap;
    }
    .sidebar h3 { margin-bottom: 0; border: none; }
    .category-list { flex-direction: row; flex-wrap: wrap; }
    .post-full { padding: 1.5rem 1.25rem; }
    .post-full h1 { font-size: 1.6rem; }
    .site-header .container { gap: .6rem; }
}

/* ── Logout-Button im Header ─────────────────────────── */
.btn-logout {
    white-space: nowrap;
    padding: .45rem 1.1rem;
    background: transparent;
    color: #c4a888;
    border: 1px solid #5a4a3a;
    border-radius: var(--radius);
    font-size: .9rem;
    text-decoration: none;
    transition: background .2s;
}
.btn-logout:hover {
    background: #3d3025;
    color: var(--header-fg);
    text-decoration: none;
}

/* ── Info-Box (z. B. nach Logout) ────────────────────── */
.info-box {
    background: #e8f0e8;
    border: 1px solid #a0c4a0;
    border-radius: var(--radius);
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    color: #2a4a2a;
    font-size: .9rem;
}

/* ── Titelbild in der Listenansicht ─────────────────────── */
.post-card { overflow: hidden; }
.post-cover-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    border-bottom: 1px solid var(--border);
}
.post-card-body { padding: 1.25rem 1.75rem 1.5rem; }
.post-card:not(:has(.post-cover-thumb)) .post-card-body { padding-top: 1.5rem; }

/* ── Titelbild in der Einzelansicht ─────────────────────── */
.post-cover-full {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.75rem;
    display: block;
}

/* ── Autoren-Leiste ─────────────────────────────────────── */
.post-author-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    color: var(--text-muted);
}
.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Autor-Hinweis in der Listenansicht ─────────────────── */
.post-author {
    font-size: .82rem;
    color: var(--text-muted);
}

/* ── TinyMCE-Inhalt im Frontend hübsch darstellen ──────── */
.post-body h1,.post-body h2,.post-body h3 {
    font-family: 'Playfair Display', Georgia, serif;
    margin: 1.75rem 0 .75rem;
    line-height: 1.25;
}
.post-body h2 { font-size: 1.55rem; }
.post-body h3 { font-size: 1.25rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin: 1rem 0; }
.post-body li { margin-bottom: .4rem; }
.post-body a { color: var(--accent); }
.post-body img { max-width: 100%; border-radius: var(--radius); }
.post-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.post-body td, .post-body th { border: 1px solid var(--border); padding: .5rem .75rem; }
.post-body th { background: var(--tag-bg); font-weight: 600; }
.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding: .5rem 1rem;
    margin: 1rem 0;
    color: var(--text-muted);
    font-style: italic;
}
.post-body code { font-family: monospace; background: var(--tag-bg); padding: .1rem .4rem; border-radius: 3px; }
.post-body pre  { background: var(--tag-bg); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }

/* ══════════════════════════════════════════════════════════════
   Blog-Layout: zweispaltig (Feed + Sidebar)
   ══════════════════════════════════════════════════════════════ */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2.5rem;
    align-items: start;
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

/* ── Feed ────────────────────────────────────────────────────── */
.feed-section { min-width: 0; }

.feed-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: .6rem 1rem;
    margin-bottom: 1.25rem;
    font-size: .88rem;
}
.filter-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-size: .85rem;
    padding: 0;
    white-space: nowrap;
}
.filter-clear-btn:hover { color: var(--accent-lt); }

/* Post-Card mit Animation beim Einblenden */
.post-card {
    animation: fadeSlideIn .35s ease both;
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Kategorie-Badge & Keywords als Buttons (für AJAX-Filter) */
.cat-btn, .kw-btn {
    cursor: pointer;
    border: none;
    font-family: inherit;
    line-height: inherit;
}
.cat-btn { background: var(--accent); color: #fff; }
.cat-btn:hover { background: var(--accent-lt); }

/* Mehr laden */
.load-more-btn {
    display: inline-block;
    padding: .65rem 2rem;
    border: 2px solid var(--accent);
    border-radius: 30px;
    background: transparent;
    color: var(--accent);
    font-family: inherit;
    font-size: .95rem;
    cursor: pointer;
    transition: background .2s, color .2s;
}
.load-more-btn:hover { background: var(--accent); color: #fff; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.blog-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 6px rgba(44,36,22,.06);
}

.widget-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: .85rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .8rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

/* Suche */
.widget-search {
    display: flex;
    gap: .4rem;
}
.widget-search input {
    flex: 1;
    padding: .45rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
    background: var(--bg);
    color: var(--text);
}
.widget-search input:focus { outline: none; border-color: var(--accent); }
.widget-search button {
    padding: .45rem .85rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
}
.widget-search button:hover { background: var(--accent-lt); }

/* Listen (Kategorien, Archiv) */
.widget-list { list-style: none; display: flex; flex-direction: column; gap: .15rem; }
.widget-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: .35rem .5rem;
    border-radius: var(--radius);
    font-size: .88rem;
    color: var(--text);
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .12s;
}
.widget-link:hover { background: var(--tag-bg); }
.widget-link.active { background: var(--accent); color: #fff; }
.widget-link.active .widget-count { color: rgba(255,255,255,.7); }
.widget-count { font-size: .78rem; color: var(--text-muted); }

/* Keyword-Cloud */
.keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}
.kw-cloud-btn {
    font-size: .78rem;
    padding: .2rem .6rem;
    border-radius: 20px;
    background: var(--tag-bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, color .12s;
}
.kw-cloud-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.kw-cloud-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Skeleton loader */
.skeleton-line {
    display: block;
    height: .85rem;
    background: linear-gradient(90deg, var(--tag-bg) 25%, var(--border) 50%, var(--tag-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin: .35rem 0;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Vorheriger / Nächster ───────────────────────────────────── */
.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.post-nav-item { display: flex; flex-direction: column; gap: .3rem; }
.post-nav-item.next { text-align: right; }
.post-nav-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.post-nav-item a { font-size: .92rem; font-weight: 600; color: var(--accent); line-height: 1.35; }
.post-nav-item a:hover { color: var(--accent-lt); }

/* ── Verwandte Artikel ───────────────────────────────────────── */
.related-posts {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.related-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.25rem;
    margin-bottom: 1.1rem;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
}
.related-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform .15s, box-shadow .15s;
}
.related-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(44,36,22,.13); text-decoration: none; }
.related-card img { width: 100%; height: 100px; object-fit: cover; display: block; }
.related-no-cover { height: 80px; display: flex; align-items: center; justify-content: center; background: var(--tag-bg); font-size: 1.5rem; color: var(--border); }
.related-card-body { padding: .65rem .75rem; display: flex; flex-direction: column; gap: .25rem; }
.related-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.related-card-body strong { font-size: .85rem; line-height: 1.3; }
.related-card-body time { font-size: .75rem; color: var(--text-muted); }

/* ── Post keywords als Links ─────────────────────────────────── */
.post-keywords {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
}
.post-keywords strong { font-size: .85rem; color: var(--text-muted); }
.post-keywords .tag { text-decoration: none; }
.post-keywords .tag:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Header spacer ───────────────────────────────────────────── */
.header-spacer { flex: 1; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 860px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 560px) {
    .blog-sidebar { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-item.next { text-align: left; }
    .related-grid { grid-template-columns: 1fr 1fr; }
}

/* ── Entwurf-Banner ─────────────────────────────────────────── */
.draft-banner {
    background: #fff8e8;
    border: 1px solid #d4900a;
    border-left: 4px solid #d4900a;
    color: #8a5c00;
    font-size: .85rem;
    padding: .6rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
