/*
 * WeAreVoice Support Site — Stylesheet
 * Generated by build-support-site.js
 * Brand tokens: Foundation Palette v1
 */

/* ---- Google Fonts: DM Sans is loaded in <head> ---- */

:root {
  /* Surfaces */
  --surface-app: #191E2E;
  --surface-card: #22283D;
  --surface-raised: #202537;
  --surface-sheet: #22283D;

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #eadfd8;
  --text-body: #a7a7a7;
  --text-link: #42a4ff;
  --text-disabled: #817f83;

  /* Border / Divider */
  --border-default: #3a4056;
  --border-focus: #94abff;
  --divider: rgba(58, 64, 86, 1);

  /* Actions */
  --action-primary: #2b65e3;
  --action-primary-pressed: #2867b0;
  --action-secondary: #fddcd0;
  --action-secondary-fg: #000000;

  /* Status */
  --status-success: #49a149;
  --status-warning: #f59e0b;
  --status-error: #ff6f62;

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  /* Spacing */
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* Shadows */
  --shadow-raised: 0 12px 28px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 20px rgba(0, 0, 0, 0.25);

  /* Typography */
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;

  /* Layout */
  --sidebar-width: 340px;
  --topbar-height: 56px;

  color-scheme: dark;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--surface-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; margin: var(--space-3) 0; }
li { margin: var(--space-1) 0; line-height: 1.55; }
p { margin: var(--space-3) 0; color: var(--text-body); line-height: 1.65; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  padding: 1px 5px;
}
pre { margin: var(--space-3) 0; }
pre code { display: block; padding: var(--space-3); overflow-x: auto; font-size: var(--fs-sm); }
strong { color: var(--text-secondary); font-weight: 600; }
em { color: var(--text-body); font-style: italic; }
h1, h2, h3, h4 { color: var(--text-primary); line-height: 1.25; margin: var(--space-5) 0 var(--space-3); }
h1 { font-size: var(--fs-2xl); font-weight: 700; margin-top: 0; }
h2 { font-size: var(--fs-xl); font-weight: 700; border-bottom: 1px solid var(--divider); padding-bottom: var(--space-2); }
h3 { font-size: var(--fs-lg); font-weight: 600; }
h4 { font-size: var(--fs-base); font-weight: 600; }

/* ---- Topbar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-height);
  background: rgba(25, 30, 46, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--divider);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* ---- Logo ---- */
.site-logo-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none !important;
}
.logo-img {
  height: 26px;
  width: auto;
  display: block;
}
.logo-support {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-body);
  border-left: 1px solid var(--divider);
  padding-left: var(--space-2);
  white-space: nowrap;
}

/* ---- Locale switcher ---- */
.locale-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-wrap: wrap;
}
.locale-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
  cursor: default;
}
a.locale-item {
  color: var(--text-secondary);
  cursor: pointer;
}
a.locale-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-default);
  text-decoration: none;
}
.locale-active {
  background: rgba(43, 101, 227, 0.18);
  border-color: rgba(43, 101, 227, 0.55);
  color: #94abff;
  font-weight: 600;
}
.locale-unavailable {
  color: var(--text-disabled);
  opacity: 0.55;
  font-size: var(--fs-xs);
}

/* ---- Page layout ---- */
.page-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
  max-width: 1280px;
  margin: 0 auto;
}

/* ---- Sidebar ---- */
.sidebar {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  border-left: 1px solid var(--divider);
  padding: var(--space-5) 0 var(--space-7);
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}
.sidebar-toggle {
  display: none;
}
.sidebar-section {
  border-bottom: 1px solid var(--divider);
}
.sidebar-section:last-child {
  border-bottom: none;
}
.sidebar-section > summary.sidebar-category {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.sidebar-section > summary.sidebar-category::-webkit-details-marker { display: none; }
.sidebar-section > summary.sidebar-category::after {
  content: '›';
  font-size: var(--fs-sm);
  color: var(--text-disabled);
  display: inline-block;
  transition: transform 150ms;
  margin-right: var(--space-1);
}
.sidebar-section[open] > summary.sidebar-category::after {
  transform: rotate(90deg);
}

/* Subcategories (second level) */
.sidebar-subsection {
  margin: 0;
}
.sidebar-subsection > summary.sidebar-subcategory {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) var(--space-5);
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.2px;
}
.sidebar-subsection > summary.sidebar-subcategory::-webkit-details-marker { display: none; }
.sidebar-subsection > summary.sidebar-subcategory::after {
  content: '›';
  font-size: var(--fs-xs);
  color: var(--text-disabled);
  display: inline-block;
  transition: transform 150ms;
  margin-right: var(--space-1);
}
.sidebar-subsection[open] > summary.sidebar-subcategory::after {
  transform: rotate(90deg);
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list--sub {
  padding-bottom: var(--space-1);
}
.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar li {
  margin: 0;
}
.sidebar-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  padding-left: calc(var(--space-4) + 8px);
  font-size: var(--fs-base);
  color: var(--text-body);
  border-left: 2px solid transparent;
  text-decoration: none !important;
  line-height: 1.4;
}
/* Sub-level links get extra indent */
.sidebar-list--sub .sidebar-link {
  padding-left: calc(var(--space-5) + 8px);
}
.sidebar-link:hover {
  color: var(--text-secondary);
}
.sidebar-active {
  color: #94abff !important;
  font-weight: 500;
}

/* ---- Main content ---- */
.main-content {
  padding: var(--space-6) var(--space-7);
  min-width: 0;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  margin-bottom: var(--space-4);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}
.crumb, .crumb-sep {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--text-body);
}
.crumb a {
  color: var(--text-body);
  text-decoration: none;
}
.crumb a:hover {
  color: var(--text-link);
  text-decoration: underline;
}
.crumb-current { color: var(--text-secondary); }
.crumb-sep {
  margin: 0 var(--space-1);
  color: var(--border-default);
  font-size: var(--fs-xs);
}

/* ---- Article card ---- */
.article-card {
  max-width: 800px;
  padding: var(--space-2) 0;
}
.article-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
  color: var(--text-primary);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--divider);
}
.article-body h2 {
  font-size: var(--fs-lg);
  margin-top: var(--space-6);
}
.article-body h3 {
  font-size: var(--fs-base);
  margin-top: var(--space-5);
}
.article-body ol, .article-body ul {
  padding-left: 1.75rem;
}
.article-body li {
  color: var(--text-body);
}
/* ---- Tables ---- */
.table-wrap {
  overflow-x: auto;
  margin: var(--space-5) 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-md);
}
.table-wrap th,
.table-wrap td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-body);
}
.table-wrap th {
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  color: var(--text-secondary);
}
.table-wrap tr:last-child td {
  border-bottom: none;
}
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--divider);
  font-size: var(--fs-xs);
  color: var(--text-disabled);
}

/* ---- Related articles ---- */
.related-articles {
  margin-top: var(--space-5);
  max-width: 800px;
}
.related-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-body);
  margin-bottom: var(--space-3);
  border: none;
  padding: 0;
}
.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.related-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  font-size: var(--fs-sm);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none !important;
  transition: background 100ms, border-color 100ms;
}
.related-chip:hover {
  background: rgba(43, 101, 227, 0.12);
  border-color: rgba(43, 101, 227, 0.55);
  color: #94abff;
}

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--action-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: var(--fs-base);
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
  opacity: 0.85;
  transition: opacity 120ms;
  z-index: 50;
}
.back-to-top:hover { opacity: 1; }

/* ---- Locale index ---- */
.index-layout {
  max-width: 1024px;
  margin: 0 auto;
}
.index-main {
  padding: var(--space-7) var(--space-6);
}
.index-header {
  margin-bottom: var(--space-6);
  text-align: center;
}
.index-title {
  font-size: var(--fs-3xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.index-subtitle {
  font-size: var(--fs-base);
  color: var(--text-body);
  margin: 0;
}
.index-categories {
  display: flex;
  flex-direction: column;
  max-width: 640px;
  margin: 0 auto;
}
.index-category {
  border-bottom: 1px solid var(--divider);
}
.index-category:last-child {
  border-bottom: none;
}
.cat-title-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}
.cat-title-inner svg {
  flex-shrink: 0;
  color: var(--action-primary);
}
.index-category > summary.index-category-title {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-5) 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.index-category > summary.index-category-title::-webkit-details-marker { display: none; }
.index-category > summary.index-category-title::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--text-disabled);
  border-bottom: 2px solid var(--text-disabled);
  transform: rotate(45deg);
  margin-left: var(--space-3);
  margin-bottom: 3px;
  transition: transform 150ms, margin-bottom 150ms;
}
.index-category[open] > summary.index-category-title::after {
  transform: rotate(-135deg);
  margin-bottom: -3px;
}
.index-category[open] > summary.index-category-title {
  border-bottom: 1px solid var(--divider);
}

/* Index subcategories */
.index-subcategory {
  /* no border between subcategories — clean tree appearance */
}
.index-subcategory > summary.index-subcategory-title {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-2);
  padding-left: var(--space-5);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-body);
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.index-subcategory > summary.index-subcategory-title::-webkit-details-marker { display: none; }
.index-subcategory > summary.index-subcategory-title::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-disabled);
  border-bottom: 1.5px solid var(--text-disabled);
  transform: rotate(45deg);
  margin-left: var(--space-2);
  margin-bottom: 2px;
  transition: transform 150ms, margin-bottom 150ms;
}
.index-subcategory[open] > summary.index-subcategory-title::after {
  transform: rotate(-135deg);
  margin-bottom: -2px;
}
.index-article-list {
  margin: 0;
  padding: 0 0 var(--space-4);
  padding-left: var(--space-5);
}
.index-article-list--sub {
  padding-left: calc(var(--space-5) + var(--space-3));
}
.index-article-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-1);
  font-size: var(--fs-base);
  color: var(--text-secondary);
  text-decoration: none !important;
}
.index-article-link:hover {
  color: var(--text-primary);
}
.index-article-title {
  flex: 1;
}
.index-article-arrow {
  color: var(--text-disabled);
  font-size: var(--fs-sm);
  flex-shrink: 0;
  margin-left: var(--space-3);
}
.index-article-link:hover .index-article-arrow {
  color: var(--action-primary);
}

/* ---- Root index (language picker) ---- */
.root-index {
  min-height: calc(100vh - var(--topbar-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-5);
}
.root-hero {
  text-align: center;
  margin-bottom: var(--space-6);
}
.root-title {
  font-size: var(--fs-3xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}
.root-subtitle {
  font-size: var(--fs-base);
  color: var(--text-body);
  margin: 0;
}
.lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 260px);
  gap: var(--space-4);
  justify-content: center;
}
.lang-card {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-5);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-align: center;
  text-decoration: none !important;
  transition: background 120ms, border-color 120ms;
}
.lang-card:hover {
  background: var(--surface-raised);
  border-color: rgba(43, 101, 227, 0.55);
}
.lang-flag { font-size: 32px; line-height: 1; }
.lang-name { font-size: var(--fs-lg); font-weight: 700; color: var(--text-primary); }
.lang-count { font-size: var(--fs-sm); color: var(--text-body); }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-left: none;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    order: -1;
    padding: 0;
  }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--surface-raised);
    border: none;
    border-bottom: 1px solid var(--divider);
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-sans);
  }

  .sidebar-toggle-icon { font-size: var(--fs-base); }

  .sidebar-body {
    display: none;
    padding: var(--space-4) 0;
  }

  .sidebar-body.sidebar-open {
    display: block;
  }

  .main-content {
    padding: var(--space-5) var(--space-4);
  }

  .article-card {
    padding: var(--space-4);
  }

  .lang-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .locale-switcher {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    padding: 0 var(--space-3);
  }
  .lang-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
}
