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

:root {
    --primary: #2d3436;
    --secondary: #f1f5f9;
    --text: #475569;
    --border: #cbd5e1;
    --accent: #10b981;
    --section-pad: clamp(4rem, 8vw, 8rem);
    --white: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Playfair Display', serif; color: var(--text); line-height: 1.6; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; background: var(--white); }
h1, h2, h3, h4, h5, h6 { font-family: 'Roboto Condensed', sans-serif; color: var(--primary); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: 0.3s; }

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

/* Header N-D (Centered header) */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: relative; z-index: 1000; padding: 2rem 0 0; text-align: center; }
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.logo { display: inline-block; font-size: clamp(2rem, 5vw, 3rem); font-weight: 700; color: var(--primary); white-space: nowrap; font-family: 'Roboto Condensed', sans-serif; text-transform: uppercase; letter-spacing: 2px; }
.logo span { color: var(--accent); }

.main-nav { width: 100%; border-top: 1px solid var(--border); padding: 1rem 0; }
.main-nav ul { display: flex; list-style: none; gap: clamp(1.5rem, 3vw, 4rem); margin: 0; padding: 0; justify-content: center; }
.main-nav a { font-weight: 500; font-family: 'Roboto Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; font-size: 1.1rem; }
.main-nav a:hover { color: var(--accent); }

.nav-toggle { display: none; }

@media (max-width: 768px) {
    .site-header { padding: 1rem 0; }
    .header-inner { flex-direction: row; justify-content: space-between; padding: 0 15px; gap: 1rem; }
    .logo { font-size: 1.5rem; }
    .main-nav { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: var(--white); z-index: 2000; transform: translateY(-100%); transition: transform 0.4s ease; visibility: hidden; padding-top: 80px; border-top: none; }
    body.menu-open .main-nav { transform: translateY(0); visibility: visible; }
    .main-nav ul { flex-direction: column; padding: 20px; gap: 1.5rem; align-items: center; }
    
    .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; }
}

/* Hero H-D (Breakout / Asymmetric) */
.hero-section { padding: var(--section-pad) 0; background: var(--secondary); position: relative; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; position: relative; z-index: 2; }
.hero-content { padding-right: 2rem; }
.hero-content h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); margin-bottom: 1.5rem; word-break: break-word; line-height: 1.1; }
.hero-content p { font-size: 1.2rem; font-family: 'Playfair Display', serif; }
.hero-image-wrap { position: relative; z-index: 1; }
.hero-image-wrap img { width: 120%; max-width: none; transform: translateX(-10%); border-radius: 0; box-shadow: 0 20px 40px rgba(0,0,0,0.1); }

@media (max-width: 768px) {
    .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
    .hero-image-wrap img { width: 100%; transform: none; }
}

/* Diagonal Decor D-A */
.diagonal-section { position: relative; z-index: 1; }
.diagonal-section::before { content: ''; position: absolute; top: -50px; left: 0; width: 100%; height: 100px; background: inherit; transform: skewY(-3deg); z-index: -1; transform-origin: top left; }

/* Features F-C (Accordion) */
.features-section { padding: var(--section-pad) 0; background: var(--white); }
.accordion { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-header { width: 100%; text-align: left; padding: 2rem 0; background: none; border: none; font-size: 1.5rem; font-family: 'Roboto Condensed', sans-serif; font-weight: 700; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.accordion-header::after { content: '+'; font-size: 2rem; color: var(--accent); transition: transform 0.3s; }
.accordion-item.active .accordion-header::after { transform: rotate(45deg); }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.accordion-item.active .accordion-content { max-height: 500px; }
.accordion-content p { padding-bottom: 2rem; font-size: 1.1rem; }

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

/* Posts Grid C-C (Overlay cards) & V-C (Thin lines) */
.posts-section { padding: var(--section-pad) 0; background: var(--secondary); }
.section-title { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 3rem; text-align: center; font-weight: 700; }
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.post-card { position: relative; height: clamp(250px, 35vw, 400px); overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.post-card .thumb { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%); z-index: 2; pointer-events: none; }
.post-card-content { position: relative; z-index: 3; padding: 2rem; }
.post-card-content h3 { font-size: 1.4rem; margin-bottom: 1rem; color: var(--white); text-shadow: 2px 2px 4px rgba(0,0,0,0.5); word-break: break-word; }
.btn-read { display: inline-block; color: var(--accent); font-family: 'Roboto Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }

@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 3rem; border: 1px solid var(--primary); color: var(--primary); font-family: 'Roboto Condensed', sans-serif; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.btn-primary:hover { background: var(--primary); color: var(--white); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; 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-family: 'Roboto Condensed', sans-serif; font-weight: 700; border: 1px solid var(--border); transition: 0.3s; }
.pagination .page-numbers.current { background: var(--primary); color: var(--white); border-color: var(--primary); }
.pagination .page-numbers.dots { border: none; background: transparent; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--border); color: var(--primary); }

/* Single Post */
.single-container { max-width: 900px; padding: var(--section-pad) 15px; }
.single-thumb { margin-bottom: 3rem; }
.single-header { margin-bottom: 3rem; text-align: center; border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.single-header h1 { font-size: clamp(2rem, 5vw, 4rem); margin-bottom: 1rem; word-break: break-word; }
.post-meta { color: var(--accent); font-family: 'Roboto Condensed', sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.post-content { line-height: 1.8; font-size: 1.15rem; }
.post-content h2, .post-content h3 { margin-top: 4rem; margin-bottom: 1.5rem; word-break: break-word; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.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; }
.post-content th, .post-content td { border-bottom: 1px solid var(--border); padding: 1rem; text-align: left; }
.post-content th { font-family: 'Roboto Condensed', sans-serif; font-weight: 700; text-transform: uppercase; }

/* Footer FT-C (Three-column) */
.site-footer { background: var(--white); 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, 4vw, 2.5rem); font-weight: 700; overflow-wrap: anywhere; margin-bottom: 1rem; color: var(--primary); font-family: 'Roboto Condensed', sans-serif; text-transform: uppercase; }
.footer-desc { max-width: 100%; overflow-wrap: break-word; font-size: 0.95rem; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.8rem; }
.footer-col a { color: var(--text); }
.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; }

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