/* ═══════════════════════════════════════════════════════════════════════════
   smoth.me Guides – Hauptstylesheet
   Farbschema: Dunkelgrau / Anthrazit + Rot (wie im Logo)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-darkest:   #0f0f0f;
  --bg-dark:      #161616;
  --bg-card:      #1e1e1e;
  --bg-card2:     #252525;
  --bg-hover:     #2a2a2a;
  --border:       #2e2e2e;
  --border-light: #3a3a3a;

  --red:          #c41e1e;
  --red-bright:   #e02424;
  --red-dark:     #9a1515;
  --red-glow:     rgba(196, 30, 30, 0.25);

  --text-white:   #f0f0f0;
  --text-light:   #c8c8c8;
  --text-muted:   #888888;
  --text-dim:     #555555;

  --font-sans:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --radius:       8px;
  --radius-lg:    14px;
  --shadow:       0 4px 20px rgba(0,0,0,0.5);
  --shadow-red:   0 4px 24px rgba(196,30,30,0.3);

  --nav-height:   64px;
}

/* ─── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-darkest);
  color: var(--text-white);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--red-bright); text-decoration: none; transition: color .2s; }
a:hover { color: #ff4444; }
img { max-width: 100%; height: auto; }

/* ─── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darkest); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ─── Navigation ──────────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 1000;
  height: var(--nav-height);
  background: rgba(15,15,15,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.nav-inner {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.35rem; font-weight: 700; color: var(--text-white);
  letter-spacing: -0.3px;
}
.nav-logo .logo-dot { color: var(--red); }
.nav-logo img { height: 36px; width: auto; }

.nav-links {
  display: flex; gap: 4px; margin-left: auto;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted); font-size: .9rem; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius);
  transition: all .2s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-white); background: var(--bg-hover);
}

.nav-search {
  position: relative; margin-left: 8px;
}
.nav-search input {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-white); border-radius: var(--radius);
  padding: 7px 14px 7px 36px; font-size: .875rem; width: 200px;
  outline: none; transition: all .2s;
}
.nav-search input:focus { border-color: var(--red); width: 240px; }
.nav-search input::placeholder { color: var(--text-dim); }
.nav-search .search-icon {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim); font-size: .85rem; pointer-events: none;
}

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a0808 50%, #0f0f0f 100%);
  border-bottom: 1px solid var(--border);
  padding: 72px 24px 64px;
  text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(196,30,30,.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(196,30,30,.15); border: 1px solid rgba(196,30,30,.3);
  color: var(--red-bright); font-size: .8rem; font-weight: 600;
  padding: 4px 14px; border-radius: 20px;
  margin-bottom: 20px; text-transform: uppercase; letter-spacing: .5px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800; letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero h1 span { color: var(--red-bright); }
.hero p {
  color: var(--text-light); font-size: 1.1rem;
  max-width: 580px; margin: 0 auto 32px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px; flex-wrap: wrap;
  margin-top: 32px;
}
.stat { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--red-bright); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* ─── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-content { padding: 48px 0 80px; }

/* ─── Section Headers ─────────────────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.section-title {
  font-size: 1.4rem; font-weight: 700; letter-spacing: -0.3px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: '';
  display: block; width: 4px; height: 22px;
  background: var(--red); border-radius: 2px;
}
.section-link { font-size: .875rem; color: var(--red-bright); font-weight: 500; }

/* ─── Category Grid ───────────────────────────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 56px;
}
.category-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 16px;
  text-align: center; cursor: pointer;
  transition: all .25s; display: block; color: var(--text-white);
}
.category-card:hover {
  border-color: var(--red); background: var(--bg-hover);
  transform: translateY(-2px); box-shadow: var(--shadow-red);
  color: var(--text-white);
}
.cat-icon { font-size: 2rem; margin-bottom: 8px; display: block; }
.cat-name { font-weight: 600; font-size: .95rem; }
.cat-count { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ─── Article Cards ───────────────────────────────────────────────────────── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.article-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 24px;
  transition: all .25s; display: flex; flex-direction: column;
}
.article-card:hover {
  border-color: var(--red); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.card-category {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(196,30,30,.12); border: 1px solid rgba(196,30,30,.25);
  color: var(--red-bright); font-size: .75rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px; margin-bottom: 12px;
  width: fit-content; text-transform: uppercase; letter-spacing: .3px;
}
.card-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-white);
  line-height: 1.35; margin-bottom: 10px;
  transition: color .2s;
}
.article-card:hover .card-title { color: var(--red-bright); }
.card-excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; line-height: 1.55; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.card-meta { font-size: .78rem; color: var(--text-dim); }
.card-read-more {
  font-size: .8rem; color: var(--red-bright); font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}

/* Featured card */
.article-card.featured {
  border-color: rgba(196,30,30,.35);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(196,30,30,.05) 100%);
}
.featured-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ─── Article Page ────────────────────────────────────────────────────────── */
.article-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 40px; align-items: start;
}
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

.article-header { margin-bottom: 32px; }
.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800; letter-spacing: -0.5px;
  line-height: 1.2; margin-bottom: 16px;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: .85rem; color: var(--text-muted);
}
.article-meta span { display: flex; align-items: center; gap: 5px; }

.article-disclaimer {
  background: rgba(196,30,30,.07); border: 1px solid rgba(196,30,30,.2);
  border-left: 4px solid var(--red); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 32px;
  font-size: .85rem; color: var(--text-muted); line-height: 1.55;
}
.article-disclaimer strong { color: var(--text-light); }

/* Markdown/Content rendering */
.article-content { line-height: 1.75; }
.article-content h2 {
  font-size: 1.5rem; font-weight: 700; margin: 40px 0 16px;
  color: var(--text-white); border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.article-content h3 { font-size: 1.2rem; font-weight: 600; margin: 28px 0 12px; }
.article-content h4 { font-size: 1rem; font-weight: 600; margin: 20px 0 10px; color: var(--text-light); }
.article-content p { margin-bottom: 16px; color: var(--text-light); }
.article-content ul, .article-content ol { margin: 12px 0 20px 24px; color: var(--text-light); }
.article-content li { margin-bottom: 6px; }
.article-content a { color: var(--red-bright); }
.article-content a:hover { text-decoration: underline; }
.article-content strong { color: var(--text-white); }
.article-content blockquote {
  border-left: 4px solid var(--red); padding: 12px 20px;
  background: var(--bg-card); border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0; color: var(--text-muted); font-style: italic;
}
.article-content pre {
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  overflow-x: auto; margin: 20px 0; position: relative;
  font-family: var(--font-mono); font-size: .875rem;
}
.article-content code {
  font-family: var(--font-mono); font-size: .875rem;
}
.article-content p code, .article-content li code {
  background: var(--bg-card2); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 4px; color: #ff9090; font-size: .82rem;
}
.article-content img {
  border-radius: var(--radius); border: 1px solid var(--border);
  margin: 16px 0;
}
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article-content table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.article-content th, .article-content td {
  border: 1px solid var(--border); padding: 10px 14px; text-align: left;
  font-size: .9rem;
}
.article-content th { background: var(--bg-card2); color: var(--text-white); font-weight: 600; }
.article-content td { color: var(--text-light); }

/* Sidebar */
.sidebar-widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px;
}
.widget-title {
  font-size: .9rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.toc-list { list-style: none; }
.toc-list li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.toc-list li:last-child { border-bottom: none; }
.toc-list a { font-size: .85rem; color: var(--text-muted); }
.toc-list a:hover { color: var(--red-bright); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius); font-size: .9rem;
  font-weight: 600; cursor: pointer; border: none; transition: all .2s;
  text-decoration: none; font-family: var(--font-sans);
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-bright); color: #fff; box-shadow: var(--shadow-red); }
.btn-secondary {
  background: transparent; color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--red); color: var(--red-bright); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-danger { background: #8b1c1c; color: #fff; }
.btn-danger:hover { background: #c41e1e; }

/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: .875rem; font-weight: 600;
  color: var(--text-light); margin-bottom: 6px;
}
.form-control {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-white); border-radius: var(--radius);
  padding: 10px 14px; font-size: .9rem; font-family: var(--font-sans);
  outline: none; transition: border-color .2s;
}
.form-control:focus { border-color: var(--red); }
.form-control::placeholder { color: var(--text-dim); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }

/* ─── Alerts / Badges ─────────────────────────────────────────────────────── */
.alert {
  padding: 12px 18px; border-radius: var(--radius);
  font-size: .875rem; margin-bottom: 20px;
}
.alert-success { background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #4ade80; }
.alert-error   { background: rgba(196,30,30,.1);  border: 1px solid rgba(196,30,30,.3);  color: #f87171; }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3); color: #60a5fa; }
.alert-warning { background: rgba(234,179,8,.1);  border: 1px solid rgba(234,179,8,.3);  color: #fbbf24; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-published { background: rgba(34,197,94,.15); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.badge-draft     { background: rgba(156,163,175,.1); color: #9ca3af; border: 1px solid rgba(156,163,175,.2); }
.badge-red       { background: rgba(196,30,30,.15); color: var(--red-bright); border: 1px solid rgba(196,30,30,.3); }

/* ─── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; gap: 6px; justify-content: center; margin-top: 40px;
}
.page-link {
  padding: 8px 14px; border-radius: var(--radius);
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .875rem; transition: all .2s;
}
.page-link:hover, .page-link.active {
  border-color: var(--red); color: var(--red-bright); background: rgba(196,30,30,.07);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-dark); border-top: 1px solid var(--border);
  padding: 40px 0 24px; margin-top: auto;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  margin-bottom: 32px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-brand p { font-size: .875rem; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }
.footer-col h4 {
  font-size: .85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: .875rem; color: var(--text-dim); }
.footer-col a:hover { color: var(--red-bright); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 20px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.footer-bottom p { font-size: .8rem; color: var(--text-dim); }
.footer-legal { display: flex; gap: 16px; }
.footer-legal a { font-size: .8rem; color: var(--text-dim); }
.footer-legal a:hover { color: var(--red-bright); }

/* ─── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: 8px; color: var(--text-light); }

/* ─── Code copy button ────────────────────────────────────────────────────── */
.code-wrapper { position: relative; }
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: var(--bg-hover); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 5px;
  padding: 4px 10px; font-size: .75rem; cursor: pointer;
  transition: all .2s;
}
.copy-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ─── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: .8rem; color: var(--text-dim); margin-bottom: 24px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--red-bright); }
.breadcrumb-sep { color: var(--text-dim); }

/* ─── Hamburger Button (Hauptnavigation) ──────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none; border: 1px solid var(--border);
  color: var(--text-white); font-size: 1.3rem;
  cursor: pointer; padding: 8px 13px; border-radius: var(--radius);
  line-height: 1; margin-left: auto; flex-shrink: 0;
  min-width: 44px; min-height: 44px; /* Touch-freundliche Mindestgröße */
  transition: all .2s;
}
.nav-hamburger:hover,
.nav-hamburger:focus { border-color: var(--red); color: var(--red-bright); outline: none; }

/* ─── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  /* Navbar */
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
  .nav-search    { display: none; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    background: rgba(13,13,13,.99);
    backdrop-filter: blur(16px);
    border-bottom: 2px solid var(--border);
    flex-direction: column;
    padding: 8px 12px 20px;
    z-index: 999;
    gap: 2px;
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }
  /* .open wird per JS über style.display="flex" gesteuert */
  .nav-links.open { display: flex; }
  .nav-links li   { width: 100%; }
  .nav-links a    {
    display: block; padding: 13px 16px; font-size: 1rem;
    border-radius: var(--radius); min-height: 48px;
    display: flex; align-items: center;
  }

  /* Layout */
  .container      { padding: 0 14px; }
  .page-content   { padding: 24px 0 48px; }

  /* Hero */
  .hero           { padding: 36px 16px 28px; }
  .hero h1        { font-size: 1.7rem; }
  .hero p         { font-size: .95rem; }
  .hero-stats     { gap: 20px; }

  /* Grids */
  .article-grid   { grid-template-columns: 1fr; }
  .category-grid  { grid-template-columns: repeat(3, 1fr); gap: 8px; }

  /* Article page */
  .article-layout { grid-template-columns: 1fr; }
  .article-content h2   { font-size: 1.3rem; margin: 28px 0 12px; }
  .article-content h3   { font-size: 1.1rem; }
  .article-content pre  { padding: 14px; font-size: .82rem; }
  /* Tabellen scrollbar machen auf Mobile */
  .article-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Sidebar Widget auf Mobile: weniger Padding */
  .sidebar-widget { padding: 14px; }

  /* Footer */
  .footer-grid    { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom  { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Pagination: kleinere Buttons */
  .page-link { padding: 8px 12px; font-size: .82rem; }

  /* Buttons touch-freundlicher */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
} /* END @media (max-width: 860px) */

/* ─── Nav-Links open-State: GLOBAL außerhalb Media Query ─────────────────── */
/* Absicherung: display:flex wird per JS gesetzt, diese Regel greift zusätzlich */
.nav-links.open {
  display: flex !important;
  flex-direction: column !important;
}

@media (max-width: 480px) {
  .category-grid  { grid-template-columns: repeat(2, 1fr); }
  .hero           { padding: 28px 14px 24px; }
  .hero h1        { font-size: 1.4rem; letter-spacing: -.5px; }
  .hero p         { font-size: .9rem; }
  .article-card   { padding: 16px; }
  .footer-grid    { grid-template-columns: 1fr; gap: 20px; }
  .hero-stats     { gap: 12px; }
  .stat-num       { font-size: 1.4rem; }
  .container      { padding: 0 12px; }
  /* Artikel-Header auf kleinen Phones */
  .article-header h1 { font-size: 1.35rem; }
  .article-meta      { gap: 8px; font-size: .8rem; }
  /* Breadcrumb kürzen */
  .breadcrumb        { font-size: .75rem; gap: 5px; }
  /* Copy-Button nur per Touch sichtbar */
  .copy-btn          { padding: 6px 10px; font-size: .72rem; }
}

/* ─── Utility ─────────────────────────────────────────────────────────────── */
.text-red    { color: var(--red-bright); }
.text-muted  { color: var(--text-muted); }
.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 16px; }
.mb-4  { margin-bottom: 16px; }
.mb-8  { margin-bottom: 32px; }
.gap-8 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
