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

:root {
    --primary: #2e1065;
    --secondary: #f3e8ff;
    --text: #4c1d95;
    --border: #d8b4fe;
    --accent: #9333ea;
    --section-pad: clamp(4rem, 8vw, 8rem);
    --shadow: 0 10px 25px -5px rgba(147, 51, 234, 0.1), 0 8px 10px -6px rgba(147, 51, 234, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Roboto', 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; 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; }

/* Decor D-B (Horizontal lines) */
.decor-line { width: 100%; height: 2px; background: var(--border); margin: 3rem 0; opacity: 0.5; }

/* 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: 90px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 900; 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: 3rem; margin: 0; padding: 0; }
.main-nav a { font-weight: 600; 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: 3px; 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: 90px; 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-C (Type-Only) */
.hero-section { padding: clamp(6rem, 12vw, 10rem) 0; background: var(--secondary); text-align: center; border-bottom: 1px solid var(--border); }
.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: 900; color: var(--primary); letter-spacing: -1px; }
.hero-content p { font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--text); max-width: 800px; margin: 0 auto; font-weight: 500; }

/* Features F-C (Accordion) */
.features-section { padding: var(--section-pad) 0; background: #fff; }
.features-section h2 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 3rem; text-align: center; color: var(--primary); font-weight: 800; }
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-header { width: 100%; text-align: left; padding: 1.5rem 0; background: none; border: none; font-size: 1.3rem; font-weight: 700; color: var(--primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: 0.3s; }
.accordion-header:hover { color: var(--accent); }
.accordion-header::after { content: '+'; font-size: 2rem; color: var(--accent); transition: transform 0.3s; font-weight: 300; }
.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: 1.5rem; font-size: 1.1rem; color: var(--text); }

/* 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; }
.method-visual h3 { color: var(--border); font-size: 3rem; margin-bottom: 1rem; font-weight: 900; }
.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: #fff; }
.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 #fff; 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(147, 51, 234, 0.15); }
.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: 800; line-height: 1.3; word-break: break-word; }
.btn-read { display: inline-block; font-weight: 700; color: var(--accent); text-transform: uppercase; font-size: 0.95rem; letter-spacing: 1px; }

@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: 1.2rem 3rem; background: var(--accent); color: #fff; font-weight: 700; font-size: 1.1rem; border-radius: 50px; transition: 0.3s; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--primary); transform: translateY(-2px); }

/* 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: 700; background: var(--secondary); color: var(--primary); border-radius: 50%; transition: 0.3s; }
.pagination .page-numbers.current { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.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; color: var(--primary); font-weight: 900; line-height: 1.2; letter-spacing: -1px; }
.post-meta { color: var(--accent); font-size: 1rem; font-weight: 600; }
.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: 800; }
.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: 12px; 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: 700; color: var(--primary); }

/* Footer FT-B (Two-column) */
.site-footer { background: var(--secondary); color: var(--primary); padding: var(--section-pad) 0; margin-top: auto; border-top: 1px solid var(--border); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 6rem); }
.footer-logo { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 900; 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: 1.05rem; opacity: 0.8; }
.footer-col h4 { font-size: 1.2rem; margin-bottom: 1.5rem; color: var(--primary); font-weight: 800; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.8rem; }
.footer-col a { color: var(--primary); 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: 1.05rem; opacity: 0.8; }

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