/*
 * RetroDSG documentation UI
 * Shared doc stylesheet loaded from public/css.
 */

.doc-layout-wrapper {
  --doc-bg-top: #f3f8ff;
  --doc-bg-bottom: #e5eef9;
  --doc-panel-top: #fdfefe;
  --doc-panel-bottom: #edf4fb;
  --doc-border: rgba(139, 166, 191, 0.62);
  --doc-border-soft: rgba(139, 166, 191, 0.4);
  --doc-title: #1e4f71;
  --doc-text: #2a4460;
  --doc-muted: #5f7893;
  --doc-link: #2f7ea8;
  --doc-link-hover: #1f6488;
  --doc-sidebar-top: #ffffff;
  --doc-sidebar-bottom: #edf5fc;
  --doc-accent: #4ea2cb;

  width: 100%;
  min-height: 24rem;
  border: 1px solid var(--doc-border);
  border-radius: 1rem;
  overflow: hidden;
  background:
    radial-gradient(860px 260px at 100% -5%, rgba(90, 169, 212, 0.16), transparent 70%),
    linear-gradient(180deg, var(--doc-bg-top) 0%, var(--doc-bg-bottom) 100%);
  box-shadow: 0 18px 38px rgba(20, 44, 67, 0.12);
}

.doc-root {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  width: 100%;
  min-height: 62vh;
}

.doc-sidebar {
  min-width: 0;
  border-right: 1px solid var(--doc-border-soft);
  background: linear-gradient(180deg, var(--doc-sidebar-top) 0%, var(--doc-sidebar-bottom) 100%);
  overflow: auto;
}

.doc-sidebar-inner {
  padding: 0.85rem;
}

.doc-sidebar-header {
  margin-bottom: 0.7rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--doc-border-soft);
}

.doc-sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--doc-title);
  font-size: 0.96rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.doc-sidebar-title i {
  color: #3a8db6;
}

.doc-sidebar-title:hover {
  color: var(--doc-link-hover);
}

.doc-sidebar .doc-sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-sidebar .doc-sidebar-node {
  margin: 0;
}

.doc-sidebar .doc-sidebar-section-link,
.doc-sidebar .doc-sidebar-page-link {
  display: block;
  text-decoration: none;
  border-radius: 0.58rem;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.doc-sidebar .doc-sidebar-section-link {
  padding: 0.44rem 0.62rem;
  color: #365672;
  font-weight: 600;
  font-size: 0.83rem;
}

.doc-sidebar .doc-sidebar-page-link {
  padding: 0.31rem 0.62rem;
  color: #5c7591;
  font-size: 0.78rem;
}

.doc-sidebar .doc-sidebar-section-link:hover,
.doc-sidebar .doc-sidebar-page-link:hover {
  background: rgba(96, 165, 204, 0.14);
  color: var(--doc-link-hover);
}

.doc-sidebar .doc-sidebar-section-link--active,
.doc-sidebar .doc-sidebar-page-link--active {
  background: linear-gradient(180deg, rgba(93, 167, 202, 0.24) 0%, rgba(58, 130, 169, 0.21) 100%);
  color: #1f6386;
  box-shadow: inset 2px 0 0 #2f84ae;
}

.doc-sidebar .doc-sidebar-level-1,
.doc-sidebar .doc-sidebar-level-2,
.doc-sidebar .doc-sidebar-level-3,
.doc-sidebar .doc-sidebar-level-4,
.doc-sidebar .doc-sidebar-level-5,
.doc-sidebar .doc-sidebar-level-6 {
  margin-left: 0.42rem;
  padding-left: 0.45rem;
  border-left: 1px solid rgba(133, 164, 191, 0.48);
}

.doc-sidebar .doc-sidebar-pages {
  margin-top: 0.1rem;
  margin-bottom: 0.24rem;
  margin-left: 0.22rem;
  padding-left: 0.4rem;
  border-left: 1px dashed rgba(132, 162, 188, 0.52);
}

.doc-main {
  min-width: 0;
  padding: 1.1rem;
}

.doc-main-inner {
  max-width: 980px;
  margin: 0 auto;
}

.doc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  align-items: center;
  margin: 0 0 0.85rem;
  padding: 0.5rem 0.72rem;
  border-radius: 0.62rem;
  border: 1px solid var(--doc-border-soft);
  background: rgba(255, 255, 255, 0.74);
  color: var(--doc-muted);
  font-size: 0.79rem;
}

.doc-breadcrumb a {
  color: #4f7390;
  text-decoration: none;
}

.doc-breadcrumb a:hover {
  color: var(--doc-link-hover);
  text-decoration: underline;
}

.doc-breadcrumb-sep {
  color: #89a5be;
}

.doc-breadcrumb-current {
  color: #234f70;
  font-weight: 600;
}

.doc-article {
  border: 1px solid var(--doc-border);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, var(--doc-panel-top) 0%, var(--doc-panel-bottom) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(17, 40, 61, 0.1);
  color: var(--doc-text);
  line-height: 1.65;
  padding: 1.35rem 1.4rem;
}

.doc-article h1,
.doc-article h2,
.doc-article h3,
.doc-article h4,
.doc-article h5,
.doc-article h6 {
  margin-top: 1.15rem;
  margin-bottom: 0.65rem;
  color: var(--doc-title);
  line-height: 1.3;
}

.doc-article h1 {
  margin-top: 0;
  font-size: 1.62rem;
}

.doc-article h2 {
  font-size: 1.28rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid var(--doc-border-soft);
}

.doc-article h3 {
  font-size: 1.06rem;
}

.doc-article p,
.doc-article ul,
.doc-article ol,
.doc-article table,
.doc-article pre,
.doc-article blockquote {
  margin-top: 0;
  margin-bottom: 0.95rem;
}

.doc-article a {
  color: var(--doc-link);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 126, 168, 0.32);
}

.doc-article a:hover {
  color: var(--doc-link-hover);
  border-bottom-color: rgba(31, 100, 136, 0.6);
}

.doc-article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.87em;
  border: 1px solid rgba(130, 163, 191, 0.62);
  border-radius: 0.35rem;
  background: #eff6fd;
  color: #2b506d;
  padding: 0.1rem 0.32rem;
}

.doc-article pre {
  border: 1px solid rgba(120, 154, 182, 0.72);
  border-left: 3px solid #3f8ab2;
  border-radius: 0.56rem;
  background: #173046;
  color: #eaf6ff;
  padding: 0.92rem 1.05rem;
  overflow-x: auto;
}

.doc-article pre code {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.doc-article blockquote {
  border-left: 3px solid #4b90b7;
  border-radius: 0 0.45rem 0.45rem 0;
  background: rgba(213, 232, 247, 0.52);
  color: #375772;
  padding: 0.68rem 0.85rem;
}

.doc-article table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--doc-border-soft);
  border-radius: 0.5rem;
  overflow: hidden;
}

.doc-article th,
.doc-article td {
  padding: 0.58rem 0.66rem;
  border: 1px solid var(--doc-border-soft);
  text-align: left;
}

.doc-article th {
  background: #e6f1fa;
  color: #244f6f;
  font-weight: 700;
}

.doc-article img {
  max-width: 100%;
  border-radius: 0.62rem;
  border: 1px solid var(--doc-border-soft);
}

.doc-landing {
  border: 1px solid var(--doc-border-soft);
  border-radius: 0.88rem;
  background: linear-gradient(180deg, #fdfefe 0%, #edf4fb 100%);
  min-height: 52vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem 1.2rem;
}

.doc-landing-icon {
  width: 3.45rem;
  height: 3.45rem;
  margin: 0 auto 0.85rem;
  border-radius: 0.85rem;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #65afd0 0%, #3c88ae 100%);
  color: #f4fbff;
  font-size: 1.35rem;
  box-shadow: 0 8px 18px rgba(23, 73, 101, 0.22);
}

.doc-landing h1 {
  margin: 0 0 0.45rem;
  color: var(--doc-title);
  font-size: 1.68rem;
}

.doc-landing p {
  margin: 0 auto;
  max-width: 34rem;
  color: var(--doc-muted);
}

@media (max-width: 1100px) {
  .doc-root {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .doc-layout-wrapper {
    border-radius: 0.82rem;
  }

  .doc-root {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--doc-border-soft);
    max-height: 44vh;
  }

  .doc-main {
    padding: 0.92rem;
  }

  .doc-article {
    padding: 1rem;
  }
}
