/* ═══════════════════════════════════════════════════════════════
   GREGOR User Manual — styles
   Standalone CSS (no Tailwind compilation needed)
   Coherent with about.html / landing dark theme.
   ═══════════════════════════════════════════════════════════════ */

/* ── Layout root ────────────────────────────────────────────── */
.manual-page {
  background: #f8f9fa;
  color: #1f2937;
  font-family: 'WixMadeforDisplay', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.manual-page.is-dark {
  background: #0d1117;
  color: rgba(255, 255, 255, 0.85);
}

/* spacer below fixed navbar */
.manual-spacer { height: 70px; }

/* ── Header banner (mismo estilo que about) ─────────────────── */
.manual-header {
  position: relative;
  z-index: 3;
  min-height: 140px;
  display: flex;
  align-items: center;
  border-top: 1px solid rgba(245, 158, 11, 0.4);
  border-bottom: 1px solid rgba(245, 158, 11, 0.4);
  background-image: url("/static/images/bg-2.b71d7c5cbdb8.png");
  background-size: cover;
  background-position: 50%;
}
.manual-header-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.manual-header-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #1e293b;
  margin: 0;
  text-shadow: none;
}
.manual-header-subtitle {
  font-size: 1rem;
  color: #4b5563;
  margin: 0;
  text-shadow: none;
}
.manual-version-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: rgba(30, 41, 59, 0.1);
  border: 1px solid rgba(30, 41, 59, 0.35);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e293b;
  width: fit-content;
}

/* ── Layout grid: TOC + content ─────────────────────────────── */
.manual-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2.5rem;
}

/* TOC (sticky en desktop) */
.manual-toc {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 1.25rem 0.5rem 1.25rem 0;
  border-right: 1px solid rgba(128, 128, 128, 0.18);
  font-size: 0.875rem;
}
.manual-toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f59e0b;
  margin: 0 0 0.75rem;
  padding: 0 0.5rem;
}
.manual-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.manual-toc li { margin: 0; }
.manual-toc a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: #4b5563;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 0.25rem 0.25rem 0;
  transition: all 0.15s ease;
}
.manual-toc a:hover {
  background: rgba(245, 158, 11, 0.08);
  color: #f59e0b;
  border-left-color: rgba(245, 158, 11, 0.4);
}
.manual-toc a.is-active {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-left-color: #f59e0b;
  font-weight: 600;
}
.manual-toc .is-sub {
  padding-left: 1.5rem;
  font-size: 0.8rem;
}

/* ── Content body ───────────────────────────────────────────── */
.manual-body { min-width: 0; }

.manual-section {
  padding: 2.5rem 0 0;
  border-top: 1px solid rgba(128, 128, 128, 0.12);
  scroll-margin-top: 90px;
}
.manual-section:first-of-type { border-top: none; padding-top: 1.5rem; }

.manual-h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: #f59e0b;
}
.manual-h2 {
  font-size: 1.375rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  color: #111827;
  scroll-margin-top: 90px;
}
.manual-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.4rem;
  color: #1f2937;
}
.manual-h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 1.1rem 0 0.3rem;
  color: #374151;
}
.manual-p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 0.85rem;
  color: #374151;
}

/* Lead paragraph (intro de sección) */
.manual-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #4b5563;
  margin-bottom: 1.25rem;
}

/* Inline link */
.manual-link {
  color: #f59e0b;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.4);
}
.manual-link:hover { border-bottom-style: solid; }

/* ── Callout boxes ──────────────────────────────────────────── */
.manual-callout {
  margin: 1rem 0;
  padding: 0.85rem 1rem 0.85rem 1rem;
  border-radius: 0.5rem;
  border-left: 4px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
  font-size: 0.9rem;
  line-height: 1.55;
}
.manual-callout-label {
  display: inline-block;
  font-weight: 700;
  margin-right: 0.4rem;
  color: #b45309;
}
.manual-callout p { margin: 0; }
.manual-callout p + p { margin-top: 0.4rem; }

.manual-callout.is-tip       { border-left-color: #10b981; background: rgba(16, 185, 129, 0.06); }
.manual-callout.is-tip       .manual-callout-label { color: #047857; }

.manual-callout.is-warning   { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.06); }
.manual-callout.is-warning   .manual-callout-label { color: #b91c1c; }

.manual-callout.is-access    { border-left-color: #6366f1; background: rgba(99, 102, 241, 0.06); }
.manual-callout.is-access    .manual-callout-label { color: #4338ca; }

.manual-callout.is-glossary  { border-left-color: #0ea5e9; background: rgba(14, 165, 233, 0.06); }
.manual-callout.is-glossary  .manual-callout-label { color: #0369a1; }

/* ── Image figures ──────────────────────────────────────────── */
.manual-figure {
  margin: 1.25rem 0 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #fff;
}
.manual-figure img {
  display: block;
  width: 100%;
  height: auto;
}
.manual-figure-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: repeating-linear-gradient(
    45deg,
    #f3f4f6,
    #f3f4f6 12px,
    #fafafa 12px,
    #fafafa 24px
  );
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 1rem;
}
.manual-figure figcaption {
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  color: #6b7280;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
.manual-figure figcaption strong {
  color: #f59e0b;
  margin-right: 0.25rem;
}

/* ── Step list (numbered, big numbers) ──────────────────────── */
.manual-steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 1rem 0;
}
.manual-steps li {
  counter-increment: step;
  position: relative;
  padding: 0.65rem 0 0.65rem 2.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #374151;
}
.manual-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Tab template structure (recurring per-tab block) ───────── */
.manual-tab-block {
  margin: 1rem 0 1.5rem;
  padding: 1.25rem 1.25rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff;
}
.manual-tab-block-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.manual-tab-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.manual-tab-block-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: #111827;
}
.manual-tab-block h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #f59e0b;
  margin: 1rem 0 0.35rem;
}
.manual-tab-block h4:first-of-type { margin-top: 0.25rem; }

/* ── Glossary ───────────────────────────────────────────────── */
.manual-glossary {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff;
  font-size: 0.9rem;
  line-height: 1.55;
}
.manual-glossary dt {
  font-weight: 700;
  color: #f59e0b;
}
.manual-glossary dd {
  margin: 0;
  color: #374151;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.manual-faq details {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  margin-bottom: 0.6rem;
  background: #fff;
  overflow: hidden;
}
.manual-faq summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
}
.manual-faq summary::-webkit-details-marker { display: none; }
.manual-faq summary::after {
  content: '+';
  float: right;
  color: #f59e0b;
  font-weight: 700;
}
.manual-faq details[open] summary::after { content: '−'; }
.manual-faq details > *:not(summary) {
  padding: 0 1rem 0.85rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #374151;
}

/* ── Open-Manual button (used in about page) ────────────────── */
.about-manual-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 1.5rem 0 0;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, #f59e0b 0%, #f59e0b 100%);
  color: #fff !important;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.about-manual-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  transition: left 0.3s ease;
  z-index: 0;
}

.about-manual-cta:hover::before {
  left: 100%;
}

.about-manual-cta:hover {
  background: linear-gradient(135deg, #d97706 0%, #d97706 100%);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
  text-decoration: none;
}

.about-manual-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.about-manual-cta svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.about-manual-cta:hover svg:last-child {
  transform: translateX(4px);
}

/* ── Manual link in app navbar ──────────────────────────────── */
.app-navbar-manual-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .manual-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .manual-toc {
    position: relative;
    top: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid rgba(128, 128, 128, 0.18);
    padding-bottom: 1rem;
  }
  .manual-glossary { grid-template-columns: 1fr; }
}

.landing-footer.footer-light {
  position: relative;
  background: #f8f9fa;
  border-top: 1px solid #e5e7eb;
}
.landing-footer.footer-dark {
  position: relative;
  background: #0d1117;
  border-top: 1px solid rgba(255,255,255,0.08);
}
