/* bumagi.online — Blog Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #16A34A;
  --green-light: #DCFCE7;
  --green-dark: #14532D;
  --text: #111827;
  --text-2: #6B7280;
  --border: #E5E7EB;
  --bg: #F9FAFB;
  --white: #fff;
  --red: #EF4444;
  --blue: #2563EB;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

body { font-family: 'Manrope', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

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

/* ─── HEADER ─── */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); height: 52px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.logo { font-size: 17px; font-weight: 700; color: var(--green); text-decoration: none; }
.logo span { color: var(--text); }
nav { display: flex; gap: 4px; }
nav a { padding: 5px 12px; border-radius: 6px; color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500; transition: all .15s; }
nav a:hover, nav a.active { background: var(--green-light); color: var(--green-dark); }

/* ─── BLOG LIST ─── */
.blog-main { padding: 40px 24px 80px; }
.blog-header { margin-bottom: 28px; }
.blog-header h1 { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 6px; }
.blog-header p { color: var(--text-2); }

.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.cat-btn { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500; transition: all .15s; background: var(--white); }
.cat-btn:hover, .cat-btn.active { background: var(--green); border-color: var(--green); color: white; }

.articles-list { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }

.article-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 24px; box-shadow: var(--shadow); transition: box-shadow .15s; }
.article-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.article-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.article-cat { font-size: 12px; font-weight: 600; color: var(--green-dark); background: var(--green-light); padding: 2px 10px; border-radius: 20px; text-decoration: none; }
.article-cat:hover { background: var(--green); color: white; }
.article-date { font-size: 12px; color: var(--text-2); }
.article-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.02em; }
.article-title a { color: var(--text); text-decoration: none; }
.article-title a:hover { color: var(--green); }
.article-excerpt { color: var(--text-2); font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
.article-link { font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; }
.article-link:hover { text-decoration: underline; }

.no-articles { color: var(--text-2); padding: 40px 0; text-align: center; }

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

/* ─── ARTICLE PAGE ─── */
.article-main { max-width: 760px; padding: 32px 24px 80px; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); margin-bottom: 28px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--text-2); text-decoration: none; }
.breadcrumbs a:hover { color: var(--green); }

.article-full-header { margin-bottom: 32px; }
.article-full-header h1 { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 12px 0; line-height: 1.3; }
.article-lead { font-size: 17px; color: var(--text-2); line-height: 1.6; margin-top: 12px; }

/* Контент статьи */
.article-content { font-size: 16px; line-height: 1.75; color: #1f2937; }
.article-content h2 { font-size: 22px; font-weight: 700; margin: 32px 0 14px; letter-spacing: -.02em; color: var(--text); }
.article-content h3 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 0 0 16px 24px; }
.article-content li { margin-bottom: 6px; }
.article-content a { color: var(--green); text-decoration: underline; }
.article-content a:hover { color: var(--green-dark); }
.article-content strong { font-weight: 700; }
.article-content blockquote { border-left: 3px solid var(--green); padding: 12px 16px; background: var(--bg); border-radius: 0 8px 8px 0; margin: 20px 0; font-style: italic; color: var(--text-2); }
.article-content code { background: #F3F4F6; padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: monospace; }
.article-content pre { background: #1f2937; color: #f9fafb; padding: 20px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; }
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 12px; font-size: 14px; }
.article-content th { background: var(--bg); font-weight: 700; }

/* Навигация между статьями */
.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
.article-nav-item { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--white); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; transition: all .15s; }
.article-nav-item:hover { border-color: var(--green); }
.article-nav-item.next { text-align: right; }
.nav-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.nav-title { font-size: 14px; color: var(--text); font-weight: 600; line-height: 1.4; }

/* CTA блок */
.article-cta { margin-top: 40px; background: var(--green-light); border-radius: 12px; padding: 28px; text-align: center; }
.article-cta p { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: var(--green-dark); }
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-btn { padding: 10px 24px; background: var(--green); color: white; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 14px; transition: all .15s; }
.cta-btn:hover { background: var(--green-dark); }
.cta-btn-outline { background: white; color: var(--green); border: 1px solid var(--green); }
.cta-btn-outline:hover { background: var(--green); color: white; }

/* ─── FOOTER ─── */
.site-footer { background: #14532D; color: rgba(255,255,255,.85); padding: 18px 24px; margin-top: 60px; font-size: 12px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer a { color: #86EFAC; text-decoration: none; font-weight: 600; }
.site-footer a:hover { text-decoration: underline; }
.footer-meta { color: rgba(255,255,255,.5); }

/* ─── ADMIN ─── */
.admin-body { background: #F3F4F6; }
.admin-header { background: #1f2937; padding: 0 24px; height: 52px; display: flex; align-items: center; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.admin-header .logo { color: #4ade80; }
.admin-header .logo span { color: white; }
.admin-nav { display: flex; align-items: center; gap: 10px; }
.admin-nav a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px; }
.admin-nav a:hover { color: white; }
.admin-main { 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; }

.status-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn { padding: 5px 14px; border-radius: 6px; border: 1px solid var(--border); background: white; color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.filter-btn.active { background: var(--green); border-color: var(--green); color: white; }

.admin-table-wrap { background: white; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { background: #F9FAFB; padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-2); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FAFAFA; }
.article-link-admin { color: var(--text); font-weight: 600; text-decoration: none; }
.article-link-admin:hover { color: var(--green); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
code { background: #F3F4F6; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: #374151; }

.status-badge { padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.status-published { background: var(--green-light); color: var(--green-dark); }
.status-draft { background: #FEF3C7; color: #92400E; }

/* Кнопки */
.btn { padding: 6px 14px; border-radius: 7px; border: 1px solid var(--border); background: white; color: var(--text); font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--green); border-color: var(--green); color: white; }
.btn-primary:hover { background: #15803D; }
.btn-success { background: var(--green-light); border-color: #86EFAC; color: var(--green-dark); }
.btn-warning { background: #FEF3C7; border-color: #FCD34D; color: #92400E; }
.btn-danger { background: #FEE2E2; border-color: #FECACA; color: var(--red); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; padding: 11px; }

/* Форма редактирования */
.edit-form { max-width: 900px; }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; margin-bottom: 0; }
.field { margin-bottom: 16px; }
.field-large { flex: 1; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type=text], input[type=datetime-local], input[type=password], select, textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'Manrope', sans-serif; font-size: 13px; color: var(--text); background: white;
  transition: border-color .15s; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.08); }
textarea { resize: vertical; }
#content { font-family: 'Courier New', monospace; font-size: 13px; line-height: 1.6; min-height: 400px; }

.seo-block { background: #F9FAFB; border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 20px; }
.seo-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); margin-bottom: 14px; }
.form-actions { display: flex; gap: 12px; padding-top: 8px; }

/* Алерты */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; font-weight: 500; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #86EFAC; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-box { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 36px; width: 100%; max-width: 380px; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
.login-box h1 { font-size: 20px; font-weight: 700; margin-bottom: 24px; text-align: center; }

/* ─── 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; }
}
