/* ====================================================================
   GUIDE PAGE — extends styles.css with article-specific layout + bot
   button/message styling that mirrors the actual Telegram/Макс UI.
   ==================================================================== */

.guide-body {
  background: var(--cream);
}

.guide-main {
  min-height: calc(100vh - 200px);
}

/* ============ HERO ============ */
.guide-hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--rule);
}

.guide-kicker {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 32px;
}

.guide-kicker .kicker-rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  max-width: 120px;
}

.guide-h1 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-size: clamp(40px, 6vw, 84px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 32px;
  color: var(--ink);
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}

.guide-h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--accent);
}

.guide-lede {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(18px, 1.5vw, 22px);
  font-weight: 400;
  line-height: 1.55;
  color: var(--muted);
  max-width: 780px;
  margin: 0 0 32px;
  text-wrap: pretty;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ============ TOC ============ */
.guide-toc {
  padding: 48px 0;
  background: var(--cream-2);
  border-bottom: 1px solid var(--rule);
}

.guide-toc h2 {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 20px;
}

.guide-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  columns: 2;
  column-gap: 48px;
}

.guide-toc li {
  counter-increment: toc;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  break-inside: avoid;
  font-family: "Inter", sans-serif;
  font-size: 16px;
}

.guide-toc li::before {
  content: counter(toc, decimal-leading-zero) " · ";
  color: var(--accent);
  font-weight: 600;
  margin-right: 8px;
}

.guide-toc a {
  color: var(--ink);
  transition: color 0.15s;
}

.guide-toc a:hover {
  color: var(--accent);
}

/* ============ SECTIONS ============ */
.guide-section {
  padding: 96px 0;
  border-bottom: 1px solid var(--rule);
}

.guide-section-alt {
  background: var(--cream-2);
}

.guide-section .section-num {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.16em;
  margin-bottom: 16px;
  padding: 4px 12px;
  border: 1px solid var(--accent);
  border-radius: 20px;
}

.guide-section h2 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 28px;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}

.guide-section h3 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 500;
  font-style: italic;
  margin: 44px 0 14px;
  color: var(--ink);
  text-wrap: balance;
}

.guide-section p {
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 760px;
  margin: 0 0 18px;
  text-wrap: pretty;
}

.guide-ol,
.guide-ul {
  font-family: "Inter", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 760px;
  margin: 0 0 24px;
  padding-left: 24px;
}

.guide-ol li,
.guide-ul li {
  padding: 6px 0;
  text-wrap: pretty;
}

.guide-tip {
  margin: 32px 0;
  padding: 20px 24px;
  background: var(--cream);
  border-left: 3px solid var(--accent);
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 760px;
  text-wrap: pretty;
}

.guide-section-alt .guide-tip {
  background: var(--cream);
}

/* ============ SCREENSHOT FLOW (real iPhone 14 bezel from Figma) ============ */
.screenshot-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin: 56px 0;
  align-items: start;
}

.screenshot-step {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
}

/* ============ FIGMA DIRECT SVG (pixel-perfect bot-step-1) ============
   Uses full Figma SVG export — no CSS reimplementation, 1:1 with design. */
.screenshot-frame.figma-svg {
  position: relative;
  width: 340px;
  aspect-ratio: 450 / 920;
  filter: drop-shadow(0 30px 60px rgba(14, 26, 61, 0.4))
    drop-shadow(0 14px 28px rgba(14, 26, 61, 0.22));
}
.screenshot-frame.figma-svg::after {
  display: none;
}
.screenshot-frame.figma-svg > img,
.screenshot-frame.figma-svg > img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* Overlay for bot avatar in nav bar (top-right) — aligned to Figma Trailing frame at
   (366, 85) 44×44 inside 450×920 bot-step-1 PNG */
.screenshot-frame.figma-svg .bot-avatar-overlay {
  position: absolute;
  top: 7.3%;
  right: 7.5%;
  width: 9.78%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
}
.screenshot-frame.figma-svg .bot-avatar-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ============ REAL DEVICE FRAME (raw iPhone screenshot) ============
   Wraps a raw iPhone screenshot in the same Figma bezel PNG used by the
   other mockups (iPhone 17 Pro Silver Portrait, 450×920). The bezel is
   an alpha-masked overlay — Dynamic Island and chassis are baked in. */
.screenshot-frame.real-device {
  position: relative;
  width: 340px;
  aspect-ratio: 450 / 920;
  filter: drop-shadow(0 30px 60px rgba(14, 26, 61, 0.4))
    drop-shadow(0 14px 28px rgba(14, 26, 61, 0.22));
}
.screenshot-frame.real-device > .screen {
  position: absolute;
  top: 2.5%;
  left: 5.333%;
  width: 89.334%;
  height: 95%;
  border-radius: 11% / 5%;
  object-fit: cover;
  display: block;
  background: #000;
  z-index: 1;
}
/* Dark strip covering the top sliver of the screen to hide
   content bleeding through the Dynamic Island area */
.screenshot-frame.real-device.dark-top::after {
  content: '';
  position: absolute;
  top: 2.5%;
  left: 5.333%;
  width: 89.334%;
  height: 2.25%;
  background: #17181C;
  border-radius: 38px 38px 0 0;
  z-index: 1;
  pointer-events: none;
}

.screenshot-frame.real-device > .bezel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
}

/* ============ STEP CAPTIONS ============ */
.screenshot-step figcaption {
  margin: 28px 0 0;
  max-width: 320px;
  text-align: left;
}

.screenshot-step .step-badge {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  padding: 5px 11px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  margin-bottom: 14px;
  text-transform: uppercase;
  white-space: nowrap;
}

.screenshot-step figcaption h4 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 10px;
  text-wrap: balance;
}

.screenshot-step figcaption p {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
  text-wrap: pretty;
}


/* ============ LIMITS GRID ============ */
.limit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.limit-card {
  padding: 28px 26px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.guide-section-alt .limit-card {
  background: var(--cream);
}

.limit-card h4 {
  font-family: "Playfair Display", "Times New Roman", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  font-style: italic;
  margin: 18px 0 8px;
  color: var(--ink);
}

.limit-card p {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.limit-more-body h4 {
  font-family: "Playfair Display", "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin: 36px 0 8px;
}

.limit-more-body h4:first-child {
  margin-top: 24px;
}

.limit-more-body p {
  margin: 12px 0 0;
}

.limit-icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--cream-2);
}

.guide-section-alt .limit-icon-frame {
  background: var(--cream);
}

.limit-icon {
  width: 16px;
  height: 16px;
  display: block;
  color: var(--accent);
}

.limit-warn .limit-icon {
  color: var(--accent-warm);
}

.limit-warn .limit-icon-frame {
  border-color: rgba(255, 136, 69, 0.35);
}

.limit-ok .limit-icon {
  color: var(--accent);
}

.limit-ok {
  border-left: 2px solid var(--accent);
}

.limit-warn {
  border-left: 2px solid var(--accent-warm);
}

/* ============ MOCKUP DISCLAIMER ============ */
.mockup-note {
  margin: 32px auto 0;
  max-width: 680px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  text-align: center;
  font-style: italic;
  opacity: 0.8;
  text-wrap: pretty;
}

/* ============ LEGAL SECTION ============ */
.guide-legal {
  background: var(--cream-2);
}

.guide-legal p {
  font-size: 14px;
  color: var(--muted);
  max-width: 820px;
  line-height: 1.6;
}

.guide-legal a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.guide-legal a:hover {
  color: var(--ink);
}

/* ============ MOBILE ============ */
@media (max-width: 1000px) {
  .screenshot-flow {
    grid-template-columns: 1fr;
    gap: 64px;
    justify-items: center;
  }

  .screenshot-step {
    align-items: center;
    text-align: center;
  }

  .screenshot-frame {
    width: 340px;
  }

  .guide-toc ol {
    columns: 1;
  }

  .guide-section {
    padding: 60px 0;
  }

  .guide-hero {
    padding: 48px 0 40px;
  }
}

@media (max-width: 600px) {
  .guide-h1 {
    font-size: clamp(32px, 8vw, 52px);
  }

  .guide-section h2 {
    font-size: clamp(28px, 7vw, 40px);
  }
}
