/* === Base Settings ============================================= */
:root {
    --primary-color: #f8f9fa;
    --secondary-color: #e9ecef;
    --accent-color: #dee2e6;
    --text-color: #495057;
    --dark-text: #212529;
    --border-color: #adb5bd;
    
    --golden-ratio: 1.618;
    --spacing-unit: 8px;
    --border-radius: 8px;
    
    --font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    --line-height: 1.6;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: var(--line-height);
    color: var(--text-color);
    background-color: var(--primary-color);
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

/* === Header Menu ===================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(248, 249, 250, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--accent-color);
    z-index: 1000;
    transition: all 0.3s ease-out;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
}

.logo {
    font-size: calc(1rem * var(--golden-ratio));
    font-weight: 600;
    color: var(--dark-text);
    text-decoration: none;
    transition: all 0.3s ease-out;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: calc(var(--spacing-unit) * 4);
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    transition: all 0.3s ease-out;
    position: relative;
}

.nav-link:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
    color: var(--dark-text);
}

/* === Active Menu Item ========================================== */
.current-menu-item .nav-link,
.current_page_item .nav-link {
    color: #ff6b00;
    cursor: default;
}

/* === Hero Section - Split Layout */
.hero {
    margin-top: 80px;
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: calc(var(--spacing-unit) * 8) 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 8);
    align-items: center;
}

.hero-text h1 {
    font-size: calc(2.5rem * var(--golden-ratio));
    font-weight: 300;
    color: var(--dark-text);
    margin-bottom: calc(var(--spacing-unit) * 3);
    line-height: 1.2;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 4);
    color: var(--text-color);
}

.hero-image {
    text-align: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(173, 181, 189, 0.3);
    transition: all 0.3s ease-out;
}

.hero-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(173, 181, 189, 0.4);
}

/* === Buttons === */
.btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background-color: var(--dark-text);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease-out;
    border: 2px solid var(--dark-text);
    margin-right: calc(var(--spacing-unit) * 2);
}

.btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
    color: var(--dark-text);
}

.btn-secondary {
    background-color: transparent;
    color: var(--dark-text);
    border: 2px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* === Sections with Golden Ratio === */
.section {
    padding: calc(var(--spacing-unit) * 10) 0;
    border-bottom: 1px solid var(--secondary-color);
}

.section:nth-child(even) {
    background-color: var(--secondary-color);
}

.section-title {
    font-size: calc(2rem * var(--golden-ratio));
    font-weight: 300;
    color: var(--dark-text);
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.section-subtitle {
    font-size: 1.3rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 8);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* === Golden Ratio Grid === */
.golden-grid {
    display: grid;
    gap: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.golden-grid-2 {
    grid-template-columns: 1fr 1.618fr;
}

.golden-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* === Cards === */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: calc(var(--spacing-unit) * 4);
    box-shadow: 0 4px 20px rgba(173, 181, 189, 0.15);
    transition: all 0.3s ease-out;
    border: 1px solid var(--accent-color);
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(173, 181, 189, 0.25);
}

.card-icon {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.card h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--dark-text);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.card p {
    color: var(--text-color);
    line-height: var(--line-height);
}

/* === Stats Section === */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: calc(var(--spacing-unit) * 4);
    text-align: center;
}

.stat-number {
    font-size: calc(3rem * var(--golden-ratio));
    font-weight: 200;
    color: var(--dark-text);
    display: block;
}

.stat-label {
    color: var(--text-color);
    font-weight: 500;
    margin-top: calc(var(--spacing-unit));
}

/* === Footer === */
.footer {
    background-color: var(--dark-text);
    color: var(--primary-color);
    text-align: center;
    padding: calc(var(--spacing-unit) * 6) 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    color: var(--secondary-color);
}

.footer-section a {
    color: var(--primary-color);
    text-decoration: none;
    display: block;
    margin-bottom: calc(var(--spacing-unit));
    transition: all 0.3s ease-out;
}

.footer-section a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* === Breadcrumbs === */
.breadcrumbs {
    max-width: 1200px;
    margin: 6rem auto 0;
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #777;
}

.breadcrumbs a {
    color: #0059b2;
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #ff6b00;
    text-decoration: underline;
}

.breadcrumbs span {
    color: #555;
}

/* === Page Container === */
.page-content {
    max-width: 800px;
    margin: 2rem auto 3rem;
    padding: 0 1rem 2rem;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* Featured image in page header */
.page-content .post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Page title */
.page-content h1 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
    color: #111;
    text-align: center;
}

/* Текстовое содержимое */
.page-content .content p {
    margin-bottom: 1rem;
    color: #444;
}

/* === Cписок записей === */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 6rem auto 2.5rem;
    padding: 0 1rem;
}

/* === Post Card === */
.post-item {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.post-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* Картинка */
.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Заголовок */
.post-item h3 {
    font-size: 1.125rem;
    margin: 1rem;
    line-height: 1.4;
}

.post-item h3 a {
    color: #111;
    text-decoration: none;
}

.post-item h3 a:hover {
    color: #ff6b00;
}

/* Краткий текст */
.post-item p {
    margin: 0 1rem 1.25rem;
    color: #555;
    flex: 1 0 auto;
}

/* "Read More" Link */
.post-item > a:last-of-type {
    align-self: flex-start;
    margin: 0 1rem 1.25rem;
    background: #0059b2;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s ease-in-out;
}

.post-item > a:last-of-type:hover {
    background: #ff6b00;
}

/* === Пагинация === */
nav.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    font-weight: 600;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #0059b2;
    transition: background 0.2s ease;
}

.page-numbers.current,
.page-numbers:hover {
    background: #0059b2;
    color: #fff;
    border-color: #0059b2;
}

.next.page-numbers,
.prev.page-numbers {
    border-color: transparent;
    color: #0059b2;
}

.next.page-numbers:hover,
.prev.page-numbers:hover {
    color: #ff6b00;
    background: transparent;
}

/* === Адаптивность === */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero-content,
    .golden-grid-2,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 4);
    }
    
    .stats,
    .golden-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stats,
    .golden-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .breadcrumbs {
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }
    
    .page-content h1 {
        font-size: 1.35rem;
    }
}

/* === Homepage Styles === */
.homepage {
    margin-top: 80px;
}

/* === Hero Section === */
.hero-section {
    padding: calc(var(--spacing-unit) * 8) 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero-section .hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-unit) * 8);
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

.hero-section .hero-image {
    order: 1;
}

.hero-section .hero-text {
    order: 2;
}

.hero-section .hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(173, 181, 189, 0.3);
    transition: all 0.3s ease-out;
}

.hero-section .hero-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 40px rgba(173, 181, 189, 0.4);
}

.hero-section h1 {
    font-size: calc(2.5rem * var(--golden-ratio));
    font-weight: 300;
    color: var(--dark-text);
    margin-bottom: calc(var(--spacing-unit) * 3);
    line-height: 1.2;
}

.hero-section h1 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease-out;
}

.hero-section h1 a:hover {
    color: #ff6b00;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: calc(var(--spacing-unit) * 4);
    color: var(--text-color);
    line-height: 1.6;
}

.hero-btn {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2.5) calc(var(--spacing-unit) * 5);
    background-color: var(--dark-text);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease-out;
    border: 2px solid var(--dark-text);
    font-size: 1.1rem;
}

.hero-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-color);
    color: var(--dark-text);
    box-shadow: 0 8px 25px rgba(173, 181, 189, 0.3);
}

/* === Random Posts Section === */
.random-posts {
    padding: calc(var(--spacing-unit) * 10) 0;
    background-color: white;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: calc(var(--spacing-unit) * 4);
    margin-bottom: calc(var(--spacing-unit) * 6);
}

.post-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(173, 181, 189, 0.1);
    transition: all 0.3s ease-out;
    border: 1px solid var(--accent-color);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(173, 181, 189, 0.2);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.post-content {
    padding: calc(var(--spacing-unit) * 3);
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--dark-text);
    margin: 0;
    line-height: 1.4;
}

.post-content h3 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease-out;
}

.post-content h3 a:hover {
    color: #ff6b00;
}

/* === Blog Link === */
.blog-link-wrapper {
    text-align: center;
    margin-top: calc(var(--spacing-unit) * 6);
}

.blog-link {
    display: inline-block;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background-color: transparent;
    color: var(--dark-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease-out;
    border: 2px solid var(--accent-color);
    font-size: 1rem;
}

.blog-link:hover {
    transform: scale(1.05);
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(173, 181, 189, 0.2);
}

/* === Responsive Design for Homepage === */
@media (max-width: 768px) {
    .hero-section .hero-content {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 4);
        text-align: center;
    }
    
    .hero-section .hero-image {
        order: 1;
    }
    
    .hero-section .hero-text {
        order: 2;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: calc(var(--spacing-unit) * 3);
    }
    
    .post-thumbnail {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: calc(var(--spacing-unit) * 4) 0;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 2);
    }
    
    .post-thumbnail {
        height: 160px;
    }
    
    .hero-btn,
    .blog-link {
        padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
        font-size: 1rem;
    }
}