/*
Theme Name: Adelzamalutdinov Theme
Description: Информационный портал о займах и МФО.
Version: 1.0
*/

:root {
    --primary: #5C1A2E;
    --secondary: #C9A227;
    --accent: #2D6A4F;
    --bg: #FAF6F1;
    --text: #1A1A1A;
    --border: #e8dfd4;
    --section-pad: clamp(4rem, 8vw, 8rem);
    --sidebar-w: 240px;
    --shadow: 0 10px 25px -5px rgba(92, 26, 46, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; color: var(--text); line-height: 1.7; background: var(--bg); min-height: 100vh; }
h1, h2, h3, h4 { font-family: 'Playfair Display', serif; color: var(--primary); }
img { max-width: 100%; height: auto; display: block; border-radius: 8px; }
a { color: var(--accent); text-decoration: none; transition: 0.3s; }

.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* V-D Alternating section backgrounds */
.section-bg-1 { background: var(--bg); }
.section-bg-2 { background: #f3ebe3; }
.section-bg-3 { background: #e8f0ea; }

/* Layout N-B */
.site-wrapper { display: flex; min-height: 100vh; }
.site-header {
    width: var(--sidebar-w);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: var(--primary);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
}
.site-main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; width: calc(100% - var(--sidebar-w)); min-width: 0; }

.logo {
    font-family: 'Playfair Display', serif;
    font-size: clamp(0.78rem, 2.2vw, 1.35rem);
    font-weight: 700;
    color: #FAF6F1;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12em;
    line-height: 1.15;
    min-height: 1em;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    text-decoration: none;
}
.logo-part {
    display: block;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.logo-accent { color: var(--secondary); }

.main-nav { flex: 1; min-width: 0; }
.main-nav ul { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }
.main-nav a { font-weight: 500; font-size: 1rem; color: rgba(250, 246, 241, 0.75); display: block; white-space: normal; overflow-wrap: break-word; }
.main-nav a:hover { color: #FAF6F1; }

.nav-toggle { display: none; }

@media (max-width: 1024px) {
    .site-wrapper { display: block; }
    .site-header {
        width: 100%;
        position: sticky;
        height: auto;
        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 {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 2.75rem);
        font-size: clamp(0.65rem, 3.8vw, 1.15rem);
        overflow: hidden;
    }
    .logo-part { display: inline; }

    .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: #FAF6F1;
        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: var(--primary);
        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.2rem; color: #FAF6F1; }
}

/* Hero H-C */
.hero-section { padding: var(--section-pad) 0; }
.hero-type-only {
    border-left: 5px solid var(--secondary);
    padding-left: clamp(1.5rem, 4vw, 3rem);
    max-width: 720px;
}
.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    word-break: break-word;
    line-height: 1.15;
    font-weight: 800;
}
.hero-content p { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text); max-width: 600px; }

/* Features F-C */
.features-section { padding: var(--section-pad) 0; }
.features-section h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 2.5rem; text-align: center; font-weight: 700; }
.accordion { max-width: 800px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header {
    width: 100%;
    text-align: left;
    padding: 1.5rem 2rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Inter', sans-serif;
}
.accordion-header:hover { color: var(--accent); background: rgba(250, 246, 241, 0.5); }
.accordion-header::after { content: '+'; font-size: 1.5rem; color: var(--secondary); 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: 0 2rem 1.5rem; font-size: 1.05rem; }

/* U-B Methodology 3 steps */
.method-section { padding: var(--section-pad) 0; }
.method-section h2 { text-align: center; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 3rem; font-weight: 700; }
.method-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.method-step { background: #fff; padding: 2rem; border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.step-num { display: block; font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 800; color: var(--secondary); margin-bottom: 1rem; }
.method-step h3 { font-size: 1.2rem; margin-bottom: 0.75rem; font-weight: 700; }
.method-step p { font-size: 1rem; color: var(--text); }
@media (max-width: 1024px) { .method-steps { grid-template-columns: 1fr; } }

/* Posts C-B horizontal */
.posts-section { padding: var(--section-pad) 0; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 3rem; text-align: center; font-weight: 700; }
.posts-grid { display: flex; flex-direction: column; gap: 2rem; }
.post-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: 0.3s;
    align-items: center;
    min-width: 0;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(92, 26, 46, 0.12); }
.post-card .thumb { width: 35%; flex-shrink: 0; height: clamp(180px, 25vw, 220px); overflow: hidden; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.post-card-content { padding: 2rem; flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 0.75rem; }
.post-category { font-size: 0.8rem; font-weight: 600; color: var(--accent); display: block; text-transform: uppercase; letter-spacing: 0.03em; }
.post-card-content h3 { font-size: 1.25rem; margin-bottom: 0; word-break: break-word; font-weight: 700; line-height: 1.35; }
.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: 4px; }

@media (max-width: 768px) {
    .post-card { flex-direction: column; align-items: stretch; }
    .post-card .thumb { width: 100%; height: 200px; }
}

.all-posts-action { text-align: center; margin-top: 3rem; }
.btn-primary {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary);
    color: #FAF6F1;
    font-weight: 600;
    border-radius: 8px;
    transition: 0.3s;
}
.btn-primary:hover { background: var(--accent); color: #fff; }

/* 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-weight: 700;
    border: 1px solid var(--border);
    transition: 0.3s;
    color: var(--primary);
    background: #fff;
}
.pagination .page-numbers.current { background: var(--primary); color: #FAF6F1; border-color: var(--primary); }
.pagination .page-numbers.dots { border: none; background: transparent; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--bg); color: var(--primary); }

/* Single & Page */
.single-container, .archive-container { max-width: 900px; padding: var(--section-pad) 20px; margin: 0 auto; width: 100%; }
.archive-header { margin-bottom: 3rem; text-align: center; }
.archive-header h1 { font-size: clamp(1.8rem, 5vw, 3rem); word-break: break-word; }
.archive-desc { margin-top: 1rem; color: var(--text); }
.single-thumb { margin-bottom: 2.5rem; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.single-header { margin-bottom: 2.5rem; text-align: center; }
.single-header h1 { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 1rem; word-break: break-word; line-height: 1.2; font-weight: 800; }
.post-meta { color: #666; font-size: 0.95rem; }
.post-content { line-height: 1.8; font-size: 1.15rem; }
.post-content h2, .post-content h3 { margin-top: 3.5rem; margin-bottom: 1.5rem; word-break: break-word; font-weight: 700; color: var(--accent); }
.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; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 1rem; text-align: left; }
.post-content th { background: var(--bg); font-weight: 600; color: var(--primary); }

/* 404 */
.not-found-container { text-align: center; padding: var(--section-pad) 20px; min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; max-width: 600px; margin: 0 auto; }
.not-found-code { font-size: clamp(3rem, 10vw, 6rem); color: var(--primary); margin-bottom: 1rem; font-weight: 800; }
.not-found-title { margin-bottom: 1rem; font-size: clamp(1.5rem, 4vw, 2rem); }
.not-found-text { margin-bottom: 2rem; color: var(--text); }

/* Footer FT-D */
.site-footer { margin-top: auto; }
.footer-cta { background: var(--accent); padding: clamp(3rem, 6vw, 4rem) 20px; text-align: center; }
.footer-cta h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 1rem; color: #fff; font-weight: 700; }
.footer-cta p { font-size: 1.05rem; margin-bottom: 2rem; opacity: 0.95; max-width: 560px; margin-left: auto; margin-right: auto; color: #fff; }
.footer-cta .btn-primary { background: #fff; color: var(--accent); }
.footer-cta .btn-primary:hover { background: var(--primary); color: #FAF6F1; }

.footer-bottom { background: var(--primary); color: rgba(250, 246, 241, 0.85); padding: clamp(3rem, 6vw, 4rem) 20px; text-align: center; }
.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1em;
    font-size: clamp(0.9rem, 4.5vw, 1.6rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #FAF6F1;
    font-family: 'Playfair Display', serif;
    line-height: 1.15;
    max-width: 100%;
}
.footer-logo .logo-part {
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-logo .logo-accent { color: var(--secondary); }
.footer-nav ul { list-style: none; display: flex; gap: clamp(1rem, 3vw, 2rem); flex-wrap: wrap; justify-content: center; margin: 0 0 1.5rem; padding: 0; }
.footer-nav a { color: rgba(250, 246, 241, 0.75); font-size: 0.95rem; }
.footer-nav a:hover { color: var(--secondary); }
.footer-contacts p { margin-bottom: 0.5rem; max-width: 100%; overflow-wrap: break-word; font-size: 0.95rem; }
.footer-note { margin-top: 1rem; font-size: 0.85rem; opacity: 0.7; }
