/*
Theme Name: Flavor Developer
Theme URI: https://example.com/flavor-developer
Author: Dennis Redder
Author URI: https://example.com
Description: Ein schlankes, gut lesbares Magazin-Theme mit konfigurierbarer Akzentfarbe, sticky Inhaltsverzeichnis und einfacher Bedienung. Klassisches Theme – kein Full Site Editing nötig.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flavor-developer
Tags: blog, magazine, one-column, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ============================================
   LOKALE FONTS (DSGVO-konform, kein Google-Request)
   Dateien liegen in assets/fonts/
   ============================================ */
@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/roboto-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('assets/fonts/roboto-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('assets/fonts/roboto-700.woff2') format('woff2');
}

/* ============================================
   CSS CUSTOM PROPERTIES
   Akzentfarbe wird per Customizer überschrieben
   ============================================ */
:root {
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --accent-light: #e8f2ff;
    --text: #1a1a1a;
    --text-light: #555;
    --text-muted: #888;
    --bg: #ffffff;
    --bg-light: #f7f8fa;
    --border: #e2e5e9;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --header-height: 130px;
    --content-width: 1140px;
    --content-narrow: 780px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}

.header-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

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

.site-logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.site-logo-text:hover { color: var(--accent); }

/* ============================================
   NAVIGATION
   ============================================ */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 4px;
}

.nav-menu > li > a {
    display: block;
    padding: 8px 16px;
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    border-radius: var(--radius);
    transition: background 0.2s, color 0.2s;
}

.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-parent > a,
.nav-menu > li.current-menu-ancestor > a {
    background: var(--accent-light);
    color: var(--accent);
}

/* Submenu */
.nav-menu li.menu-item-has-children {
    position: relative;
}

.nav-menu .sub-menu {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s;
}

.nav-menu li.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 8px 20px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.15s;
}

.nav-menu .sub-menu li a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* ============================================
   HERO
   ============================================ */
.hero {
    position: relative;
    background: var(--bg-light);
    background-size: cover;
    background-position: center;
    padding: 80px 0;
    text-align: center;
    min-height: 320px;
    display: flex;
    align-items: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.72) 0%,
        rgba(0, 0, 0, 0.6) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 14px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Hero without image fallback */
.hero--no-image {
    background: var(--bg-light);
}
.hero--no-image .hero-overlay { display: none; }
.hero--no-image .hero-title {
    color: var(--text);
    text-shadow: none;
}
.hero--no-image .hero-subtitle {
    color: var(--text-light);
    text-shadow: none;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 48px 0 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* ============================================
   POST GRID (Startseite & Archiv)
   ============================================ */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.post-card-image {
    display: block;
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--bg-light);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 20px;
}

.post-card-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent);
    background: var(--accent-light);
    padding: 3px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.post-card-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card-content h3 a {
    color: var(--text);
}
.post-card-content h3 a:hover {
    color: var(--accent);
}

.post-card-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 12px;
}

.post-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 40px 0 60px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.pagination .current,
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
}

.pagination a.page-numbers {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}
.pagination a.page-numbers:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ============================================
   SINGLE POST LAYOUT
   ============================================ */
.single-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    padding: 40px 0 60px;
    align-items: start;
}

/* Table of Contents (sticky sidebar) */
.toc-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
}

.toc-sidebar h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.toc-list {
    list-style: none;
}

.toc-list li {
    margin-bottom: 2px;
}

.toc-list a {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-light);
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    transition: all 0.15s;
    line-height: 1.4;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-light);
}

.toc-list .toc-h3 {
    padding-left: 24px;
    font-size: 12px;
}

/* ============================================
   ARTICLE CONTENT
   ============================================ */
.article-header {
    margin-bottom: 32px;
}

.article-breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--accent); }

.article-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: var(--text-muted);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.article-featured-image {
    margin-bottom: 32px;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
}

/* Article Body – Gutenberg block styles */
.article-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 16px;
    color: var(--text);
}

.article-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text);
}

.article-body p {
    margin-bottom: 20px;
    color: var(--text);
}

.article-body ul, .article-body ol {
    margin: 0 0 20px 24px;
}

.article-body li {
    margin-bottom: 6px;
}

.article-body blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--text-light);
}

.article-body img {
    border-radius: var(--radius);
    margin: 24px 0;
}

.article-body figure {
    margin: 24px 0;
}

.article-body figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* Gutenberg alignment classes */
.alignwide {
    max-width: calc(var(--content-width) - 48px);
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 24px;
    margin-bottom: 12px;
}

.alignright {
    float: right;
    margin-left: 24px;
    margin-bottom: 12px;
}

/* Article Tags */
.article-tags {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-link {
    display: inline-block;
    padding: 4px 14px;
    font-size: 13px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-light);
}
.tag-link:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent);
}

/* ============================================
   CATEGORY / ARCHIVE HEADER
   ============================================ */
.archive-header {
    background: var(--bg-light);
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
}

.archive-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.archive-header p {
    color: var(--text-light);
    margin-top: 8px;
    max-width: 600px;
}

/* ============================================
   PAGE TEMPLATE
   ============================================ */
.page-content {
    max-width: var(--content-narrow);
    margin: 0 auto;
    padding: 48px 24px 60px;
}

.page-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    padding: 48px 0 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}

.footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    color: var(--text);
}

.footer-col p {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a {
    font-size: 14px;
    color: var(--text-light);
}
.footer-col ul a:hover { color: var(--accent); }

.footer-bottom {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--text-muted);
}
.footer-copyright { margin: 0; }
.footer-legal-nav { margin: 0; }
.footer-legal-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.footer-legal-menu li a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}
.footer-legal-menu li a:hover {
    color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .single-layout {
        grid-template-columns: 1fr;
    }
    .toc-sidebar {
        position: static;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 16px 20px;
        margin-bottom: 24px;
        background: var(--bg-light);
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 640px) {
    body { font-size: 16px; }

    .nav-menu { display: none; }
    .nav-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        padding: 16px;
        gap: 0;
    }
    .nav-menu.open > li > a {
        padding: 12px 16px;
    }
    .nav-menu.open .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: 16px;
    }
    .mobile-menu-toggle { display: flex; }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .hero { padding: 48px 0; min-height: 220px; }
    .hero-title { font-size: 1.6rem; }

    .article-title { font-size: 1.5rem; }

    .article-meta {
        flex-direction: column;
        gap: 4px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}
