/*
Theme Name: Kalashnikov Roman Theme
Description: Финансовый портал (Договоры займа, МФО).
Version: 1.0
*/

:root {
    --primary: #111827;
    --secondary: #f3f4f6;
    --text: #374151;
    --border: #e5e7eb;
    --accent: #d97706;
    --section-pad: clamp(4rem, 8vw, 8rem);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

* { 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: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: 0.3s; }

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

/* Header N-C (Hamburger always) */
.site-header { background: transparent; position: absolute; top: 0; left: 0; width: 100%; z-index: 1000; padding: 2rem 0; }
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }

.main-nav { display: block; position: fixed; top: 0; right: 0; width: clamp(300px, 40vw, 400px); height: 100vh; background: var(--primary); z-index: 2000; transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1); visibility: hidden; padding: 6rem 2rem 2rem; border-left: 5px solid var(--accent); }
body.menu-open .main-nav { transform: translateX(0); visibility: visible; }
.main-nav ul { display: flex; flex-direction: column; list-style: none; gap: 2rem; margin: 0; padding: 0; }
.main-nav a { font-weight: 600; font-size: 1.5rem; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.main-nav a:hover { color: var(--accent); }

.nav-toggle { display: block; flex-shrink: 0; z-index: 2100; background: none; border: none; width: 40px; height: 24px; position: relative; cursor: pointer; }
.hamburger, .hamburger::before, .hamburger::after { content: ''; display: block; width: 100%; height: 3px; background: #fff; position: absolute; transition: 0.3s; }
.hamburger { top: 50%; transform: translateY(-50%); }
.hamburger::before { top: -10px; }
.hamburger::after { bottom: -10px; }
body.menu-open .hamburger { background: transparent; }
body.menu-open .hamburger::before { top: 0; transform: rotate(45deg); background: #fff; }
body.menu-open .hamburger::after { bottom: 0; transform: rotate(-45deg); background: #fff; }

@media (max-width: 768px) {
    .site-header { padding: 1rem 0; }
    .main-nav { width: 100%; }
}

/* Hero H-A (Full Bleed Overlay) */
.hero-section { position: relative; min-height: 80vh; display: flex; align-items: center; padding: var(--section-pad) 0; color: #fff; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, rgba(17,24,39,0.9) 0%, rgba(17,24,39,0.5) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 800px; border-left: 8px solid var(--accent); padding-left: 2rem; }
.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; text-shadow: 2px 2px 4px rgba(0,0,0,0.5); }
.hero-content p { font-size: clamp(1.1rem, 2vw, 1.5rem); text-shadow: 1px 1px 3px rgba(0,0,0,0.5); font-weight: 300; }

/* Features F-F (Number counters) */
.stats-section { padding: var(--section-pad) 0; background: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; text-align: center; }
.stat-item { position: relative; padding-top: 2rem; }
.stat-item::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 50px; height: 4px; background: var(--accent); }
.stat-item h4 { font-size: clamp(3rem, 6vw, 4.5rem); color: var(--primary); line-height: 1; font-weight: 800; margin-bottom: 1rem; }
.stat-item p { font-size: 1.1rem; color: var(--text); font-weight: 500; }
@media (max-width: 768px) { .stats-grid { grid-template-columns: 1fr; gap: 4rem; } }

/* Unique Block U-F (Text manifesto) */
.manifesto-section { padding: var(--section-pad) 0; background: var(--secondary); }
.manifesto-inner { max-width: 800px; margin: 0 auto; border-left: 5px solid var(--accent); padding-left: 3rem; }
.manifesto-inner h2 { font-size: clamp(2rem, 4vw, 3rem); color: var(--primary); margin-bottom: 2rem; font-weight: 800; }
.manifesto-inner p { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--text); }
@media (max-width: 768px) { .manifesto-inner { padding-left: 1.5rem; } }

/* Posts Grid C-E (Numbered cards) & V-A (Soft shadows) */
.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: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; counter-reset: post-counter; }
.post-card { display: flex; flex-direction: column; height: 100%; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; transition: 0.3s; position: relative; border-top: 4px solid transparent; }
.post-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); border-top-color: var(--accent); }
.post-card::before { counter-increment: post-counter; content: "0" counter(post-counter); position: absolute; top: 1rem; right: 1.5rem; font-size: 3rem; font-weight: 900; color: rgba(0,0,0,0.05); z-index: 1; pointer-events: none; }
.post-card .thumb { height: 200px; overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { padding: 2rem; display: flex; flex-direction: column; flex-grow: 1; position: relative; z-index: 2; }
.post-card-content h3 { font-size: 1.3rem; margin-bottom: 1.5rem; flex-grow: 1; word-break: break-word; color: var(--primary); font-weight: 700; line-height: 1.4; }
.btn-read { display: inline-block; font-weight: 600; color: var(--accent); text-transform: uppercase; font-size: 0.9rem; letter-spacing: 1px; }

@media (max-width: 1024px) { .posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) { .posts-grid { grid-template-columns: minmax(0, 1fr); } }

.all-posts-action { text-align: center; margin-top: 4rem; }
.btn-primary { display: inline-block; padding: 1rem 2.5rem; background: var(--primary); color: #fff; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border-radius: 6px; transition: 0.3s; }
.btn-primary:hover { background: var(--accent); 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: 45px; height: 45px; padding: 0 8px; text-decoration: none; font-weight: 600; background: var(--secondary); color: var(--text); border-radius: 6px; transition: 0.3s; }
.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(--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: 12px; overflow: hidden; box-shadow: var(--shadow); }
.single-header { margin-bottom: 3rem; border-left: 5px solid var(--accent); padding-left: 2rem; }
.single-header h1 { font-size: clamp(2rem, 5vw, 3.5rem); margin-bottom: 1rem; word-break: break-word; color: var(--primary); font-weight: 800; line-height: 1.2; }
.post-meta { color: #6b7280; 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; box-shadow: var(--shadow); 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; }

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