/*
Theme Name: Netdormovozam Theme
Description: Информационный портал о займах без переплат.
Version: 1.0
*/

:root {
    --primary: #2C6E49;
    --secondary: #F4A261;
    --accent: #264653;
    --bg: #FEFAE0;
    --text: #1D3557;
    --border: rgba(29, 53, 87, 0.12);
    --section-pad: clamp(3.5rem, 7vw, 6rem);
    --shadow: 0 10px 30px -8px rgba(38, 70, 83, 0.12), 0 6px 16px -6px rgba(38, 70, 83, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Manrope', sans-serif; color: var(--text); line-height: 1.75; overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
h1, h2, h3, h4 { font-family: 'Lora', serif; color: var(--accent); }
img { max-width: 100%; height: auto; display: block; border-radius: 10px; }
.ndv-hero-bg img,
.ndv-thumb img,
.ndv-single-thumb img,
.ndv-post-content img { border-radius: 0; }
a { color: var(--primary); text-decoration: none; transition: 0.3s; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* DNA: D-C — whitespace + section rhythm */
.ndv-section-space { padding: var(--section-pad) 0; }
.ndv-section-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary); margin-bottom: 0.65rem; }
.ndv-section-kicker--light { color: var(--secondary); }
.ndv-section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 2.5rem; text-align: center; font-weight: 600; }
.ndv-section-title--left { text-align: left; margin-bottom: 0.85rem; }
.ndv-section-title--light { color: #fff; text-align: left; margin-bottom: 2.5rem; }
.ndv-section-lead { font-size: 1.05rem; color: var(--text); opacity: 0.88; max-width: 640px; margin-bottom: 2.5rem; line-height: 1.65; }
.ndv-section-head { margin-bottom: 0.5rem; }

/* DNA: N-E — thin green top-bar */
.ndv-site-header { background: var(--primary); color: #fff; position: relative; z-index: 1000; border-bottom: 2px solid rgba(255,255,255,0.15); }
.ndv-header-inner { display: flex; align-items: center; justify-content: space-between; height: 42px; gap: clamp(1rem, 5vw, 4rem); }
.ndv-logo { font-size: 1rem; font-weight: 700; color: #fff; white-space: nowrap; flex-shrink: 0; letter-spacing: 0.3px; }
.ndv-logo span { color: var(--secondary); }
.ndv-main-nav { flex: 1; min-width: 0; overflow: hidden; display: flex; justify-content: flex-end; }
.ndv-main-nav ul { display: flex; list-style: none; gap: 2rem; margin: 0; padding: 0; }
.ndv-main-nav a { font-weight: 500; font-size: 0.85rem; color: rgba(255,255,255,0.85); }
.ndv-main-nav a:hover { color: #fff; }
.ndv-nav-toggle { display: none; flex-shrink: 0; z-index: 2100; background: none; border: none; width: 22px; height: 14px; position: relative; cursor: pointer; }
.ndv-hamburger, .ndv-hamburger::before, .ndv-hamburger::after { content: ''; display: block; width: 100%; height: 2px; background: #fff; position: absolute; transition: 0.3s; }
.ndv-hamburger { top: 50%; transform: translateY(-50%); }
.ndv-hamburger::before { top: -5px; }
.ndv-hamburger::after { bottom: -5px; }
@media (max-width: 768px) {
    .ndv-nav-toggle { display: block; }
    .ndv-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: 60px; }
    body.menu-open .ndv-main-nav { transform: translateY(0); visibility: visible; }
    .ndv-main-nav ul { flex-direction: column; padding: 20px; gap: 1.5rem; align-items: center; }
    .ndv-main-nav a { font-size: 1.1rem; color: #fff; }
}

.ndv-site-main { flex: 1; }

/* DNA: H-E — compact hero with content panel */
.ndv-hero-section { position: relative; min-height: clamp(280px, 38vh, 420px); display: flex; align-items: center; padding: clamp(2.5rem, 5vw, 4rem) 0; overflow: hidden; background: linear-gradient(135deg, #f8f5e4 0%, #eef6f0 55%, #fff 100%); border-bottom: 4px solid var(--primary); }
.ndv-hero-bg { position: absolute; inset: 0; z-index: 0; opacity: 0.32; }
.ndv-hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(254, 250, 224, 0.92) 0%, rgba(254, 250, 224, 0.55) 45%, rgba(254, 250, 224, 0.15) 100%); }
.ndv-hero-bg img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.ndv-hero-inner { position: relative; z-index: 1; }
.ndv-hero-content { max-width: 640px; background: rgba(255, 255, 255, 0.94); padding: clamp(1.75rem, 4vw, 2.75rem); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); border-left: 5px solid var(--primary); }
.ndv-hero-content h1 { font-size: clamp(1.65rem, 3.5vw, 2.35rem); margin-bottom: 1rem; word-break: break-word; line-height: 1.2; font-weight: 700; color: var(--accent); }
.ndv-hero-content p { font-size: clamp(1rem, 1.8vw, 1.12rem); max-width: 560px; color: var(--text); line-height: 1.7; }

/* DNA: F-F — stat counters on contrast band */
.ndv-stats-section { background: var(--accent); color: #fff; border-bottom: 6px solid var(--secondary); }
.ndv-stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.ndv-stat-item { text-align: center; padding: clamp(1.75rem, 3vw, 2.5rem) 1.5rem; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; transition: background 0.3s, transform 0.3s; }
.ndv-stat-item:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-3px); }
.ndv-stat-item h4 { font-family: 'Manrope', sans-serif; font-size: clamp(2.5rem, 5vw, 3.5rem); color: var(--secondary); line-height: 1; font-weight: 800; margin-bottom: 0.75rem; }
.ndv-stat-item p { font-size: 0.95rem; color: rgba(255, 255, 255, 0.88); line-height: 1.5; }
@media (max-width: 768px) { .ndv-stats-grid { grid-template-columns: 1fr; } }

/* DNA: U-C — horizontal scroll topic cards */
.ndv-topics-section { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ndv-topics-scroll { display: flex; gap: 1.5rem; overflow-x: auto; padding: 0 max(24px, calc((100% - 1100px) / 2 + 24px)) 1.5rem; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.ndv-topics-scroll::-webkit-scrollbar { height: 6px; }
.ndv-topics-scroll::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
.ndv-topic-card { flex: 0 0 clamp(260px, 70vw, 320px); scroll-snap-align: start; background: #fff; padding: 2rem; border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); border-top: 4px solid var(--primary); }
.ndv-topic-num { display: block; font-family: 'Manrope', sans-serif; font-size: 0.8rem; font-weight: 700; color: var(--primary); margin-bottom: 0.75rem; letter-spacing: 0.12em; }
.ndv-topic-card h3 { font-size: 1.15rem; margin-bottom: 0.75rem; color: var(--accent); line-height: 1.35; }
.ndv-topic-card p { font-size: 0.95rem; color: var(--text); opacity: 0.9; line-height: 1.6; }

/* DNA: C-B — horizontal post cards, V-A soft shadows */
.ndv-posts-section { background: #fff; border-top: 4px solid rgba(44, 110, 73, 0.15); }
.ndv-posts-section .ndv-section-lead { margin-bottom: 3rem; }
.ndv-posts-grid { display: flex; flex-direction: column; gap: 2.5rem; width: 100%; }
.ndv-post-card { display: flex; flex-direction: row; background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; transition: 0.3s; align-items: stretch; border: 1px solid var(--border); min-width: 0; width: 100%; }
.ndv-post-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -10px rgba(38, 70, 83, 0.15); }
.ndv-thumb { width: 38%; max-width: 380px; flex-shrink: 0; min-height: clamp(180px, 25vw, 220px); overflow: hidden; position: relative; background: var(--bg); line-height: 0; }
.ndv-thumb a { display: block; width: 100%; height: 100%; min-height: inherit; line-height: 0; }
.ndv-thumb img { width: 100%; height: 100%; min-height: clamp(180px, 25vw, 220px); max-width: none; object-fit: cover; object-position: center center; border-radius: 0; }
.ndv-post-card-content { padding: 2rem; flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; gap: 0.75rem; }
.ndv-post-category { font-size: 0.75rem; font-weight: 700; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.04em; display: block; }
.ndv-post-card-content h3 { font-size: 1.25rem; margin-bottom: 0; font-weight: 600; line-height: 1.35; word-break: break-word; }
.ndv-btn-read { display: inline-block; font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.ndv-btn-read::after { content: ' →'; }
@media (max-width: 768px) {
    .ndv-post-card { flex-direction: column; align-items: stretch; }
    .ndv-thumb { width: 100%; max-width: none; min-height: 200px; }
    .ndv-thumb img { min-height: 200px; }
}

.ndv-all-posts-action { text-align: center; margin-top: 4rem; }
.ndv-btn-primary { display: inline-block; padding: 0.9rem 2.2rem; background: var(--primary); color: #fff; font-weight: 600; border-radius: 8px; transition: 0.3s; }
.ndv-btn-primary:hover { background: var(--accent); color: #fff; }

.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; font-weight: 600; background: var(--bg); color: var(--accent); border-radius: 8px; box-shadow: var(--shadow); transition: 0.3s; }
.pagination .page-numbers.current { background: var(--primary); color: #fff; }
.pagination .page-numbers.dots { background: transparent; box-shadow: none; cursor: default; }
.pagination .page-numbers:hover:not(.current):not(.dots) { background: var(--secondary); color: var(--accent); }

.ndv-archive-container { padding: var(--section-pad) 0; }
.ndv-archive-header { margin-bottom: 2.5rem; }
.ndv-archive-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; line-height: 1.2; }
.ndv-archive-desc { font-size: 1.05rem; line-height: 1.65; opacity: 0.9; max-width: 720px; }
.ndv-single-container { max-width: 800px; padding: var(--section-pad) 24px; margin: 0 auto; }
.ndv-single-thumb { margin-bottom: 2.5rem; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.ndv-single-header { margin-bottom: 2.5rem; }
.ndv-single-header h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 1rem; word-break: break-word; line-height: 1.2; }
.ndv-post-meta { color: var(--primary); font-size: 0.9rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.ndv-post-content { line-height: 1.8; font-size: 1.05rem; }
.ndv-post-content h2, .ndv-post-content h3 { margin-top: 2.5rem; margin-bottom: 1rem; word-break: break-word; }
.ndv-post-content p { margin-bottom: 1.25rem; }
.ndv-post-content ul, .ndv-post-content ol { margin-bottom: 1.25rem; padding-left: 1.75rem; }
.ndv-post-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.25rem; box-shadow: var(--shadow); border-radius: 8px; overflow: hidden; }
.ndv-post-content th, .ndv-post-content td { border: 1px solid var(--border); padding: 0.85rem; text-align: left; }
.ndv-post-content th { background: var(--bg); font-weight: 600; }

.ndv-error-page { text-align: center; min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ndv-error-code { font-size: clamp(3rem, 10vw, 6rem); color: var(--primary); margin-bottom: 0.5rem; font-family: 'Manrope', sans-serif; }
.ndv-error-page h2 { margin-bottom: 1rem; }
.ndv-error-page p { margin-bottom: 2rem; }

/* DNA: FT-D — CTA footer + nav */
.ndv-site-footer { margin-top: auto; }
.ndv-footer-cta { background: var(--secondary); padding: 4rem 24px; text-align: center; }
.ndv-footer-cta-text { font-size: clamp(1.05rem, 2vw, 1.2rem); margin-bottom: 2rem; max-width: 620px; margin-left: auto; margin-right: auto; color: var(--text); line-height: 1.65; font-weight: 500; }
.ndv-footer-cta .ndv-btn-primary { background: var(--accent); }
.ndv-footer-cta .ndv-btn-primary:hover { background: var(--primary); }
.ndv-footer-bottom { background: var(--accent); color: #fff; padding: 3rem 0; }
.ndv-footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; }
.ndv-footer-logo { font-size: clamp(1.2rem, 7vw, 2rem); font-weight: 700; margin-bottom: 1rem; color: #fff; font-family: 'Lora', serif; overflow-wrap: anywhere; }
.ndv-footer-desc { font-size: 0.9rem; opacity: 0.85; overflow-wrap: break-word; }
.ndv-footer-col h4 { font-size: 1rem; margin-bottom: 1rem; color: var(--secondary); font-family: 'Manrope', sans-serif; }
.ndv-footer-col ul { list-style: none; padding: 0; margin: 0; }
.ndv-footer-col li { margin-bottom: 0.6rem; }
.ndv-footer-col a { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.ndv-footer-col a:hover { color: var(--secondary); }
@media (max-width: 768px) { .ndv-footer-grid { grid-template-columns: 1fr; } }
