/* ============================================================
   MailToPDF — guide page
   Editorial layout with sticky TOC + section-numbered prose
============================================================ */

.guide-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ============================================================
   Hero
============================================================ */
.guide-hero {
  text-align: center;
  padding: clamp(48px, 7vw, 80px) 0 clamp(36px, 5vw, 56px);
  border-bottom: 1px solid var(--rule);
}
.guide-hero .hero-meta { margin-bottom: 28px; }
.guide-title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 76px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 28px;
  max-width: 16ch;
  margin-left: auto;
  margin-right: auto;
}
.guide-title em { color: var(--accent); }
.guide-lede {
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 64ch;
  margin: 0 auto;
  font-variation-settings: "opsz" 18, "wght" 380;
}
.guide-lede code {
  background: var(--paper);
  padding: 2px 8px;
  border: 1px solid var(--rule-soft);
  font-size: 0.82em;
  color: var(--accent);
}

/* ============================================================
   Mobile TOC (collapsed details)
============================================================ */
.guide-toc-mobile {
  display: none;
  margin: 28px 0 0;
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 0 18px;
}
.guide-toc-mobile summary {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  cursor: pointer;
  padding: 14px 0;
  list-style: none;
}
.guide-toc-mobile summary::-webkit-details-marker { display: none; }
.guide-toc-mobile summary::after {
  content: "↓";
  float: right;
  color: var(--accent);
}
.guide-toc-mobile[open] summary::after { content: "↑"; }
.guide-toc-mobile ol {
  list-style: none;
  padding: 0 0 14px;
  margin: 0;
  border-top: 1px dotted var(--rule-soft);
  padding-top: 12px;
}
.guide-toc-mobile li { padding: 6px 0; font-size: 14px; }
.guide-toc-mobile a { color: var(--ink-soft); }
.guide-toc-mobile a:hover { color: var(--accent); }

@media (max-width: 960px) {
  .guide-toc-mobile { display: block; }
}

/* ============================================================
   Two-column shell
============================================================ */
.guide-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(36px, 6vw, 80px);
  padding: clamp(48px, 6vw, 72px) 0 clamp(60px, 8vw, 100px);
}

/* ============================================================
   Sticky TOC
============================================================ */
.guide-toc {
  position: sticky;
  top: 32px;
  align-self: start;
  height: max-content;
}
.guide-toc-inner {
  border-left: 1px solid var(--rule);
  padding-left: 18px;
}
.guide-toc-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin-bottom: 14px;
}
.guide-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}
.guide-toc li {
  margin-bottom: 6px;
}
.guide-toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  color: var(--ink-soft);
  padding: 4px 0;
  transition: color 0.2s;
  line-height: 1.3;
}
.guide-toc a span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.guide-toc a:hover { color: var(--accent); }
.guide-toc a.is-active {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 960px) {
  .guide-shell { grid-template-columns: 1fr; }
  .guide-toc { display: none; }
}

/* ============================================================
   Article
============================================================ */
.guide-article {
  max-width: 68ch;
}

.guide-section {
  padding-top: clamp(40px, 5vw, 64px);
  margin-bottom: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 32px;
}
.guide-section:first-of-type {
  border-top: none;
  padding-top: 0;
}
.guide-section-header {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.guide-num {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 500;
  flex-shrink: 0;
}
.guide-section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.guide-section-header h2 em {
  color: var(--accent);
  font-size: 0.78em;
  font-weight: 400;
}

.guide-article p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-variation-settings: "opsz" 16, "wght" 400;
  max-width: 64ch;
}
.guide-article p code,
.guide-article li code {
  background: var(--paper);
  padding: 1px 6px;
  border: 1px solid var(--rule-soft);
  font-size: 0.82em;
  color: var(--accent);
}
.guide-article a:not(.primary-cta) {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 1px;
  transition: color 0.2s;
}
.guide-article a:not(.primary-cta):hover { color: var(--accent-deep); }
.guide-article em { color: var(--accent); }
.guide-article strong { font-weight: 600; color: var(--ink); }

/* Steps */
.guide-steps {
  list-style: none;
  counter-reset: gstep;
  padding: 0;
  margin: 24px 0 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.guide-steps li {
  counter-increment: gstep;
  position: relative;
  padding: 14px 22px 14px 60px;
  border-bottom: 1px dotted var(--rule-soft);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}
.guide-steps li:last-child { border-bottom: none; }
.guide-steps li::before {
  content: counter(gstep, lower-roman);
  position: absolute;
  left: 18px;
  top: 12px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--accent);
  font-weight: 400;
  width: 30px;
  text-align: right;
  line-height: 1;
}

/* Illustration */
.guide-illustration {
  margin: 24px 0 28px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.guide-illustration svg {
  display: block;
  width: 100%;
  height: auto;
}
.guide-illustration figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-muted);
  text-align: center;
  padding: 12px 18px;
  border-top: 1px dotted var(--rule-soft);
}

/* Callout */
.guide-callout {
  border-left: 3px solid var(--accent);
  background: rgba(114, 47, 47, 0.04);
  padding: 18px 22px;
  margin: 24px 0 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
}
.guide-callout strong {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
  display: inline;
  margin-right: 4px;
}
.guide-callout em {
  color: var(--ink);
  font-style: italic;
}
.guide-callout code {
  font-style: normal;
  background: var(--paper);
  padding: 1px 6px;
  border: 1px solid var(--rule-soft);
  font-size: 0.82em;
  color: var(--accent);
}

/* CTA */
.guide-cta {
  margin-top: clamp(60px, 8vw, 100px);
  padding: clamp(40px, 6vw, 72px) clamp(32px, 5vw, 56px);
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.guide-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(114, 47, 47, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(176, 136, 56, 0.15) 0%, transparent 50%);
  pointer-events: none;
}
.guide-cta-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
  position: relative;
}
.guide-cta-title em { color: #d49b9b; }
.guide-cta-body {
  font-size: 16px;
  color: rgba(243, 237, 224, 0.8);
  margin-bottom: 28px;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
.guide-cta-body code {
  background: rgba(250, 246, 236, 0.1);
  padding: 1px 6px;
  font-size: 0.85em;
  color: #d49b9b;
  border: 1px solid rgba(212, 155, 155, 0.3);
}
.guide-cta .primary-cta {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}
.guide-cta .primary-cta:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  color: var(--paper);
}

@media (max-width: 540px) {
  .guide-steps li {
    padding: 12px 16px 12px 48px;
    font-size: 14px;
  }
  .guide-steps li::before {
    font-size: 18px;
    left: 12px;
  }
}
