/*
Theme Name: ИИ-гид
Theme URI: https://ii-guide.ru
Author: AI Guide Team
Author URI: https://ii-guide.ru
Description: Современная тема для ИИ-блога с тёмной/светлой темой, адаптивным дизайном и встроенными шаблонами политик.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-guide
Tags: blog, news, ai, dark-mode, responsive, modern
*/

/* ============================================
   CSS-ПЕРЕМЕННЫЕ (ДИЗАЙН-ТОКЕНЫ)
   Определяют цвета, шрифты, отступы и скорости анимации.
   Переменные в :root доступны глобально.
   ============================================ */
:root {
    /* Цветовая палитра — светлая тема по умолчанию */
    --bg-primary: #ffffff;
    --bg-secondary: #f7f8fa;
    --bg-tertiary: #eef0f4;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent: #6366f1;        /* Индиго — акцент ИИ-тематики */
    --accent-hover: #4f46e5;
    --accent-soft: rgba(99, 102, 241, 0.1);
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Типографика */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --line-height: 1.6;

    /* Отступы — 4px база */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-9: 96px;

    /* Анимации */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
}

/* ============================================
   ТЁМНАЯ ТЕМА
   Переключается через класс .dark на <html>
   ============================================ */
.dark {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent: #818cf8;
    --accent-hover: #a5b4fc;
    --accent-soft: rgba(129, 140, 248, 0.12);
    --border: #1e293b;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================
   RESET / BASE
   Убираем стандартные отступы, задаём box-sizing,
   подключаем шрифты и сглаживание.
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: var(--line-height);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

body.overflow-hidden {
    overflow: hidden;
}

/* Типографика контента */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Списки */
ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-5);
}

li {
    margin-bottom: var(--space-2);
}

/* Код */
code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

pre {
    background: var(--bg-tertiary);
    padding: var(--space-5);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-5);
}

pre code {
    background: none;
    padding: 0;
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--space-5);
}

th, td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Формы */
input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
}

input, textarea, select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ============================================
   УТИЛИТАРНЫЕ КЛАССЫ
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}