/* ==========================================================================
   GRIDWALLVTT — CARTOGRAPHER'S FIELD GUIDE SYSTEM
   Shared Stylesheet for SEO Problem-Solver Guides (Zero External CDNs)
   ========================================================================== */

body.guide-page {
  min-height: 100dvh;
  height: auto;
  overflow-x: clip;
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(212, 162, 76, 0.06) 1px, transparent 1px),
    radial-gradient(ellipse 900px 420px at 78% 12%, rgba(217, 107, 39, 0.09), transparent 70%);
  background-size: 28px 28px, 100% 100%;
}

/* Skip Link for Keyboard Accessibility */
.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
}

.skip-link:focus-visible {
  inset-block-start: 10px;
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.guide-page :where(a:any-link, button, summary):focus-visible {
  outline: 2px solid var(--border-brass);
  outline-offset: 2px;
}

.brand-home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
}

.guide-wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

/* Above-the-Fold Hero Workbench Split */
.guide-hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.guide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 162, 76, 0.12);
  border: 1px solid rgba(212, 162, 76, 0.42);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.guide-hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.05vw, 2.5rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
  margin: 14px 0 14px;
  color: var(--text);
}

.guide-hero-copy h1 .brass-highlight {
  color: var(--primary);
}

.guide-hero-copy h1 code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--primary);
  background: rgba(212, 162, 76, 0.10);
  border: 1px solid rgba(212, 162, 76, 0.34);
  border-radius: 6px;
  padding: 0 7px;
  vertical-align: baseline;
}

.guide-lead {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.62;
  color: var(--text-muted);
  max-width: 56ch;
}

.guide-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.guide-hero-actions .btn {
  padding: 9px 16px;
  font-size: 0.84rem;
}

.guide-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.guide-meta-strip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Bespoke Cartographer Blueprint Card */
.blueprint-card {
  background: var(--surface);
  border: 1.5px solid var(--border-brass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised), 0 0 28px rgba(212, 162, 76, 0.12);
  overflow: hidden;
}

.blueprint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.blueprint-head .badge {
  white-space: nowrap;
  flex-shrink: 0;
}

.blueprint-title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.015em;
}

.blueprint-stage {
  padding: 14px;
  background: var(--surface-sunken);
}

.blueprint-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.blueprint-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.blueprint-readout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--success-text);
  font-variant-numeric: tabular-nums;
}

.blueprint-readout .dot-emerald {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3FB984;
  box-shadow: 0 0 8px rgba(63, 185, 132, 0.8);
  flex-shrink: 0;
}

/* 3-Step Visual Guide Cards (Visible Above the Fold on 1440x900) */
.visual-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0 36px;
}

.visual-guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.visual-guide-card:hover {
  border-color: var(--border-brass);
  transform: translateY(-2px);
}

.vc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vc-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(212, 162, 76, 0.12);
  border: 1px solid rgba(212, 162, 76, 0.36);
  flex-shrink: 0;
}

.vc-step {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.visual-guide-card h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.visual-guide-card p {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.52;
  color: var(--text-muted);
}

/* Long-Form Cartographer Manual Body */
.guide-article {
  max-width: 880px;
  margin: 0 auto;
}

.guide-article h2 {
  font-family: var(--font-serif);
  font-size: 1.52rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 38px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.guide-article h3 {
  font-family: var(--font-serif);
  font-size: 1.14rem;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--primary);
}

.guide-article p {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--text-muted);
}

.guide-article strong {
  color: var(--text);
}

.guide-article ul,
.guide-article ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 0.91rem;
  line-height: 1.65;
}

.guide-article li {
  margin-bottom: 8px;
}

.guide-article code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--primary);
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--torch-ember);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0 24px;
  box-shadow: var(--shadow);
}

.callout p:last-child {
  margin-bottom: 0;
}

.formula-block {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
  color: #FAD39B;
  overflow-x: auto;
}

/* Modern Responsive Comparison Table (Container Query + Sticky Headers) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  margin: 18px 0 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-wrapper:focus-visible {
  outline: 2px solid var(--border-brass);
  outline-offset: 2px;
}

.table-comparison {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  --label-1: "Method";
  --label-2: "Column 2";
  --label-3: "Column 3";
  --label-4: "Column 4";
}

.table-comparison caption {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.table-comparison thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.table-comparison th,
.table-comparison td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  text-align: left;
  vertical-align: top;
}

.table-comparison th:last-child,
.table-comparison td:last-child {
  border-right: none;
}

.table-comparison tbody tr:last-child th,
.table-comparison tbody tr:last-child td {
  border-bottom: none;
}

.table-comparison thead th {
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.table-comparison tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.table-comparison tbody td {
  color: var(--text-muted);
}

.table-comparison tbody tr.row-highlight th,
.table-comparison tbody tr.row-highlight td {
  background: rgba(212, 162, 76, 0.08);
  color: var(--text);
}

@container (width < 600px) {
  .table-comparison,
  .table-comparison thead,
  .table-comparison tbody,
  .table-comparison tr,
  .table-comparison th,
  .table-comparison td {
    display: block;
  }

  .table-comparison thead {
    display: none;
  }

  .table-comparison tr {
    margin: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
  }

  .table-comparison th,
  .table-comparison td {
    border-right: none;
  }

  .table-comparison tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
  }

  .table-comparison td:nth-child(2)::before {
    content: var(--label-2) ": ";
    font-weight: 700;
    color: var(--primary);
  }

  .table-comparison td:nth-child(3)::before {
    content: var(--label-3) ": ";
    font-weight: 700;
    color: var(--primary);
  }

  .table-comparison td:nth-child(4)::before {
    content: var(--label-4) ": ";
    font-weight: 700;
    color: var(--primary);
  }
}

/* Step Cards */
.playbook-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0 28px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.step-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.step-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.56;
}

/* Conversion Banner */
.cta-box {
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.14), rgba(217, 107, 39, 0.10));
  border: 1.5px solid var(--border-brass);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin: 34px 0;
  box-shadow: var(--shadow-raised);
}

.cta-box h3 {
  font-family: var(--font-serif);
  font-size: 1.46rem;
  color: var(--text);
  margin: 0 0 8px;
}

.cta-box p {
  max-width: 580px;
  margin: 0 auto 18px;
  color: var(--text-muted);
}

.btn-cta-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-cta-group .btn {
  padding: 10px 18px;
  font-size: 0.86rem;
}

/* Interactive Native FAQ Accordions (Modern ::details-content progressive slide) */
.faq-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.faq-item[open] {
  border-color: var(--border-brass);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.02rem;
  line-height: 1;
  color: var(--primary);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  content: "−";
}

.faq-item::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.faq-item:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .faq-item::details-content {
    transition: block-size 0.25s ease, content-visibility 0.25s ease;
    transition-behavior: allow-discrete;
  }
}

.faq-item p {
  margin: 0;
  padding: 12px 16px 14px 44px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* Related Field Guides Cross-Link Grid */
.related-guides {
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.related-guides-heading {
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.related-card:hover {
  border-color: var(--border-brass);
  transform: translateY(-2px);
}

.related-card-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.related-card-title {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.related-card-desc {
  font-size: 0.78rem;
  line-height: 1.48;
  color: var(--text-muted);
}

/* Guide Footer */
.guide-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.guide-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.guide-footer a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-footer a:hover {
  color: var(--primary-hover);
}

@media (max-width: 900px) {
  .guide-wrap {
    padding: 20px 14px 48px;
  }
  .guide-hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .visual-cards-grid,
  .playbook-steps,
  .related-grid {
    grid-template-columns: 1fr;
  }
  .guide-footer {
    justify-content: center;
    text-align: center;
  }
  .guide-footer-nav {
    justify-content: center;
  }
  .faq-item p {
    padding-left: 16px;
  }
}
