/* ==========================================================
   Reading pages: blog posts and guides. Loaded after styles.css and app.css.
   - Light or dark to match the device (prefers-color-scheme). Dark is the default.
   - A serif reading font (Literata) at a comfortable size and line length.
   - One column, no sidebar, no film grain over the text.
   ========================================================== */

.guide-page {
  --read: "Literata", "Iowan Old Style", Georgia, serif;
  --measure: 680px;                          /* text column: about 65 to 75 characters a line */
  --read-text: rgba(244, 239, 230, .86);     /* body text */
  --read-soft: rgba(244, 239, 230, .7);      /* notes, captions, sources */
  --note-bg: rgba(244, 239, 230, .045);
  --bar-bg: rgba(29, 26, 39, .92);
  --nav-bg: rgba(14, 13, 20, .78);
}

/* ---------- Light: same parts, colors flipped ----------
   --ink is the page and --cream the "ink", so buttons, the logo and badges flip with them. */
@media (prefers-color-scheme: light) {
  :root:has(.guide-page) { color-scheme: light; }
  .guide-page {
    --ink: #FBF8F3;
    --ink-2: #F3EEE6;
    --ink-3: #EBE5DB;
    --cream: #1B1922;
    --cream-2: #2A2731;
    --text: #1B1922;
    --muted: rgba(27, 25, 34, .7);
    --faint: rgba(27, 25, 34, .56);
    --line: rgba(27, 25, 34, .12);
    --read-text: #2B2833;
    --read-soft: rgba(27, 25, 34, .72);
    --note-bg: rgba(27, 25, 34, .04);
    --bar-bg: rgba(255, 255, 255, .94);
    --nav-bg: rgba(251, 248, 243, .84);
  }
  .guide-page { --menu-bg: #FFFFFF; }
  .guide-page .nav-links a:hover { background: rgba(27, 25, 34, .06); }
  .guide-page .nav-menu { background: rgba(255, 255, 255, .7); }
  .guide-page .nav .nav-links { box-shadow: 0 20px 50px -14px rgba(27, 25, 34, .25), 0 0 0 1px var(--line); }
  @media (min-width: 721px) { .guide-page .nav-links { background: rgba(255, 255, 255, .6); } }
  .guide-page .nav-cta:hover, .guide-page .btn-primary:hover { background: #000; }
  .guide-page .g-head::before { opacity: .55; }
  .guide-page .app-bar.is-chosen { box-shadow: 0 10px 30px rgba(27, 25, 34, .16); }
  .guide-page .g-hero img { border-color: transparent; }

  /* The footer stays dark: it's the brand's sign-off */
  .guide-page .footer {
    --ink: #0E0D14; --ink-2: #15131D; --cream: #F4EFE6; --text: #F4EFE6;
    --muted: rgba(244, 239, 230, .62); --faint: rgba(244, 239, 230, .38); --line: rgba(244, 239, 230, .12);
    background: #0E0D14; color: var(--text);
  }
}

.guide-page .grain { display: none; }
.guide-page .nav.is-scrolled { background: var(--nav-bg); }
.guide-page .app-bar.is-chosen { background: var(--bar-bg); }

/* ---------- Reading progress ---------- */
.read-progress { position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 3px; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 100%; background: var(--c); transform: scaleX(0); transform-origin: left; }

/* ---------- Header: same width as the text ---------- */
.guide-page .g-head {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  padding-top: clamp(104px, 14vh, 148px); padding-bottom: clamp(28px, 4vw, 44px);
}
.guide-page .g-head::before { right: -40%; top: -20%; }
.guide-page .g-head .app-title {
  max-width: none; margin-top: 18px;
  font-size: clamp(34px, 4.6vw, 54px); font-weight: 600; line-height: 1.06; letter-spacing: -.035em;
}
.guide-page .g-head .app-lead {
  max-width: none; margin-top: 18px;
  font-family: var(--read); font-size: clamp(18.5px, 1.6vw, 21px); line-height: 1.55; color: var(--muted);
}
.guide-page .crumbs { font-family: var(--sans); font-size: 14px; color: var(--muted); }
.guide-page .g-meta { margin-top: 22px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.guide-page .g-meta span + span::before { color: var(--faint); }
.guide-page .g-meta span:first-child { color: var(--muted); }

/* ---------- Photo: a little wider than the text ---------- */
.guide-page .g-hero { max-width: calc(1000px + 2 * var(--gutter)); margin-bottom: clamp(36px, 5vw, 56px); }
.guide-page .g-hero img { aspect-ratio: 16 / 9; border-radius: 18px; }
.guide-page .g-hero figcaption { font-family: var(--sans); font-size: 13px; color: var(--faint); text-align: right; }

/* ---------- One column ---------- */
.guide-page .g-layout {
  display: block;
  max-width: calc(var(--measure) + 2 * var(--gutter));
}
.guide-page .g-side { display: none; }

/* ---------- Body text ---------- */
.guide-page .g-body {
  font-family: var(--read); font-size: 19px; line-height: 1.68; color: var(--read-text);
  font-optical-sizing: auto; hanging-punctuation: first;
  text-wrap: pretty;
}
.guide-page .g-body p + p, .guide-page .g-body p + ol, .guide-page .g-body p + ul,
.guide-page .g-body ol + p, .guide-page .g-body ul + p { margin-top: 1.05em; }
.guide-page .g-body b { font-weight: 600; color: var(--text); }
.guide-page .g-body a:not(.store-badge):not(.g-more):not(.app-bar-get) {
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}

/* Headings stay in the brand sans */
.guide-page .g-section { margin-top: clamp(48px, 6vw, 64px); }
.guide-page .g-section h2 {
  margin-bottom: 16px; font-family: var(--sans);
  font-size: clamp(25px, 2.4vw, 31px); font-weight: 600; line-height: 1.18; letter-spacing: -.025em;
}

/* Lists */
.guide-page .g-steps li + li, .guide-page .g-list li + li { margin-top: .7em; }
.guide-page .g-list li::before { top: .78em; width: 6px; height: 6px; }
.guide-page .g-steps li::before { top: .1em; font-family: var(--sans); font-size: 14px; font-weight: 600; }

/* Short answer */
.guide-page .g-answer {
  padding: clamp(20px, 2.6vw, 26px) clamp(20px, 2.8vw, 28px);
  border-radius: 18px; color: var(--text);
}
.guide-page .g-answer-label { margin-bottom: 6px; font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .04em; }

/* "Good to know" notes: quiet, smaller, still easy to read */
.guide-page .g-tip {
  margin-top: 22px !important; padding: 14px 18px;
  border-left-width: 2px; border-radius: 0 12px 12px 0; background: var(--note-bg);
  font-size: 17px; line-height: 1.6; color: var(--read-soft);
}
.guide-page .g-tip b {
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: .05em; color: var(--text);
}

/* Contents, inside the article (replaces the desktop sidebar; phones had none) */
.g-toc-in {
  margin-top: 22px; border: 1px solid var(--line); border-radius: 14px;
  font-family: var(--sans); font-size: 15.5px; line-height: 1.4;
}
.g-toc-in summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  font-weight: 600; color: var(--text);
}
.g-toc-in summary::-webkit-details-marker { display: none; }
.g-toc-in summary::before {
  content: ""; width: 7px; height: 7px; flex: none; margin-right: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .25s var(--ease);
}
.g-toc-in[open] summary::before { transform: rotate(45deg); }
.g-toc-in summary span { margin-left: auto; font-weight: 400; font-size: 14px; color: var(--faint); }
.g-toc-in ol { margin: 0; padding: 2px 18px 14px 44px; color: var(--faint); }
.g-toc-in li { padding: 5px 0 5px 4px; }
.guide-page .g-toc-in a { color: var(--muted) !important; text-decoration: none !important; }
.guide-page .g-toc-in a:hover { color: var(--text) !important; }

/* App card in the text */
.guide-page .g-app { font-family: var(--sans); border-radius: 22px; }

/* Questions */
.guide-page .g-section .faq { font-family: var(--sans); }
.guide-page .g-section .faq summary { font-size: clamp(17.5px, 1.4vw, 19.5px); font-weight: 600; letter-spacing: -.015em; }
.guide-page .g-section .faq details p { font-family: var(--read); font-size: 17.5px; line-height: 1.62; color: var(--read-soft); }

/* About this article, sources */
.guide-page .g-about { font-size: 16.5px; color: var(--read-soft); background: var(--note-bg); border-radius: 18px; }
.guide-page .g-about h2 { font-size: clamp(20px, 1.8vw, 23px) !important; }
.guide-page .g-src { font-size: 15.5px; line-height: 1.55; color: var(--read-soft); }
.guide-page .g-src li::marker { font-family: var(--sans); font-size: 13.5px; }
.guide-page .g-body .g-src a { font-family: var(--sans); font-size: 13.5px; color: var(--faint); }

/* ---------- Phones ---------- */
@media (max-width: 620px) {
  .guide-page .g-body { font-size: 18px; line-height: 1.64; }
  /* Items wrap onto two lines here, so no dots between them */
  .guide-page .g-meta { gap: 2px 16px; }
  .guide-page .g-meta span + span::before { content: none; }
  .guide-page .g-hero { padding: 0; }
  .guide-page .g-hero img { border-radius: 0; border: 0; }
  .guide-page .g-hero figcaption { padding: 0 var(--gutter); }
  .guide-page .g-section .faq details p { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .read-progress { display: none; }
}
