/* =========================
   VirusTotal Site – DOCS PAGES
   Body reset, layout, TOC, article, FAQ
   ========================= */

/* --- Body reset (docs pages don't load landing.css) --- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

a { color: inherit; }

img, svg { display: block; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem;
}

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

/* --- Container --- */

.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container { padding-inline: var(--space-5); }
}

/* --- Header: breadcrumb + actions --- */

.docs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

/* Breadcrumb nav */
.docs-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.docs-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--text-main);
}

.docs-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.docs-nav__sep {
  color: var(--text-subtle);
}

/* --- Buttons (minimal, docs-only) --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  color: inherit;
  background: transparent;
  cursor: pointer;
  transition: all 160ms ease-out;
}

.btn--ghost {
  border-color: var(--border-subtle);
}
.btn--ghost:hover {
  background: var(--panel);
  border-color: var(--border-strong);
}

.btn--sm {
  font-size: var(--fs-sm);
  padding: 0.25em 0.7em;
}

/* --- Icon (for breadcrumb & dropdown) --- */

.icon {
  width: 1em; height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}

.icon--sm { width: 0.875em; height: 0.875em; }

/* --- Language dropdown --- */

.lang-dropdown {
  position: relative;
}

.lang-dropdown__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--fs-sm);
  font-family: inherit;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.25em 0.6em;
  cursor: pointer;
  transition: all 120ms ease-out;
}

.lang-dropdown__btn:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.lang-dropdown__menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.35rem);
  min-width: 10rem;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-1);
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
}

.lang-dropdown__menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-dropdown__item {
  display: flex;
  align-items: center;
  gap: 0.5em;
  width: 100%;
  padding: 0.35em 0.6em;
  font-size: var(--fs-sm);
  font-family: inherit;
  color: var(--text-main);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-align: start;
  text-decoration: none;
  transition: background 120ms ease-out;
}

.lang-dropdown__item:hover {
  background: var(--bg-soft);
}

.lang-dropdown__item.is-active {
  color: var(--primary);
  font-weight: 500;
}

.lang-dropdown__flag {
  width: 1.25em;
  height: 0.9em;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

/* =========================
   LAYOUT: TOC sidebar + article
   ========================= */

.docs-layout {
  display: block;
  padding-bottom: var(--space-6);
}

@media (min-width: 1024px) {
  .docs-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-6);
    align-items: start;
  }
}

/* =========================
   TABLE OF CONTENTS
   ========================= */

.docs-toc {
  margin-bottom: var(--space-5);
}

.docs-toc__title {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
  margin: 0 0 var(--space-2);
}

.docs-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.docs-toc__list a {
  display: block;
  padding: var(--space-1) var(--space-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  border-inline-start: 2px solid transparent;
  transition: all 120ms ease-out;
}

.docs-toc__list a:hover {
  color: var(--text-main);
  background: var(--bg-soft);
  border-inline-start-color: var(--primary);
}

/* Desktop: sticky sidebar */
@media (min-width: 1024px) {
  .docs-toc {
    position: sticky;
    top: var(--space-5);
    margin-bottom: 0;
  }
}

/* Mobile: collapsible details */
.docs-toc-mobile {
  display: block;
  margin-bottom: var(--space-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.docs-toc-mobile summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.docs-toc-mobile summary::-webkit-details-marker { display: none; }

.docs-toc-mobile summary::before {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-top: 0.3em solid transparent;
  border-bottom: 0.3em solid transparent;
  border-left: 0.4em solid currentColor;
  transition: transform 120ms ease-out;
  flex-shrink: 0;
}

.docs-toc-mobile[open] summary::before {
  transform: rotate(90deg);
}

.docs-toc-mobile .docs-toc__list {
  padding: 0 var(--space-4) var(--space-4);
}

/* Hide mobile TOC on desktop, hide sidebar TOC on mobile */
@media (min-width: 1024px) {
  .docs-toc-mobile { display: none; }
}

@media (max-width: 1023px) {
  .docs-toc--sidebar { display: none; }
}

/* =========================
   Article
   ========================= */

.docs-article {
  max-width: 720px;
  padding-bottom: var(--space-6);
}

/* Center article when no sidebar (privacy page) */
.docs-article:only-child,
.container > .docs-article {
  margin-inline: auto;
}

.docs-article h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--fw-bold);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
}

.docs-article .docs-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0 0 var(--space-5);
}

.docs-article h2 {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  margin: var(--space-6) 0 var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

.docs-article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.docs-article h3 {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  margin: var(--space-4) 0 var(--space-2);
}

.docs-article p {
  font-size: var(--fs-md);
  line-height: 1.7;
  margin: 0 0 var(--space-4);
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 var(--space-4);
  padding-left: 1.5em;
}

.docs-article li {
  font-size: var(--fs-md);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

.docs-article li strong {
  font-weight: var(--fw-semibold);
}

/* Inline code */
.docs-article code {
  font-family: ui-monospace, "Cascadia Code", "Fira Code", monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.15em 0.4em;
  word-break: break-word;
}

/* Tables */
.docs-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 var(--space-4);
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-4);
  font-size: var(--fs-sm);
  min-width: 480px;
}

.docs-article th,
.docs-article td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}

.docs-article th {
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Links */
.docs-article a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-article a:hover {
  color: var(--primary-hover);
}

/* Horizontal rule */
.docs-article hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-6) 0;
}

/* Related links at bottom */
.docs-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.docs-links a {
  text-decoration: none;
}

/* =========================
   FAQ (details/summary accordion)
   ========================= */

.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.faq details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--panel);
  transition: border-color 120ms ease-out;
}

.faq details[open] {
  border-color: var(--border-strong);
}

.faq summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: color 120ms ease-out;
}

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

.faq summary::before {
  content: '';
  display: inline-block;
  width: 0; height: 0;
  border-top: 0.3em solid transparent;
  border-bottom: 0.3em solid transparent;
  border-left: 0.4em solid currentColor;
  transition: transform 120ms ease-out;
  flex-shrink: 0;
}

.faq details[open] summary::before {
  transform: rotate(90deg);
}

.faq summary:hover {
  color: var(--primary-hover);
}

.faq .faq__body {
  padding: 0 var(--space-4) var(--space-4);
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-muted);
}

.faq .faq__body p {
  margin: 0;
}

/* =========================
   FOOTER (docs pages)
   ========================= */

.footer {
  border-top: 1px solid var(--border-subtle);
  padding-block: var(--space-5);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.footer__copy {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
}

.footer__links {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  margin: 0; padding: 0;
}

.footer__links a {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
  transition: color 120ms ease-out;
}

.footer__links a:hover { color: var(--text-main); }

/* =========================
   Mobile
   ========================= */
@media (max-width: 480px) {
  .docs-article h1 {
    font-size: 1.5rem;
  }

  .docs-article table {
    font-size: var(--fs-xs);
  }

  .docs-article th,
  .docs-article td {
    padding: var(--space-1) var(--space-2);
  }
}
