/* ============================================================
   web.mm Blog — Blueprint-Theme
   Dunkel als Standard, Hell umschaltbar via [data-theme="light"].
   Farben aus dem web.mm-Designsystem.
   ============================================================ */

:root {
    --navy:        #0b1b3a;
    --blue:        #2563eb;
    --blue-hover:  #1d4ed8;
    --azure:       #38bdf8;

    /* Dunkel (Standard) */
    --bg:          #070f1f;
    --bg-2:        #0b1b3a;
    --surface:     #0f2145;
    --surface-2:   #13284f;
    --border:      #1d2b52;
    --text:        #e6edf7;
    --muted:       #93a4c4;
    --hero-overlay: rgba(7, 15, 31, .72);
}

[data-theme="light"] {
    --bg:          #f6f8fc;
    --bg-2:        #eef2fa;
    --surface:     #ffffff;
    --surface-2:   #f0f4fb;
    --border:      #d7e0f0;
    --text:        #0b1b3a;
    --muted:       #5b6b8c;
    --hero-overlay: rgba(11, 27, 58, .55);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--gh-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
    line-height: 1.65;
    font-size: 1.05rem;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--azure); text-decoration: none; }
a:hover { color: var(--blue); }

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

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem; }
.wrap-narrow { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: flex; align-items: center; gap: 1.5rem;
    height: 64px;
}
.site-brand { display: flex; align-items: center; }
.site-logo { max-height: 34px; width: auto; }
.site-title { font-weight: 700; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.site-nav a {
    color: var(--muted); font-weight: 500; font-size: .96rem;
    padding: .35rem 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--blue); }

.theme-toggle {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    width: 38px; height: 38px; cursor: pointer; font-size: 1.1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
}
.theme-toggle:hover { border-color: var(--blue); background: var(--surface-2); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    background: linear-gradient(160deg, var(--bg-2), var(--bg));
    background-size: cover; background-position: center;
    border-bottom: 1px solid var(--border);
}
.hero-has-image .hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, var(--hero-overlay), var(--hero-overlay));
}
.hero-inner { position: relative; padding: 5rem 1.25rem; text-align: center; }
.hero-title {
    margin: 0 0 .6rem; font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -.03em; color: #fff;
    text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero-desc { margin: 0 auto; max-width: 60ch; color: #d7e0f2; font-size: 1.15rem; }
[data-theme="light"] .hero-title,
[data-theme="light"] .hero-desc { color: #fff; }

/* ---------- Post-Grid ---------- */
.post-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
    padding: 3rem 0;
}
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--blue);
    box-shadow: 0 12px 34px rgba(0,0,0,.28);
}
.card-link { color: inherit; display: block; height: 100%; }
.card-image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1.15rem 1.2rem 1.35rem; }
.card-tag {
    display: inline-block; font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--azure); margin-bottom: .5rem;
}
.card-title { margin: 0 0 .5rem; font-size: 1.18rem; line-height: 1.3; letter-spacing: -.01em; color: var(--text); }
.card-excerpt { margin: 0 0 .9rem; color: var(--muted); font-size: .95rem; }
.card-meta { color: var(--muted); font-size: .82rem; display: flex; align-items: center; gap: .5rem; }
.card-dot { opacity: .5; }

/* ---------- Einzelbeitrag ---------- */
.post { padding-bottom: 4rem; }
.post-header { padding: 3.5rem 1.25rem 1.5rem; text-align: center; }
.post-tag, .post-title, .post-subtitle { display: block; }
.post-tag {
    font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--azure); margin-bottom: .8rem;
}
.post-title { margin: 0 0 .8rem; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.15; letter-spacing: -.02em; }
.post-subtitle { color: var(--muted); font-size: 1.2rem; margin: 0 0 1rem; }
.post-meta { color: var(--muted); font-size: .9rem; display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.post-author { color: var(--text); font-weight: 600; }

.post-feature { margin: 2rem auto; max-width: 1000px; }
.post-feature img { width: 100%; border-radius: 14px; border: 1px solid var(--border); }

.post-content { font-size: 1.12rem; }
.post-content > * { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.post-content h2 { font-size: 1.7rem; letter-spacing: -.01em; margin-top: 2.5rem; }
.post-content h3 { font-size: 1.35rem; margin-top: 2rem; }
.post-content a { text-decoration: underline; text-underline-offset: 3px; }
.post-content img { border-radius: 12px; }
.post-content blockquote {
    margin: 2rem 0; padding: .6rem 1.3rem; border-left: 4px solid var(--blue);
    color: var(--muted); font-style: italic;
}
.post-content pre {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
    padding: 1.1rem 1.25rem; overflow: auto; font-size: .92rem; line-height: 1.55;
}
.post-content code {
    background: var(--surface-2); border: 1px solid var(--border);
    padding: .12em .4em; border-radius: 6px; font-size: .9em;
}
.post-content pre code { background: none; border: 0; padding: 0; }

.post-tags { margin-top: 2.5rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.pill {
    display: inline-block; font-size: .82rem; color: var(--muted);
    border: 1px solid var(--border); border-radius: 999px; padding: .25rem .8rem;
}
.pill:hover { border-color: var(--blue); color: var(--text); }

/* ---------- Archiv (Tag/Autor) ---------- */
.archive-head { border-bottom: 1px solid var(--border); background: linear-gradient(160deg, var(--bg-2), var(--bg)); }
.archive-head .wrap { padding-top: 3.5rem; padding-bottom: 2.5rem; text-align: center; }
.archive-title { margin: 0 0 .5rem; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.archive-desc { margin: 0 auto; max-width: 60ch; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 1rem; padding: 1rem 0 4rem; align-items: center; }
.pagination a, .pagination .page-number {
    color: var(--muted); border: 1px solid var(--border); border-radius: 8px;
    padding: .5rem .9rem; background: var(--surface);
}
.pagination a:hover { border-color: var(--blue); color: var(--text); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); margin-top: 2rem; }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 2rem 1.25rem; flex-wrap: wrap; }
.footer-brand { color: var(--muted); font-size: .9rem; }
.footer-nav ul { list-style: none; display: flex; gap: 1.2rem; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); font-size: .9rem; }
.footer-nav a:hover { color: var(--text); }

/* ---------- Ghost-Editor (Koenig) Support ---------- */
/* Breite/volle Bilder & Karten aus dem Ghost-Editor korrekt darstellen */
.post-content :is(.kg-width-wide) {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin-left: calc(50% - 42.5vw);
    margin-right: calc(50% - 42.5vw);
    transform: none;
}
.post-content :is(.kg-width-full) {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    max-width: 100vw;
}
.post-content .kg-width-full img { border-radius: 0; }

/* Gallery-, Bookmark- und weitere Koenig-Karten (Grundstyling) */
.kg-card-hascaption { display: flex; flex-direction: column; align-items: center; }
.kg-image-card figcaption, .kg-embed-card figcaption { color: var(--muted); font-size: .9rem; text-align: center; margin-top: .6rem; }
.kg-bookmark-card, .kg-bookmark-container {
    display: flex; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text);
}
.kg-bookmark-content { padding: 1rem 1.2rem; flex: 1 1 auto; }
.kg-bookmark-title { font-weight: 600; color: var(--text); }
.kg-bookmark-description { color: var(--muted); font-size: .92rem; margin-top: .4rem; }
.kg-bookmark-thumbnail { max-width: 200px; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Custom Fonts Support (Ghost 5.67+) */
:is(body):is(.gh-font-heading-serif) h1,
:is(body):is(.gh-font-heading-serif) h2,
:is(body):is(.gh-font-heading-serif) h3 { font-family: Georgia, "Times New Roman", serif; }
:is(body):is(.gh-font-body-serif) .post-content { font-family: Georgia, "Times New Roman", serif; }

/* Ghost Custom Fonts (Settings → Design → Fonts) */
h1, h2, h3, .hero-title, .post-title, .card-title, .archive-title, .site-title {
    font-family: var(--gh-font-heading, inherit);
}
