/* ============================================================
   OranjeStad Wetboek – Public stylesheet
   ============================================================ */

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

:root {
  --orange:       #E8780A;
  --orange-dk:    #C46200;
  --orange-bg:    #fff8f0;
  --orange-muted: rgba(232,120,10,.12);
  --navy:         #17202e;
  --navy-2:       #1e2b3c;
  --navy-3:       #253347;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f5f6f8;
  --white:        #ffffff;
  --sidebar-w:    272px;
  --radius:       8px;
  --radius-sm:    5px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 2px 8px rgba(0,0,0,.10);
  --shadow-md:    0 4px 20px rgba(0,0,0,.14);
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* ── Root layout: sidebar left + main right ───────────────── */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
}

.sidebar-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.sidebar-inner::-webkit-scrollbar { width: 4px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 18px 18px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand-icon {
  color: #ffffff;
  font-size: 26px;
  flex-shrink: 0;
  background: var(--orange);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.sidebar-brand-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.sidebar-brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  line-height: 1.3;
  margin-top: 2px;
}

/* Search */
.sidebar-search {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-search-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  gap: 7px;
  transition: background .15s;
}
.sidebar-search-wrap:focus-within { background: rgba(255,255,255,.14); }
.sidebar-search-icon { font-size: 13px; flex-shrink: 0; opacity: .6; }
.sidebar-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 0;
  font-size: 13px;
  color: rgba(255,255,255,.85);
}
.sidebar-search input::placeholder { color: rgba(255,255,255,.35); }

/* Nav */
.sidebar-nav {
  padding: 8px 0 12px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 13.5px;
  color: rgba(255,255,255,.68);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .12s;
  line-height: 1.4;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
  text-decoration: none;
}
.sidebar-link.is-active {
  color: #fff;
  border-left-color: var(--orange);
  background: rgba(232,120,10,.14);
  font-weight: 600;
}
.sidebar-link-home { font-weight: 500; }
.sidebar-link-icon { font-size: 14px; flex-shrink: 0; }

/* Sub-links */
.sidebar-link-sub {
  font-size: 13px;
  padding-left: 28px;
  color: rgba(255,255,255,.55);
}
.sidebar-link-sub.is-active { color: rgba(255,255,255,.9); }

.sidebar-children { border-left: 1px solid rgba(255,255,255,.08); margin-left: 24px; }
.depth-2 .sidebar-link { padding-left: 16px; font-size: 12.5px; }

/* Sidebar footer */
.sidebar-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.sidebar-foot-link {
  font-size: 12px;
  color: rgba(255,255,255,.4);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all .12s;
}
.sidebar-foot-link:hover {
  color: rgba(255,255,255,.8);
  background: rgba(255,255,255,.08);
  text-decoration: none;
}

/* ── Main area ────────────────────────────────────────────── */

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.main-content {
  flex: 1;
  padding: 36px 48px;
  max-width: 900px;
  width: 100%;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  margin-left: 0;
  padding: 14px 48px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ── Breadcrumb ───────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.breadcrumb a { color: var(--orange); }
.bc-sep { color: var(--border); }
.bc-current { color: var(--text); font-weight: 500; }

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  text-decoration: none; border: 2px solid transparent;
  transition: all .15s; line-height: 1.4;
}
.btn-primary { background: var(--orange); color: #fff; border-color: var(--orange); }
.btn-primary:hover { background: var(--orange-dk); border-color: var(--orange-dk); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--orange); border-color: var(--orange); }
.btn-outline:hover { background: var(--orange-bg); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 11px 28px; font-size: 16px; }

/* ── Homepage ─────────────────────────────────────────────── */

.page-index {}

.page-hero {
  padding: 10px 0 32px;
  border-bottom: 3px solid var(--orange);
  margin-bottom: 36px;
}
.page-hero h1 {
  font-size: 30px; font-weight: 800; color: var(--navy);
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.25;
}
.hero-sub {
  font-size: 15px; color: var(--text-muted); margin-top: 8px;
}

.home-intro {
  background: var(--orange-bg);
  border-left: 4px solid var(--orange);
  padding: 14px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 32px;
  font-size: 15px; color: var(--text);
}

.home-section { margin-bottom: 44px; }
.section-title {
  font-size: 18px; font-weight: 700; color: var(--navy);
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  font-family: Georgia, 'Times New Roman', serif;
  display: flex; align-items: center; gap: 8px;
}

/* ── Category cards ───────────────────────────────────────── */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.cat-grid-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.cat-card {
  display: flex; flex-direction: column;
  padding: 20px 16px; gap: 6px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text);
  box-shadow: var(--shadow-sm); transition: all .15s;
}
.cat-card:hover {
  border-color: var(--orange); box-shadow: var(--shadow);
  transform: translateY(-2px); text-decoration: none; color: var(--text);
}
.cat-card-icon { font-size: 26px; }
.cat-card-name { font-weight: 700; font-size: 14px; color: var(--navy); line-height: 1.3; }
.cat-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.cat-card-sub { font-size: 12px; color: var(--orange); margin-top: auto; padding-top: 4px; }

/* ── Article list ─────────────────────────────────────────── */

.article-list { display: flex; flex-direction: column; }
.article-list-full {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.article-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background .1s;
}
.article-list-full .article-list-item:last-child { border-bottom: none; }
.article-list-item:hover {
  background: var(--orange-bg); text-decoration: none; color: var(--text);
}

.art-number {
  font-family: 'Courier New', monospace;
  font-size: 12.5px; font-weight: 700;
  color: var(--orange); flex-shrink: 0;
  background: var(--orange-muted);
  padding: 2px 7px; border-radius: 4px;
  min-width: 52px; text-align: center;
}
.art-title { flex: 1; font-size: 14.5px; }
.art-cat {
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; flex-shrink: 0;
}
.art-main { flex: 1; display: flex; align-items: center; gap: 10px; }

/* ── Category page ────────────────────────────────────────── */

.category-header { margin-bottom: 32px; }
.category-header h1 {
  font-size: 26px; font-weight: 800; color: var(--navy);
  font-family: Georgia, 'Times New Roman', serif; line-height: 1.3;
}
.cat-header-icon { margin-right: 6px; }
.category-desc { color: var(--text-muted); margin-top: 8px; font-size: 15px; }
.cat-section { margin-bottom: 36px; }

/* ── Article page ─────────────────────────────────────────── */

.page-article {}

.law-article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  overflow: hidden;
}

.law-article-header {
  padding: 28px 36px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
}

.law-article-number {
  display: inline-block;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--orange);
  background: rgba(232,120,10,.18);
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 10px;
  font-family: system-ui, sans-serif;
}

.law-article-title {
  font-size: 26px; font-weight: 800;
  color: #fff;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.3;
}

.law-article-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin-top: 14px; font-size: 12.5px; color: rgba(255,255,255,.5);
}
.law-article-meta a { color: rgba(255,255,255,.7); }
.law-article-meta a:hover { color: var(--orange); text-decoration: none; }

/* Article body */
.law-article-body {
  padding: 32px 36px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 16px; line-height: 1.85; color: var(--text);
}
.law-article-body h1,
.law-article-body h2,
.law-article-body h3,
.law-article-body h4 {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--navy); line-height: 1.3;
  margin: 28px 0 12px;
}
.law-article-body h1 { font-size: 22px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.law-article-body h2 { font-size: 19px; }
.law-article-body h3 { font-size: 16px; }
.law-article-body p { margin-bottom: 14px; }
.law-article-body ul, .law-article-body ol { margin: 10px 0 14px 22px; }
.law-article-body li { margin-bottom: 5px; }
.law-article-body strong { font-weight: 700; }
.law-article-body em { font-style: italic; }
.law-article-body code {
  background: var(--bg); padding: 2px 6px; border-radius: 4px;
  font-family: 'Courier New', monospace; font-size: 14px; color: var(--navy);
  border: 1px solid var(--border);
}
.law-article-body pre {
  background: var(--navy); color: #e2e8f0; padding: 18px 20px;
  border-radius: var(--radius); overflow-x: auto; margin: 16px 0; font-size: 13.5px;
}
.law-article-body pre code { background: none; border: none; color: inherit; padding: 0; }
.law-article-body blockquote {
  border-left: 4px solid var(--orange); padding: 14px 20px;
  background: var(--orange-bg); margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0; font-style: italic;
}
.law-article-body table { border-collapse: collapse; width: 100%; margin: 18px 0; font-size: 15px; }
.law-article-body th, .law-article-body td { border: 1px solid var(--border); padding: 9px 14px; }
.law-article-body th { background: var(--navy); color: #fff; font-family: system-ui, sans-serif; font-size: 13px; text-align: left; }
.law-article-body tr:nth-child(even) td { background: var(--bg); }
.law-article-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 8px 0; border: 1px solid var(--border); }
.law-article-body hr { border: none; border-top: 2px solid var(--border); margin: 24px 0; }
.law-article-body a { color: var(--orange); font-weight: 500; }
.law-article-body a.internal-link::before { content: '→ '; font-size: 12px; }

/* Details / Dropdown */
.law-details {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin: 16px 0; overflow: hidden; background: var(--white);
}
.law-details-summary {
  padding: 12px 18px;
  background: var(--bg);
  cursor: pointer; font-weight: 600;
  font-family: system-ui, sans-serif; font-size: 14.5px;
  color: var(--navy); list-style: none;
  display: flex; align-items: center; gap: 10px;
  user-select: none; border-bottom: 1px solid transparent;
  transition: background .12s;
}
.law-details-summary::-webkit-details-marker { display: none; }
.law-details-summary::before {
  content: '▶'; font-size: 10px; color: var(--orange);
  transition: transform .2s; flex-shrink: 0;
}
details[open] > .law-details-summary { border-bottom-color: var(--border); background: var(--orange-bg); }
details[open] > .law-details-summary::before { transform: rotate(90deg); }
.law-details-summary:hover { background: var(--orange-bg); }
.law-details-body { padding: 18px 20px; }
.law-details-body > *:last-child { margin-bottom: 0; }

/* Admin bar */
.law-article-admin-bar {
  padding: 12px 36px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Related articles */
.related-articles {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}
.related-articles h3 {
  font-size: 15px; font-weight: 700; color: var(--navy);
  margin-bottom: 12px; font-family: system-ui, sans-serif;
}
.related-articles ul { list-style: none; }
.related-articles li {
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.related-articles li:last-child { border-bottom: none; }
.related-articles a { color: var(--text); }
.related-articles a:hover { color: var(--orange); }

/* ── Search page ──────────────────────────────────────────── */

.page-search h1 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 20px; font-family: Georgia, serif; }
.search-form-page {
  display: flex; gap: 8px; margin-bottom: 28px; max-width: 560px;
}
.search-form-page input {
  flex: 1; padding: 10px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; outline: none; background: var(--white);
  transition: border-color .15s;
}
.search-form-page input:focus { border-color: var(--orange); }
.search-results-header {
  font-size: 14px; color: var(--text-muted); margin-bottom: 16px;
  padding: 10px 16px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* ── 404 ──────────────────────────────────────────────────── */

.page-error { display: flex; align-items: center; justify-content: center; min-height: 60vh; text-align: center; }
.error-code { font-size: 90px; font-weight: 900; color: var(--orange); line-height: 1; }
.error-content h1 { font-size: 26px; margin: 8px 0 14px; color: var(--navy); }
.error-content p { color: var(--text-muted); margin-bottom: 24px; }

/* ── Empty state ──────────────────────────────────────────── */

.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-icon { font-size: 44px; margin-bottom: 16px; opacity: .7; }
.empty-state p { font-size: 15px; }
.empty-state a { color: var(--orange); font-weight: 500; }

/* ── Mobile topbar ────────────────────────────────────────── */

.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 52px;
  background: var(--navy);
  position: sticky; top: 0; z-index: 150;
  flex-shrink: 0;
}
.mobile-menu-btn {
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: #fff; padding: 4px 6px;
  border-radius: 4px; line-height: 1;
}
.mobile-menu-btn:hover { background: rgba(255,255,255,.1); }
.mobile-brand {
  font-size: 15px; font-weight: 700; color: #fff; text-decoration: none;
}
.mobile-brand:hover { text-decoration: none; color: rgba(255,255,255,.85); }

/* Overlay when sidebar is open on mobile */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 190;
  background: rgba(0,0,0,.45);
}
.sidebar-overlay.is-visible { display: block; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 860px) {
  .mobile-topbar { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 200;
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .main-area { margin-left: 0; }
  .main-content { padding: 20px 18px; max-width: 100%; }
  .law-article-header { padding: 20px; }
  .law-article-body { padding: 20px; }
  .law-article-admin-bar { padding: 12px 20px; }
  .site-footer { padding: 14px 18px; }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .main-content { padding: 28px 32px; }
}

@media (min-width: 861px) {
  .mobile-topbar { display: none; }
}
