/* ticke.de – modernes Theme für simpleCMS. Keine externen Ressourcen (Schriften: Systemschriften). */
:root {
    --bg: #f5f4fa;
    --surface: #ffffff;
    --ink: #1b1830;
    --muted: #5f5b78;
    --line: #e5e2f0;
    --night: #12101f;
    --night-2: #1d1933;
    --accent: #7c3aed;
    --accent-2: #db2777;
    --accent-soft: #f1ebff;
    --radius: 1rem;
    --shadow: 0 1px 2px rgb(18 16 31 / .06), 0 8px 24px rgb(18 16 31 / .06);
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 1.0625rem/1.7 var(--font);
    color: var(--ink);
    background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: .25rem; }

.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; border-radius: .5rem; z-index: 10; }
.skip:focus { left: .5rem; }

/* ---------- Kopfleiste ---------- */
.topbar {
    position: sticky; top: 0; z-index: 5;
    background: color-mix(in srgb, var(--night) 92%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid rgb(255 255 255 / .06);
}
.topbar-inner {
    max-width: 76rem; margin: auto; padding: .75rem 1.25rem;
    display: flex; align-items: center; gap: 1.5rem;
}
.brand {
    display: inline-flex; align-items: center; gap: .6rem; flex: none;
    color: #fff; text-decoration: none; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em;
}
.brand:hover { color: #fff; }
.brand-mark {
    width: 1.9rem; height: 1.35rem; border-radius: .35rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-mask: radial-gradient(circle at 0 50%, transparent .32rem, #000 .33rem) left / 51% 100% no-repeat,
                  radial-gradient(circle at 100% 50%, transparent .32rem, #000 .33rem) right / 51% 100% no-repeat;
            mask: radial-gradient(circle at 0 50%, transparent .32rem, #000 .33rem) left / 51% 100% no-repeat,
                  radial-gradient(circle at 100% 50%, transparent .32rem, #000 .33rem) right / 51% 100% no-repeat;
}
.mainnav { min-width: 0; flex: 1; }
.mainnav ul {
    display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none;
    overflow-x: auto; scrollbar-width: none;
}
@media (max-width: 60rem) {
    .mainnav ul { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 2rem; }
}
.mainnav ul::-webkit-scrollbar { display: none; }
.mainnav a {
    display: block; white-space: nowrap; padding: .45rem .85rem; border-radius: 999px;
    color: #d9d5ee; text-decoration: none; font-weight: 600; font-size: .95rem;
}
.mainnav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.mainnav li:first-child { display: none; } /* "Start" – das Logo führt bereits zur Startseite */

/* ---------- Seitenraster ---------- */
.page {
    max-width: 76rem; margin: auto; padding: 1.5rem 1.25rem 3rem;
    display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 60rem) {
    .page { grid-template-columns: minmax(0, 1fr) 18rem; align-items: start; padding-top: 2rem; }
    .sidebar { position: sticky; top: 5rem; }
}
.content {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: clamp(1.1rem, 3vw, 2.5rem); min-width: 0;
}

/* ---------- Brotkrumen ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .875rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: .5rem; color: #b3aecb; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb:not(:has(li + li)) { display: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- Bannerbild ---------- */
.hero { margin: 0 0 1.75rem; border-radius: calc(var(--radius) - .25rem); overflow: hidden; background: var(--night-2); }
.hero img { width: 100%; aspect-ratio: 1080 / 250; object-fit: cover; }
@media (max-width: 40rem) { .hero img { aspect-ratio: 16 / 7; } }

/* ---------- Text ---------- */
.story h1 {
    margin: 0 0 1rem; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 800;
}
.story h1 + p { font-size: 1.15rem; color: var(--muted); }
.story h2 {
    margin: 2.25rem 0 .75rem; font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); line-height: 1.3; letter-spacing: -.01em;
    display: flex; align-items: center; gap: .65rem;
}
.story h2::before {
    content: ""; flex: none; width: .35rem; height: 1.3em; border-radius: 999px;
    background: linear-gradient(var(--accent), var(--accent-2));
}
.story p { margin: 0 0 1rem; }
.story ul { margin: 0 0 1.25rem; padding: 0; list-style: none; display: grid; gap: .5rem; }
.story li { position: relative; padding-left: 1.6rem; }
.story li::before {
    content: ""; position: absolute; left: .2rem; top: .62em; width: .55rem; height: .55rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
/* Listen, die nur aus Links zu Unterkategorien bestehen, werden zu Karten */
.story ul:has(> li > a:first-child) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .75rem;
}
.story ul:has(> li > a:first-child) li {
    padding: .9rem 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #fcfbff;
    color: var(--muted); font-size: .95rem; line-height: 1.45; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.story ul:has(> li > a:first-child) li::before { display: none; }
.story ul:has(> li > a:first-child) li:hover { border-color: #cdbcf7; transform: translateY(-2px); box-shadow: var(--shadow); }
.story ul:has(> li > a:first-child) li a { display: block; font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; margin-bottom: .15rem; }
.story ul:has(> li > a:first-child) li a::after { content: " →"; color: var(--accent); }
.story ul:has(> li > a:first-child) .sep { display: none; }

.search-results a { text-decoration: none; }
.search-results h3 { margin: .75rem 0; }

/* ---------- Seitenleiste ---------- */
.sidebar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.25rem; }
.card:not(:has(li, form)) { display: none; }
.card h3 { margin: 0 0 .75rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card ul { margin: 0; padding: 0; list-style: none; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips a {
    display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: var(--accent-soft);
    color: #5b21b6; text-decoration: none; font-size: .9rem; font-weight: 600;
}
.chips a:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.related li + li { margin-top: .4rem; }

.search form { display: flex; gap: .5rem; }
.search input[type="search"] {
    flex: 1; width: 100%; min-width: 0; font: inherit; font-size: .95rem; padding: .6rem .9rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink);
}
.search input[type="search"]:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(124 58 237 / .18); }
.search button {
    font: inherit; font-size: .95rem; font-weight: 700; padding: .6rem 1rem; border: 0; border-radius: 999px; cursor: pointer;
    color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.search button:hover { filter: brightness(1.08); }

/* ---------- Fußzeile ---------- */
.footer { background: var(--night); color: #a9a4c6; }
.footer-inner { max-width: 76rem; margin: auto; padding: 2rem 1.25rem; display: grid; gap: .75rem; font-size: .9rem; }
.footer ul { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer a { color: #e7e4f7; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
