/* =============================================
   negabaro.com Design System
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Shippori+Mincho:wght@400;500;600;700&display=swap');

:root {
  --brand: #059669;
  --brand-hover: #047857;
  --brand-light: #ecfdf5;
  --brand-light-80: rgba(236, 253, 245, 0.8);
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --sidebar-width: 280px;
}

/* ── Base overrides ── */
.nb-layout body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-800);
  font-size: 16px;
  margin: 0;
  background: var(--gray-50);
}

.nb-layout h1,
.nb-layout h2,
.nb-layout h3,
.nb-layout h4,
.nb-layout h5,
.nb-layout h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--gray-900);
}

.nb-layout a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.2s;
}
.nb-layout a:hover,
.nb-layout a:focus {
  color: var(--brand-hover);
}

/* ── Top Nav (override clean-blog navbar) ── */
.nb-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 56px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-family: 'Outfit', sans-serif;
}
.nb-nav .nb-nav-brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--gray-900);
  text-decoration: none;
  margin-right: 32px;
}
.nb-nav .nb-nav-brand:hover {
  color: var(--brand);
}
.nb-nav .nb-nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nb-nav .nb-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.2s;
}
.nb-nav .nb-nav-links a:hover {
  color: var(--brand);
}

/* ── Layout Container ── */
.nb-wrapper {
  display: flex;
  min-height: 100vh;
  padding-top: 56px; /* nav height */
}

/* ── Left Sidebar ── */
.nb-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--gray-100);
  padding: 24px 0;
  overflow-y: auto;
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.3s ease-out;
}

.nb-sidebar-header {
  padding: 0 20px 16px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 12px;
}
.nb-sidebar-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin: 0;
}

.nb-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Category group */
.nb-sidebar-nav .nb-cat-group {
  margin-bottom: 4px;
}
.nb-sidebar-nav .nb-cat-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Outfit', sans-serif;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  gap: 8px;
}
.nb-sidebar-nav .nb-cat-toggle:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}
.nb-sidebar-nav .nb-cat-toggle.active {
  color: var(--brand);
  background: var(--brand-light-80);
  font-weight: 600;
}
.nb-sidebar-nav .nb-cat-toggle .nb-cat-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--gray-400);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.nb-sidebar-nav .nb-cat-toggle.open .nb-cat-icon {
  transform: rotate(90deg);
}
.nb-sidebar-nav .nb-cat-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 400;
}

/* Sub-items (tree: children + posts) */
.nb-sidebar-nav .nb-cat-sub {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
}
.nb-sidebar-nav .nb-cat-sub.open {
  display: block;
}

/* Post items in tree */
.nb-sidebar-nav .nb-tree-post a {
  display: block;
  padding: 5px 20px;
  font-size: 12.5px;
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nb-sidebar-nav .nb-tree-post a:hover {
  color: var(--brand);
  background: var(--gray-50);
}
.nb-sidebar-nav .nb-tree-post a.active {
  color: var(--brand);
  font-weight: 600;
  background: var(--brand-light-80);
  border-right: 3px solid var(--brand);
}

/* Tree toggle: category name takes remaining space */
.nb-sidebar-nav .nb-cat-toggle .nb-cat-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Custom Tooltip ── */
.nb-sidebar-nav .nb-tree-post a,
.nb-sidebar-nav .nb-cat-toggle {
  position: relative;
}
.nb-sidebar-nav .nb-tree-post a::after,
.nb-sidebar-nav .nb-cat-toggle::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--gray-900);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 6px;
  white-space: normal;
  max-width: 280px;
  width: max-content;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.nb-sidebar-nav .nb-tree-post a:hover::after,
.nb-sidebar-nav .nb-cat-toggle:hover::after {
  opacity: 1;
}
/* Hide tooltip if no data-tip */
.nb-sidebar-nav .nb-tree-post a:not([data-tip])::after,
.nb-sidebar-nav .nb-cat-toggle:not([data-tip])::after,
.nb-sidebar-nav .nb-tree-post a[data-tip=""]::after,
.nb-sidebar-nav .nb-cat-toggle[data-tip=""]::after {
  display: none;
}

/* ── Main Content ── */
.nb-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
  max-width: 100%;
  min-width: 0;
}

/* ── Article Header ── */
.nb-article-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-100);
}
.nb-article-header .nb-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nb-article-header .nb-breadcrumb a {
  color: var(--gray-500);
  text-decoration: none;
}
.nb-article-header .nb-breadcrumb a:hover {
  color: var(--brand);
}
.nb-article-header .nb-breadcrumb .nb-sep {
  color: var(--gray-300);
}
.nb-article-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 12px;
  line-height: 1.3;
}
.nb-article-header .nb-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--gray-400);
  flex-wrap: wrap;
}
.nb-article-header .nb-meta .nb-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-light-80);
  padding: 2px 8px;
  border-radius: var(--radius-md);
}

/* ── Article Body ── */
.nb-article-body {
  max-width: 56rem;
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--gray-800);
}
.nb-article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-100);
}
.nb-article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.nb-article-body h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.nb-article-body p {
  margin: 0 0 1.25rem;
  line-height: 1.85;
  color: var(--gray-600);
}
.nb-article-body ul,
.nb-article-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
  color: var(--gray-600);
}
.nb-article-body li {
  margin-bottom: 0.4rem;
}
.nb-article-body img {
  max-width: 100%;
  border-radius: var(--radius-xl);
  margin: 1rem 0;
}
.nb-article-body blockquote {
  border-left: 4px solid var(--brand);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--gray-50);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  color: var(--gray-600);
  font-style: normal;
}
.nb-article-body blockquote p {
  margin: 0;
}
.nb-article-body pre {
  background: var(--gray-900);
  color: #e5e7eb;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.25rem 0;
}
.nb-article-body code {
  font-size: 0.875em;
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--brand-hover);
}
.nb-article-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
.nb-article-body a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nb-article-body a:hover {
  color: var(--brand-hover);
}
.nb-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
}
.nb-article-body table th {
  background: var(--gray-50);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--gray-200);
}
.nb-article-body table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.nb-article-body hr {
  border: none;
  height: 1px;
  background: var(--gray-100);
  margin: 2rem 0;
}

/* ── Article Card (optional wrapper) ── */
.nb-article-card {
  background: #fff;
  border-radius: var(--radius-3xl);
  border: 1px solid var(--gray-100);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  padding: 40px 48px;
  margin-bottom: 32px;
}

/* ── Post Navigation ── */
.nb-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
}
.nb-post-nav a {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-100);
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 48%;
}
.nb-post-nav a:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.1);
}
.nb-post-nav a .nb-nav-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.nb-post-nav a .nb-nav-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}
.nb-post-nav .nb-next {
  text-align: right;
  margin-left: auto;
}

/* ── Mobile sidebar toggle ── */
.nb-sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  font-size: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.nb-sidebar-toggle:hover {
  background: var(--brand-hover);
}

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  .nb-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .nb-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  }
  .nb-main {
    margin-left: 0;
    padding: 24px 16px;
  }
  .nb-article-card {
    padding: 24px 20px;
    border-radius: var(--radius-2xl);
  }
  .nb-article-header h1 {
    font-size: 1.5rem;
  }
  .nb-sidebar-toggle {
    display: flex;
  }
  .nb-post-nav {
    flex-direction: column;
  }
  .nb-post-nav a {
    max-width: 100%;
  }
  .nb-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 35;
  }
  .nb-sidebar-overlay.active {
    display: block;
  }
}

@media (min-width: 769px) {
  .nb-sidebar-toggle {
    display: none !important;
  }
}

/* ── Search in sidebar ── */
.nb-sidebar-search {
  padding: 0 16px 16px;
}
.nb-sidebar-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--gray-50);
  box-sizing: border-box;
}
.nb-sidebar-search input:focus {
  border-color: var(--brand);
  background: #fff;
}
.nb-sidebar-search input::placeholder {
  color: var(--gray-400);
}

/* ── Footer in sidebar layout ── */
.nb-footer {
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
  border-top: 1px solid var(--gray-100);
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}
@media (max-width: 768px) {
  .nb-footer {
    margin-left: 0;
    padding: 24px 16px;
  }
}
