/* ==========================================================================
   Medicine Vault — User Manual Stylesheet
   Design System Matched to medicinevault.app
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  /* Color Tokens matching style.css */
  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-subtle: #d1fae5;
  --primary-border: #6ee7b7;
  --primary-dark: #064e3b;
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 100%);
  --accent-mint: #10b981;
  --accent-red: #ef4444;

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-elevated: #ffffff;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --sidebar-bg: #091322;
  --sidebar-border: #16243b;
  --sidebar-ink: #e2e8f0;
  --sidebar-ink-muted: #94a3b8;
  --sidebar-active-bg: rgba(5, 150, 105, 0.2);
  --sidebar-active-text: #6ee7b7;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-xl: 36px;

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);

  color-scheme: light dark;
}

[data-theme="dark"] {
  --bg-main: #080f1a;
  --bg-surface: #0f192b;
  --bg-subtle: #18253b;
  --bg-elevated: #162238;

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;

  --border-light: #1e2f4a;
  --border-medium: #2d4366;

  --sidebar-bg: #060c16;
  --sidebar-border: #132035;
  --sidebar-ink: #f8fafc;
  --sidebar-ink-muted: #94a3b8;
}

/* Reset & Layout */
.nav-toggle {
  display: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 4.75rem);
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Styling */
.sidebar {
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-ink);
  position: sticky;
  top: 4.75rem;
  height: calc(100vh - 4.75rem);
  overflow-y: auto;
  padding: 1.75rem 1rem 3rem 1rem;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--sidebar-border);
  }
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0 0.75rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 1.25rem;
}

.sidebar-brand .mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  flex-shrink: 0;
}

.sidebar-brand .name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-brand .tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sidebar-ink-muted);
}

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

.sidebar .group-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #10b981;
  margin: 1.25rem 0.75rem 0.4rem 0.75rem;
}

.sidebar nav a {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--sidebar-ink-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 150ms ease;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background-color: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  padding-left: 1.1rem;
}

.pdf-note {
  font-size: 0.8rem;
  color: var(--sidebar-ink-muted);
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 2rem;
  line-height: 1.5;
}

.sidebar-footer {
  font-size: 0.75rem;
  color: var(--sidebar-ink-muted);
  padding: 0.5rem 0.75rem;
  opacity: 0.75;
}

/* Content Column Styling */
.content {
  padding: 3rem 2rem 6rem 3rem;
  max-width: 920px;
}

@media (max-width: 768px) {
  .content {
    padding: 2rem 1.25rem 4rem 1.25rem;
  }
}

.page-hero {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 3rem;
  margin-bottom: 3.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 6px; height: 100%;
  background: var(--primary-gradient);
}

.page-hero .eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

[data-theme="dark"] .page-hero .eyebrow {
  color: #6ee7b7;
  background: rgba(5, 150, 105, 0.25);
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.page-hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Chapters */
.chapter {
  margin-bottom: 4.5rem;
  scroll-margin-top: 6rem;
}

.chapter-kicker {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-mint);
  margin-bottom: 0.5rem;
}

.chapter h2 {
  font-family: var(--font-heading);
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
}

.chapter p {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.7;
}

.chapter p.dek {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

/* Tile Grid */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.tile {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 200ms ease, border-color 200ms ease;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--primary-border);
  box-shadow: var(--shadow-md);
}

.tile h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.tile p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Callouts */
.callout {
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0;
  border-left: 5px solid var(--primary);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.callout.warn {
  border-left-color: var(--accent-red);
  background-color: rgba(239, 68, 68, 0.05);
}

.callout.warn p {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 0;
}

/* Screenshots Figures */
figure {
  margin: 2rem 0;
  text-align: center;
}

figure img {
  max-width: 340px;
  width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  margin: 0 auto 1rem auto;
}

figcaption {
  font-size: 0.9rem;
  color: var(--text-subtle);
  font-weight: 600;
}

/* TOC Grid */
.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.toc-card {
  display: block;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  transition: all 200ms ease;
}

.toc-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.toc-card .n {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent-mint);
  margin-bottom: 0.25rem;
}

.toc-card h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.toc-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
