/* Seula Help — Apple Help Book stylesheet.
   System font stack, generous measure, AAA-ish contrast, automatic dark mode
   via prefers-color-scheme. Hand-tuned to read like Apple's own help. */

:root {
  --bg: #ffffff;
  --bg-elevated: #f5f5f7;
  --bg-note: #eef4ff;
  --bg-note-border: #2f6fed;
  --bg-warn: #fff6e5;
  --bg-warn-border: #c77700;
  --text: #1d1d1f;
  --text-secondary: #515154;
  --text-tertiary: #86868b;
  --link: #0066cc;
  --rule: #d2d2d7;
  --kbd-bg: #f0f0f2;
  --kbd-border: #c7c7cc;
  --kbd-text: #1d1d1f;
  --code-bg: #f5f5f7;
  --table-head: #f5f5f7;
  --table-stripe: #fafafa;
  --shot-bg: #f5f5f7;
  --shot-border: #c7c7cc;
  --nav-bg: #f7f7f9;
  --nav-hover: rgba(0, 0, 0, 0.05);
  --nav-current-bg: #0066cc;
  --nav-current-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --bg-elevated: #2a2a2c;
    --bg-note: #16263f;
    --bg-note-border: #4f8cff;
    --bg-warn: #3a2c12;
    --bg-warn-border: #e0a33a;
    --text: #f5f5f7;
    --text-secondary: #c7c7cc;
    --text-tertiary: #98989d;
    --link: #4f9dff;
    --rule: #3a3a3c;
    --kbd-bg: #2f2f31;
    --kbd-border: #545458;
    --kbd-text: #f5f5f7;
    --code-bg: #2a2a2c;
    --table-head: #2a2a2c;
    --table-stripe: #242426;
    --shot-bg: #2a2a2c;
    --shot-border: #545458;
    --nav-bg: #252527;
    --nav-hover: rgba(255, 255, 255, 0.07);
    --nav-current-bg: #0a6cff;
    --nav-current-text: #ffffff;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout: sidebar + content ───────────────────────────────────── */

.help-layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.page {
  flex: 1 1 auto;
  max-width: 760px;
  min-width: 0;
  margin: 0;
  padding: 34px 40px 80px;
}

/* ── Navigation sidebar ──────────────────────────────────────────── */

.help-nav {
  flex: 0 0 230px;
  width: 230px;
  align-self: stretch;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px 10px 40px;
  background: var(--nav-bg);
  border-right: 1px solid var(--rule);
  -webkit-overflow-scrolling: touch;
}

.help-nav .nav-home {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px 0;
  margin-bottom: 12px;
}
.help-nav .nav-home.current { color: var(--text); }
.help-nav .nav-home:hover { color: var(--text); }

.nav-list, .nav-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list > li { margin: 0; }

.nav-link {
  display: block;
  padding: 6px 10px 6px 24px;   /* left room aligns with disclosure topics */
  border-radius: 6px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--text);
  text-decoration: none;
}
.nav-link:hover { background: var(--nav-hover); text-decoration: none; }
.nav-link.current {
  background: var(--nav-current-bg);
  color: var(--nav-current-text);
  font-weight: 600;
}
.nav-link.current:hover { background: var(--nav-current-bg); }

/* Disclosure rows: a <details> per expandable topic. We hide the native
   marker and draw our own triangle on the summary so the row looks like a
   normal sidebar item that rotates open. */
.help-nav details { margin: 0; }
.help-nav summary {
  list-style: none;
  display: block;
  position: relative;
  cursor: default;
  border-radius: 6px;
}
.help-nav summary::-webkit-details-marker { display: none; }
.help-nav summary::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  width: 0;
  height: 0;
  border-left: 5px solid var(--text-tertiary);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.help-nav details[open] > summary::before { transform: rotate(90deg); }
.help-nav summary:hover::before { border-left-color: var(--text-secondary); }
.help-nav summary .nav-link.current ~ * { color: inherit; }

.nav-sub {
  margin: 1px 0 6px 22px;
  padding-left: 10px;
  border-left: 1px solid var(--rule);
}
.nav-sub > li { margin: 0; }
.nav-link.sub {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 5px 10px;
}
.nav-link.sub.current { color: var(--nav-current-text); }
.nav-link.sub:hover { color: var(--text); }
.nav-link.sub.current:hover { color: var(--nav-current-text); }

/* Only collapse to a top banner on a genuinely narrow Help Viewer window;
   keep the left sidebar for the common, wider case. */
@media (max-width: 520px) {
  .help-layout { flex-direction: column; }
  .help-nav {
    position: static;
    width: auto;
    flex: none;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 12px 14px;
  }
  .page { padding: 22px 18px 60px; }
}

/* ── Typography ──────────────────────────────────────────────────── */

.index-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 28px;
}
.index-hero-text { flex: 1 1 auto; min-width: 0; }
.index-hero-text > :last-child { margin-bottom: 0; }

.help-logo {
  flex: 0 0 auto;
  width: 128px;
  height: 128px;
  border-radius: 28px;
}

h1 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 18px;
}

h2 {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 34px 0 12px;
  padding-top: 6px;
}

h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
}

p { margin: 0 0 14px; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

strong { font-weight: 600; }

.lede {
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 26px;
}

/* ── Lists ───────────────────────────────────────────────────────── */

ul, ol { margin: 0 0 16px; padding-left: 26px; }
li { margin: 0 0 7px; }
li > ul, li > ol { margin-top: 7px; margin-bottom: 0; }

ol { counter-reset: none; }

/* Numbered task steps read a touch more prominently. */
ol.steps { padding-left: 0; list-style: none; counter-reset: step; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 38px;
  margin-bottom: 12px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 24px;
}

/* ── Code & keys ─────────────────────────────────────────────────── */

code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: 1px 5px;
}

pre {
  background: var(--code-bg);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 16px;
}
pre code { background: none; padding: 0; font-size: 13px; }

kbd {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9em;
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--kbd-text);
  white-space: nowrap;
  box-shadow: 0 1px 0 var(--kbd-border);
}

/* ── Notes / callouts ────────────────────────────────────────────── */

.note, .warn {
  border-left: 3px solid var(--bg-note-border);
  background: var(--bg-note);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 0 0 18px;
}
.note p:last-child, .warn p:last-child { margin-bottom: 0; }
.warn {
  border-left-color: var(--bg-warn-border);
  background: var(--bg-warn);
}

/* ── Tables ──────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 0 20px; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th {
  background: var(--table-head);
  font-weight: 600;
  border-bottom: 1px solid var(--rule);
}
tbody tr:nth-child(even) { background: var(--table-stripe); }
td kbd { font-size: 0.85em; }

/* ── Screenshot placeholders ─────────────────────────────────────── */

figure.screenshot-placeholder {
  margin: 0 0 20px;
  border: 1px dashed var(--shot-border);
  background: var(--shot-bg);
  border-radius: 10px;
  padding: 22px 18px;
  text-align: center;
  color: var(--text-tertiary);
}
figure.screenshot-placeholder::before {
  content: "📷";
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
  opacity: 0.7;
}
figure.screenshot-placeholder figcaption {
  font-size: 13px;
  font-style: italic;
}

figure.shot { margin: 0 0 20px; }
figure.shot img { max-width: 100%; border-radius: 10px; border: 1px solid var(--rule); min-height: 44px; background: var(--shot-bg); }
figure.shot figcaption { font-size: 13px; color: var(--text-tertiary); margin-top: 6px; }
/* Red number badge marking which numbered screenshot belongs in this slot. */
figure.shot .shot-num {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-right: 6px;
  border-radius: 9px;
  background: #d6453d;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

/* ── See also ────────────────────────────────────────────────────── */

.see-also {
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.see-also h2 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin: 0 0 8px;
}
.see-also ul { list-style: none; padding: 0; margin: 0; }
.see-also li { margin: 0 0 4px; }

/* ── Landing page grid ───────────────────────────────────────────── */

.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.toc-grid li { margin: 0; }
.toc-grid a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--bg-elevated);
  text-decoration: none;
  height: 100%;
}
.toc-grid a:hover { border-color: var(--link); }
.toc-grid .title { display: block; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.toc-grid .blurb { display: block; font-size: 13px; color: var(--text-secondary); }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 28px 0;
}

dl { margin: 0 0 18px; }
dt { font-weight: 600; margin-top: 14px; }
dd { margin: 2px 0 0; color: var(--text-secondary); }
