/* ==========================================================================
   Скандинавский лесной дизайн «Северный дровяник» (Nordic Wood Aesthetic)
   ========================================================================== */

:root {
    --bg-page: #F7F5F0;
    --bg-surface: #FFFFFF;
    --bg-card: #FAF8F5;
    --bg-card-alt: #F0ECE4;
    
    --text-primary: #2C2825;
    --text-secondary: #635C55;
    --text-muted: #8E867E;
    
    --accent-wood: #C87D32;       /* Древесный янтарь */
    --accent-wood-hover: #AF6A25;
    --accent-pine: #2E4A3E;       /* Хвойная зелень */
    --accent-pine-hover: #22372E;
    --accent-terracotta: #A45236;  /* Ольховый терракот */
    
    --border-light: #E7E2D8;
    --border-strong: #D5CEBF;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 2px 6px rgba(44, 40, 37, 0.05);
    --shadow-md: 0 6px 18px rgba(44, 40, 37, 0.08);
    --shadow-lg: 0 14px 32px rgba(44, 40, 37, 0.12);
    
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent-wood);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-wood-hover);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 24px;
}

.main-nav a {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-wood);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-wood);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    position: relative;
}

.search-box input {
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    outline: none;
    width: 180px;
    transition: width 0.3s ease, border-color 0.2s;
}

.search-box input:focus {
    width: 240px;
    border-color: var(--accent-wood);
    background: #fff;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    max-height: 380px;
    overflow-y: auto;
    z-index: 200;
}

.search-result-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    display: block;
}

.search-result-item:hover {
    background: var(--bg-card);
}

.search-result-item h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.search-result-item p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.mobile-menu-btn span {
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 16px 0;
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumbs li:not(:last-child)::after {
    content: "›";
    margin: 0 8px;
    color: var(--border-strong);
}

.breadcrumbs a {
    color: var(--text-secondary);
}

/* Hero Section */
.hero-section {
    padding: 48px 0 64px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-page) 100%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
}

.hero-badge {
    display: inline-block;
    background: var(--bg-card-alt);
    color: var(--accent-pine);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-light);
}

.hero-title {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-wood);
    color: #fff;
    border: 1px solid var(--accent-wood);
}

.btn-primary:hover {
    background: var(--accent-wood-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

.btn-outline {
    background: transparent;
    color: var(--accent-wood);
    border: 2px solid var(--accent-wood);
}

.btn-outline:hover {
    background: var(--accent-wood);
    color: #fff;
}

.hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    object-fit: cover;
    width: 100%;
}

/* Tables */
.section-header {
    text-align: center;
    max-width: 720px;
    margin: 48px auto 32px;
}

.section-header h2 {
    font-size: 2rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.table-wrapper {
    overflow-x: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 24px 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    text-align: left;
}

th, td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

th {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #FAF9F5;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
    margin-top: 24px;
}

.article-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card-img-link {
    position: relative;
    display: block;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.card-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .card-img-link img {
    transform: scale(1.03);
}

.card-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(44, 40, 37, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.meta-dot {
    margin: 0 4px;
}

.card-title {
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-title a {
    color: var(--text-primary);
}

.card-title a:hover {
    color: var(--accent-wood);
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.read-more {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--accent-wood);
    display: inline-flex;
    align-items: center;
}

.all-articles-link-wrapper {
    text-align: center;
    margin: 40px 0 60px;
}

/* Pillars */
.pillars-section {
    padding: 60px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.pillar-card {
    background: var(--bg-surface);
    padding: 28px 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.pillar-num {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-wood);
    margin-bottom: 8px;
}

.pillar-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.pillar-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.pillar-card a {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Single Article */
.article-container {
    max-width: 860px;
    padding-bottom: 80px;
}

.article-header {
    margin: 20px 0 28px;
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.category-badge {
    background: var(--accent-pine);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
}

.category-badge:hover {
    color: #fff;
    background: var(--accent-pine-hover);
}

.article-h1 {
    font-size: 2.4rem;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.article-intro-lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.article-hero-img img {
    border-radius: var(--radius-md);
    margin-bottom: 36px;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.article-body h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 36px 0 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.article-body p {
    margin-bottom: 18px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #332E2A;
}

.article-body ul, .article-body ol {
    margin: 0 0 22px 24px;
    font-size: 1.02rem;
    line-height: 1.65;
}

.article-body li {
    margin-bottom: 8px;
}

.article-lead {
    font-size: 1.18rem !important;
    font-weight: 500;
    color: var(--text-primary) !important;
    border-left: 4px solid var(--accent-wood);
    padding-left: 18px;
    margin-bottom: 28px !important;
}

.article-sources {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 40px 0 20px;
}

.article-sources h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.article-sources ul {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.article-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 24px;
    margin-top: 40px;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tag {
    background: var(--bg-card-alt);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.share-box {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.share-box code {
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-primary);
}

.related-section {
    margin-top: 50px;
    border-top: 2px solid var(--border-light);
    padding-top: 36px;
}

.related-section h3 {
    font-size: 1.35rem;
    margin-bottom: 20px;
}

/* Catalog Filter Buttons */
.catalog-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.filter-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-wood);
    border-color: var(--accent-wood);
    color: #fff;
}

/* About Page */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin-top: 32px;
}

.about-text h2 {
    font-size: 1.45rem;
    margin: 28px 0 14px;
    color: var(--text-primary);
}

.about-text p {
    margin-bottom: 16px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.about-text ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.about-img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
}

.aside-stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
}

.stat-item {
    margin-bottom: 16px;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-val {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-wood);
}

.stat-lbl {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* 404 Page */
.not-found-container {
    padding: 80px 20px;
    text-align: center;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--accent-wood);
    line-height: 1;
}

.error-box h1 {
    font-size: 2rem;
    margin: 16px 0 12px;
}

.error-box p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 28px;
}

.error-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

/* Footer */
.site-footer {
    background: #231F1C;
    color: #C2BBB3;
    padding: 60px 0 40px;
    margin-top: 80px;
    font-size: 0.9rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
}

.footer-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #FAF8F5;
}

.footer-desc {
    margin: 14px 0 18px;
    line-height: 1.6;
    color: #A39B92;
}

.footer-copyright {
    font-size: 0.8rem;
    color: #7D756D;
}

.footer-col h4 {
    color: #FAF8F5;
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 10px;
}

.footer-col a {
    color: #C2BBB3;
}

.footer-col a:hover {
    color: var(--accent-wood);
}

.nordic-badge {
    margin-top: 20px;
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    font-size: 0.8rem;
    color: #E6E1D8;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-container {
        grid-template-columns: 1fr;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border-light);
        padding: 20px;
        box-shadow: var(--shadow-md);
    }
    .main-nav.open {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 14px;
    }
    .mobile-menu-btn {
        display: flex;
    }
    .hero-title {
        font-size: 1.9rem;
    }
    .article-h1 {
        font-size: 1.75rem;
    }
}
