/*
Theme Name: Kubgr Theme
Description: Финансовый портал для бизнеса и стартапов (МФО, кредиты).
Version: 1.0
*/

:root {
    --primary: #1a365d;
    --secondary: #f8fafc;
    --text: #334155;
    --border: #e2e8f0;
    --accent: #2563eb;
    --section-pad: clamp(4rem, 8vw, 8rem);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --sidebar-w: 280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; color: var(--text); line-height: 1.7; overflow-x: hidden; background: #ffffff; }
img { max-width: 100%; height: auto; display: block; border-radius: 12px; }
a { color: var(--accent); text-decoration: none; transition: 0.3s; }

/* Layout N-B (Fixed Sidebar) */
.site-wrapper { display: flex; min-height: 100vh; }
.site-header { width: var(--sidebar-w); position: fixed; top: 0; left: 0; height: 100vh; background: var(--secondary); border-right: 1px solid var(--border); padding: 3rem 2rem; display: flex; flex-direction: column; overflow-y: auto; z-index: 1000; overflow-x: hidden; }
.site-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; width: calc(100% - var(--sidebar-w)); }

.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 2rem; }

/* Header Elements */
.logo { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; color: var(--primary); margin-bottom: 3rem; display: block; white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.logo span { color: var(--accent); }

.main-nav { flex: 1; min-width: 0; }
.main-nav ul { list-style: none; display: flex; flex-direction: column; gap: 1.5rem; }
.main-nav a { font-weight: 500; font-size: 1.1rem; color: var(--text); display: block; white-space: normal; overflow-wrap: break-word; }
.main-nav a:hover { color: var(--accent); transform: translateX(5px); }

.nav-toggle { display: none; }

/* Mobile Sidebar Reset */
@media (max-width: 1024px) {
    .site-wrapper { display: block; }
    .site-header { width: 100%; position: sticky; height: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 1rem 1.5rem; flex-direction: row; align-items: center; justify-content: space-between; overflow: visible; }
    .site-main { margin-left: 0 !important; width: 100% !important; }
    .logo { margin-bottom: 0; font-size: 1.5rem; }
    
    .nav-toggle { display: block; flex-shrink: 0; z-index: 2100; background: none; border: none; width: 30px; height: 20px; position: relative; cursor: pointer; }
    .hamburger, .hamburger::before, .hamburger::after { content: ''; display: block; width: 100%; height: 2px; background: var(--primary); position: absolute; transition: 0.3s; }
    .hamburger { top: 50%; transform: translateY(-50%); }
    .hamburger::before { top: -8px; }
    .hamburger::after { bottom: -8px; }
    
    .main-nav { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: #fff; z-index: 2000; transform: translateY(-100%); transition: transform 0.4s ease; visibility: hidden; padding-top: 80px; }
    body.menu-open .main-nav { transform: translateY(0); visibility: visible; }
    .main-nav ul { padding: 2rem; align-items: center; }
    .main-nav a { font-size: 1.3rem; }
}

/* Hero (H-C Type-Only) */
.hero-section { padding: clamp(6rem, 12vw, 10rem) 0; background: #fff; text-align: center; }
.hero-content h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 1.5rem; word-break: break-word; line-height: 1.1; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.hero-content p { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--text); max-width: 800px; margin: 0 auto; }

/* Features (F-A Horizontal stripes) */
.features-section { display: flex; flex-direction: column; }
.feature-strip { padding: 4rem 0; }
.feature-strip:nth-child(odd) { background: var(--secondary); }
.feature-strip:nth-child(even) { background: #fff; }
.feature-strip-inner { display: flex; align-items: center; gap: 3rem; }
.feature-strip h3 { font-size: 1.8rem; color: var(--primary); margin-bottom: 1rem; }
.feature-strip p { font-size: 1.1rem; }

/* Unique Block (U-A Quote) */
.quote-section { padding: var(--section-pad) 0; background: var(--primary); color: #fff; text-align: center; }
.quote-inner { max-width: 800px; margin: 0 auto; }
.quote-text { font-size: clamp(1.5rem, 4vw, 2.5rem); font-style: italic; font-weight: 300; line-height: 1.4; margin-bottom: 2rem; }
.quote-author { font-size: 1.1rem; font-weight: 600; color: var(--secondary); opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; }

/* Posts Grid (C-B Horizontal cards) */
.posts-section { padding: var(--section-pad) 0; background: #fff; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 4rem; text-align: center; font-weight: 800; color: var(--primary); }
.posts-grid { display: flex; flex-direction: column; gap: 2.5rem; }
.post-card { display: flex; background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; transition: 0.3s; align-items: center; }
.post-card:hover { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); transform: translateY(-3px); }
.post-card .thumb { width: 40%; height: 250px; flex-shrink: 0; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post-card-content { padding: 2.5rem; flex: 1; }
.post-card-content h3 { font-size: 1.4rem; margin-bottom: 1rem; font-weight: 700; color: var(--primary); line-height: 1.3; }
.btn-read { display: inline-block; font-weight: 600; color: var(--accent); margin-top: 1rem; }
.btn-read::after { content: ' →'; transition: 0.2s; }
.btn-read:hover::after { margin-left: 5px; }

@media (max-width: 768px) {
    .post-card { flex-direction: column; }
    .post-card .thumb { width: 100%; height: 200px; }
    .post-card-content { padding: 1.5rem; }
}

.all-posts-action { text-align: center; margin-top: 4rem; }
.btn-primary { display: inline-block; padding: 1rem 2.5rem; background: var(--accent); color: #fff; font-weight: 600; border-radius: 8px; transition: 0.3s; }
.btn-primary:hover { background: var(--primary); color: #fff; }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 0.5rem; margin: 5rem 0; flex-wrap: wrap; }
.pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 45px; height: 45px; padding: 0 8px; text-decoration: none; font-weight: 600; border-radius: 8px; color: var(--text); transition: 0.3s; background: var(--secondary); }
.pagination .page-numbers.current { background: var(--accent); color: #fff; }
.pagination .page-numbers.dots { background: transparent; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--border); }

/* Single Post */
.single-container { max-width: 800px; padding: var(--section-pad) 15px; margin: 0 auto; }
.single-thumb { margin-bottom: 3rem; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.single-header { margin-bottom: 3rem; text-align: center; }
.single-header h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1.5rem; word-break: break-word; font-weight: 800; color: var(--primary); line-height: 1.2; }
.post-meta { color: #64748b; font-size: 1rem; font-weight: 500; }
.post-content { line-height: 1.8; font-size: 1.15rem; color: var(--text); }
.post-content h2, .post-content h3 { margin-top: 3.5rem; margin-bottom: 1.5rem; word-break: break-word; color: var(--primary); font-weight: 700; }
.post-content p { margin-bottom: 1.5rem; }
.post-content ul, .post-content ol { margin-bottom: 1.5rem; padding-left: 2rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; border-radius: 8px; overflow: hidden; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 1rem; text-align: left; }
.post-content th { background: var(--secondary); font-weight: 600; color: var(--primary); }

/* Footer (FT-A Minimalist) */
.site-footer { background: #fff; border-top: 1px solid var(--border); padding: 3rem 0; margin-top: auto; text-align: center; }
.footer-logo { font-size: clamp(1.2rem, 3vw, 1.5rem); font-weight: 800; color: var(--primary); margin-bottom: 1rem; overflow-wrap: anywhere; }
.footer-desc { font-size: 0.95rem; color: #64748b; max-width: 600px; margin: 0 auto 2rem; overflow-wrap: break-word; }
.footer-contacts p { color: #64748b; font-size: 0.9rem; margin-bottom: 0.5rem; }
