/* ============================================================
   Selbstversorgerbasis.online - Frontend Styles
   Erdiges, verspieltes Design. Keine externen Fonts (DSGVO).
   ============================================================ */

:root {
    --green-deep:  #2d5233;
    --green:       #3e7a46;
    --leaf:        #8fbc6d;
    --cream:       #faf6ec;
    --paper:       #fffdf7;
    --sand:        #f0e8d8;
    --earth:       #8b5e3c;
    --terracotta:  #d1603d;
    --ink:         #2b2c26;
    --muted:       #6e6c60;
    --line:        #e3dcc9;
    --radius:      14px;
    --shadow:      0 2px 10px rgba(60, 50, 30, .08);
    --shadow-lift: 0 10px 26px rgba(60, 50, 30, .16);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--cream);
    -webkit-font-smoothing: antialiased;
}

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

a { color: var(--green); }
a:hover { color: var(--terracotta); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--green-deep); font-weight: 800; }

.wrap        { max-width: 1160px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 780px;  margin: 0 auto; padding: 0 1.25rem; }
.section     { padding: 2.5rem 1.25rem; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 200;
    background: var(--green-deep); color: #fff; padding: .6rem 1rem;
}
.skip-link:focus { left: 0; }

/* --- Lesefortschritt --- */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 4px; width: 0;
    background: linear-gradient(90deg, var(--leaf), var(--terracotta));
    z-index: 150; transition: width .1s linear;
}

/* --- Buttons --- */
.btn {
    display: inline-block; padding: .65rem 1.4rem; border-radius: 999px;
    font-weight: 700; text-decoration: none; border: 2px solid transparent;
    cursor: pointer; font-size: 1rem; font-family: var(--font);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--green); color: #fff !important; }
.btn-primary:hover { background: var(--green-deep); }
.btn-outline { background: transparent; color: var(--green-deep) !important; border-color: var(--green); }
.hero .btn-outline { color: #fff !important; border-color: rgba(255,255,255,.65); }
.hero .btn-outline:hover { background: rgba(255,255,255,.12); }

.linklike {
    background: none; border: none; padding: 0; cursor: pointer;
    color: inherit; font: inherit; text-decoration: underline;
}

/* --- Header --- */
.site-header {
    background: var(--green-deep);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; padding: .6rem 1.25rem; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-logo { width: 44px; height: 44px; transition: transform .4s ease; }
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { color: #fff; font-weight: 800; font-size: 1.25rem; letter-spacing: .01em; }
.brand-claim { color: var(--leaf); font-size: .78rem; }

.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
    color: #eef3e6; text-decoration: none; padding: .45rem .8rem;
    border-radius: 999px; font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }

.nav-search { display: flex; }
.nav-search input {
    border: none; border-radius: 999px 0 0 999px; padding: .45rem .9rem;
    font-size: .9rem; width: 130px; background: rgba(255,255,255,.92);
}
.nav-search button {
    border: none; border-radius: 0 999px 999px 0; padding: .45rem .7rem;
    background: var(--leaf); cursor: pointer; font-size: .9rem;
}

.nav-toggle { display: none; }

/* --- Hero --- */
.hero { background: linear-gradient(160deg, var(--green-deep) 0%, var(--green) 70%, #4d8a55 100%); position: relative; overflow: hidden; }
.hero-inner {
    display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem;
    align-items: center; padding: 3.5rem 1.25rem 4.5rem;
}
.hero-kicker { color: var(--leaf); font-weight: 700; letter-spacing: .06em; margin: 0 0 .5rem; }
.hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.9rem); margin: 0 0 1rem; }
.hero .accent {
    background: linear-gradient(transparent 62%, var(--terracotta) 62%, var(--terracotta) 92%, transparent 92%);
    padding: 0 .1em;
}
.hero-sub { color: #dfe9d4; font-size: 1.15rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .8rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-art img { border-radius: var(--radius); box-shadow: var(--shadow-lift); transform: rotate(2deg); }
.hero-art-fallback::before {
    content: "🌻🥕⛺"; font-size: 4rem; display: grid; place-items: center;
    height: 260px; background: rgba(255,255,255,.08); border-radius: var(--radius);
    letter-spacing: .3em;
}
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; line-height: 0; }
.hero-wave svg { width: 100%; height: 46px; }

/* --- Sektionen --- */
.section-title { font-size: 1.6rem; margin: 0 0 1.4rem; }

/* --- Featured --- */
.featured-post {
    display: grid; grid-template-columns: 1.05fr .95fr; gap: 0;
    background: var(--paper); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
    border: 1px solid var(--line);
}
.featured-image img { width: 100%; height: 100%; object-fit: cover; min-height: 280px; }
.featured-body { padding: 1.8rem; display: flex; flex-direction: column; gap: .6rem; align-items: flex-start; }
.featured-body h3 { margin: 0; font-size: 1.5rem; }
.featured-body h3 a { color: inherit; text-decoration: none; }
.featured-body h3 a:hover { color: var(--terracotta); }

/* --- Kategorie-Kacheln --- */
.category-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.category-tile {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem 1.2rem; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column; gap: .3rem;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.category-tile:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow-lift); color: var(--ink); }
.category-icon { font-size: 2rem; }
.category-name { font-weight: 800; color: var(--green-deep); font-size: 1.05rem; }
.category-desc { font-size: .85rem; color: var(--muted); }
.category-count {
    margin-top: .4rem; font-size: .78rem; font-weight: 700;
    color: var(--earth); background: var(--sand);
    border-radius: 999px; padding: .1rem .6rem; align-self: flex-start;
}

/* --- Artikelkarten --- */
.post-grid {
    display: grid; gap: 1.4rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.post-card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.post-card-image { aspect-ratio: 16 / 9; overflow: hidden; display: block; background: var(--sand); }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-placeholder { display: grid; place-items: center; height: 100%; font-size: 3rem; }
.post-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.post-card-category {
    align-self: flex-start; font-size: .75rem; font-weight: 800; letter-spacing: .05em;
    text-transform: uppercase; color: var(--terracotta);
}
.post-card-title { margin: 0; font-size: 1.15rem; }
.post-card-title a { color: var(--green-deep); text-decoration: none; }
.post-card-title a:hover { color: var(--terracotta); }
.post-card-teaser { margin: 0; font-size: .92rem; color: var(--muted); flex: 1; }
.post-card-meta { display: flex; gap: .45rem; font-size: .82rem; color: var(--muted); }

/* --- Archiv --- */
.archive-header { margin-bottom: 1.6rem; }
.archive-header h1 { margin: 0 0 .4rem; }
.archive-desc { color: var(--muted); max-width: 40rem; margin: 0; }
.archive-count { font-size: .85rem; font-weight: 700; color: var(--earth); }
.empty-note { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; }

.search-form { display: flex; gap: .6rem; max-width: 34rem; margin: 1rem 0; }
.search-form input {
    flex: 1; padding: .65rem 1.1rem; border-radius: 999px;
    border: 2px solid var(--line); font-size: 1rem; background: var(--paper);
}
.search-form input:focus { outline: none; border-color: var(--green); }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1.2rem; margin-top: 2rem; }
.pagination a {
    background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
    padding: .5rem 1.1rem; text-decoration: none; font-weight: 700;
}
.pagination-info { color: var(--muted); font-size: .9rem; }

/* --- Artikelseite --- */
.article-header { padding-top: 2rem; }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; gap: .45rem; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }
.article-badges { display: flex; gap: .5rem; margin-bottom: .6rem; flex-wrap: wrap; }
.badge {
    font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: #fff !important; background: var(--green); text-decoration: none;
    border-radius: 999px; padding: .2rem .7rem;
}
.badge:hover { background: var(--terracotta); }
.article-header h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); margin: 0 0 .8rem; }
.article-teaser { font-size: 1.2rem; color: var(--muted); margin: 0 0 1rem; }
.article-meta { display: flex; gap: .5rem; flex-wrap: wrap; color: var(--muted); font-size: .9rem; margin-bottom: 1.5rem; }

.article-hero { margin-bottom: 2rem; }
.article-hero img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

.toc {
    background: var(--paper); border-left: 5px solid var(--leaf); border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.1rem 1.4rem; margin-bottom: 2rem; box-shadow: var(--shadow);
}
.toc ol { margin: .5rem 0 0; padding-left: 1.2rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.article-body { font-size: 1.08rem; }
.article-body h2 {
    font-size: 1.5rem; margin: 2.2rem 0 .8rem; padding-bottom: .3rem;
    border-bottom: 3px solid var(--sand);
}
.article-body h3 { font-size: 1.2rem; margin: 1.8rem 0 .6rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: .3rem; }
.article-body pre { background: #2f3228; color: #e6e6d8; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
.article-body code { background: var(--sand); border-radius: 4px; padding: .1em .35em; font-size: .92em; }
.article-body pre code { background: none; padding: 0; }

.article-figure { margin: 1.8rem 0; }
.article-figure img { border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 auto; }
.article-figure figcaption { text-align: center; font-size: .85rem; color: var(--muted); margin-top: .5rem; }

.callout { border-radius: var(--radius); padding: 1rem 1.3rem; margin: 1.6rem 0; box-shadow: var(--shadow); }
.callout-tip  { background: #eef6e4; border-left: 5px solid var(--leaf); }
.callout-warn { background: #fdf0e3; border-left: 5px solid var(--terracotta); }
.callout-info { background: #e9f1f5; border-left: 5px solid #6d9fb5; }

.table-wrap { overflow-x: auto; margin: 1.6rem 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap table { border-collapse: collapse; width: 100%; background: var(--paper); font-size: .95rem; }
.table-wrap th { background: var(--green-deep); color: #fff; text-align: left; padding: .65rem .9rem; }
.table-wrap td { padding: .55rem .9rem; border-top: 1px solid var(--line); }
.table-wrap tbody tr:nth-child(even) { background: var(--cream); }

/* Video Zwei-Klick */
.video-consent { position: relative; margin: 1.8rem 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; background: #000; }
.video-consent img { width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.video-consent-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: .6rem; text-align: center;
    padding: 1rem; color: #fff;
}
.video-consent-overlay p { font-size: .8rem; margin: 0; max-width: 28rem; }
.video-consent-overlay a { color: var(--leaf); }
.video-consent-btn {
    background: var(--terracotta); color: #fff; border: none; border-radius: 999px;
    padding: .8rem 1.6rem; font-size: 1.05rem; font-weight: 800; cursor: pointer;
    transition: transform .15s ease;
}
.video-consent-btn:hover { transform: scale(1.05); }
.video-consent iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Affiliate-Produktbox */
.product-box {
    position: relative; background: var(--paper); border: 2px solid var(--sand);
    border-radius: var(--radius); padding: 1.3rem 1.4rem 1rem; margin: 1.8rem 0;
    box-shadow: var(--shadow);
}
.product-box-flag {
    position: absolute; top: -10px; right: 14px; background: var(--sand);
    color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; border-radius: 999px; padding: .15rem .6rem;
}
.product-box-head { font-size: 1.08rem; margin-bottom: .5rem; color: var(--green-deep); }
.product-box-criteria span { font-weight: 700; font-size: .85rem; }
.product-box-criteria ul { margin: .3rem 0 .8rem; padding-left: 1.3rem; font-size: .92rem; }
.product-box-criteria li { margin-bottom: .15rem; }
.product-box-btn {
    display: inline-block; background: var(--terracotta); color: #fff !important;
    font-weight: 700; text-decoration: none; border-radius: 999px;
    padding: .55rem 1.3rem; transition: transform .15s ease, box-shadow .15s ease;
}
.product-box-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.product-box-note { font-size: .72rem; color: var(--muted); margin: .7rem 0 0; }

/* Lies-auch-Boxen im Artikeltext */
.readalso { margin: 1.8rem 0; }
.readalso a {
    display: flex; align-items: center; gap: 1rem; text-decoration: none;
    background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--leaf);
    border-radius: var(--radius); padding: .7rem 1rem; box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
}
.readalso a:hover { transform: translateX(4px); box-shadow: var(--shadow-lift); }
.readalso img { width: 92px; height: 60px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.readalso-icon { font-size: 1.8rem; width: 92px; text-align: center; }
.readalso-kicker { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--terracotta); }
.readalso-title { display: block; font-weight: 700; color: var(--green-deep); line-height: 1.3; }

/* Themenwelt am Artikelende */
.topic-cloud {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem 1.3rem; margin: 2rem 0; box-shadow: var(--shadow);
}
.topic-cloud-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.topic-cloud .tag-own { background: var(--leaf); color: var(--green-deep) !important; }
.tag-count {
    background: rgba(0,0,0,.1); border-radius: 999px; padding: 0 .4rem;
    font-size: .72rem; margin-left: .15rem;
}

/* Kategorie-Hub-Intro */
.hub-intro {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem 1.8rem; margin-bottom: 2rem; box-shadow: var(--shadow);
}

/* Footer-Tags */
.footer-tags { display: flex; gap: .4rem; flex-wrap: wrap; }
.footer-tags a {
    background: rgba(255,255,255,.1); border-radius: 999px; padding: .12rem .6rem;
    font-size: .8rem; text-decoration: none !important;
}
.footer-tags a:hover { background: rgba(255,255,255,.22); }

.article-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin: 2rem 0; }
.tag {
    background: var(--sand); color: var(--earth) !important; text-decoration: none;
    border-radius: 999px; padding: .25rem .8rem; font-size: .85rem; font-weight: 700;
}
.tag:hover { background: var(--leaf); color: var(--green-deep) !important; }

.series-nav {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.1rem 1.4rem; margin: 2rem 0; box-shadow: var(--shadow);
}
.series-nav ol { margin: .5rem 0 0; padding-left: 1.4rem; }
.series-nav [aria-current] { font-weight: 800; color: var(--terracotta); }

.author-box {
    display: flex; gap: 1rem; align-items: center;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.2rem 1.4rem; margin: 2rem 0; box-shadow: var(--shadow);
}
.author-avatar {
    font-size: 1.8rem; background: var(--sand); border-radius: 50%;
    width: 56px; height: 56px; display: grid; place-items: center; flex-shrink: 0;
}
.author-box p { margin: .2rem 0 0; font-size: .9rem; color: var(--muted); }

/* --- Statische Seiten --- */
.static-page h1 { margin-top: 2rem; }
.static-page h2 { font-size: 1.25rem; margin-top: 1.8rem; }
.legal-note { font-size: .85rem; color: var(--muted); font-style: italic; }

/* --- 404 --- */
.notfound { text-align: center; padding-top: 4rem; padding-bottom: 4rem; }
.notfound-icon { font-size: 4rem; margin: 0; }
.notfound .hero-actions { justify-content: center; }

/* --- Footer --- */
.site-footer { background: var(--green-deep); color: #cfdbc3; margin-top: 3rem; }
.footer-grid {
    display: grid; grid-template-columns: 1.6fr 1fr 1.4fr 1fr; gap: 2rem;
    padding-top: 2.5rem; padding-bottom: 1.5rem;
}
.footer-brand { color: #fff; margin: 0 0 .5rem; }
.site-footer h3 { color: var(--leaf); font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer a, .site-footer .linklike { color: #cfdbc3; text-decoration: none; }
.site-footer a:hover, .site-footer .linklike:hover { color: #fff; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.14); padding-top: 1rem; padding-bottom: 1.2rem; font-size: .85rem; }

/* --- Consent-Banner --- */
.consent-banner {
    position: fixed; bottom: 1rem; left: 1rem; right: 1rem; z-index: 300;
    display: flex; justify-content: center;
}
.consent-banner[hidden] { display: none; }
.consent-inner {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lift); padding: 1.3rem 1.6rem; max-width: 620px;
}
.consent-inner h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.consent-inner p { margin: 0 0 1rem; font-size: .9rem; }
.consent-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

/* --- Nach oben --- */
.to-top {
    position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
    width: 46px; height: 46px; border-radius: 50%; border: none;
    background: var(--green); color: #fff; font-size: 1.2rem; cursor: pointer;
    box-shadow: var(--shadow-lift); opacity: 0; pointer-events: none;
    transition: opacity .25s ease, transform .15s ease;
}
.to-top.visible { opacity: 1; pointer-events: auto; }
.to-top:hover { transform: translateY(-3px); }

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; padding-bottom: 4rem; }
    .hero-art { display: none; }
    .featured-post { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    .nav-toggle {
        display: flex; flex-direction: column; gap: 5px; margin-left: auto;
        background: none; border: none; cursor: pointer; padding: .5rem;
    }
    .nav-toggle span { width: 26px; height: 3px; background: #fff; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
    .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .site-nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: var(--green-deep); flex-direction: column; align-items: stretch;
        padding: 1rem 1.25rem 1.4rem; gap: .8rem; box-shadow: 0 12px 20px rgba(0,0,0,.25);
    }
    .site-nav.open { display: flex; }
    .site-nav ul { flex-direction: column; }
    .nav-search input { width: 100%; flex: 1; }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .brand-claim { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
}
