/* ── Variables ── */
:root {
  --bg:           #faf9f7;
  --surface:      #ffffff;
  --border:       #e8e4de;
  --text:         #2c2825;
  --text-muted:   #8c8278;
  --accent:       #c0622a;
  --accent-light: #f7ede4;
  --sidebar-w:    240px;
  --toc-w:        200px;
  --topbar-h:     60px;

  --font-display: 'Lora', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  --radius:       10px;
  --shadow:       0 1px 4px rgba(0,0,0,0.06);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Base ── */
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 300;
}

/* ── Top Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.logo-mark {
  color: var(--accent);
  font-size: 0.9rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
}

.top-nav a { color: var(--text-muted); }
.top-nav a:hover { color: var(--text); text-decoration: none; }

.btn-outline {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  color: var(--text) !important;
  transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  text-decoration: none !important;
}

/* ── Layout ── */
.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  gap: 0;
  min-height: calc(100vh - var(--topbar-h));
  padding: 0 24px;
}

/* ── Sidebar ── */
.sidebar {
  padding: 40px 24px 40px 0;
  border-right: 1px solid var(--border);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 32px; }

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.sidebar ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar ul a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}

.sidebar ul a:hover {
  background: var(--accent-light);
  color: var(--text);
  text-decoration: none;
}

.sidebar ul a.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 500;
}

/* ── Main Content ── */
.content {
  padding: 48px 56px;
  max-width: 720px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }
.breadcrumb span:last-child { color: var(--text); }

/* ── Page Header ── */
.page-header { margin-bottom: 32px; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 12px;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Callouts ── */
.callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 36px;
  border: 1px solid transparent;
}

.callout-icon { font-size: 1.1rem; line-height: 1.6; flex-shrink: 0; }

.callout-tip {
  background: #eef6ff;
  border-color: #c3daf9;
  color: #2a4a70;
}

.callout-warning {
  background: #fff8ec;
  border-color: #f5d98b;
  color: #6b4c10;
}

.callout a { color: inherit; font-weight: 500; }

/* ── Doc Sections ── */
.doc-section {
  margin-bottom: 52px;
}

.doc-section h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.doc-section p {
  margin-bottom: 16px;
  color: var(--text);
}

.doc-section p:last-child { margin-bottom: 0; }

/* ── Steps ── */
.steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.step-number {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 2px;
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text);
}

.step-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(192, 98, 42, 0.1);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-icon { font-size: 1.4rem; }

.card h3 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Page Nav ── */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.page-nav-next {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text);
  text-decoration: none;
}

.page-nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.page-nav-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
}

.page-nav-next:hover .page-nav-title { text-decoration: underline; }

/* ── Right TOC ── */
.toc {
  padding: 40px 0 40px 32px;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}

.toc-title {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.toc ul { list-style: none; }

.toc ul li { margin-bottom: 4px; }

.toc ul a {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: block;
  padding: 3px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: color 0.12s, border-color 0.12s;
}

.toc ul a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* ── Footer ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer a { color: var(--text-muted); margin: 0 4px; }
.footer a:hover { color: var(--accent); }

.doc-section h2 {
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}

.doc-image {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.doc-image {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  width: fit-content;   /* shrinks to the image's natural size */
  max-width: 100%;      /* never overflows on small screens */
}

.doc-image figcaption {
  padding: 10px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  vertical-align: middle;
}

.btn-download:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .toc { display: none; }
  .layout { grid-template-columns: var(--sidebar-w) 1fr; }
}

@media (max-width: 720px) {
  .sidebar { display: none; }
  .layout { grid-template-columns: 1fr; padding: 0 16px; }
  .content { padding: 32px 0; }
  .page-header h1 { font-size: 1.7rem; }
  .top-nav a:not(.btn-outline) { display: none; }
}
