/* Wall Help — shared styles
 * Dark theme matching wall.tg branding. Static site, no JS framework.
 */

:root {
  --bg: #0A0A0F;
  --bg-elevated: #14141C;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.40);
  --accent: #4FC3F7;
  --accent-2: #00BCD4;
  --accent-grad: linear-gradient(135deg, #4FC3F7 0%, #00BCD4 100%);
  --radius: 14px;
  --radius-sm: 10px;
  --max-w: 880px;
}

/* Bilingual EN/RU toggle — synchronous locale-detect script in each page head
   sets class="lang-ru" on <html>; CSS below hides the inactive language.
   Both spans coexist in DOM for SEO and no-JS readability. */
.i18n-en, .i18n-ru { display: inline; }
.lang-en .i18n-ru { display: none !important; }
.lang-ru .i18n-en { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
}

/* Layout */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
/* Brand mark — real Wall 7-brick logo, not the placeholder "W" text.
   Coordinates match LOGO_BRICKS in sites/_tools/generate-og-images.py
   (programmatic recreation of wall_logo_light.svg) so the HTML brand
   mark and OG share-preview brand mark are pixel-identical at proportion.
   Color: var(--accent) cyan #4FC3F7 — wall-support per-host accent. */
.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: transparent;
  position: relative;
  font-size: 0; /* hide the "W" placeholder text */
  display: inline-block;
}
.brand-logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 135'><g fill='%234FC3F7'><rect x='0' y='0' width='60' height='35' rx='6'/><rect x='75' y='0' width='75' height='35' rx='6'/><rect x='0' y='50' width='30' height='35' rx='6'/><rect x='45' y='50' width='60' height='35' rx='6'/><rect x='120' y='50' width='30' height='35' rx='6'/><rect x='0' y='100' width='75' height='35' rx='6'/><rect x='90' y='100' width='60' height='35' rx='6'/></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.brand-tag {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  margin-left: 6px;
}
.header-cta {
  background: var(--accent-grad);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}
.header-cta:hover { text-decoration: none; opacity: 0.92; }

/* Hero */
.hero {
  padding: 80px 0 64px;
  text-align: center;
}
.hero h1 {
  font-size: 44px;
  font-weight: 800;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  padding: 24px 0 64px;
}
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  display: block;
  color: var(--text);
}
.topic-card:hover {
  background: var(--surface-hover);
  border-color: rgba(79, 195, 247, 0.3);
  text-decoration: none;
  transform: translateY(-2px);
}
.topic-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}
.topic-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Article */
.article {
  padding: 48px 0 80px;
}
.article h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.article .lede {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 36px;
}
.article h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 14px;
  letter-spacing: -0.01em;
}
.article h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 8px;
}
.article p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.85);
}
.article ul { padding-left: 20px; color: rgba(255, 255, 255, 0.85); }
.article ul li { margin-bottom: 6px; }

.breadcrumbs {
  font-size: 14px;
  color: var(--text-muted);
  margin: 32px 0 12px;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); text-decoration: none; }

/* Method cards (payment options, etc.) */
.method {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 14px 0;
}
.method h3 { margin: 0 0 6px; font-size: 17px; }
.method-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 8px;
  vertical-align: middle;
}
.tag-primary { background: rgba(79, 195, 247, 0.18); color: var(--accent); }
.tag-soon { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.tag-beta { background: rgba(255, 193, 7, 0.16); color: #FFC107; }

/* FAQ accordion-style (CSS-only) */
.faq { margin: 8px 0; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  margin-bottom: 8px;
  overflow: hidden;
}
.faq summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .answer { padding: 14px 20px 18px; color: var(--text-muted); }
.faq .answer p { margin: 0 0 10px; color: var(--text-muted); }
.faq .answer p:last-child { margin-bottom: 0; }

/* Inline CTA panel */
.cta-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin: 40px 0 0;
  text-align: center;
}
.cta-panel h3 { margin: 0 0 6px; font-size: 19px; }
.cta-panel p { margin: 0 0 18px; color: var(--text-muted); }
.cta-button {
  display: inline-block;
  background: var(--accent-grad);
  color: var(--bg);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
}
.cta-button:hover { text-decoration: none; opacity: 0.92; }

/* Related articles */
.related-articles {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.related-articles h3,
.related-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.related-articles ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.related-articles li { margin: 0; }
.related-articles a {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.related-articles a:hover {
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
  margin-top: 60px;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  justify-content: space-between;
  align-items: center;
}
.footer-links a { color: var(--text-muted); margin-right: 16px; }
.footer-links a:hover { color: var(--text); text-decoration: none; }

/* Mobile */
@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 17px; }
  .article h1 { font-size: 28px; }
  .article h2 { font-size: 21px; }
  .container { padding: 0 18px; }
  .header-cta { padding: 7px 12px; font-size: 13px; }
}

/* Search form (hero) */
.search-form { margin-top: 28px; }
.search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 6px 4px 14px;
  gap: 8px;
  transition: border-color 0.15s;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-icon { width: 17px; height: 17px; color: var(--text-dim); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  padding: 8px 0;
  font-family: inherit;
}
.search-input::placeholder { color: var(--text-dim); }
.search-btn {
  background: var(--accent-grad);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.search-btn:hover { opacity: 0.88; }

/* "In this article" ToC (injected by JS) */
.page-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 32px;
}
.page-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.page-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 24px;
}
.page-toc li { margin-bottom: 5px; break-inside: avoid; }
.page-toc a { font-size: 13px; color: var(--text-muted); }
.page-toc a:hover { color: var(--text); }
@media (max-width: 640px) { .page-toc ul { columns: 1; } }

/* ============================================================
   DOCS LAYOUT — sidebar + content (Gemini-style)
   ============================================================ */

.page-wide {
  max-width: 1360px;
  margin: 0 auto;
}

.docs-layout {
  display: grid;
  grid-template-columns: 248px 1fr;
  align-items: start;
  min-height: calc(100vh - 66px);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 28px 0 48px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sidebar-nav { padding: 0 16px; }

.sidebar-section { margin-bottom: 24px; }

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  padding: 0 10px 8px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
  margin-bottom: 1px;
  gap: 4px;
  text-decoration: none;
}
.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(79, 195, 247, 0.1);
  color: var(--accent);
  font-weight: 600;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1;
  margin-left: auto;
  flex-shrink: 0;
}
.badge-live  { background: rgba(76, 175, 80, 0.18); color: #5ddb62; }
.badge-new   { background: rgba(79, 195, 247, 0.18); color: var(--accent); }
.badge-beta  { background: rgba(255, 193, 7, 0.16);  color: #FFC107; }

/* Docs content area */
.docs-content {
  min-width: 0;
  padding: 0 56px;
  max-width: 900px;
}

/* Comparison table (Free vs Premium vs Ultra) */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.comparison-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.comparison-table th:first-child { color: var(--text-dim); }
.comparison-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table td:first-child { color: var(--text-muted); font-size: 13px; }
.check { color: #5ddb62; font-size: 16px; }
.cross { color: var(--text-dim); }
.col-premium { color: var(--accent); font-weight: 600; }
.col-ultra { color: #c084fc; font-weight: 600; }

/* Mobile sidebar toggle button */
.sidebar-mobile-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  margin: 20px 18px 0;
  width: calc(100% - 36px);
  text-align: left;
}

/* Overlay (mobile, behind sidebar) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.docs-layout.sidebar-open .sidebar-overlay { display: block; }

@media (max-width: 960px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 66px;
    left: -268px;
    width: 268px;
    height: calc(100vh - 66px);
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    z-index: 200;
    transition: left 0.22s ease;
    padding: 16px 0 48px;
  }

  .docs-layout.sidebar-open .sidebar {
    left: 0;
    box-shadow: 4px 0 40px rgba(0,0,0,0.55);
  }

  .sidebar-mobile-toggle { display: flex; }

  .docs-content {
    padding: 0;
  }

  .docs-content .article {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 640px) {
  .docs-content .article h1 { font-size: 26px; }
  .docs-content .article h2 { font-size: 20px; }
  .comparison-table { font-size: 13px; }
  .comparison-table th, .comparison-table td { padding: 8px 10px; }
}
