/*
Theme Name: Dark Blog Theme
Theme URI: https://gerber.ag
Author: Gerber Family
Description: Dunkles Vintage-Blog-Theme mit 3x3 Grid, Logo-Platzhalter und Navigation
Version: 2.4
License: GNU General Public License v2 or later
Tags: dark, blog, grid, vintage
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary:    #3a3a3a;
    --bg-secondary:  #424242;
    --bg-card:       #4a4a4a;
    --bg-nav:        #1e1e1e;
    --bg-sidebar:    #252525;
    --text-primary:  #f0f0f0;
    --text-secondary:#c8d4dc;
    --text-muted:    #7a8f9e;
    --accent:        #8aa0b8;
    --accent-hover:  #adc0d4;
    --border:        #505050;
    --border-light:  #606060;
    --shadow:        rgba(0,0,0,0.45);
    --font-serif:    Georgia, 'Times New Roman', serif;
    --font-sans:     'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-primary);
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; display: block; }

/* ===== PAGE WRAPPER ===== */
#page { display: flex; flex-direction: column; min-height: 100vh; }

/* ================================================
   HEADER
   ================================================ */
#site-header {
    background-color: #0f0f0f;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 16px var(--shadow);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    height: 70px;
    gap: 24px;
}

/* Logo / Branding */
.site-branding { flex-shrink: 0; display: flex; align-items: center; }

.logo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 52px;
    border: 1px dashed #3a3028;
    border-radius: 4px;
    background: var(--bg-sidebar);
    gap: 8px;
    cursor: default;
    text-decoration: none;
}
.logo-placeholder svg { opacity: .35; flex-shrink: 0; }
.logo-placeholder span {
    color: var(--text-muted);
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    line-height: 1.35;
    opacity: .7;
}

.site-logo img { max-height: 80px; width: auto; }

/* Seitenname + Beschreibung neben Logo */
.site-title-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 16px;
    border-left: 1px solid var(--border-light);
}
.site-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    line-height: 1.2;
}
.site-title a { color: var(--text-primary); }
.site-title a:hover { color: var(--accent); }
.site-description {
    font-family: var(--font-serif);
    font-size: .78rem;
    color: var(--text-muted);
    letter-spacing: .06em;
    font-style: italic;
    margin-top: 3px;
}

.site-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.site-title a { color: var(--text-primary); }
.site-title a:hover { color: var(--accent); }

/* Top Navigation */
#top-nav { flex: 1; overflow: hidden; }

#top-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    align-items: center;
}
#top-menu > li > a {
    display: block;
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 3px;
    font-size: .84rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background .18s, color .18s;
}
#top-menu > li > a:hover,
#top-menu > li.current-menu-item > a,
#top-menu > li.current_page_item > a {
    color: var(--accent);
    background: rgba(201,162,39,.09);
}
#top-menu li { position: relative; }
#top-menu li ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-nav);
    border: 1px solid var(--border);
    border-radius: 4px;
    min-width: 180px;
    padding: 6px 0;
    z-index: 999;
    list-style: none;
    box-shadow: 0 8px 24px var(--shadow);
}
#top-menu li:hover > ul { display: block; }
#top-menu li ul li a {
    display: block;
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: .84rem;
}
#top-menu li ul li a:hover { color: var(--accent); }

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: .84rem;
    margin-left: auto;
    flex-shrink: 0;
}
.menu-toggle:hover { color: var(--accent); border-color: var(--accent); }

/* ================================================
   CONTENT AREA
   ================================================ */
#content-area {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 30px 28px;
    display: flex;
    gap: 30px;
}

/* ================================================
   SIDEBAR
   ================================================ */
#sidebar { width: 230px; flex-shrink: 0; }
.sidebar-inner {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.sidebar-nav, .widget {
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
}
.sidebar-nav h3, .widget-title {
    font-family: var(--font-serif);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--accent);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
#sidebar-menu { list-style: none; }

/* Oberste Ebene */
#sidebar-menu > li > a {
    display: block;
    color: var(--text-secondary);
    padding: 7px 10px;
    border-radius: 3px;
    font-size: .87rem;
    font-weight: 600;
    transition: all .18s;
}
#sidebar-menu > li > a:hover,
#sidebar-menu > li.current-menu-item > a,
#sidebar-menu > li.current_page_item > a {
    color: var(--accent);
    background: rgba(201,162,39,.07);
}

/* Untermenü-Container */
#sidebar-menu .sub-menu {
    list-style: none;
    margin: 2px 0 4px 0;
    padding: 0;
    border-left: 2px solid var(--border-light);
    margin-left: 12px;
}

/* Erste Unterebene */
#sidebar-menu .sub-menu li a {
    display: block;
    color: var(--text-muted);
    padding: 5px 10px 5px 12px;
    border-radius: 3px;
    font-size: .83rem;
    font-weight: 400;
    transition: all .18s;
}
#sidebar-menu .sub-menu li a:hover,
#sidebar-menu .sub-menu li.current-menu-item a,
#sidebar-menu .sub-menu li.current_page_item a {
    color: var(--accent);
    background: rgba(201,162,39,.06);
}

/* Zweite Unterebene */
#sidebar-menu .sub-menu .sub-menu {
    margin-left: 10px;
    border-left-color: var(--border);
}
#sidebar-menu .sub-menu .sub-menu li a {
    font-size: .8rem;
    padding-left: 14px;
    opacity: .8;
}

/* Pfeil-Indikator */
.menu-child-indicator {
    color: var(--accent);
    opacity: .55;
    font-size: .8em;
    margin-right: 3px;
    font-style: normal;
}
.menu-grandchild-indicator { opacity: .35; }

/* Einrück-Indikator für Unterseiten */
.menu-indent {
    color: var(--accent);
    opacity: .5;
    font-size: .8em;
}

/* Home-Link speziell hervorheben */
#sidebar-menu > li:first-child > a {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
    padding-bottom: 10px;
    font-size: .85rem;
}
.widget ul { list-style: none; }
.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: .87rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a { color: var(--text-secondary); }
.widget ul li a:hover { color: var(--accent); }

/* ================================================
   MAIN COLUMN
   ================================================ */
#main { flex: 1; min-width: 0; }

.page-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-header::before {
    content: '';
    display: block;
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}
.page-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: .03em;
}

/* ================================================
   BLOG GRID 3×3
   ================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 7px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px var(--shadow);
    border-color: rgba(201,162,39,.3);
}

/* Thumbnail always 16:9 */
a.post-thumbnail {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
    position: relative;
}
a.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.post-card:hover a.post-thumbnail img { transform: scale(1.05); }

.post-thumbnail-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #2a3038;
    color: var(--text-muted);
    overflow: hidden;
}
.post-thumbnail-placeholder svg { opacity: .3; }
.post-thumbnail-placeholder span {
    font-size: .67rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    opacity: .45;
    font-family: var(--font-serif);
}

.post-body {
    padding: 15px 16px 17px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.post-title {
    font-family: var(--font-serif);
    font-size: .92rem;
    font-weight: 700;
    line-height: 1.4;
}
.post-title a { color: var(--text-primary); }
.post-title a:hover { color: var(--accent); }
.post-excerpt {
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ================================================
   SINGLE POST / PAGE
   ================================================ */
.single-post, .page-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 36px 40px;
}
.single-post .post-title, .page-content .entry-title {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 22px;
    color: var(--text-primary);
}
.single-post > a.post-thumbnail {
    border-radius: 6px;
    margin-bottom: 26px;
    aspect-ratio: 16 / 7;
}
.entry-content {
    color: var(--text-secondary);
    line-height: 1.85;
}
.entry-content h1,.entry-content h2,.entry-content h3,
.entry-content h4,.entry-content h5,.entry-content h6 {
    font-family: var(--font-serif);
    color: var(--text-primary);
    margin: 1.5em 0 .5em;
}
.entry-content p { margin-bottom: 1.1em; }
.entry-content a { color: var(--accent); text-decoration: underline; }
.entry-content ul,.entry-content ol { margin: 1em 0 1em 2em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 1.5em 0;
    background: var(--bg-sidebar);
    border-radius: 0 6px 6px 0;
    font-style: italic;
}
.entry-content code {
    background: var(--bg-nav);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: .9em;
    color: #a8d8a8;
}
.entry-content pre {
    background: var(--bg-nav);
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5em 0;
    border: 1px solid var(--border);
}
.entry-content img { border-radius: 6px; margin: 1.2em 0; }

/* ================================================
   PAGINATION
   ================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: .84rem;
    font-weight: 600;
    border: 1px solid var(--border);
    transition: all .18s;
}
.pagination a { color: var(--text-secondary); background: var(--bg-card); }
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #1e1e1e; }

/* ================================================
   MISC
   ================================================ */
.no-posts { text-align: center; padding: 60px 20px; color: var(--text-muted); }

#site-footer {
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    padding: 18px 28px;
    text-align: center;
    color: var(--text-muted);
    font-size: .82rem;
    font-family: var(--font-serif);
    letter-spacing: .04em;
}
#site-footer a { color: var(--text-muted); }
#site-footer a:hover { color: var(--accent); }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 1100px) {
    #sidebar { width: 200px; }
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
    #content-area { flex-direction: column; padding: 18px 14px; }
    #sidebar { width: 100%; }
    .sidebar-inner { position: static; }
    .blog-grid { grid-template-columns: 1fr; }
    .single-post, .page-content { padding: 20px; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
    .menu-toggle { display: flex; align-items: center; gap: 6px; }
    #top-nav { width: 100%; display: none; }
    #top-nav.nav-open { display: block; padding-bottom: 10px; }
    #top-menu { flex-direction: column; gap: 2px; }
    #top-menu > li > a { padding: 9px 12px; }
    .logo-placeholder { width: 140px; height: 40px; font-size: .6rem; }
    .site-title-area { display: none; }
}
