/* ================================================================
   eldauto.ru — Стили для статических страниц (Правила, FAQ, О нас)
   Версия: v=16
   ================================================================ */

/* ---------- Контейнер страницы ---------- */
.static-container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* ---------- Шапка страницы ---------- */
.static-header {
  margin-bottom: 2rem;
  text-align: center;
}

.static-header h1 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  /* Явно перебиваем глобальный h1 из style.css */
  text-align: center;
}

.static-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

/* ---------- Контент ---------- */
.static-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.static-content h2 {
  font-size: 1.4rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.static-content h2:first-child {
  margin-top: 0;
}

.static-content h3 {
  font-size: 1.15rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.static-content p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text);
}

.static-content ul,
.static-content ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text);
}

.static-content li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.static-content strong {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Ссылки ---------- */
.static-content a {
  color: var(--primary);
  text-decoration: none;
  /* Длинные URL не должны ломать вёрстку на мобилке */
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: color 0.15s ease;
}

.static-content a:hover {
  text-decoration: underline;
}

.static-content a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Цитаты ---------- */
.static-content blockquote {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--primary);
  background: var(--input-bg);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ---------- Код ---------- */
.static-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
}

.static-content pre {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}

.static-content pre code {
  padding: 0;
  background: none;
  border: none;
  font-size: inherit;
}

/* ---------- Таблицы ---------- */
.static-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.static-content th,
.static-content td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.static-content th {
  font-weight: 700;
  background: var(--input-bg);
}

.static-content tr:last-child td {
  border-bottom: none;
}

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 768px) {
  .static-container {
    margin: 1rem auto;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .static-header {
    margin-bottom: 1rem;
    /* Заголовок и подзаголовок — оба слева, чтобы не разъезжались */
    text-align: left;
  }

  .static-header h1 {
    font-size: 1.5rem;
    text-align: left;
  }

  .static-content {
    padding: 1.25rem;
    /* transparent — чтобы не затирать градиент body в тёмной теме */
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }

  .static-content h2 {
    font-size: 1.2rem;
    margin-top: 1.25rem;
  }

  .static-content h3 {
    font-size: 1.05rem;
  }

  /* Таблицы — горизонтальный скролл вместо поломки вёрстки */
  .static-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* ---------- Тёмная тема ---------- */
[data-theme="dark"] .static-content th {
  background: var(--card-bg);
}
