/* ============================================================
   Scripster — Blog Styles
   Цвета и шрифты под стиль scripster.ru
   ============================================================ */

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

:root {
  --accent:       #3b82f6;
  --accent-dark:  #2563eb;
  --accent-light: rgba(59,130,246,.1);
  --accent-border:rgba(59,130,246,.25);
  --gradient:     linear-gradient(90deg, #7c3aed, #a855f7);

  --bg:       #f8f7ff;
  --surface:  #ffffff;
  --border:   #e2dcff;
  --text:     #0f172a;
  --muted:    #4b5563;
  --faint:    #94a3b8;

  --shadow-sm: 0 1px 3px rgba(124,58,237,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(124,58,237,.08), 0 1px 4px rgba(0,0,0,.04);
}

body {
  font-family: 'Golos Text', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── LAYOUT ─── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ─── HEADER ─── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo {
  font-family: 'Unbounded', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.03em;
}
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
nav { display: flex; gap: 4px; }
nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
}
nav a:hover, nav a.active {
  background: var(--accent-light);
  color: var(--accent-dark);
  text-decoration: none;
}

/* ─── BLOG LIST ─── */
.blog-main { padding: 48px 24px 80px; }
.blog-header { margin-bottom: 32px; }
.blog-header h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.04em;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.2;
}
.blog-header p { color: var(--muted); font-size: 15px; }

/* Фильтр */
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.cat-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  transition: all .15s;
  letter-spacing: -.01em;
}
.cat-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--accent-light); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Список статей */
.articles-list { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.article-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.article-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.article-cat {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-light);
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid var(--accent-border);
  font-family: 'Unbounded', sans-serif;
}
.article-cat:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.article-date { font-size: 12px; color: var(--faint); }
.article-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -.03em;
  line-height: 1.35;
}
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--accent); text-decoration: none; }
.article-excerpt { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.article-link { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; letter-spacing: -.01em; }
.article-link:hover { text-decoration: underline; }
.no-articles { color: var(--muted); padding: 60px 0; text-align: center; }

/* Пагинация */
.pagination { display: flex; gap: 6px; margin-top: 40px; flex-wrap: wrap; }
.page-btn {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* ─── ARTICLE PAGE ─── */
.article-main { max-width: 760px; padding: 36px 24px 80px; }

.breadcrumbs {
  display: flex; gap: 8px; align-items: center;
  font-size: 13px; color: var(--faint);
  margin-bottom: 32px; flex-wrap: wrap;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }

.article-full-header { margin-bottom: 36px; }
.article-full-header h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.04em;
  margin: 14px 0;
  line-height: 1.25;
  color: var(--text);
}
.article-lead { font-size: 17px; color: var(--muted); line-height: 1.7; margin-top: 12px; }

/* Контент */
.article-content { font-size: 16px; line-height: 1.8; color: #1e293b; }
.article-content h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 20px; font-weight: 700;
  margin: 36px 0 14px;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.3;
}
.article-content h3 {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px; font-weight: 700;
  margin: 28px 0 10px;
  letter-spacing: -.02em;
  color: var(--text);
}
.article-content p { margin-bottom: 18px; }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; }
.article-content li { margin-bottom: 8px; }
.article-content a { color: var(--accent); text-decoration: underline; }
.article-content a:hover { color: var(--accent-dark); }
.article-content strong { font-weight: 700; color: var(--text); }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 20px;
  background: var(--accent-light);
  border-radius: 0 10px 10px 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--muted);
}
.article-content code {
  background: #ede9fe;
  color: #6d28d9;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
}
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 22px;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-size: 13px;
}
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 18px; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 10px 14px; }
.article-content th { background: var(--bg); font-weight: 700; font-family: 'Unbounded', sans-serif; font-size: 12px; letter-spacing: -.01em; }
.article-content img { border-radius: 12px; margin: 24px 0; max-width: 100%; }

/* Навигация пред/след */
.article-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 52px; padding-top: 32px;
  border-top: 1px solid var(--border);
}
.article-nav-item {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; transition: all .15s;
}
.article-nav-item:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); text-decoration: none; }
.article-nav-item.next { text-align: right; }
.nav-label { font-size: 11px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-family: 'Unbounded', sans-serif; }
.nav-title { font-size: 14px; color: var(--text); font-weight: 600; line-height: 1.4; }

/* CTA */
.article-cta {
  margin-top: 44px;
  background: linear-gradient(135deg, rgba(124,58,237,.06) 0%, rgba(59,130,246,.08) 100%);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}
.article-cta p {
  font-family: 'Unbounded', sans-serif;
  font-size: 16px; font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1.4;
}
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  transition: all .15s;
  letter-spacing: -.01em;
}
.cta-btn:hover { background: var(--accent-dark); text-decoration: none; transform: translateY(-1px); }
.cta-btn-outline {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}
.cta-btn-outline:hover { background: var(--accent); color: #fff; }

/* ─── FOOTER ─── */
.site-footer {
  background: #0f172a;
  color: rgba(255,255,255,.6);
  padding: 20px 24px;
  margin-top: 60px;
  font-size: 12px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center;
  justify-content: center;
}
.footer-inner span { color: rgba(255,255,255,.4); }

/* ─── ADMIN ─── */
.admin-body { background: #f1f5f9; font-family: 'Golos Text', system-ui, sans-serif; }
.admin-header { background: #0f172a; padding: 0 24px; height: 54px; display: flex; align-items: center; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1100px; margin: 0 auto; }
.admin-header .logo { color: #fff; font-family: 'Unbounded', sans-serif; font-size: 14px; letter-spacing: -.02em; }
.admin-header .logo span { color: var(--accent); }
.admin-nav { display: flex; align-items: center; gap: 10px; }
.admin-nav a { color: rgba(255,255,255,.6); text-decoration: none; font-size: 13px; }
.admin-nav a:hover { color: #fff; }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 32px 24px 60px; }
.admin-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-title-row h1 { font-size: 22px; font-weight: 700; color: #0f172a; font-family: 'Unbounded', sans-serif; letter-spacing: -.03em; }

.status-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 6px 16px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #64748b; text-decoration: none; font-size: 13px; font-weight: 600; transition: all .15s; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.admin-table-wrap { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; border-bottom: 1px solid #e2e8f0; font-family: 'Unbounded', sans-serif; }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #374151; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbff; }
.article-link-admin { color: #0f172a; font-weight: 600; text-decoration: none; }
.article-link-admin:hover { color: var(--accent); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
code { background: #ede9fe; padding: 2px 6px; border-radius: 4px; font-size: 11px; color: #6d28d9; font-family: monospace; }
.status-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-published { background: #dbeafe; color: #1d4ed8; }
.status-draft { background: #fef3c7; color: #92400e; }

/* Кнопки */
.btn { padding: 7px 16px; border-radius: 8px; border: 1px solid #e2e8f0; background: #fff; color: #374151; font-family: 'Golos Text', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; line-height: 1; }
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-success { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.btn-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.btn-danger { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.btn-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 12px; }

/* Форма */
.edit-form { max-width: 900px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.field { margin-bottom: 16px; }
.field-large { flex: 1; }
label { display: block; font-size: 12px; font-weight: 700; color: #64748b; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; font-family: 'Unbounded', sans-serif; }
input[type=text], input[type=datetime-local], input[type=password], select, textarea { width: 100%; padding: 9px 13px; border: 1px solid #e2e8f0; border-radius: 9px; font-family: 'Golos Text', sans-serif; font-size: 13px; color: #0f172a; background: #fff; transition: border-color .15s; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
textarea { resize: vertical; }
#content { font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6; min-height: 400px; }
.seo-block { background: #f8faff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.seo-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; margin-bottom: 14px; font-family: 'Unbounded', sans-serif; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; }

/* Алерты */
.alert { padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dbeafe; color: #1d4ed8; border: 1px solid #93c5fd; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-box { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 18px; font-weight: 700; margin-bottom: 24px; text-align: center; font-family: 'Unbounded', sans-serif; letter-spacing: -.03em; color: var(--text); }

/* ─── RESPONSIVE ─── */
@media (max-width: 640px) {
  .article-main { padding: 20px 16px 60px; }
  .article-full-header h1 { font-size: 22px; }
  .article-nav { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .admin-title-row { flex-direction: column; align-items: flex-start; }
  .actions { flex-wrap: wrap; }
  .cta-buttons { flex-direction: column; }
}
