:root {
  color-scheme: light dark;
  --background-color: #f7f8fa;
  --surface-color: #ffffff;
  --border-color: rgba(0, 0, 0, 0.08);
  --text-color: #1f2933;
  --muted-text-color: #52606d;
  --link-color: #2563eb;
  --link-hover-color: #1d4ed8;
  --accent-color: #f97316;
  --nav-width: 280px;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--background-color);
  color: var(--text-color);
}

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

a:hover {
  color: var(--link-hover-color);
}

.docs-layout {
  display: flex;
  width: 100%;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-color);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: var(--link-color);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.sidebar-toggle-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.sidebar-backdrop {
  display: none;
}

.sidebar {
  width: var(--nav-width);
  flex-shrink: 0;
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  min-height: 100vh;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.sidebar-inner {
  padding: 1.5rem 1.75rem 2rem;
  height: 100vh;
  overflow-y: auto;
}

.sidebar h1 {
  margin-top: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sidebar h1::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 32px;
  background: url("../images/BC2Fabric_icon.png") center/contain no-repeat;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.18));
}

.nav-section {
  margin-top: 2rem;
}

.nav-section-title {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-text-color);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

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

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

.nav-item > a,
.nav-subitem > a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted-text-color);
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item > a:hover,
.nav-subitem > a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--link-color);
}

.nav-item.active > a,
.nav-subitem.active > a {
  background: rgba(37, 99, 235, 0.12);
  color: var(--link-color);
  font-weight: 600;
}

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

.main-content {
  flex: 1;
  padding: 3rem 5vw;
  max-width: 960px;
  margin: 0 auto;
}

.main-content header {
  margin-bottom: 2.5rem;
}

.main-content h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.main-content p {
  line-height: 1.7;
  font-size: 1.05rem;
  color: var(--muted-text-color);
}

.content-card {
  background: var(--surface-color);
  border-radius: 1rem;
  padding: 1.5rem 2rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.content-card + .content-card {
  margin-top: 1.5rem;
}

.content-card h2 {
  margin-top: 2rem;
}

.content-card h2:first-child {
  margin-top: 0;
}

.content-card h2 .anchor-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.content-card h2 .anchor-link::after {
  content: "#";
  font-size: 0.85em;
  color: var(--link-color);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.content-card h2:hover .anchor-link::after,
.content-card h2 .anchor-link:focus-visible::after {
  opacity: 0.6;
}

.content-card ul,
.content-card ol {
  color: var(--muted-text-color);
}

.content-card li {
  line-height: 1.5;
  margin-bottom: 0.35rem;
}

.content-card li:last-child {
  margin-bottom: 0;
}

.media-frame {
  margin: 2rem 0;
  background: var(--surface-color);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.media-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.media-frame figcaption {
  margin-top: 0.75rem;
  color: var(--muted-text-color);
  font-size: 0.9rem;
  text-align: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--link-color);
  color: #fff;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.button-link:hover {
  background: var(--link-hover-color);
  color: #fff;
  transform: translateY(-1px);
}

.footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--muted-text-color);
}

@media (max-width: 960px) {
  body {
    display: block;
    overflow-x: hidden;
  }

  .docs-layout {
    display: block;
  }

  .sidebar-toggle {
    display: inline-flex;
    position: sticky;
    top: 0.75rem;
    margin: 0.75rem;
    z-index: 1100;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(80vw, 320px);
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.15);
    z-index: 1200;
  }

  .sidebar-inner {
    height: 100%;
    padding-bottom: 4rem;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1150;
    display: none;
  }

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

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .main-content {
    padding: 1.5rem;
    margin-top: 0;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--surface-color);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

table th,
table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

table thead th {
  background: rgba(37, 99, 235, 0.06);
  font-weight: 600;
  color: var(--text-color);
}

table tbody tr:last-child td {
  border-bottom: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}
