/* ============================================================
   Hydra Forge Documentation — Canonical Stylesheet
   ============================================================ */

/* ---- Base ------------------------------------------------- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: #f7f8fb;
  color: #1f2937;
  line-height: 1.75;
}

/* Mobile default */
@media (max-width: 900px) {

  aside {
    display: none;
  }

  aside:target {
    display: block;
  }

  .menu-toggle {
    display: inline-block;
    font-size: 1.4rem;
    text-decoration: none;
  }
}

/* ---- Header ---------------------------------------------- */

header {
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  padding: 12px 24px;
}

header a {
  text-decoration: none;
  font-size: 1.25rem;
}

/* ---- Layout ---------------------------------------------- */

.layout {
  display: flex;
  min-height: calc(100vh - 50px);
}

/* ---- Sidebar --------------------------------------------- */

aside {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #ddd;
  padding: 24px;
}

aside h3 {
  margin-top: 24px;
  font-size: 0.9rem;
  color: #374151;
}

aside a {
  display: block;
  margin: 6px 0;
  color: #1a3d6b;
  text-decoration: none;
  font-size: 0.95rem;
}

aside a:hover {
  text-decoration: underline;
}

aside a.active {
  font-weight: 600;
  color: #0f172a;
}

.menu-close {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
}

aside#nav {
  position: sticky;
  top: 1rem;               /* distance from top after header */
  align-self: flex-start;  /* important inside flex layouts */
  height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-right: 0.5rem;
}

@media (max-width: 900px) {
  aside#nav {
    position: static;
    height: auto;
  }
}

/* ---- Main content ---------------------------------------- */

main {
  max-width: 900px;
  padding: 48px;
}

h1, h2, h3 {
  color: #10243f;
}

h1 {
  margin-top: 0;
}

p.intro {
  font-size: 1.05rem;
  color: #374151;
}

hr {
  border: none;
  border-top: 1px solid #d1d5db;
  margin: 2.5rem 0;
}

ul {
  margin-left: 1.25rem;
}

em {
  color: #374151;
}

.context-box {
  border: 1px solid #d1d5db;
  border-left: 4px solid #4b5563; /* neutral gray */
  background: #f9fafb;
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0 1.8rem 0;
  font-size: 0.95rem;
}

.context-box__header {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #374151;
  margin-bottom: 0.4rem;
  text-transform: none;
}

.context-box__list {
  margin: 0;
  padding-left: 1.2rem;
}

.context-box__list li {
  margin: 0.2rem 0;
  line-height: 1.35;
  color: #111827;
}

/* ---- Quiet persistent demo CTA --------------------------- */

.demo-cta {
  position: fixed;
  right: 16px;
  bottom: 24px;
  font-size: 0.85rem;
  color: #1a3d6b;
  text-decoration: none;
  padding: 10px 14px;
  border: 1px solid #c7d2e5;
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  transition: background 0.2s ease, box-shadow 0.2s ease;
  z-index: 1000;
}

.demo-cta:hover {
  background: #f3f6fb;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
}

.docs-cta:hover {
  background: rgba(207, 210, 255, 0.08);
  color: var(--accent);
}

/* ---- Responsive ------------------------------------------ */

@media (max-width: 900px) {
  aside {
    display: none;
  }

  main {
    padding: 32px;
  }

  .demo-cta {
    display: none;
  }
}

.doc-figure {
  margin: 1.5rem 0;
  max-width: 100%;
}

.doc-figure img {
  display: block;          /* remove inline gaps */
  width: 100%;             /* scale with container */
  max-width: 100%;         /* never overflow */
  height: auto;            /* preserve aspect ratio */
  margin-left: 0;          /* hug left */
}

.doc-figure figcaption {
  margin-top: 0.5rem;
  max-width: 70ch;         /* readable line length */
  color: #555;
}

.doc-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
  gap: 1rem;
}

.doc-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

.doc-nav a:hover {
  text-decoration: underline;
}

.doc-nav-prev {
  text-align: left;
}

.doc-nav-next {
  text-align: right;
}