/* DL Mendali — Shared Stylesheet (DLM Tech Orbit Palette) */
:root {
  --navy-950: #081226;
  --navy-900: #0B2559;
  --blue-600: #0D6EFD;
  --teal-500: #00A8B5;
  --grad-brand: linear-gradient(135deg, #0B2559 0%, #0D6EFD 55%, #00A8B5 100%);
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-alt: #F1F5F9;
  --text: #0F172A;
  --muted: #475569;
  --border: #E2E8F0;
  --radius: 12px;
  --shadow: 0 4px 20px -2px rgba(8, 18, 38, 0.06);
}

[data-theme="dark"] {
  --bg: #081226;
  --surface: #0D1B36;
  --surface-alt: #132548;
  --text: #F8FAFC;
  --muted: #94A3B8;
  --border: #1E325C;
  --shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.2s, color 0.2s;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header & Navigation */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.brand span { color: var(--teal-500); }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.94rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--blue-600); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Buttons & Badges */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: 0.2s;
}
.btn-primary { background: var(--grad-brand); color: #fff; }
.btn-primary:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--teal-500); color: var(--teal-500); }
.icon-btn {
  background: var(--surface-alt); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: rgba(0, 168, 181, 0.12); color: var(--teal-500);
}

/* Grids & Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-3px); border-color: var(--teal-500); }
.card h3 { font-size: 1.15rem; margin: 10px 0 8px; line-height: 1.35; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { color: var(--blue-600); }
.card p { color: var(--muted); font-size: 0.93rem; margin-bottom: 16px; }

/* Filter Bar & Search */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 28px 0; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  padding: 7px 15px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.filter-btn.active, .filter-btn:hover { background: var(--grad-brand); color: #fff; border-color: transparent; }
.search-input {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 0.9rem; min-width: 240px;
}
.search-input:focus { outline: none; border-color: var(--teal-500); }

/* Article Prose, Tables & Code Blocks */
.article-body { max-width: 780px; margin: 40px auto; }
.article-body h2 { font-size: 1.55rem; margin: 32px 0 12px; color: var(--text); }
.article-body p, .article-body ul, .article-body ol { margin-bottom: 16px; color: var(--text); }
.article-body ul, .article-body ol { padding-left: 22px; }

.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--surface); }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-alt); font-weight: 700; color: var(--text); }

.code-wrap { position: relative; margin: 20px 0; border-radius: 10px; overflow: hidden; border: 1px solid #1E325C; background: #081226; }
.code-header {
  display: flex; justify-content: space-between; align-items: center; padding: 8px 14px;
  background: #0B2559; color: #94A3B8; font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
}
.copy-btn {
  background: rgba(0, 168, 181, 0.18); color: #38BDF8; border: 1px solid rgba(0, 168, 181, 0.4);
  padding: 3px 10px; border-radius: 5px; font-size: 0.76rem; font-weight: 600; cursor: pointer;
}
.copy-btn:hover { background: var(--teal-500); color: #fff; }
pre { padding: 16px; overflow-x: auto; color: #E2E8F0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; line-height: 1.55; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 36px 0; margin-top: 64px; text-align: center; color: var(--muted); font-size: 0.88rem; }

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 20px; align-items: flex-start;
  }
  .search-input { width: 100%; }
}
