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

:root {
    --primary: #1e293b;
    --secondary: #f8fafc;
    --text: #334155;
    --border: #e2e8f0;
    --accent: #0ea5e9;
    --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);
}

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

.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* Header N-A (Classic horizontal) */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; z-index: 1000; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: clamp(1rem, 5vw, 4rem); min-height: 80px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; color: var(--primary); min-height: 1em; min-width: 100px; white-space: nowrap; flex-shrink: 0; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }

.main-nav { flex: 1; min-width: 0; overflow: hidden; display: flex; justify-content: flex-end; }
.main-nav ul { display: flex; list-style: none; gap: 2.5rem; margin: 0; padding: 0; }
.main-nav a { font-weight: 500; font-size: 1.05rem; color: var(--primary); white-space: normal; overflow-wrap: break-word; }
.main-nav a:hover { color: var(--accent); }

.nav-toggle { display: none; 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; border-radius: 2px; }
.hamburger { top: 50%; transform: translateY(-50%); }
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

@media (max-width: 1024px) {
    .main-nav ul { gap: 1.5rem; }
}
@media (max-width: 768px) {
    .header-inner { gap: 1rem; }
    .nav-toggle { display: block; }
    .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; border-bottom: 1px solid var(--border); }
    body.menu-open .main-nav { transform: translateY(0); visibility: visible; }
    .main-nav ul { flex-direction: column; padding: 20px; gap: 1.5rem; align-items: center; }
    .main-nav a { display: block; font-size: 1.3rem; }
}

/* Hero H-B (Split-screen 50/50) */
.hero-section { display: flex; background: var(--secondary); }
.hero-content-wrap { flex: 1; padding: var(--section-pad) 5%; display: flex; flex-direction: column; justify-content: center; }
.hero-content h1 { font-size: clamp(2rem, 5vw, 4rem); margin-bottom: 1.5rem; word-break: break-word; line-height: 1.1; font-weight: 800; color: var(--primary); letter-spacing: -1px; }
.hero-content p { font-size: 1.2rem; font-weight: 400; color: var(--text); }
.hero-image-wrap { flex: 1; min-height: 400px; position: relative; overflow: hidden; }
.hero-image-wrap img { position: absolute; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

@media (max-width: 768px) {
    .hero-section { flex-direction: column; }
    .hero-image-wrap { min-height: 300px; }
}

/* Features F-B (Cards in grid) */
.features-section { padding: var(--section-pad) 0; background: #fff; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 2rem; }
.feature-card { padding: 2.5rem; background: var(--secondary); border-radius: 12px; transition: 0.3s; }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.feature-card h3 { font-size: 1.4rem; margin-bottom: 1rem; font-weight: 700; color: var(--primary); }
.feature-card p { font-size: 1.05rem; }

/* Unique Block U-B (Method + Visual) */
.method-section { padding: var(--section-pad) 0; background: var(--primary); color: #fff; }
.method-section h2 { color: #fff; margin-bottom: 3rem; text-align: center; font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.method-text p { margin-bottom: 1.5rem; font-size: 1.15rem; opacity: 0.9; }
.method-visual { background: rgba(255,255,255,0.05); padding: 3rem; border-radius: 16px; text-align: center; border: 1px solid rgba(255,255,255,0.1); }
.method-visual h3 { color: var(--accent); font-size: 3rem; margin-bottom: 1rem; font-weight: 800; }
.method-visual p { font-size: 1.2rem; font-weight: 500; }
@media (max-width: 768px) { .method-grid { grid-template-columns: 1fr; } }

/* Posts Grid C-F (Timeline) & V-A (Soft shadows) */
.posts-section { padding: var(--section-pad) 0; background: var(--secondary); }
.section-title { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 4rem; text-align: center; font-weight: 800; color: var(--primary); }
.posts-grid { position: relative; max-width: 800px; margin: 0 auto; }
.posts-grid::before { content: ''; position: absolute; top: 0; bottom: 0; left: 30px; width: 2px; background: var(--border); z-index: 1; }
.post-card { position: relative; margin-bottom: 3rem; padding-left: 80px; z-index: 2; }
.post-card::before { content: ''; position: absolute; top: 0; left: 21px; width: 20px; height: 20px; background: var(--accent); border-radius: 50%; border: 4px solid var(--secondary); box-shadow: 0 0 0 2px var(--border); }
.post-card-inner { background: #fff; border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; transition: 0.3s; }
.post-card-inner:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.post-card .thumb { height: 200px; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px 16px 0 0; }
.post-card-content { padding: 2rem; }
.post-card-content h3 { font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--primary); font-weight: 700; line-height: 1.3; word-break: break-word; }
.btn-read { display: inline-block; font-weight: 600; color: var(--accent); font-size: 0.95rem; }
.btn-read::after { content: ' →'; transition: 0.2s; }
.btn-read:hover::after { margin-left: 5px; }

@media (max-width: 768px) {
    .posts-grid::before { left: 20px; }
    .post-card { padding-left: 60px; }
    .post-card::before { left: 11px; }
}

.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: 4rem 0; flex-wrap: wrap; }
.pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; text-decoration: none; font-weight: 600; background: #fff; color: var(--primary); border-radius: 8px; transition: 0.3s; box-shadow: var(--shadow); }
.pagination .page-numbers.current { background: var(--accent); color: #fff; }
.pagination .page-numbers.dots { background: transparent; cursor: default; box-shadow: none; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--primary); color: #fff; }

/* 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; color: var(--primary); font-weight: 800; line-height: 1.2; letter-spacing: -1px; }
.post-meta { color: #64748b; font-size: 0.95rem; 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; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.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-C (Three-column) */
.site-footer { background: #fff; color: var(--text); padding: var(--section-pad) 0; margin-top: auto; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.footer-logo { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; overflow-wrap: anywhere; margin-bottom: 1.5rem; color: var(--primary); letter-spacing: -0.5px; }
.footer-desc { max-width: 100%; overflow-wrap: break-word; font-size: 0.95rem; color: #64748b; }
.footer-col h4 { font-size: 1.1rem; margin-bottom: 1.5rem; color: var(--primary); font-weight: 700; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.8rem; }
.footer-col a { color: #64748b; font-weight: 500; }
.footer-col a:hover { color: var(--accent); }
.footer-contacts p { margin-bottom: 0.8rem; max-width: 100%; overflow-wrap: break-word; font-size: 0.95rem; color: #64748b; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
}
