/* ============================================================
   Tuxon — User Guide (documentation) styles
   Layer on top of assets/css/styles.css (shared landing design).
   All classes are prefixed `gd-` so they never collide with the
   marketing page styles.
   ============================================================ */

/* ---------- Guide hero ---------- */
.gd-hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background:
    radial-gradient(
      1000px 380px at 15% -10%,
      rgba(53, 151, 186, 0.12),
      transparent 60%
    ),
    radial-gradient(
      900px 380px at 85% -20%,
      rgba(242, 142, 75, 0.12),
      transparent 60%
    ),
    var(--bg-light);
  border-bottom: 1px solid var(--border-light);
}

.gd-hero .container {
  max-width: 980px;
}

.gd-hero h1 {
  margin-bottom: 1rem;
}

.gd-hero .gd-hero-sub {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  font-size: 1.2rem;
}

.gd-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.gd-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.gd-hero-meta .gd-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
}

/* ---------- Generic pills / chips ---------- */
.gd-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.gd-pill-teal {
  background: var(--primary-light);
  color: var(--primary);
}
.gd-pill-orange {
  background: var(--accent-light);
  color: var(--accent-hover);
}
.gd-pill-gray {
  background: #eef1f4;
  color: #5b6472;
}

/* ---------- Docs layout (TOC + content) ---------- */
.gd-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
  padding: 3rem 2rem 5rem;
}

.gd-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.25rem 0.75rem;
}

.gd-toc-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-medium);
  font-weight: 700;
  margin: 0 0 0.75rem 0.75rem;
}

.gd-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gd-toc ul ul {
  margin-left: 0.9rem;
}

.gd-toc a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.gd-toc ul ul a {
  font-size: 13px;
  color: var(--text-medium);
}

.gd-toc a:hover {
  background: rgba(53, 151, 186, 0.08);
  color: var(--primary);
}

.gd-toc a.gd-active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}

.gd-toc-toggle {
  display: none;
}

/* ---------- Content ---------- */
.gd-content {
  min-width: 0;
  max-width: 860px;
}

.gd-section {
  padding-bottom: 3.5rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-light);
}

.gd-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

/* Anchor headings need a scroll offset (sticky nav height) */
.gd-section h2[id],
.gd-content h3[id],
.gd-content h4[id] {
  scroll-margin-top: 110px;
}

.gd-content h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  margin-bottom: 0.35rem;
}

.gd-h2-rule {
  width: 52px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 0.4rem 0 1.4rem;
}

.gd-content h3 {
  font-size: 1.3rem;
  margin: 2rem 0 0.75rem;
  color: var(--text-dark);
}

.gd-content h4 {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.5rem;
  color: var(--text-dark);
}

.gd-content p {
  margin-bottom: 1rem;
}

.gd-content strong {
  color: var(--text-dark);
}

.gd-lede {
  font-size: 1.2rem;
  color: var(--text-medium);
  margin-bottom: 1.5rem;
}

/* Inline elements */
.gd-code-inline,
.gd-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  background: #eef2f4;
  color: #0f3f52;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #e2e8ec;
}

.gd-kbd {
  font-family: var(--font-sans);
  font-size: 0.8em;
  background: #fff;
  border: 1px solid #d4dae1;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
  color: var(--text-dark);
}

.gd-path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13.5px;
  color: var(--text-medium);
}

.gd-path b {
  color: var(--primary);
  font-weight: 500;
}

.gd-path .gd-sep {
  color: #c2c9d1;
}

/* ---------- Buttons inside content ---------- */
.gd-content .btn {
  margin: 0.25rem 0.5rem 0.5rem 0;
}

/* ---------- Steps ---------- */
.gd-steps {
  counter-reset: gdstep;
  list-style: none;
  margin: 1.2rem 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
}

.gd-steps li {
  counter-increment: gdstep;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.gd-steps li::before {
  content: counter(gdstep);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  display: grid;
  place-items: center;
  margin-top: 2px;
  box-shadow: 0 4px 10px rgba(53, 151, 186, 0.3);
}

.gd-steps li > div {
  min-width: 0;
}
.gd-steps li > div > p:last-child {
  margin-bottom: 0;
}

/* ---------- Callouts ---------- */
.gd-callout {
  display: flex;
  gap: 0.8rem;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  font-size: 0.98rem;
  border: 1px solid;
}

.gd-callout .gd-callout-ic {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1.4;
}

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

.gd-callout-tip {
  background: rgba(53, 151, 186, 0.07);
  border-color: rgba(53, 151, 186, 0.28);
}
.gd-callout-note {
  background: rgba(52, 199, 89, 0.07);
  border-color: rgba(52, 199, 89, 0.3);
}
.gd-callout-warn {
  background: rgba(242, 142, 75, 0.09);
  border-color: rgba(242, 142, 75, 0.35);
}
.gd-callout-danger {
  background: rgba(229, 72, 77, 0.07);
  border-color: rgba(229, 72, 77, 0.3);
}

/* ---------- Tables ---------- */
.gd-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.gd-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
  font-size: 0.95rem;
}

.gd-table th {
  background: var(--bg-card);
  text-align: left;
  padding: 12px 16px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-medium);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.gd-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

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

.gd-table tbody tr:hover td {
  background: rgba(53, 151, 186, 0.04);
}

/* ---------- Code blocks ---------- */
.gd-codeblock {
  position: relative;
  background: #0f3f52;
  color: #e6f2f6;
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  margin: 1.25rem 0;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}

.gd-codeblock code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ---------- Feature cards (small) ---------- */
.gd-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.gd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.gd-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.gd-card h4 {
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gd-card p {
  font-size: 0.93rem;
  margin-bottom: 0;
}

.gd-card .gd-card-ic {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 17px;
}

/* ---------- Status / mode pills row ---------- */
.gd-keyvals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.4rem;
}

/* ---------- FAQ ---------- */
.gd-faq {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0;
}

.gd-faq details {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.25rem 1.1rem;
}

.gd-faq summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-dark);
  padding: 0.9rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

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

.gd-faq summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--primary);
  line-height: 1;
  transition: transform 0.2s ease;
}

.gd-faq details[open] summary::after {
  transform: rotate(45deg);
}

.gd-faq details .gd-faq-body {
  padding: 0 0 1rem;
  border-top: 1px dashed var(--border-light);
}

.gd-faq details .gd-faq-body p {
  padding-top: 0.8rem;
  font-size: 0.98rem;
}

/* ---------- "Jump to" quick links under section title ---------- */
.gd-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0.25rem;
}

.gd-subnav a {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.15s ease;
}

.gd-subnav a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .gd-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem 4rem;
  }

  /* TOC becomes a collapsible block */
  .gd-toc {
    position: static;
    max-height: none;
    padding: 0;
    overflow: hidden;
  }

  .gd-toc-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
  }

  .gd-toc-toggle .gd-toc-caret {
    transition: transform 0.2s ease;
    color: var(--primary);
  }

  .gd-toc.open .gd-toc-caret {
    transform: rotate(180deg);
  }

  .gd-toc-nav {
    display: none;
    padding: 0.5rem 0.25rem 1rem;
  }

  .gd-toc.open .gd-toc-nav {
    display: block;
  }
}

@media (max-width: 480px) {
  .gd-layout {
    padding: 1.5rem 1rem 3rem;
  }
  .gd-cards {
    grid-template-columns: 1fr;
  }
}
