/* Notifiier Theme */
:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --border: #2a2d3a;
    --text: #e8eaf0;
    --muted: #8b8fa8;
    --accent: #5b8dee;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "Fira Code", Consolas, "Courier New", monospace;
}

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

html { font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

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

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

/* ─── Header ─────────────────────────────────── */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.site-logo img {
    height: 36px;
    width: auto;
    display: block;
    transition: opacity 0.15s;
}

.site-logo:hover img { opacity: 0.8; }

/* Dark theme (default): show dark-palette logo, hide light-palette logo */
.logo-light { display: none; }
.logo-dark  { display: block; }

@media (prefers-color-scheme: light) {
    .logo-light { display: block; }
    .logo-dark  { display: none; }
}

.site-nav ul { display: flex; gap: 1.5rem; list-style: none; }
.site-nav a { color: var(--muted); font-size: 0.875rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav .nav-current a { color: var(--text); }

/* ─── Main ───────────────────────────────────── */
.site-main { flex: 1; padding: 3rem 0; }

/* ─── Site description ───────────────────────── */
.site-description {
    margin-bottom: 2.5rem;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ─── Post list ──────────────────────────────── */
.post-list { display: flex; flex-direction: column; gap: 0; }

.post-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.post-card:last-child { border-bottom: none; }

.post-card-image-link { display: block; margin-bottom: 1.25rem; }

.post-card-image-link img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.post-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }

.post-card-excerpt {
    color: var(--muted);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.post-card-author::before { content: "·"; margin-right: 0.75rem; }

/* ─── Pagination ─────────────────────────────── */
.pagination {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.pagination .newer-posts, .pagination .older-posts {
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    transition: border-color 0.15s;
}

.pagination .newer-posts:hover, .pagination .older-posts:hover {
    border-color: var(--accent);
    text-decoration: none;
}

/* ─── Tag header ─────────────────────────────── */
.tag-header { margin-bottom: 2.5rem; }
.tag-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.tag-description { color: var(--muted); }

/* ─── Single post ────────────────────────────── */
.post-header { margin-bottom: 2.5rem; }

.post-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.post-meta {
    font-size: 0.875rem;
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.post-author::before { content: "·"; margin-right: 0.5rem; }

.post-feature-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1.5rem;
    display: block;
}

.post-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
    margin: 2.25rem 0 0.75rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.post-content h1 { font-size: 1.9rem; }
.post-content h2 { font-size: 1.5rem; }
.post-content h3 { font-size: 1.25rem; }

.post-content p { margin-bottom: 1.25rem; }

.post-content ul, .post-content ol {
    margin: 0.75rem 0 1.25rem 1.75rem;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--muted);
    font-style: italic;
}

.post-content code {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.post-content pre {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.post-content img { border-radius: 6px; margin: 1.25rem 0; }
.post-content a { color: var(--accent); }
.post-content a:hover { text-decoration: underline; }

.post-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.post-content th, .post-content td {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th { background: var(--surface); font-weight: 600; }

/* ─── Post footer / tags ─────────────────────── */
.post-footer { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.post-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--muted);
    transition: border-color 0.15s, color 0.15s;
}

.post-tag:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* ─── Static page ────────────────────────────── */
.page-header { margin-bottom: 2rem; }
.page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; }
.page-content { line-height: 1.8; font-size: 1.05rem; }
.page-content p { margin-bottom: 1.25rem; }
.page-content h2, .page-content h3 { margin: 2rem 0 0.75rem; }
.page-content ul, .page-content ol { margin: 0.75rem 0 1.25rem 1.75rem; }
.page-content a { color: var(--accent); }

/* ─── Error page ─────────────────────────────── */
.error-page { text-align: center; padding: 5rem 0; }
.error-page h1 { font-size: 5rem; font-weight: 800; color: var(--accent); margin-bottom: 0.75rem; }
.error-page p { color: var(--muted); margin-bottom: 2rem; font-size: 1.1rem; }
.error-home-link {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.9rem;
    transition: background 0.15s;
}
.error-home-link:hover { background: var(--accent); color: var(--bg); text-decoration: none; }

/* ─── Footer ─────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.8rem;
}

/* ─── Koenig editor card widths ─────────────── */
.post-content .kg-width-wide {
    margin-left: -4rem;
    margin-right: -4rem;
}

.post-content .kg-width-full {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
}

.post-content .kg-image { max-width: 100%; }
.post-content .kg-gallery-container { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0; }
.post-content .kg-gallery-row { display: flex; gap: 0.5rem; width: 100%; }
.post-content .kg-gallery-image { flex: 1; min-width: 0; }
.post-content .kg-gallery-image img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }

/* ─── Early-access CTA ───────────────────────── */
.early-access-cta {
    margin-top: 3rem;
    padding: 2.25rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.cta-inner { max-width: 520px; }

.cta-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.cta-desc {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.55;
}

.cta-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cta-input {
    flex: 1;
    min-width: 200px;
    padding: 0.65rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.cta-input:focus { border-color: var(--accent); }
.cta-input::placeholder { color: var(--muted); }

.cta-btn {
    padding: 0.65rem 1.4rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.cta-btn:hover { opacity: 0.85; }

.cta-error {
    color: #e06c75;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 0;
}

.cta-success {
    color: #98c379;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    min-height: 0;
}

.cta-privacy {
    margin-top: 0.75rem;
    color: var(--muted);
    font-size: 0.78rem;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 600px) {
    .post-title { font-size: 1.75rem; }
    .site-header .container { flex-direction: column; align-items: flex-start; }
    .post-card-image-link img { height: 180px; }
    .cta-row { flex-direction: column; }
    .cta-btn { width: 100%; }
    .early-access-cta { padding: 1.75rem 1.5rem; }
}
