﻿/* ============================================================
   UnderHost Docs-Article & Content Components
   Callouts, code blocks, steps, FAQ, related, prose, CTAs.
   ============================================================ */

/* ---------- Article header ---------- */
.uh-docs-article-head { margin-bottom: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--uh-border); position: static !important; top: auto !important; }
.uh-article-labels { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.uh-docs-article-head h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -0.025em; margin-bottom: 14px; }
.uh-article-summary { font-size: 18px; color: var(--uh-ink-soft); line-height: 1.6; margin-bottom: 20px; max-width: 70ch; }
.uh-article-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.uh-article-author { display: flex; align-items: center; gap: 10px; }
.uh-article-author .avatar {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 auto;
  background: var(--uh-gradient-card-header); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--uh-border-primary);
}
.uh-article-author .avatar img { width: 22px; height: 22px; }
.uh-article-author .who { display: flex; flex-direction: column; gap: 3px; }
.uh-article-author .who .name { font-size: 13.5px; font-weight: 700; color: var(--uh-ink); display: block; line-height: 1.2; }
.uh-article-author .who .role { font-size: 12px; color: var(--uh-ink-soft); display: block; line-height: 1.2; }
.uh-byline-divider { width: 1px; height: 26px; background: var(--uh-border); }

/* ---------- Prose typography ---------- */
.uh-prose { font-size: 16.5px; line-height: 1.72; color: var(--uh-ink); }
.uh-prose > h2 {
  font-size: 27px; font-weight: 800; margin: 46px 0 16px; padding-top: 8px; letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--uh-header-h) + 24px);
}
.uh-prose > h3 {
  font-size: 21px; font-weight: 700; margin: 34px 0 12px;
  scroll-margin-top: calc(var(--uh-header-h) + 24px);
}
.uh-prose h2 .anchor, .uh-prose h3 .anchor {
  opacity: 0; margin-left: 8px; color: var(--uh-ink-faint); font-size: 0.7em; transition: opacity 140ms ease;
}
.uh-prose h2:hover .anchor, .uh-prose h3:hover .anchor { opacity: 1; }
.uh-prose p { margin: 0 0 18px; }
.uh-prose ul, .uh-prose ol { margin: 0 0 20px; padding-left: 1.4em; }
.uh-prose li { margin: 8px 0; padding-left: 4px; }
.uh-prose li::marker { color: var(--uh-secondary-dark); font-weight: 700; }
.uh-prose strong { font-weight: 700; color: var(--uh-ink); }
.uh-prose a { font-weight: 600; border-bottom: 1px solid rgba(0,145,214,0.3); }
.uh-prose a:hover { border-bottom-color: var(--uh-primary); }
.uh-prose hr { border: 0; height: 1px; background: var(--uh-border); margin: 36px 0; }
.uh-prose :not(pre) > code {
  font-family: var(--uh-font-mono); font-size: 0.86em; padding: 2px 7px; border-radius: 6px;
  background: var(--uh-surface-softer); color: #0B5C82; border: 1px solid var(--uh-border);
  font-weight: 500; white-space: nowrap;
}

/* lead intro paragraph */
.uh-prose .lead { font-size: 18.5px; color: var(--uh-ink-soft); line-height: 1.65; }

/* ---------- Callout blocks ---------- */
.uh-callout {
  display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; margin: 24px 0;
  border: 1px solid var(--uh-border); background: var(--uh-surface-soft);
  border-left-width: 4px;
}
.uh-callout .callout-ico { flex: 0 0 auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-size: 15px; margin-top: 1px; }
.uh-callout .callout-body { min-width: 0; }
.uh-callout .callout-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; letter-spacing: 0.01em; }
.uh-callout .callout-body p { font-size: 14.5px; margin: 0; color: var(--uh-ink-soft); line-height: 1.6; }
.uh-callout .callout-body p + p { margin-top: 8px; }
.uh-callout code { white-space: normal !important; }

.uh-callout-info { border-left-color: var(--uh-secondary); background: #EEF7FC; }
.uh-callout-info .callout-ico { color: var(--uh-secondary-dark); }
.uh-callout-info .callout-title { color: #075E87; }

.uh-callout-warning { border-left-color: var(--uh-warning); background: var(--uh-warning-soft); }
.uh-callout-warning .callout-ico { color: var(--uh-warning); }
.uh-callout-warning .callout-title { color: #92500A; }

.uh-callout-important { border-left-color: #DC2626; background: var(--uh-error-soft); }
.uh-callout-important .callout-ico { color: var(--uh-error); }
.uh-callout-important .callout-title { color: #991B1B; }

.uh-callout-security { border-left-color: #7A3CB0; background: #F5EEFB; }
.uh-callout-security .callout-ico { color: #7A3CB0; }
.uh-callout-security .callout-title { color: #5E2C8A; }

.uh-callout-performance { border-left-color: var(--uh-success); background: var(--uh-success-soft); }
.uh-callout-performance .callout-ico { color: var(--uh-success); }
.uh-callout-performance .callout-title { color: #11663A; }

.uh-callout-billing { border-left-color: #0F766E; background: #E7F6F4; }
.uh-callout-billing .callout-ico { color: #0F766E; }
.uh-callout-billing .callout-title { color: #0C5A53; }

.uh-callout-tip { border-left-color: var(--uh-primary); background: linear-gradient(120deg, rgba(0,212,255,0.08), rgba(0,145,214,0.04)); }
.uh-callout-tip .callout-ico { color: var(--uh-secondary-dark); }
.uh-callout-tip .callout-title { color: var(--uh-secondary-dark); }

/* ---------- Code blocks ---------- */
.uh-code-block { margin: 24px 0; border-radius: 14px; overflow: hidden; border: 1px solid #1a3350; box-shadow: var(--uh-shadow-card); }
.uh-code-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #071120; border-bottom: 1px solid #172b44;
}
.uh-code-head .dots { display: flex; gap: 6px; margin-right: 4px; }
.uh-code-head .dots span { width: 10px; height: 10px; border-radius: 50%; background: #1e3452; }
.uh-code-head .fname { font-family: var(--uh-font-mono); font-size: 12.5px; color: #7ab0d4; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.uh-code-head .lang { font-family: var(--uh-font-mono); font-size: 11px; color: #4d7a9a; text-transform: uppercase; letter-spacing: 0.08em; }
.uh-copy-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px;
  background: rgba(0,212,255,0.12); color: #00D4FF; border: 1px solid rgba(0,212,255,0.30);
  font-family: var(--uh-font-sans); font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 140ms ease; flex-shrink: 0;
}
.uh-copy-btn:hover { background: rgba(0,212,255,0.22); color: #38E1FF !important; }
.uh-copy-btn.copied { background: rgba(22,163,74,0.2); color: #86efac !important; border-color: rgba(22,163,74,0.4); }
.uh-code-block pre { margin: 0; padding: 18px 20px; background: #071120; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.uh-code-block pre code {
  font-family: var(--uh-font-mono); font-size: 13.5px; line-height: 1.75; color: #00D4FF;
  white-space: pre; display: block; min-width: min-content;
}
/* Syntax highlighting token colours */
.uh-code-block .c { color: #3d6480; font-style: italic; }   /* comment-muted */
.uh-code-block .k { color: #ff9e64; }                        /* keyword-orange */
.uh-code-block .s { color: #9ece6a; }                        /* string-green */
.uh-code-block .v { color: #38E1FF; }                        /* variable-bright cyan */
.uh-code-block .p { color: #bb9af7; }                        /* punctuation-purple */

/* command block (single line, $ prompt + copy)
   Uses !important on color because .uh-prose :not(pre) > code
   has higher specificity (0,1,2) and overrides inline code color. */
.uh-cmd {
  display: flex; align-items: center; gap: 12px; margin: 20px 0; padding: 13px 14px 13px 18px;
  background: #071120; border: 1px solid #1a3350; border-radius: 12px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.uh-cmd .prompt { color: #00D4FF; font-family: var(--uh-font-mono); font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.uh-cmd code { flex: 1; font-family: var(--uh-font-mono); font-size: 13.5px; color: #00D4FF !important; white-space: pre; overflow-x: auto; background: none !important; border: 0 !important; padding: 0 !important; border-radius: 0 !important; min-width: min-content; -webkit-overflow-scrolling: touch; }
.uh-cmd .uh-copy-btn { flex: 0 0 auto; }

/* ---------- Step list ----------
   Grid-based layout: badge in col-1, all content in col-2.
   This avoids any dependency on padding-left (which CDN CSS can override).
   ------------------------------------------------------------------ */
.uh-docs-steps { counter-reset: ustep; margin: 26px 0 !important; padding: 0 !important; list-style: none !important; }

.uh-docs-step {
  display: grid !important;
  grid-template-columns: 34px 1fr !important;
  column-gap: 18px !important;
  align-items: start !important;
  position: relative !important;
  padding: 0 0 26px 0 !important;
  margin: 0 !important;
  list-style: none !important;
}

/* Badge-lives in grid col 1, in normal flow (not absolute) */
.uh-docs-step::before {
  counter-increment: ustep;
  content: counter(ustep) !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: start !important;
  position: static !important;
  display: block !important;
  width: 34px !important; height: 34px !important;
  border-radius: 10px !important;
  background: var(--uh-gradient-horizontal) !important;
  color: #fff !important;
  font-weight: 800 !important; font-size: 15px !important;
  line-height: 34px !important; text-align: center !important;
  box-shadow: var(--uh-shadow-md);
}

/* All element children go in grid col 2 */
.uh-docs-step > * { grid-column: 2 !important; min-width: 0; }

/* Connector line-absolutely positioned, still works inside position:relative step */
.uh-docs-step::after {
  content: "" !important;
  position: absolute !important;
  left: 16px !important; top: 40px !important; bottom: 4px !important; width: 2px !important;
  background: linear-gradient(var(--uh-border-primary), var(--uh-border));
}
.uh-docs-step:last-child { padding-bottom: 0 !important; }
.uh-docs-step:last-child::after { display: none !important; }

.uh-docs-step h3 { font-size: 18px !important; font-weight: 700 !important; margin: 4px 0 8px !important; padding: 0 !important; }
.uh-docs-step p  { font-size: 15px !important; color: var(--uh-ink-soft); margin: 0 0 12px !important; padding: 0 !important; }

/* ---------- Image / screenshot block ---------- */
.uh-shot { margin: 26px 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--uh-border); box-shadow: var(--uh-shadow-card); }
.uh-shot-frame {
  aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(0,212,255,0.08), transparent 50%),
    var(--uh-surface-soft);
  color: var(--uh-ink-faint);
}
.uh-shot-frame i { font-size: 30px; color: var(--uh-secondary); opacity: 0.6; }
.uh-shot-frame span { font-size: 13px; font-weight: 600; }
.uh-shot-cap { padding: 10px 16px; font-size: 13px; color: var(--uh-ink-faint); background: #fff; border-top: 1px solid var(--uh-border); }

/* ---------- Tables ---------- */
.uh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; border: 1px solid var(--uh-border); border-radius: 14px; max-width: 100%; }
.uh-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: min-content; }
.uh-table thead th {
  background: var(--uh-surface-soft); text-align: left; padding: 12px 16px; font-weight: 700; color: var(--uh-ink);
  border-bottom: 1px solid var(--uh-border); white-space: nowrap; font-size: 13px; letter-spacing: 0.02em;
}
.uh-table td { padding: 12px 16px; border-bottom: 1px solid var(--uh-border-soft); color: var(--uh-ink-soft); vertical-align: top; }
.uh-table tr:last-child td { border-bottom: 0; }
.uh-table tbody tr:hover { background: var(--uh-surface-soft); }
.uh-table td strong { color: var(--uh-ink); }

/* ---------- FAQ accordion ---------- */
.uh-faq-list { margin: 24px 0; border: 1px solid var(--uh-border); border-radius: 14px; overflow: hidden; }
.uh-faq { border-bottom: 1px solid var(--uh-border); }
.uh-faq:last-child { border-bottom: 0; }
.uh-faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: #fff; border: 0; cursor: pointer; padding: 17px 20px; text-align: left;
  font-family: var(--uh-font-display); font-size: 16px; font-weight: 700; color: var(--uh-ink);
  transition: background 140ms ease;
}
.uh-faq-q:hover { background: var(--uh-surface-soft); }
.uh-faq-q i { color: var(--uh-secondary-dark); font-size: 14px; transition: transform 200ms ease; flex: 0 0 auto; }
.uh-faq.is-open .uh-faq-q i { transform: rotate(180deg); }
.uh-faq-a { max-height: 0; overflow: hidden; transition: max-height 260ms ease; }
.uh-faq-a-inner { padding: 0 20px 18px; font-size: 15px; color: var(--uh-ink-soft); line-height: 1.65; }

/* ---------- Related articles ---------- */
.uh-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.uh-related-card { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px; height: 100%; }
.uh-related-card .rel-cat { font-size: 12px; font-weight: 700; color: var(--uh-secondary-dark); text-transform: uppercase; letter-spacing: 0.05em; }
.uh-related-card h4 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.uh-related-card p { font-size: 13.5px; color: var(--uh-ink-soft); margin: 0; flex: 1; }
.uh-related-card .rel-meta { font-size: 12.5px; color: var(--uh-ink-faint); display: flex; gap: 12px; margin-top: 4px; }

/* ---------- Helpful / feedback block ---------- */
.uh-helpful {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 26px; border-radius: 16px; margin: 38px 0;
  background: var(--uh-surface-soft); border: 1px solid var(--uh-border);
}
.uh-helpful .h-title { font-size: 16px; font-weight: 700; }
.uh-helpful .h-actions { display: flex; gap: 10px; }
.uh-vote-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 10px;
  background: #fff; border: 1px solid var(--uh-border); color: var(--uh-ink); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
  transition: all 150ms ease;
}
.uh-vote-btn:hover { border-color: var(--uh-secondary); color: var(--uh-secondary-dark); transform: translateY(-1px); }
.uh-vote-btn.voted { background: var(--uh-success-soft); border-color: var(--uh-success); color: #11663A; }
.uh-vote-btn i { font-size: 13px; }

/* ---------- Support CTA panel ---------- */
.uh-support-cta {
  position: relative; overflow: hidden; border-radius: 20px; padding: 34px 36px; margin: 38px 0;
  background:
    radial-gradient(circle at 85% 10%, rgba(0,212,255,0.18), transparent 45%),
    var(--uh-gradient-primary);
  color: #fff; border: 1px solid rgba(0,212,255,0.2);
}
.uh-support-cta h3 { color: #fff; font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.uh-support-cta p { color: rgba(255,255,255,0.74); font-size: 15px; margin-bottom: 20px; max-width: 56ch; }
.uh-support-cta .cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- TOC sidebar help box ---------- */
.uh-toc-help {
  margin-top: 24px; padding: 18px; border-radius: 14px;
  background: linear-gradient(135deg, #EEF7FC 0%, #E8F4FB 100%);
  border: 1px solid rgba(0,145,214,0.18);
}
.uh-toc-help .uh-toc-help-title {
  font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--uh-secondary-dark); margin-bottom: 7px; display: block;
}
.uh-toc-help p {
  font-size: 13px; color: var(--uh-ink-soft); margin: 0 0 14px; line-height: 1.55;
}

/* article footer nav */
.uh-article-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--uh-border); }

/* on this page (mobile inline TOC) */
.uh-inline-toc { display: none; margin: 0 0 26px; border: 1px solid var(--uh-border); border-radius: 12px; overflow: hidden; }
.uh-inline-toc summary { padding: 14px 18px; font-weight: 700; font-size: 14px; cursor: pointer; background: var(--uh-surface-soft); list-style: none; display: flex; align-items: center; justify-content: space-between; }
.uh-inline-toc summary::-webkit-details-marker { display: none; }
.uh-inline-toc summary::after { content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 12px; color: var(--uh-secondary-dark); }
.uh-inline-toc[open] summary::after { transform: rotate(180deg); }
.uh-inline-toc ul { list-style: none; margin: 0; padding: 8px 0; }
.uh-inline-toc a { display: block; padding: 7px 18px; font-size: 14px; color: var(--uh-ink-soft); }

@media (max-width: 1024px) {
  .uh-inline-toc { display: block; }
}
@media (max-width: 600px) {
  .uh-article-head h1 { font-size: 28px; }
  .uh-prose { font-size: 16px; }
  .uh-prose > h2 { font-size: 23px; }
  .uh-support-cta, .uh-helpful { padding: 22px 18px; }
  .uh-docs-step { column-gap: 12px !important; }

  /* Mobile code block improvements */
  .uh-code-block { margin: 20px 0; }
  .uh-code-head { padding: 10px 12px; gap: 8px; }
  .uh-code-head .fname { font-size: 11px; }
  .uh-code-head .lang { font-size: 10px; }
  .uh-copy-btn { padding: 5px 9px; font-size: 11px; gap: 4px; }
  .uh-code-block pre { padding: 16px 14px; font-size: 12px; }
  .uh-code-block pre code { font-size: 12px; line-height: 1.6; }

  /* Command block mobile */
  .uh-cmd { padding: 12px 12px 12px 14px; gap: 10px; margin: 18px 0; font-size: 12px; }
  .uh-cmd .prompt { font-size: 13px; }
  .uh-cmd code { font-size: 12px; }

  /* Inline code */
  .uh-prose :not(pre) > code { font-size: 0.8em; padding: 2px 5px; }

  /* Tables scrollable on mobile */
  .uh-table-wrap { margin: 20px 0; border: 1px solid var(--uh-border); }
  .uh-table { font-size: 12px; }
  .uh-table thead th { padding: 10px 10px; font-size: 11px; white-space: normal; }
  .uh-table td { padding: 8px 10px; font-size: 12px; }
  .uh-table thead th, .uh-table td { word-break: break-word; }
}
