/* TOORCE Firewall Admin Guide — Documentation styles */

:root {
  --toorce-red: #c41e3a;
  --toorce-red-dark: #9e1830;
  --sidebar-bg: #1a1d23;
  --sidebar-text: #c8cdd5;
  --sidebar-hover: #2a2f38;
  --sidebar-active: #c41e3a;
  --content-bg: #ffffff;
  --text-primary: #1a1d23;
  --text-secondary: #5c6370;
  --border: #e2e5ea;
  --note-bg: #f0f7ff;
  --note-border: #3b82f6;
  --code-bg: #f4f5f7;
  --header-height: 56px;
  --sidebar-width: 280px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--content-bg);
  line-height: 1.65;
  font-size: 15px;
}

/* ── Top header ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 100;
  gap: 1rem;
}

.site-header .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.05rem;
}

.site-header .logo img {
  height: 32px;
  width: auto;
}

.site-header .logo span { color: var(--toorce-red); }

.site-header .breadcrumb {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-left: 1rem;
}

.site-header .breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-header .breadcrumb a:hover { color: var(--toorce-red); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  color: var(--text-primary);
}

/* ── Layout ── */
.docs-layout {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

/* ── Sidebar ── */
.docs-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: var(--sidebar-bg);
  overflow-y: auto;
  padding: 1.25rem 0;
  z-index: 50;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: #3a3f4b; border-radius: 2px; }

.nav-section { margin-bottom: 0.25rem; }

.nav-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  color: var(--sidebar-text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-section-title:hover { color: #fff; }

.nav-section-title .chevron {
  transition: transform 0.2s;
  font-size: 0.7rem;
  opacity: 0.6;
}

.nav-section.open .chevron { transform: rotate(90deg); }

.nav-items {
  list-style: none;
  display: none;
  padding: 0.125rem 0 0.5rem;
}

.nav-section.open .nav-items { display: block; }

.nav-items a {
  display: block;
  padding: 0.4rem 1.25rem 0.4rem 2rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.nav-items a:hover {
  color: #fff;
  background: var(--sidebar-hover);
}

.nav-items a.active {
  color: #fff;
  border-left-color: var(--sidebar-active);
  background: rgba(196, 30, 58, 0.15);
}

/* ── Main content ── */
.docs-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
}

.docs-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  color: var(--text-primary);
}

.docs-content h2 {
  font-size: 1.375rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

.docs-content p { margin-bottom: 1rem; }

.docs-content ul, .docs-content ol {
  margin: 0 0 1rem 1.5rem;
}

.docs-content li { margin-bottom: 0.35rem; }

.docs-content a {
  color: var(--toorce-red);
  text-decoration: none;
}

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

.docs-content strong { font-weight: 600; }

.docs-content code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.docs-content pre {
  background: var(--code-bg);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.docs-content pre code {
  background: none;
  padding: 0;
}

.docs-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}

.docs-content th, .docs-content td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}

.docs-content th {
  background: #f8f9fb;
  font-weight: 600;
}

.docs-content blockquote {
  background: var(--note-bg);
  border-left: 4px solid var(--note-border);
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  border-radius: 0 6px 6px 0;
  color: #1e3a5f;
  font-size: 0.9rem;
}

.docs-content blockquote p { margin: 0; }

.docs-content .config-table {
  font-size: 0.9rem;
}

.docs-content .object-ref {
  background: #fef7f0;
  border-left: 4px solid var(--toorce-red);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
}

.docs-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: var(--text-secondary);
}

.docs-content .tech-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.docs-content figure {
  margin: 1rem 0 1.5rem;
}

.docs-content img.diagram,
.docs-content figure.scenario-diagram img {
  display: block;
  max-width: 100%;
  width: min(960px, 100%);
  height: auto;
  margin: 1rem auto 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.docs-content figure.scenario-diagram {
  margin: 1.25rem 0 1.75rem;
  text-align: center;
}

.docs-content figcaption {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  text-align: center;
}

.docs-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.nav-path {
  display: inline-block;
  background: #f4f5f7;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.section-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.section-card:hover {
  border-color: var(--toorce-red);
  box-shadow: 0 2px 12px rgba(196,30,58,0.1);
  text-decoration: none;
}

.section-card h3 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  border: none;
  padding: 0;
  color: var(--toorce-red);
}

.section-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

.site-footer {
  margin-left: var(--sidebar-width);
  padding: 1.5rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .menu-toggle { display: block; }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

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

  .docs-content, .site-footer {
    margin-left: 0;
    padding: 1.5rem;
  }
}
