/* elpado.de – Stylesheet
   Hell/Dunkel über prefers-color-scheme, mobil zuerst. */

:root {
    --bg: #f6f6f1;
    --surface: #ffffff;
    --surface-2: #eeefe8;
    --ink: #1a1d1a;
    --ink-2: #4b524c;
    --muted: #6f776f;
    --line: #dfe2d8;
    --accent: #1e8a3a;
    --accent-ink: #ffffff;
    --accent-soft: #e2f3e4;
    --error: #b3261e;
    --error-soft: #fbe9e7;
    --radius: 14px;
    --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    --wrap: 1120px;
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1210;
        --surface: #171b18;
        --surface-2: #1f2420;
        --ink: #e7ebe6;
        --ink-2: #b7beb7;
        --muted: #8b938b;
        --line: #2a302b;
        --accent: #4cc46a;
        --accent-ink: #08130b;
        --accent-soft: #183321;
        --error: #ff8a80;
        --error-soft: #3a1714;
        --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.6 var(--font);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem); }
h2 { font-size: 1.35rem; }
h3, .h3 { font-size: 1.15rem; }
.h4 { font-size: 1rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 700px) { .wrap { padding-inline: 24px; } }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* --- Header --- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 5;
}
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-block: 12px; }

.logo {
    font: 700 1.35rem/1 var(--mono);
    color: var(--ink);
    text-decoration: none;
    display: inline-flex; align-items: center;
}
.logo-prompt { color: var(--accent); margin-right: .35em; }
.logo-tld { color: var(--muted); }
.logo-cursor {
    width: .55em; height: 1em; margin-left: .2em;
    background: var(--accent);
    animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .logo-cursor { animation: none; } }

.site-nav { flex: 1 1 auto; }
.site-nav ul { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; justify-content: flex-start; }
@media (max-width: 899px) { .site-header { position: static; } }
@media (min-width: 900px) { .site-nav ul { justify-content: flex-end; } }
.site-nav a {
    display: block; white-space: nowrap;
    padding: 6px 12px; border-radius: 999px;
    color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* --- Main --- */
main { flex: 1; padding-block: 32px 48px; }

.hero { padding: 8px 0 32px; max-width: 760px; }
.eyebrow { font: 600 .8rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--ink-2); }

.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

.grid-home, .grid-detail { display: grid; gap: 24px; }
@media (min-width: 900px) {
    .grid-home { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
    .grid-detail { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}

.section-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }

/* --- Cards --- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-width: 0;
}
@media (min-width: 700px) { .card { padding: 24px 28px; } }
.card-compact { padding: 16px 20px; }
.card-compact h3 { margin-bottom: 0; }
.card-header { margin-bottom: 12px; }
.card-header h2 { margin-bottom: 4px; }
.card-header h2 a { color: inherit; text-decoration: none; }
.card-header h2 a:hover { color: var(--accent); }
.featured { border-top: 4px solid var(--accent); }
.narrow { max-width: 680px; margin-inline: auto; }
.center { text-align: center; }

.meta { color: var(--muted); font-size: .9rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.badge {
    display: inline-block; margin-bottom: 8px;
    font: 600 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
    padding: 5px 8px; border-radius: 6px;
    background: var(--accent-soft); color: var(--accent);
}
.badge-muted { background: var(--surface-2); color: var(--ink-2); }

.entry-body { margin: 0; overflow-wrap: anywhere; }

.prose { overflow-wrap: break-word; }
.prose > :last-child { margin-bottom: 0; }
.prose ul { padding-left: 1.2em; }
.prose pre, .prose code { font-family: var(--mono); font-size: .9em; }
.prose pre { background: var(--surface-2); padding: 12px 16px; border-radius: 8px; overflow-x: auto; }
.prose h1 { font-size: 1.8rem; }

.c64 {
    background: #4b45c5 !important; color: #a5a0ff;
    font-weight: 700; letter-spacing: .05em; border-radius: 8px;
}

.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 8px; }

/* --- Buttons --- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: 9px 18px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface-2);
    color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-link { background: none; border: 0; padding-inline: 0; color: var(--accent); }
.btn-block { width: 100%; margin-top: 12px; }

/* --- Fakten --- */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

/* --- Galerie --- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.gallery a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }
.photo { padding: 12px; margin: 0; }
.photo img { border-radius: 8px; }
.photo figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; text-align: center; }

/* --- Listen / Pagination --- */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li + li { border-top: 1px solid var(--line); }
.link-list a { display: block; padding: 10px 0; font-weight: 500; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; }
.pagination a, .pagination span {
    min-width: 38px; padding: 6px 10px; text-align: center; border-radius: 8px;
    border: 1px solid var(--line); background: var(--surface); text-decoration: none;
}
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pagination .disabled { color: var(--muted); opacity: .6; }
.pagination .pagination-info { border: 0; background: none; color: var(--muted); margin-left: auto; }
.stack + .pagination { margin-top: 20px; }

/* --- Formulare --- */
.form-card { margin-top: 32px; }
.form { display: grid; gap: 16px; }
.form-row { display: grid; gap: 16px; }
@media (min-width: 700px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field-small input { max-width: 120px; }
.field small { color: var(--muted); font-weight: 400; }
label { font-weight: 600; font-size: .95rem; }
.req { color: var(--accent); }
input[type="text"], input[type="email"], textarea {
    width: 100%; font: inherit; color: var(--ink);
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea { resize: vertical; min-height: 120px; }
.form .btn { justify-self: start; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.alert { border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.alert ul { margin: 0; padding-left: 1.2em; }
.alert-success { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.alert-error { background: var(--error-soft); color: var(--error); }

/* --- Fehlerseite --- */
.error-code { font: 800 5rem/1 var(--mono); color: var(--accent); margin: 0 0 8px; }
.debug { margin-top: 24px; }
.debug pre { overflow-x: auto; font-size: .8rem; white-space: pre-wrap; }

/* --- Anzeige / Footer --- */
.ad { padding-block: 0 32px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: .9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-block: 20px; }
.site-footer a { color: var(--ink-2); }

/* --- Lightbox --- */
.lightbox {
    border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh;
    width: 100vw; height: 100vh;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgb(0 0 0 / .85); }
.lightbox figure { margin: 0; max-width: min(92vw, 1100px); }
.lightbox img { max-height: 82vh; width: auto; margin-inline: auto; border-radius: 8px; }
.lightbox figcaption { color: #eee; text-align: center; margin-top: 10px; font-size: .9rem; }
.lightbox button {
    position: fixed; background: rgb(255 255 255 / .12); color: #fff; border: 0; cursor: pointer;
    width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1;
}
.lightbox button:hover { background: rgb(255 255 255 / .25); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-nav.prev { left: 16px; top: 50%; translate: 0 -50%; }
.lightbox-nav.next { right: 16px; top: 50%; translate: 0 -50%; }
