@import url("./theme.css");

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

html {
  font-size: 19px;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-text);
  height: 100%;
}

a { color: var(--color-text); text-decoration: none; }
a:hover, a:focus { opacity: 0.65; }

/* ── Layout ── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background-color: var(--color-sidebar-bg);
  border-right: 1px solid var(--color-light-grey);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.75rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo { display: block; margin-bottom: 2rem; user-select: none; }
.sidebar-logo img { width: 10rem; }

.sidebar-section-title {
  font-family: var(--font-text);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-dark-grey);
  margin: 0 0 0.75rem 0;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--color-light-grey);
  margin: 1.5rem 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-nav a {
  font-family: var(--font-text);
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  color: var(--color-dark-grey);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-left: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
}

.sidebar-nav a:hover { color: var(--color-text); opacity: 1; }
.sidebar-nav a.active {
  color: var(--color-text);
  border-left-color: var(--color-text);
  font-weight: 500;
}

/* ── Content ── */
.content-area {
  flex: 1;
  min-width: 0;
  padding: 3.5rem 4rem;
}

.doc-content { max-width: 680px; }

/* ── Markdown ── */
.doc-content h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.96rem;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.doc-content .doc-subtitle {
  font-size: 0.875rem;
  color: var(--color-dark-grey);
  margin: 0 0 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-light-grey);
}

.doc-content h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 2.75rem 0 0.6rem;
  border-bottom: 1px solid var(--color-light-grey);
  padding-bottom: 0.35rem;
}

.doc-content h3 {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 1rem;
  margin: 1.75rem 0 0.4rem;
}

.doc-content p {
  color: var(--color-dark-grey);
  line-height: 1.85rem;
  margin: 0.6rem 0;
  text-align: justify;
}

.doc-content strong { color: var(--color-text); font-weight: 600; }

.doc-content ul, .doc-content ol {
  color: var(--color-dark-grey);
  line-height: 1.85rem;
  padding-left: 1.5rem;
  display: block;
}
.doc-content ul { list-style-type: disc; }
.doc-content ol { list-style-type: decimal; }
.doc-content li { margin: 0.3rem 0; width: auto; }

.doc-content code {
  font-family: var(--font-text);
  background: var(--color-sidebar-bg);
  border: 1px solid var(--color-light-grey);
  padding: 0.1em 0.35em;
  border-radius: 2px;
  font-size: 0.9em;
}

.doc-content pre {
  background: var(--color-sidebar-bg);
  border: 1px solid var(--color-light-grey);
  padding: 1.25rem;
  overflow-x: auto;
  border-radius: 2px;
}
.doc-content pre code { background: none; border: none; padding: 0; }

.doc-content blockquote {
  border-left: 3px solid var(--color-light-grey);
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: var(--color-dark-grey);
  font-style: italic;
}

.doc-content hr {
  border: none;
  border-top: 1px solid var(--color-light-grey);
  margin: 2.5rem 0;
}

.doc-content a { border-bottom: 1px solid var(--color-light-grey); }
.doc-content a:hover { border-bottom-color: var(--color-text); opacity: 1; }

/* ── Mobile ── */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-light-grey);
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  color: var(--color-text);
  font-family: var(--font-text);
  font-size: 0.8rem;
  margin-top: 1rem;
}

@media screen and (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    position: relative;
    padding: 1.5rem 1.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--color-light-grey);
  }
  .sidebar-logo img { width: 8rem; }
  .sidebar-nav { display: none; }
  .sidebar-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .content-area { padding: 2rem 1.5rem; }
  .doc-content h1 { font-size: 1.4rem; }
  .doc-content h2 { font-size: 1.15rem; }
}
