/* ==========================================================================
   MIMBUS Documentation Portal - Clean Classic White Theme
   Inspired by modern classic documentation sites (GitBook, Stripe Docs, Docusaurus)
   ========================================================================== */

:root {
  --bg-main: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --link-color: #2563eb;
  --link-hover: #1d4ed8;

  --accent-orange: #ea580c;
  --accent-orange-bg: #fff7ed;
  --accent-orange-border: #ffedd5;

  --sidebar-width: 300px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Layout: Sidebar + Main Content
   ========================================================================== */
.docs-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Left TOC) */
.docs-sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  z-index: 50;
}

.sidebar-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  display: block;
}

/* Sidebar Search Box */
.sidebar-search {
  margin-bottom: 1.25rem;
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-main);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.sidebar-search input:focus {
  border-color: var(--link-color);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* Sidebar Navigation (TOC) */
.toc-nav {
  flex: 1;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-left: 0.5rem;
}

.toc-list {
  list-style: none;
}

.toc-item {
  margin-bottom: 0.25rem;
}

.toc-section-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-section-link:hover {
  background-color: var(--bg-hover);
  color: var(--link-color);
}

.toc-sublist {
  list-style: none;
  padding-left: 1rem;
  margin: 0.2rem 0 0.6rem;
  border-left: 1px solid var(--border-color);
}

.toc-subitem a {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.toc-subitem a:hover {
  background-color: var(--bg-hover);
  color: var(--link-color);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sidebar-footer a {
  color: var(--link-color);
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.docs-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 3rem 4rem 6rem;
  max-width: 1060px;
}

/* Page Header */
.content-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}

.content-header-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Language Switcher Pills */
.lang-switch-container {
  display: inline-flex;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px;
  gap: 3px;
}

.sidebar-lang-switch {
  display: flex;
  margin-bottom: 1.25rem;
  width: 100%;
}

.sidebar-lang-switch .lang-pill {
  flex: 1;
  justify-content: center;
  text-align: center;
  padding: 0.4rem 0.25rem;
}

.lang-pill {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  font-family: inherit;
}

.lang-pill:hover:not(.active) {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.lang-pill.active {
  background-color: #ffffff;
  color: var(--accent-orange);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-badge {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Sections */
.doc-section {
  margin-bottom: 4rem;
}

.section-h2 {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-flag {
  font-size: 1.3rem;
}

/* Product Blocks */
.product-block {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-block:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.product-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.product-logo-box {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
}

/* Specific styling for Mimbus Stone which is white on transparent */
.logo-box-dark {
  background-color: #1e293b;
  border-color: #334155;
}

.product-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-title-group {
  flex: 1;
}

.product-h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-domain-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Links List */
.product-links {
  list-style: none;
  padding-left: 0;
}

.product-links li {
  margin-bottom: 0.5rem;
}

.product-links li:last-child {
  margin-bottom: 0;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.doc-link:hover {
  color: var(--link-hover);
  background-color: #eff6ff;
  text-decoration: underline;
}

.doc-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-html {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-pdf {
  background-color: #fee2e2;
  color: #b91c1c;
}

.link-arrow {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Footer inside content */
.content-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.content-footer a {
  color: var(--link-color);
  text-decoration: none;
}

.content-footer a:hover {
  text-decoration: underline;
}

/* Mobile Toggle */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--text-primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 100;
  cursor: pointer;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-content {
    margin-left: 0;
    padding: 2rem 1.5rem 4rem;
  }

  .mobile-nav-toggle {
    display: block;
  }
}
