/* === /css/style.css === */

/* 1. Базовые настройки и шрифты */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8fafc;
    color: #334155;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: color 0.15s; }
a:hover { color: #2563eb; }

/* 2. Шапка сайта */
.header { background: #ffffff; border-bottom: 1px solid #e2e8f0; height: 64px; display: flex; align-items: center; }
.header-inner { max-width: 1152px; margin: 0 auto; padding: 0 24px; width: 100%; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 20px; font-weight: 700; color: #0f172a; letter-spacing: -0.02em; }
.nav { display: flex; gap: 24px; font-size: 14px; font-weight: 500; color: #475569; }

/* 3. Основной контейнер и сетка */
.container { max-width: 1152px; margin: 0 auto; padding: 32px 24px; display: grid; grid-template-columns: 280px 1fr; gap: 40px; }

/* 4. Сайдбар */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.author-card { background: #ffffff; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.author-avatar { width: 64px; height: 64px; background: #e2e8f0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; }
.author-name { font-weight: 700; color: #0f172a; margin-bottom: 4px; letter-spacing: -0.01em; }
.author-bio { font-size: 14px; color: #64748b; line-height: 1.6; }

.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; margin-bottom: 12px; }
.categories { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.categories a { display: flex; align-items: center; font-size: 14px; color: #475569; padding: 4px 0; }
.categories .dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; margin-right: 10px; transition: background 0.15s; }
.categories a:hover .dot, .categories a.active .dot { background: #2563eb; }
.categories a:hover, .categories a.active { color: #2563eb; font-weight: 500; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 12px; background: #f1f5f9; color: #475569; font-size: 12px; border-radius: 999px; }
.tag:hover { background: #2563eb; color: #ffffff; }

/* 5. Статьи и типографика */
.breadcrumbs { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.breadcrumbs span { margin: 0 8px; color: #cbd5e1; }

.article-header { margin-bottom: 32px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge { padding: 4px 12px; font-size: 12px; font-weight: 600; border-radius: 999px; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }

.article-title { font-size: 40px; font-weight: 800; color: #0f172a; line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.025em; }
.meta { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; color: #64748b; }

.prose { font-size: 17px; color: #334155; }
.prose p { margin-bottom: 1.25em; }
.prose h2 { font-size: 24px; font-weight: 700; color: #0f172a; margin-top: 2em; margin-bottom: 0.75em; letter-spacing: -0.02em; line-height: 1.3; }
.prose h3 { font-size: 20px; font-weight: 600; color: #0f172a; margin-top: 1.5em; margin-bottom: 0.5em; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.25em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: #0f172a; font-weight: 600; }
.prose blockquote { border-left: 4px solid #2563eb; padding: 4px 0 4px 16px; color: #475569; font-style: italic; margin: 1.5em 0; }
.prose code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #be185d; font-family: "SF Mono", Monaco, Consolas, monospace; }

.lead { font-size: 19px; color: #475569; font-weight: 500; border-left: 4px solid #2563eb; padding: 4px 0 4px 16px; margin-bottom: 2em; line-height: 1.6; }
.callout { background: #fef2f2; border-left: 4px solid #f87171; padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0; }
.callout strong { color: #991b1b; }
.callout p { color: #7f1d1d; font-size: 15px; margin: 0; }

/* 6. Главная страница (список статей) */
.page-title { font-size: 32px; font-weight: 800; color: #0f172a; margin-bottom: 32px; letter-spacing: -0.02em; }
.article-card { display: block; background: #ffffff; padding: 24px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 16px; transition: all 0.15s; }
.article-card:hover { border-color: #2563eb; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08); transform: translateY(-2px); }
.article-card-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #64748b; margin-bottom: 8px; }
.article-card-title { font-size: 22px; font-weight: 700; color: #0f172a; margin-bottom: 8px; letter-spacing: -0.01em; }
.article-card:hover .article-card-title { color: #2563eb; }
.article-card-desc { font-size: 15px; color: #475569; line-height: 1.6; }

/* 7. Админка */
.admin-container { max-width: 1000px; margin: 0 auto; padding: 24px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-header h1 { font-size: 24px; font-weight: 700; color: #0f172a; margin: 0; }
.form-card { background: white; padding: 32px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #0f172a; }
.form-group input, .form-group textarea, .form-group select { 
    width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; 
    font-size: 15px; font-family: inherit; transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-group small { display: block; margin-top: 6px; color: #64748b; font-size: 13px; }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input { width: 18px; height: 18px; cursor: pointer; }
.btn { padding: 10px 20px; border: none; border-radius: 6px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; transition: background 0.15s; }
.btn-primary { background: #2563eb; color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.upload-area { border: 2px dashed #cbd5e1; border-radius: 8px; padding: 24px; text-align: center; cursor: pointer; transition: all 0.15s; color: #64748b; }
.upload-area:hover { border-color: #2563eb; background: #f8fafc; color: #2563eb; }
.preview-image { max-width: 100%; height: auto; margin-top: 12px; border-radius: 8px; border: 1px solid #e2e8f0; }
.success { background: #dcfce7; color: #166534; padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; border: 1px solid #bbf7d0; }

/* Таблица в админке */
.articles-table { background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 13px; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 16px; border-top: 1px solid #e2e8f0; }
.status { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-published { background: #dcfce7; color: #166534; }
.status-draft { background: #fef3c7; color: #92400e; }
.actions { display: flex; gap: 8px; }

/* 8. Подвал */
.footer { background: #ffffff; border-top: 1px solid #e2e8f0; padding: 32px 24px; text-align: center; font-size: 14px; color: #64748b; margin-top: 64px; }

/* 9. Адаптивность */
@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; }
    .article-title { font-size: 30px; }
    .nav { display: none; }
    .form-row { grid-template-columns: 1fr; }
}