/*
Theme Name: Direct Budget Theme
Theme URI: https://direct-budget.ru
Description: Кастомная тема для раздела новостей и публикаций, наследующая дизайн основного лендинга Direct Budget
Version: 1.0
Author: Direct Budget Team
Author URI: https://direct-budget.ru
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: direct-budget
*/

/* ==========================================================================
   Директ Бюджет — тема WordPress для раздела публикаций
   Наследует дизайн основного лендинга direct-budget.ru
   ========================================================================== */

:root {
    --primary: #2b5cd9;
    --primary-dark: #1f45ad;
    --primary-soft: #eef3ff;
    --accent: #ffb020;
    --accent-soft: #fff6e6;
    --success: #12a150;
    --success-soft: #ecfdf3;
    --danger: #d92d20;
    --danger-soft: #fef3f2;

    --bg: #ffffff;
    --bg-alt: #f6f8fc;
    --border: #e4e8f0;
    --border-strong: #d3d9e5;
    --text: #16203a;
    --muted: #5f6a80;

    --radius: 14px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px rgba(21, 33, 63, .06);
    --shadow-md: 0 6px 24px rgba(21, 33, 63, .08);
    --shadow-lg: 0 18px 48px rgba(21, 33, 63, .12);
    --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 14px; letter-spacing: -.02em; line-height: 1.22; }
h1 { font-size: 44px; font-weight: 800; }
h2 { font-size: 32px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
h4 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 7px; }

img { max-width: 100%; height: auto; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: 84px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head { max-width: 660px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); font-size: 17px; margin-bottom: 0; }

/* --------------------------------------------------------------- Логотип */

.logo { display: inline-flex; align-items: center; gap: 11px; }
.logo:hover { text-decoration: none; }
.logo-mark { display: block; flex: none; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name { font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.02em; white-space: nowrap; }
.logo-site { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }

/* ---------------------------------------------------------------- Кнопки */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background .16s, border-color .16s, box-shadow .16s, transform .06s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(43, 92, 217, .28);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: #f5f7fb; border-color: #c3cbdb; }

.btn-ghost { background: transparent; color: var(--text); padding: 12px 16px; }
.btn-ghost:hover { background: #f2f5fa; }

/* ----------------------------------------------------------------- Шапка */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 72px;
    flex-wrap: wrap;
}
.site-nav { display: flex; gap: 2px; margin-right: auto; flex-wrap: wrap; }
.site-nav a {
    padding: 8px 10px;
    border-radius: 8px;
    color: #46516b;
    font-size: 14.5px;
    font-weight: 500;
}
.site-nav a:hover { background: #f2f5fa; color: var(--text); text-decoration: none; }
.site-nav a.current { color: var(--primary); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.header-actions .btn { padding: 11px 18px; }
.site-header .btn-ghost { padding: 11px 12px; }

/* --------------------------------------------------------------- Подвал */

.site-footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 56px 0 34px;
    font-size: 14.5px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.5fr 1fr;
    gap: 34px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--border);
}
.footer-col { display: flex; flex-direction: column; gap: 9px; align-items: flex-start; }
.footer-col h4 { color: var(--text); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.footer-col a { color: var(--muted); font-size: 14.5px; }
.footer-col a:hover { color: var(--primary); }
.footer-note { color: var(--muted); font-size: 14px; margin: 14px 0 0; max-width: 300px; }
.footer-legal { padding-top: 26px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.footer-legal p { margin-bottom: 10px; }
.footer-copy { color: #8b93a5; font-size: 12.5px; }

/* --------------------------------------------------------- Контент блога */

.blog-header {
    padding: 64px 0 48px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.blog-header h1 {
    text-align: center;
    font-size: 42px;
    margin-bottom: 12px;
}

.blog-header .lead {
    text-align: center;
    font-size: 18px;
    color: var(--muted);
    max-width: 640px;
    margin: 0 auto;
}

.blog-content {
    padding: 64px 0;
}

/* Сетка постов */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 48px;
}

.post-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.post-card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 12px;
}

.post-card-category {
    color: var(--primary);
    font-weight: 600;
}

.post-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text);
}

.post-card h2 a:hover {
    color: var(--primary);
    text-decoration: none;
}

.post-card-excerpt {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.55;
    margin-bottom: 16px;
    flex: 1;
}

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.post-card-author {
    font-size: 14px;
    color: var(--muted);
}

.post-card-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    background: #fff;
}

.pagination a:hover {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}

.pagination .current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Одиночный пост */
.single-post {
    padding: 0px 0;
}

.single-post .container {
    max-width: var(--container);
}

.post-header {
    max-width: 780px;
    margin: 0 auto 48px;
    text-align: center;
}

.post-header h1 {
    font-size: 44px;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 15px;
    color: var(--muted);
}

.post-meta-category {
    color: var(--primary);
    font-weight: 600;
}

.post-featured-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 48px;
}

.post-content {
    max-width: 780px;
    margin: 0 auto;
}

.post-content p {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.post-content h2 {
    font-size: 28px;
    margin-top: 48px;
    margin-bottom: 20px;
}

.post-content h3 {
    font-size: 22px;
    margin-top: 36px;
    margin-bottom: 16px;
}

.post-content img {
    border-radius: var(--radius-sm);
    margin: 32px 0;
}

.post-content ul,
.post-content ol {
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 24px;
    padding-left: 28px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 20px 24px;
    margin: 32px 0;
    background: var(--bg-alt);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 17px;
    color: var(--text);
}

.post-content code {
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 15px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    margin: 32px 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

/* -------------------------------------------------------------- Адаптив */

@media (max-width: 980px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    body { font-size: 15.5px; }
    h1 { font-size: 32px; }
    h2 { font-size: 25px; }
    .section { padding: 58px 0; }
    .container { padding: 0 18px; }
    
    .header-inner {
        min-height: 0;
        gap: 10px;
        padding-top: 11px;
        padding-bottom: 11px;
        flex-wrap: nowrap;
    }
    .site-nav { display: none; }
    .header-actions { gap: 4px; margin-left: auto; }
    .header-actions .btn {
        padding: 8px 13px;
        font-size: 13.5px;
        border-radius: 8px;
    }
    .header-actions .btn-ghost { padding: 8px 10px; }
    .logo { gap: 9px; }
    .logo-mark { width: 32px; height: 32px; }
    .logo-name { font-size: 15px; }
    .logo-site { font-size: 10.5px; }
    
    .posts-grid { grid-template-columns: 1fr; gap: 22px; }
    .footer-grid { grid-template-columns: 1fr; gap: 26px; }
    
    .blog-header h1 { font-size: 32px; }
    .blog-header .lead { font-size: 16px; }
    
    .post-header h1 { font-size: 32px; }
    .post-content p { font-size: 16px; }
    .post-content h2 { font-size: 24px; }
    .post-content h3 { font-size: 20px; }
}

@media (max-width: 400px) {
    .header-actions .btn-ghost { display: none; }
    .logo-text { display: none; }
    .header-actions .btn { padding: 8px 12px; }
}
