/* ============================================================
   Customer Guide (/customer-guide.html)
   Standalone documentation page. Uses the shared theme variables
   from common.css so the five palettes keep working.
   ============================================================ */

html {
  scroll-behavior: smooth;
}

body[data-pv-page="guide"] {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(212, 168, 67, 0.10), transparent 60%),
    var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body[data-pv-page="guide"] a {
  color: var(--accent);
  text-decoration: none;
}

body[data-pv-page="guide"] a:hover {
  text-decoration: underline;
}

body[data-pv-page="guide"] strong {
  color: #f2f2f2;
}

body[data-pv-page="guide"] code {
  padding: 1px 5px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: 4px;
  background: rgba(212, 168, 67, 0.10);
  color: #f0d58a;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  word-break: break-word;
}

/* ---------- Hero ---------- */

.guide-hero {
  padding: 118px 24px 44px;
  background:
    linear-gradient(160deg, rgba(26, 26, 46, 0.96) 0%, rgba(15, 52, 96, 0.72) 100%);
  border-bottom: 1px solid var(--accent-dim);
}

.guide-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.guide-eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.guide-hero h1 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.guide-lede {
  max-width: 76ch;
  margin: 0 0 22px;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

.guide-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.guide-meta span {
  padding: 4px 12px;
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-secondary);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
}

/* ---------- Layout ---------- */

.guide-layout {
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
  gap: 44px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  align-items: start;
}

/* ---------- Table of contents ---------- */

.guide-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 18px 16px 20px;
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
  background: var(--bg-secondary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.guide-toc-title {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 168, 67, 0.22);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guide-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-toc li {
  margin: 0;
}

.guide-toc a {
  display: block;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  border-radius: 0 5px 5px 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.guide-toc a:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  text-decoration: none;
}

.guide-toc a.is-active {
  border-left-color: var(--accent);
  background: rgba(212, 168, 67, 0.10);
  color: var(--accent);
  font-weight: 600;
}

.guide-toc::-webkit-scrollbar {
  width: 8px;
}

.guide-toc::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 4px;
}

/* ---------- Content ---------- */

.guide-content {
  min-width: 0;
  font-size: 0.94rem;
}

.guide-content section {
  padding-bottom: 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  scroll-margin-top: 92px;
}

.guide-content section:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.guide-content h2 {
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--accent-dim);
  color: #ffffff;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.25;
}

.guide-content h3 {
  margin: 26px 0 10px;
  color: var(--accent);
  font-size: 1.06rem;
  line-height: 1.35;
}

.guide-content p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.guide-content ul,
.guide-content ol {
  margin: 0 0 16px;
  padding-left: 1.5rem;
}

.guide-content li {
  margin: 7px 0;
  color: var(--text-secondary);
}

.guide-content li::marker {
  color: var(--accent);
}

.guide-steps li {
  padding-left: 2px;
}

.guide-list li {
  padding-left: 2px;
}

/* ---------- Tables ---------- */

.guide-table {
  width: 100%;
  margin: 16px 0 20px;
  border: 1px solid rgba(212, 168, 67, 0.22);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.85rem;
}

.guide-table th {
  padding: 10px 13px;
  border-bottom: 1px solid var(--accent-dim);
  background: rgba(212, 168, 67, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  vertical-align: bottom;
}

.guide-table td {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  line-height: 1.55;
  vertical-align: top;
}

.guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.guide-table tbody tr:hover td {
  background: rgba(212, 168, 67, 0.06);
}

/* ---------- Callouts ---------- */

.guide-callout {
  margin: 18px 0;
  padding: 13px 16px;
  border: 1px solid rgba(212, 168, 67, 0.22);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(212, 168, 67, 0.07);
}

.guide-callout p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-callout strong {
  color: var(--accent);
}

.guide-callout-tip {
  border-left-color: var(--accent);
  border-color: rgba(212, 168, 67, 0.28);
  background: rgba(212, 168, 67, 0.09);
}

.guide-callout-tip strong {
  color: var(--accent);
}

.guide-callout-note {
  border-left-color: #7fb3d5;
  border-color: rgba(127, 179, 213, 0.28);
  background: rgba(127, 179, 213, 0.07);
}

.guide-callout-note strong {
  color: #9cc9e8;
}

.guide-callout-warning {
  border-left-color: #e94560;
  border-color: rgba(233, 69, 96, 0.30);
  background: rgba(233, 69, 96, 0.08);
}

.guide-callout-warning strong {
  color: #ff7d91;
}

/* ---------- FAQ ---------- */

.guide-content details {
  margin: 10px 0;
  padding: 0 16px;
  border: 1px solid rgba(212, 168, 67, 0.20);
  border-radius: 8px;
  background: var(--bg-secondary);
  transition: border-color 0.15s, background 0.15s;
}

.guide-content details:hover {
  border-color: var(--accent-dim);
}

.guide-content details[open] {
  border-color: var(--accent-dim);
  background: rgba(212, 168, 67, 0.05);
}

.guide-content summary {
  padding: 12px 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
  list-style-position: outside;
}

.guide-content summary::marker {
  color: var(--accent);
}

.guide-content details[open] summary {
  color: var(--accent);
}

.guide-content details p {
  margin: 0 0 13px;
  padding-top: 2px;
}

/* ---------- Glossary ---------- */

.guide-glossary {
  display: grid;
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  gap: 10px 22px;
  margin: 18px 0 0;
  padding: 18px 20px;
  border: 1px solid rgba(212, 168, 67, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.guide-glossary dt {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.5;
}

.guide-glossary dd {
  margin: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* ---------- Final section + footer ---------- */

.guide-final {
  padding: 22px 24px !important;
  border: 1px solid var(--accent-dim) !important;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(212, 168, 67, 0.10), rgba(212, 168, 67, 0.03));
}

.guide-final h2 {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 10px;
}

.guide-back-top {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.85rem;
}

.guide-footer {
  padding: 24px;
  border-top: 1px solid var(--accent-dim);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
}

.guide-footer p {
  margin: 0;
}

body[data-pv-page="guide"] a:focus-visible,
body[data-pv-page="guide"] summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .guide-layout {
    grid-template-columns: 224px minmax(0, 1fr);
    gap: 30px;
  }

  .guide-glossary {
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  body[data-pv-page="guide"] .top-nav {
    top: 46px;
    left: 8px;
    right: 8px;
    transform: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 7px 10px;
  }

  body[data-pv-page="guide"] .nav-link {
    padding: 5px 11px;
    font-size: 0.8rem;
  }

  body[data-pv-page="guide"] .nav-auth {
    margin-left: 0;
  }

  .guide-hero {
    padding-top: 150px;
  }

  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding-top: 28px;
  }

  .guide-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .guide-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 8px;
  }

  .guide-glossary {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px 0;
  }

  .guide-glossary dt {
    margin-top: 10px;
  }

  .guide-glossary dd {
    padding-bottom: 8px;
  }
}

@media (max-width: 700px) {
  .guide-content section {
    scroll-margin-top: 140px;
  }

  .guide-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 480px) {
  .guide-hero {
    padding: 158px 16px 34px;
  }

  .guide-layout {
    padding: 22px 16px 48px;
  }

  .guide-toc ol {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-meta span {
    font-size: 0.7rem;
  }

  .guide-content {
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .guide-toc a,
  .guide-content details {
    transition: none;
  }
}

/* ---------- Print ---------- */

@media print {
  body[data-pv-page="guide"] {
    background: #ffffff;
    color: #111111;
  }

  .theme-selector,
  .top-nav,
  .guide-toc,
  .guide-footer {
    display: none !important;
  }

  .guide-hero {
    padding: 0 0 18px;
    background: none;
    border-bottom: 1px solid #999;
  }

  .guide-hero h1,
  .guide-content h2,
  .guide-content h3,
  .guide-glossary dt,
  .guide-content summary {
    color: #111111;
  }

  .guide-layout {
    display: block;
    max-width: none;
    padding: 0;
  }

  .guide-content p,
  .guide-content li,
  .guide-table td,
  .guide-glossary dd,
  .guide-callout p {
    color: #222222;
  }

  .guide-content section {
    break-inside: avoid-page;
  }

  .guide-content details {
    border: 1px solid #ccc;
    background: none;
  }

  .guide-content details p {
    display: block;
  }
}
