/*
Theme Name: ENGI.KZ
Theme URI: https://engi.kz
Author: ENGI.KZ
Description: Крупнейшая инженерная платформа Казахстана — тема на основе исходного дизайн-макета site-template.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: engi
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F8FAFC; color: #475569; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #1E5DB4; text-decoration: none; transition: color .2s; }
a:hover { color: #164A8F; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; }
ul { list-style: none; }

/* ===== VARIABLES ===== */
:root {
  --primary: #1E5DB4; --primary-hover: #164A8F; --primary-light: #EBF2FB;
  --secondary: #0EA5E9; --accent: #F59E0B;
  --success: #10B981; --danger: #EF4444;
  --bg: #F8FAFC; --bg-white: #FFFFFF; --bg-dark: #0F172A;
  --text: #0F172A; --text-secondary: #475569; --text-muted: #94A3B8;
  --border: #E2E8F0; --border-light: #F1F5F9;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ===== UTILITIES ===== */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.col-span-2 { grid-column: span 2; }
.text-center { text-align: center; }
.text-gradient { background: linear-gradient(90deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 15px; transition: all .2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); color: #fff; }
.btn-secondary { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-full { width: 100%; }

/* ===== CARDS ===== */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: all .2s;
}
.card-hover:hover {
  transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-light);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-accent { background: #FEF3C7; color: #92400E; }
.badge-gray { background: var(--border-light); color: var(--text-secondary); }

/* ===== FORMS ===== */
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); background: #fff;
  transition: all .2s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.textarea { height: auto; padding: 12px 16px; resize: vertical; min-height: 100px; }
.input-icon { position: relative; }
.input-icon .input { padding-left: 44px; }
.input-icon svg, .input-icon .icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); width: 18px; height: 18px;
}
label { display: block; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

/* ===== SECTIONS ===== */
.section { padding: 64px 0; }
.section-white { background: #fff; }
.section-title {
  font-size: 32px; font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.section-subtitle { color: var(--text-secondary); margin-bottom: 40px; }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 64px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: var(--primary); }
.logo-icon { width: 28px; height: 28px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 16px; border-radius: var(--radius-sm); font-size: 15px;
  font-weight: 500; color: var(--text-secondary); transition: all .2s;
}
.nav a:hover, .nav a.active { color: var(--primary); background: var(--primary-light); }
.header-auth { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; padding: 8px; color: var(--text-secondary); }

/* ===== FOOTER ===== */
.footer { background: var(--bg-dark); color: #fff; padding-top: 64px; padding-bottom: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 16px; }
.footer-desc { color: #94A3B8; font-size: 14px; line-height: 1.6; margin-bottom: 20px; }
.footer h4 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; color: #CBD5E1; }
.footer a { color: #94A3B8; font-size: 14px; display: block; padding: 4px 0; transition: color .2s; }
.footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1E293B; padding-top: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-bottom p, .footer-bottom a { font-size: 12px; color: #64748B; }

/* ===== HERO ===== */
.hero { min-height: 92vh; display: flex; align-items: center; background: var(--bg); position: relative; overflow: hidden; }
.hero-pattern {
  position: absolute; inset: 0; opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230F172A' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.hero h1 { font-size: 52px; font-weight: 800; line-height: 1.1; color: var(--text); margin-bottom: 24px; }
.hero p { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--text-muted); }
.hero-stats strong { color: var(--primary); font-size: 18px; }
.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-circle { width: 420px; height: 420px; border-radius: 50%; background: linear-gradient(135deg, rgba(30,93,180,0.1), rgba(14,165,233,0.1)); display: flex; align-items: center; justify-content: center; }
.hero-circle-inner { width: 320px; height: 320px; border-radius: 50%; background: linear-gradient(135deg, rgba(30,93,180,0.15), rgba(14,165,233,0.15)); display: flex; align-items: center; justify-content: center; }
.hero-circle-core { width: 220px; height: 220px; border-radius: 50%; background: linear-gradient(135deg, rgba(30,93,180,0.2), rgba(14,165,233,0.2)); display: flex; align-items: center; justify-content: center; }

/* ===== CATALOG PAGES ===== */
.page-header { background: #fff; border-bottom: 1px solid var(--border); padding: 48px 0 32px; padding-top: 112px; }
.page-header h1 { font-size: 32px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.page-header p { color: var(--text-secondary); }

.filters { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.filters h3 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 20px; }
.filter-group { margin-bottom: 20px; }
.filter-group h4 { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 10px; }
.filter-group label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; color: var(--text-secondary); cursor: pointer; margin-bottom: 8px; }
.filter-group input[type="checkbox"], .filter-group input[type="radio"] { accent-color: var(--primary); }
.filter-actions { display: flex; gap: 8px; margin-top: 24px; }

/* ===== SPECIALIST CARD ===== */
.spec-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; transition: all .2s; }
.spec-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-light); }
.spec-card:hover .spec-name { color: var(--primary); }
.spec-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
.spec-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; position: relative; }
.spec-online { position: absolute; bottom: 2px; right: 2px; width: 14px; height: 14px; background: var(--success); border: 2px solid #fff; border-radius: 50%; }
.spec-name { font-size: 16px; font-weight: 600; color: var(--text); transition: color .2s; }
.spec-rating { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.spec-rating svg { width: 14px; height: 14px; }
.spec-desc { font-size: 14px; color: var(--text-secondary); margin: 12px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spec-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.spec-tag { font-size: 12px; padding: 3px 10px; background: var(--bg); color: var(--text-secondary); border-radius: 6px; }

/* ===== PROFILE PAGE ===== */
.profile-hero {
  background: linear-gradient(135deg, rgba(30,93,180,0.05), rgba(14,165,233,0.05));
  border-bottom: 1px solid var(--border); padding: 48px 0 32px; padding-top: 112px;
}
.profile-hero-grid { display: flex; align-items: center; gap: 32px; }
.profile-avatar-lg { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow); flex-shrink: 0; position: relative; }
.profile-hero h1 { font-size: 32px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.profile-rating { display: flex; align-items: center; gap: 6px; }
.profile-rating svg { width: 20px; height: 20px; }
.profile-actions { display: flex; gap: 12px; margin-top: 16px; }

/* TABS */
.tabs-bar { background: #fff; border-bottom: 1px solid var(--border); }
.tabs { display: flex; gap: 0; overflow-x: auto; }
.tab-btn {
  padding: 16px 24px; font-size: 14px; font-weight: 500; color: var(--text-secondary);
  border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ===== FORUM ===== */
.forum-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 32px; }
.forum-stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.forum-stat-value { font-size: 28px; font-weight: 700; color: var(--primary); }
.forum-stat-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.forum-section {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
  display: flex; align-items: flex-start; gap: 20px; transition: all .2s; cursor: pointer;
}
.forum-section:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-light); }
.forum-section-icon { width: 56px; height: 56px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.forum-section-icon svg { width: 28px; height: 28px; color: var(--primary); }
.forum-section h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.forum-section h3:hover { color: var(--primary); }
.forum-section p { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.forum-section-meta { font-size: 13px; color: var(--text-muted); }

/* Topic list */
.topic-list { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topic-row {
  display: grid; grid-template-columns: 1fr 120px 80px 60px 140px; gap: 16px;
  padding: 16px 24px; align-items: center; border-bottom: 1px solid var(--border-light); transition: background .15s;
}
.topic-row:hover { background: var(--bg); }
.topic-row-header {
  display: grid; grid-template-columns: 1fr 120px 80px 60px 140px; gap: 16px;
  padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase;
}
.topic-title-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topic-title { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-row:hover .topic-title { color: var(--primary); }
.topic-author { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.topic-author img { width: 28px; height: 28px; border-radius: 50%; }

/* Post */
.post { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; }
.post-solution { border-color: var(--success); box-shadow: 0 0 0 1px rgba(16,185,129,0.1); }
.post-header { display: flex; gap: 20px; }
.post-author { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.post-author img { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 8px; }
.post-author-name { font-weight: 600; color: var(--text); font-size: 14px; }
.post-author-badge { margin-top: 4px; }
.post-author-stats { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.post-body { flex: 1; min-width: 0; }
.post-date { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.post-content { color: var(--text-secondary); line-height: 1.8; font-size: 15px; white-space: pre-line; }
.post-content h2 { font-size: 20px; font-weight: 600; color: var(--text); margin: 24px 0 12px; }
.post-content ul { list-style: disc; padding-left: 24px; margin: 12px 0; }
.post-content li { margin-bottom: 6px; }
.post-content strong { color: var(--text); }
.post-content blockquote { background: var(--bg); border-left: 4px solid var(--primary); padding: 16px 20px; margin: 16px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post-content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0; }
.post-content th, .post-content td { padding: 12px; border: 1px solid var(--border); text-align: left; }
.post-content th { background: var(--bg); font-weight: 600; color: var(--text); }
.post-actions { display: flex; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.post-action { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-secondary); cursor: pointer; transition: color .2s; }
.post-action:hover { color: var(--primary); }
.post-action.active { color: var(--primary); }

/* Reply form */
.reply-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.reply-toolbar { display: flex; gap: 4px; padding: 8px; background: var(--bg); border-radius: var(--radius-sm); margin-bottom: 12px; border: 1px solid var(--border); }
.reply-toolbar button { padding: 4px 12px; background: #fff; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; color: var(--text-secondary); }
.reply-toolbar button:hover { background: var(--primary-light); }

/* ===== ARTICLES ===== */
.article-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .2s; display: block; }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.article-card:hover .article-title { color: var(--primary); }
.article-card-img { aspect-ratio: 16/9; overflow: hidden; }
.article-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.article-card:hover .article-card-img img { transform: scale(1.05); }
.article-card-body { padding: 20px; }
.article-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 8px; line-height: 1.4; transition: color .2s; }
.article-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* Article detail */
.article-cover { position: relative; height: 400px; overflow: hidden; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6), transparent); }
.article-cover-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 40px 24px; z-index: 1; }
.article-cover-content .badge { margin-bottom: 12px; }
.article-cover-content h1 { color: #fff; font-size: 36px; font-weight: 700; }

/* ===== PROJECTS ===== */
.project-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all .2s; display: block; }
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.project-card:hover .project-title { color: var(--primary); }
.project-img { position: relative; aspect-ratio: 3/2; overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.project-card:hover .project-img img { transform: scale(1.05); }
.project-img .badge { position: absolute; top: 12px; left: 12px; }
.project-body { padding: 20px; }
.project-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 8px; transition: color .2s; }

/* ===== AUTH ===== */
.auth-page { min-height: 100vh; display: flex; background: var(--bg); }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-form-wrap { width: 100%; max-width: 440px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 32px; font-size: 24px; font-weight: 800; color: var(--primary); }
.auth-visual {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  position: relative; overflow: hidden;
}
.auth-visual::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 0H0v40' fill='none' stroke='white' stroke-opacity='0.1'/%3E%3C/svg%3E");
}
.auth-visual-content { position: relative; z-index: 1; text-align: center; color: #fff; padding: 40px; }
.auth-visual-content h2 { font-size: 32px; font-weight: 700; margin-bottom: 16px; }
.auth-visual-content p { font-size: 16px; opacity: 0.8; max-width: 360px; }
.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--text-muted); font-size: 14px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ===== DASHBOARD ===== */
.dashboard { display: flex; min-height: calc(100vh - 64px); background: var(--bg); }
.dashboard-sidebar { width: 280px; flex-shrink: 0; padding: 24px; }
.dashboard-sidebar-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.dashboard-user { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.dashboard-user-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 600; }
.dashboard-user-name { font-weight: 600; color: var(--text); }
.dashboard-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
  color: var(--text-secondary); transition: all .2s; margin-bottom: 2px;
}
.dashboard-nav a:hover, .dashboard-nav a.active { background: var(--primary); color: #fff; }
.dashboard-nav a:hover svg, .dashboard-nav a.active svg { color: #fff; }
.dashboard-nav svg { width: 18px; height: 18px; color: var(--text-muted); }
.dashboard-main { flex: 1; padding: 32px; overflow-y: auto; }

/* Stats */
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.stat-card-change { font-size: 12px; font-weight: 600; color: var(--success); background: #D1FAE5; padding: 2px 10px; border-radius: 20px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-card-label { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ===== PAGINATION ===== */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; transition: all .2s;
}
.pagination a { background: #fff; border: 1px solid var(--border); color: var(--text-secondary); }
.pagination a:hover { background: var(--bg); }
.pagination span { background: var(--primary); color: #fff; }

/* ===== MOBILE MENU ===== */
.mobile-menu {
  position: fixed; top: 64px; right: 0; bottom: 0; width: 280px;
  background: #fff; border-left: 1px solid var(--border); z-index: 99;
  padding: 24px; transform: translateX(100%); transition: transform .3s; overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu a { display: block; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; color: var(--text-secondary); margin-bottom: 4px; }
.mobile-menu a:hover, .mobile-menu a.active { background: var(--primary-light); color: var(--primary); }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 98; display: none; }
.mobile-overlay.open { display: block; }

/* ===== PROGRESS ===== */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

/* ===== GALLERY ===== */
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; background: rgba(255,255,255,0.2); backdrop-filter: blur(4px); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; transition: background .2s; border: none; }
.gallery-nav:hover { background: rgba(255,255,255,0.4); }
.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }
.gallery-counter { position: absolute; bottom: 16px; right: 16px; background: rgba(0,0,0,0.5); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 20px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.gallery-thumb { width: 80px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); }

/* ===== BREADCRUMB ===== */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text); }

/* ===== SOCIAL ICONS ===== */
.social-links { display: flex; gap: 10px; }
.social-links a { width: 36px; height: 36px; border-radius: var(--radius-sm); background: #1E293B; display: flex; align-items: center; justify-content: center; color: #94A3B8; transition: all .2s; }
.social-links a:hover { background: var(--primary); color: #fff; }

/* ===== SCROLLBAR HIDE ===== */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn .4s ease-out; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero h1 { font-size: 36px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard { flex-direction: column; }
  .dashboard-sidebar { width: 100%; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .topic-row-header, .topic-row { grid-template-columns: 1fr 100px 70px 50px !important; }
  .topic-row :nth-child(4), .topic-row-header :nth-child(4) { display: none; }
  .post-header { flex-direction: column; }
  .post-author { width: 100%; flex-direction: row; text-align: left; margin-bottom: 16px; }
}
@media (max-width: 768px) {
  .nav, .header-auth { display: none; }
  .menu-toggle { display: block; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .forum-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }
  .auth-visual { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 90; overflow-y: auto; border-radius: 0; }
  .filters.open { display: block; }
  .topic-row-header { display: none !important; }
  .topic-row { grid-template-columns: 1fr !important; padding: 16px; }
  .gallery-nav { width: 32px; height: 32px; }
  .page-header { padding-top: 96px; }
  .profile-hero { padding-top: 96px; }
  .profile-hero-grid { flex-direction: column; text-align: center; }
  .profile-actions { justify-content: center; }
}
@media (min-width: 769px) {
  .filters { display: block !important; }
}

/* ===== ARTICLE BODY (типографика для the_content(), 1:1 с article.html) ===== */
.article-body { font-size: 16px; line-height: 1.8; color: var(--text-secondary); }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin-bottom: 20px; }
.article-body h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 32px 0 16px; }
.article-body h3 { font-size: 18px; font-weight: 600; color: var(--text); margin: 24px 0 12px; }
.article-body ul, .article-body ol { margin-bottom: 20px; padding-left: 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--text); }
.article-body a { text-decoration: underline; }
.article-body img { border-radius: var(--radius); margin: 20px 0; }
.article-body blockquote { background: var(--bg); border-left: 4px solid var(--primary); padding: 20px 24px; border-radius: 0 var(--radius) var(--radius) 0; margin: 24px 0; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 20px 0; }
.article-body th, .article-body td { padding: 12px; border: 1px solid var(--border); text-align: left; }
.article-body th { background: var(--bg); font-weight: 600; color: var(--text); }
.article-body tr:nth-child(even) td { background: var(--bg); }
.article-body figcaption { font-size: 13px; color: var(--text-muted); margin-top: -12px; margin-bottom: 20px; }

/* ===== ОДИНОЧНАЯ СТАТЬЯ ===== */
.single-article-grid { display: grid; grid-template-columns: 1fr 320px; gap: 40px; }
@media (max-width: 900px) {
  .single-article-grid { grid-template-columns: 1fr; }
}

/* ===== TOC / комментарии статьи ===== */
.toc-link { font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; padding: 0; }
.toc-link:hover { color: var(--primary); }
.comment-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-light); display: flex; align-items: center; justify-content: center; color: var(--primary); font-weight: 600; font-size: 14px; flex-shrink: 0; }
.like-btn.active { color: var(--primary); }
.like-btn.active svg { fill: var(--primary); }

/* ===== ЧЁРНАЯ АДМИН-ПАНЕЛЬ WORDPRESS (для залогиненных) =====
   .header у нас position:fixed;top:0 — WP сдвигает body через margin-top,
   но fixed-элементы это не подхватывают, поэтому шапку нужно сдвинуть вручную. */
body.admin-bar .header { top: 32px; }
body.admin-bar .mobile-menu, body.admin-bar .mobile-overlay { top: 96px; }
@media (max-width: 782px) {
  body.admin-bar .header { top: 46px; }
  body.admin-bar .mobile-menu, body.admin-bar .mobile-overlay { top: 110px; }
}
