/* MakerLinks — Design System */

:root {
    --bg: #0b0f14;
    --bg-elevated: #121820;
    --bg-card: #151d27;
    --bg-card-hover: #1a2430;
    --border: #232d3a;
    --border-hover: #2f3d4f;
    --text: #e6edf3;
    --text-muted: #8b96a5;
    --text-faint: #5c6675;
    --accent: #00d4aa;
    --accent-hover: #00f0c0;
    --accent-dim: rgba(0, 212, 170, 0.12);
    --accent-2: #7c5cff;
    --accent-warm: #ff7a45;
    --accent-warm-hover: #ff9466;
    --accent-warm-dim: rgba(255, 122, 69, 0.14);
    --danger: #ff5470;
    --warning: #ffb454;
    --success: #00d4aa;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    --max-width: 1180px;
    --grid-size: 28px;
}

:root[data-theme="light"] {
    --bg: #e7ebf0;
    --bg-elevated: #f2f4f7;
    --bg-card: #f4f6f8;
    --bg-card-hover: #e9edf1;
    --border: #d5dce4;
    --border-hover: #b9c3cf;
    --text: #0f1720;
    --text-muted: #52606f;
    --text-faint: #7d8996;
    --accent: #058b74;
    --accent-hover: #04735f;
    --accent-dim: rgba(5, 139, 116, 0.10);
    --accent-2: #6d28d9;
    --accent-warm: #c2410c;
    --accent-warm-hover: #9a3412;
    --accent-warm-dim: rgba(194, 65, 12, 0.10);
    --danger: #dc2626;
    --warning: #b45309;
    --success: #058b74;
    --shadow: 0 8px 24px rgba(15, 23, 32, 0.12);
}

* { box-sizing: border-box; }

/* Removes the ~300ms tap delay on touch devices for anything clickable. */
a, button, input, select, textarea, .pill, .category-art-card {
    touch-action: manipulation;
}

html { color-scheme: dark; scroll-behavior: smooth; }
html[data-theme="light"] { color-scheme: light; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(0, 212, 170, 0.09), transparent),
        radial-gradient(ellipse 700px 500px at 90% 0%, rgba(255, 122, 69, 0.06), transparent),
        linear-gradient(rgba(230, 237, 243, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(230, 237, 243, 0.05) 1px, transparent 1px);
    background-size: auto, auto, var(--grid-size) var(--grid-size), var(--grid-size) var(--grid-size);
    background-position: 0 0, 0 0, -1px -1px, -1px -1px;
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.25s ease, color 0.25s ease;
}

[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 900px 500px at 15% -10%, rgba(5, 139, 116, 0.07), transparent),
        radial-gradient(ellipse 700px 500px at 90% 0%, rgba(194, 65, 12, 0.05), transparent),
        linear-gradient(rgba(15, 23, 32, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 32, 0.045) 1px, transparent 1px);
}

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
code, .mono { font-family: var(--font-mono); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}
[data-theme="light"] .site-header { background: rgba(238, 241, 245, 0.85); }

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    color: var(--text);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0b0f14;
    font-weight: 900;
    font-family: var(--font-mono);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { color: var(--text); background: var(--bg-card); }
.nav-links a.active { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--border-hover); }
.theme-icon-moon { display: none; }
.theme-icon-sun { display: block; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

.lang-switch { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 3px; }
.lang-switch a { padding: 4px 10px; border-radius: 16px; font-size: 12px; font-weight: 700; color: var(--text-faint); }
.lang-switch a.active { background: var(--accent); color: #0b0f14; }

.nav-toggle { display: none; }
/* Nur im Klappmenue sichtbar, siehe Medienabfrage bei 860px */
.nav-auth-mobile { display: none; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.1s, background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--accent); color: #06110d; transition: transform 0.1s, background 0.2s, box-shadow 0.2s; }
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), var(--accent-warm)); color: #06110d; box-shadow: 0 4px 18px -4px rgba(255, 122, 69, 0.45); }

.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-hover); background: var(--bg-card); color: var(--text); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 32px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); background: linear-gradient(120deg, #fff 15%, var(--accent) 70%, var(--accent-warm) 115%); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="light"] .hero h1 { background: linear-gradient(120deg, var(--text) 15%, var(--accent) 70%, var(--accent-warm) 115%); -webkit-background-clip: text; background-clip: text; }
.hero p { color: var(--text-muted); max-width: 560px; margin: 0 auto 28px; font-size: 16px; }

.hero-split { padding: 48px 0 12px; display: flex; align-items: center; gap: 40px; text-align: left; }
.hero-split .hero-text { flex: 1 1 380px; }

/* Signature moment: the headline is "printed" left-to-right on load by a small
   hotend gliding across the top — the text reveal underneath stays in lockstep. */
.hero-heading { position: relative; display: inline-block; }

.hero-split .hero-text h1 {
    font-size: clamp(28px, 4vw, 42px);
    background: linear-gradient(120deg, #fff 15%, var(--accent) 70%, var(--accent-warm) 115%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    display: inline-block;
    clip-path: inset(0 0 0 0);
    /* Safe default: fully visible with no animation, in case JS never fires (no-JS,
       script error). initHeroIntro() below adds .is-ready once the page has settled,
       which is what actually starts the print-reveal animation. */
}
[data-theme="light"] .hero-split .hero-text h1 {
    background: linear-gradient(120deg, var(--text) 15%, var(--accent) 70%, var(--accent-warm) 115%);
    -webkit-background-clip: text;
    background-clip: text;
}
.hero-heading.is-ready h1 {
    animation: print-reveal 4.5s cubic-bezier(.4, 0, .2, 1) both;
}

.hotend-icon {
    position: absolute;
    top: -32px;
    left: 100%;
    opacity: 0;
    transform: translateX(-50%);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
}
.hero-heading.is-ready .hotend-icon {
    opacity: 1;
    animation: hotend-move 4.5s cubic-bezier(.4, 0, .2, 1) both;
}
.hotend-icon .nozzle-tip {
    transform-box: fill-box;
    transform-origin: center;
    animation: nozzle-glow 0.5s ease-in-out infinite alternate;
}

@keyframes print-reveal {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}
@keyframes hotend-move {
    from { left: 0%; }
    to { left: 100%; }
}
@keyframes nozzle-glow {
    from { opacity: 0.7; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1.15); }
}

.hero-split .hero-text p {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 480px;
    margin: 0 0 24px;
    animation: fade-up 0.6s ease both;
    animation-delay: 0.5s;
}
.hero-split .hero-art {
    flex: 1 1 360px;
    max-width: 480px;
    animation: fade-up 0.7s ease both;
    animation-delay: 0.25s;
}
.hero-split .hero-art img {
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 0 32px rgba(0, 212, 170, .28));
    animation: glow-breathe 4.5s ease-in-out infinite;
}
@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes glow-breathe {
    0%, 100% { filter: drop-shadow(0 0 32px rgba(0, 212, 170, .28)); }
    50% { filter: drop-shadow(0 0 44px rgba(0, 212, 170, .4)); }
}
.pill-icon { margin-right: 5px; }

@media (max-width: 760px) {
    .hero-split { flex-direction: column; text-align: center; padding-top: 28px; gap: 12px; }
    .hero-split .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-split .hero-art { max-width: 280px; order: -1; }
}

/* ---------- Kategorie-Karten-Grid (Bild-Kacheln) ---------- */
/* Kategoriekacheln sind Navigation, keine Inhalte -- sie duerfen den
   Linkkarten darunter nicht aehneln. Deshalb: dichteres Raster, flacheres
   Format, andere Flaeche (--bg-elevated statt --bg-card) und kein staendig
   sichtbarer Rahmen. Der Rahmen erscheint erst beim Zeigen. */
/* auto-fill statt fester Spaltenzahl: passt sich selbst an die Breite an und
   spart die Breakpoints. 16/9 entspricht fast dem Seitenverhaeltnis der
   Illustrationen (900x491), es bleiben also kaum leere Raender. */
.category-art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 34px; }
.category-art-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    background: var(--bg-elevated);
    border: 1px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.category-art-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -16px rgba(0, 212, 170, .35);
}
.category-art-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 9px 9px 26px;  /* unten mehr Luft: die Beschriftung liegt darueber */
    filter: drop-shadow(0 0 16px rgba(0, 212, 170, .28));
    transition: transform .2s ease;
}
.category-art-card:hover img { transform: scale(1.04); }
.category-art-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 11px;
    background: linear-gradient(0deg, rgba(6, 10, 14, .94), rgba(6, 10, 14, .6) 72%, transparent);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.3;
    color: #e6edf3; /* always light -- this sits on a permanently dark scrim regardless of site theme */
}
.category-art-icon { font-size: 14px; }

/* Unterhalb von ~430px waere eine 200px-Spalte zu breit fuers Raster --
   dort zwei schmalere Kacheln nebeneinander statt einer riesigen. */
@media (max-width: 430px) {
    .category-art-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .category-art-label { font-size: 11.5px; padding: 6px 8px; }
}

/* ---------- Link des Monats: Laufband direkt unter der Kopfzeile ---------- */
.lom-ticker {
    background: linear-gradient(90deg, var(--accent-warm-dim), transparent 65%);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}
.lom-ticker-inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.lom-ticker-label {
    flex: none;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--accent-warm);
    white-space: nowrap;
}
.lom-ticker-viewport {
    flex: 1 1 auto;
    min-width: 0;  /* ohne das sprengt der nowrap-Inhalt den Flex-Container */
    overflow: hidden;
    /* Weiche Kanten statt harter Schnittkante am Rand des Sichtfensters */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
            mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
}
.lom-ticker-track {
    display: flex;
    width: max-content;
    animation: lom-scroll 34s linear infinite;
}
/* Anhalten, solange jemand lesen oder klicken will -- ein Link, der wegläuft,
   während man ihn treffen möchte, ist die häufigste Schwäche solcher Laufbänder. */
.lom-ticker:hover .lom-ticker-track,
.lom-ticker:focus-within .lom-ticker-track { animation-play-state: paused; }

@keyframes lom-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.lom-ticker-item {
    /* Der Abstand gehört INS Element, nicht als gap auf die Spur: bei -50%
       muss die zweite Hälfte deckungsgleich auf der ersten landen, sonst
       ruckelt die Schleife bei jedem Durchlauf um die halbe Lücke. */
    padding-right: 72px;
    white-space: nowrap;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text);
    text-decoration: none;
}
.lom-ticker-title { font-weight: 600; }
.lom-ticker-item:hover .lom-ticker-title { color: var(--accent); }
.lom-ticker-desc { color: var(--text-muted); }
.lom-ticker-desc::before { content: "–"; margin: 0 8px; color: var(--text-faint); }

@media (max-width: 640px) {
    .lom-ticker-label { font-size: 0; }           /* Text weg, Stern bleibt */
    .lom-ticker-label::first-letter { font-size: 15px; }
    .lom-ticker-item { padding-right: 48px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
    .lom-ticker-track { animation: none; }
    .lom-ticker-item:not(:first-child) { display: none; }
    .lom-ticker-item { white-space: normal; padding-right: 0; }
}

/* ---------- Search / Filters ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}
/* Suchzeile steht jetzt ganz oben, direkt unter Kopfzeile bzw. Laufband */
.toolbar-top { margin-top: 22px; }
/* Die Filterpills schliessen direkt an die Suchzeile an -- sie bilden mit ihr
   einen Block, deshalb hier enger als der normale Abstand zwischen Sektionen. */
.filter-row-top { margin-top: -10px; }
/* Zweite Filterzeile, wenn eine erste darueber steht: enger anschliessen. */
.filter-row-tight { margin-top: -16px; }

.search-box { position: relative; flex: 1 1 320px; }
.search-box input {
    width: 100%;
    padding: 12px 44px 12px 42px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box::before {
    content: "⌕";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 18px;
    pointer-events: none;
}
.search-box-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-faint);
    font-size: 19px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}
.search-box-btn:hover { color: var(--accent); background: var(--accent-dim); }

select, .select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
}

.search-elsewhere { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -16px 0 24px; font-size: 13px; color: var(--text-faint); }
.search-elsewhere a { color: var(--accent); font-weight: 600; padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.search-elsewhere a:hover { border-color: var(--accent); background: var(--accent-dim); }

.category-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.pill {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    background: var(--bg-card);
}
.pill:hover { border-color: var(--border-hover); color: var(--text); }
.pill.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ---------- Link cards ---------- */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.link-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
    position: relative;
}
.link-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); transform: translateY(-2px); }

/* Uses animation (not transition) so it never collides with .link-card's own
   hover transition on transform/border-color/background. */
.reveal { opacity: 0; }
.reveal.is-visible { animation: fade-up 0.5s ease both; }

/* Build-volume registration marks — signature detail, echoes a slicer viewport corner gizmo */
.link-card::before,
.link-card::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.link-card::before { top: 7px; left: 7px; border-top: 2px solid var(--accent-warm); border-left: 2px solid var(--accent-warm); border-radius: 3px 0 0 0; }
.link-card::after { bottom: 7px; right: 7px; border-bottom: 2px solid var(--accent-warm); border-right: 2px solid var(--accent-warm); border-radius: 0 0 3px 0; }
.link-card:hover::before, .link-card:hover::after { opacity: 0.9; }

.link-card.pinned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pinned-badge {
    position: absolute;
    top: -10px;
    right: 14px;
    background: var(--accent);
    color: #06110d;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}

/* Link des Monats — warm "heated nozzle" glow instead of the standard teal, so the one
   featured pick reads as genuinely hot/different rather than another teal card. */
.link-card.featured {
    border-color: var(--accent-warm);
    box-shadow: 0 0 0 1px var(--accent-warm), 0 12px 32px -12px rgba(255, 122, 69, 0.35);
    background: linear-gradient(180deg, rgba(255, 122, 69, 0.06), var(--bg-card) 60%);
}
.featured-badge { background: linear-gradient(135deg, var(--accent-warm), #ff9466); color: #2a0f04; }
.link-card.featured::before, .link-card.featured::after { border-color: var(--accent) !important; }

.link-card-top { display: flex; align-items: flex-start; gap: 12px; }
.link-card-top .favorite-btn { margin-left: auto; font-size: 16px; color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 2px 6px; }
.link-card-top .favorite-btn:hover { color: var(--warning); }
.link-favicon { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-elevated); flex-shrink: 0; object-fit: cover; }
.link-title { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; color: var(--text); }
.link-title a { color: inherit; }
.link-url { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-desc { font-size: 13.5px; color: var(--text-muted); flex: 1; }

.link-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.link-tag { font-size: 11px; color: var(--accent-warm); background: var(--accent-warm-dim); padding: 2px 9px; border-radius: 10px; font-weight: 600; font-family: var(--font-mono); }

/* flex-wrap und min-width:0 sind hier Pflicht, nicht Kosmetik: Flex-Kinder
   haben von Haus aus min-width:auto und schrumpfen deshalb nie unter ihre
   Inhaltsbreite. Ohne beides lief diese Zeile in schmalen Karten ueber den
   Kartenrand hinaus und erzeugte waagerechten Seitenlauf. */
.link-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
.link-meta > * { min-width: 0; }
.link-category { font-size: 11px; color: var(--accent); background: var(--accent-dim); padding: 3px 10px; border-radius: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

.link-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.stat-btn { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.stat-btn:hover { color: var(--accent); background: var(--accent-dim); }
.stat-btn.voted { color: var(--accent); }
.favorite-btn.favorited { color: var(--warning); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-supporter { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.badge-creator { background: rgba(124, 92, 255, 0.18); color: #a893ff; }
.badge-verified { background: rgba(255, 180, 84, 0.15); color: var(--warning); }

/* The light-mode accent is a darker teal (needed for AA text contrast on white), which
   means it's no longer light enough for near-black text on top of it as a background --
   these spots use --accent/--accent-2 as a solid fill with dark text, so they need to
   flip to white text specifically in light mode. */
[data-theme="light"] .brand-mark,
[data-theme="light"] .lang-switch a.active,
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .pinned-badge,
[data-theme="light"] .pagination .current,
[data-theme="light"] .featured-badge {
    color: #ffffff;
}
/* These two are hardcoded light tints meant to sit on a dark page background --
   too low-contrast against white, so darken them specifically for light mode. */
[data-theme="light"] .alert-error { color: var(--danger); }
[data-theme="light"] .badge-creator { color: var(--accent-2); }

/* ---------- Comments ---------- */
.comments-panel { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.comments-panel[hidden] { display: none; }
.comments-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.comment-item { font-size: 13px; background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 8px 10px; }
.comment-item .comment-author { font-weight: 700; color: var(--text); margin-right: 6px; }
.comment-item .comment-time { color: var(--text-faint); font-size: 11px; margin-left: 6px; }
.comment-item .comment-body { color: var(--text-muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .btn { align-self: flex-start; }

/* ---------- Link melden ---------- */
.report-panel { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.report-panel[hidden] { display: none; }
.report-form { display: flex; flex-direction: column; gap: 8px; }
.report-form textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}
.report-form textarea:focus { outline: none; border-color: var(--accent); }
.report-form .btn { align-self: flex-start; }
.report-toggle.reported { color: var(--danger); }

/* ---------- Registrierungs-Sperre ---------- */
.gate-cta {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    margin: 8px 0 40px;
}
.gate-cta h2 { font-size: 22px; margin-bottom: 10px; }
.gate-cta p { color: var(--text-muted); max-width: 480px; margin: 0 auto 24px; font-size: 14.5px; }
.gate-cta .btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Pagination ---------- */
/* flex-wrap, weil die Zahl der Seitenlinks mit dem Bestand waechst: ohne
   Umbruch lief die Zeile auf schmalen Bildschirmen aus dem Bild -- bei 375px
   Fensterbreite reichte sie bis 485px. */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 20px 0 40px; }
.pagination a, .pagination span {
    min-width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #06110d; }
.pagination .disabled { opacity: 0.35; pointer-events: none; }

/* ---------- Forms / Auth ---------- */
.auth-wrapper { display: flex; align-items: center; justify-content: center; padding: 60px 20px; min-height: 60vh; }
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 22px; }
.auth-card .subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }

.form-footer { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--text-muted); }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: rgba(255, 84, 112, 0.1); border-color: rgba(255, 84, 112, 0.3); color: #ff8fa3; }
.alert-success { background: rgba(0, 212, 170, 0.1); border-color: rgba(0, 212, 170, 0.3); color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 32px 0; color: var(--text-faint); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Utility ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }

/* ---------- Responsive ---------- */
/* Umbruchgrenze bei 1200px statt 860px: angemeldet hat die Leiste acht Eintraege
   plus Profil und Admin. Die brauchen rund 760px -- bei 1325px Fensterbreite bleiben
   neben Logo und Schaltflaechen aber nur etwa 650px, die Zeile brach also um.
   Unterhalb dieser Grenze uebernimmt das Klappmenue, oberhalb passt alles in eine Zeile. */
@media (max-width: 1200px) {
    .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 10px; display: none; }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }

    /* Die Auth-Schaltflaechen wandern ins Klappmenue. Vorher wurde hier nur ihre
       Beschriftung ausgeblendet -- das ergab eine leere, farbige Pille ohne Symbol
       und ohne erkennbare Funktion, und "Anmelden" blieb trotzdem in voller
       Breite stehen, weil dieser Link gar kein <span> hat. Zusammen sprengte das
       die Kopfzeile: 322px Aktionen neben 147px Logo bei 375px Fensterbreite. */
    .nav-actions .btn-ghost, .nav-actions .btn-primary { display: none; }
    .nav-auth-mobile { display: block; }
}

@media (max-width: 560px) {
    .link-grid { grid-template-columns: 1fr; }
    .hero { padding: 36px 0 24px; }
    .auth-card { padding: 26px; }

    /* Letzte Reserve in der Kopfzeile: Logo und Sprachumschalter etwas enger,
       damit bei 375px auch mit Scrollleiste nichts ueberlaeuft. */
    .lang-switch a { padding: 4px 7px; }
    .brand-text { font-size: 15px; }

    /* Touch targets below ~44px are hard to tap accurately on mobile (WCAG/Material
       guidance) -- widen the hit area here without changing the compact desktop look. */
    .stat-btn { min-height: 44px; padding: 4px 10px; }
    .favorite-btn { min-height: 44px; min-width: 44px; justify-content: center; }
    .search-box-btn { min-height: 44px; min-width: 44px; }
    .pagination a, .pagination span { min-width: 44px; height: 44px; }
}

/* ---------- Beitraege (Ratgeber) ---------- */
/* Fliesstext braucht andere Regeln als die Kartenoberflaeche: laengere Zeilen
   ermuedet man beim Lesen, deshalb begrenzt die Seite die Breite und erhoeht
   Zeilenhoehe und Abstand zwischen den Absaetzen. */
.article-body { font-size: 16px; line-height: 1.75; }
.article-body p { margin: 0 0 18px; }
.article-body h2 {
    font-family: var(--font-display);
    font-size: 23px;
    margin: 34px 0 12px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
}
.article-body h3 { font-family: var(--font-display); font-size: 18px; margin: 26px 0 8px; }
.article-body ul { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin-bottom: 7px; }
.article-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 5px;
}
/* Ausgehende Links im Text bekommen eine Unterstreichung -- im Fliesstext
   reicht Farbe allein nicht, das waere eine Information nur ueber Farbe. */
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body strong { color: var(--text); }
