/* === Переменные ====================================================== */
:root {
    --primary-color: #455a64;
    --secondary-color: #607d8b;
    --accent-color: #90a4ae;
    --light-color: #cfd8dc;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --border-radius: 8px;
    --transition: all 0.3s ease;
    --shadow: 0 4px 15px rgba(69, 90, 100, 0.15);
    --shadow-hover: 0 8px 25px rgba(69, 90, 100, 0.25);
}

/* === Базовые настройки ============================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    align-items: center;
}

.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-12 { grid-column: span 12; }

/* === Шапка-меню ===================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--light-color);
    z-index: 1000;
    padding: 0;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 100%;
}

/* === Hero Section - Split Layout ===================================== */
.hero {
    background: linear-gradient(135deg, var(--light-color) 0%, #ffffff 100%);
    padding: 120px 0 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    max-width: 500px;
}

.hero-image {
    text-align: center;
}

.hero-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-width: 100%;
    height: auto;
}

.hero-image img:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

/* === Buttons ======================================================== */
.btn {
    display: inline-block;
    padding: 15px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    margin-left: 15px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--text-light);
}

/* === Sections ======================================================= */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-title p {
    font-size: 1.2rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

/* === Cards ========================================================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.card p {
    color: var(--secondary-color);
    line-height: 1.6;
}

/* === Stats Section ================================================== */
.stats {
    background: var(--primary-color);
    color: var(--text-light);
}

.stat-item {
    text-align: center;
    padding: 20px;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--light-color);
    display: block;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* === Contact Section ================================================ */
.contact {
    background: var(--light-color);
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(69, 90, 100, 0.1);
}

/* === Footer ========================================================= */
.footer {
    background: var(--primary-color);
    color: var(--text-light);
    text-align: center;
    padding: 40px 0;
}

.footer-content {
    margin-bottom: 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    text-align: left;
}

.footer-section {
    margin-bottom: 20px;
}

.logo-footer {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-color);
    margin-bottom: 15px;
}

.footer-section h4 {
    color: var(--light-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-section p {
    color: #d3d3d3;
    margin-bottom: 20px;
    line-height: 1.6;
}

.footer-nav {
    list-style: none;
    padding: 0;
}

.footer-nav li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: #d3d3d3;
    text-decoration: none;
    transition: var(--transition);
}

.footer-nav a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #d3d3d3;
}

.footer-contact-item i {
    margin-right: 10px;
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: #d3d3d3;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #d3d3d3;
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* === Хлебные крошки (breadcrumbs) ================================== */
.breadcrumbs {
    max-width: 1200px;
    margin: 100px auto 0;
    padding: 0 20px;
    font-size: 0.875rem;
    color: #777;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.breadcrumbs span {
    color: #555;
}

/* === Страница-контейнер =========================================== */
.page-content {
    max-width: 800px;
    margin: 2rem auto 3rem;
    padding: 0 1rem 2rem;
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* Картинка в шапке страницы */
.page-content .post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Заголовок страницы */
.page-content h1 {
    font-size: 1.75rem;
    margin: 1.5rem 0 1rem;
    line-height: 1.3;
    color: var(--text-dark);
    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: 2.5rem auto;
    padding: 0 1rem;
}

/* === Карточка записи ============================================== */
.post-item {
    background: #fff;
    border: 1px solid #ebebeb;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    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: var(--shadow-hover);
}

/* Картинка */
.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: var(--text-dark);
    text-decoration: none;
}

.post-item h3 a:hover {
    color: var(--secondary-color);
}

/* Краткий текст */
.post-item p {
    margin: 0 1rem 1.25rem;
    color: #555;
    flex: 1 0 auto;
}

/* Ссылка "Подробнее" */
.post-item > a:last-of-type {
    align-self: flex-start;
    margin: 0 1rem 1.25rem;
    background: var(--primary-color);
    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: var(--secondary-color);
}

/* === Пагинация ===================================================== */
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: var(--primary-color);
    transition: background 0.2s ease;
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.next.page-numbers,
.prev.page-numbers {
    border-color: transparent;
    color: var(--primary-color);
}

.next.page-numbers:hover,
.prev.page-numbers:hover {
    color: var(--secondary-color);
    background: transparent;
}

/* === Главная страница - Hero Section ============================= */
.homepage {
    padding-top: 70px; /* Учитываем фиксированный хедер */
}

.hero-section {
    background: linear-gradient(135deg, var(--light-color) 0%, #ffffff 100%);
    padding: 60px 0;
    margin-bottom: 60px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.hero-image img:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.hero-text {
    padding: 20px 0;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-title a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.hero-title a:hover {
    color: var(--secondary-color);
}

.hero-excerpt {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 30px;
    line-height: 1.6;
}

.hero-button {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
    display: inline-block;
}

.hero-button:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* === Секция случайных постов ======================================= */
.random-posts {
    padding: 60px 0;
    background: #ffffff;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: #ffffff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.post-thumbnail {
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.post-thumbnail:hover img {
    transform: scale(1.05);
}

.post-content {
    padding: 20px;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--primary-color);
}

.blog-link {
    text-align: center;
    margin-top: 40px;
}

.blog-button {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 15px 30px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.blog-button:hover {
    background: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* === Минималистичный хедер ========================================= */
.site-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--light-color);
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.site-logo:hover {
    color: var(--secondary-color);
}

/* === Минималистичный футер ========================================= */
.site-footer {
    background: var(--primary-color);
    color: var(--text-light);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
    align-items: start;
}

.footer-brand {
    margin-bottom: 20px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-color);
    margin-bottom: 15px;
}

.footer-description {
    color: #d3d3d3;
    line-height: 1.6;
    margin: 0;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a {
    color: #d3d3d3;
    text-decoration: none;
    transition: var(--transition);
}

.footer-menu a:hover {
    color: #ffffff;
}

.footer-contacts {
    margin-bottom: 20px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #d3d3d3;
}

.footer-contact-item i {
    margin-right: 10px;
    color: var(--accent-color);
    width: 16px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

.copyright {
    color: #d3d3d3;
    margin: 0;
}

/* === Mobile Responsive ============================================== */
@media (max-width: 768px) {
    .grid-12 {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .col-6, .col-4, .col-3 {
        grid-column: span 1;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .nav-menu {
        display: none;
    }

    .hero {
        text-align: center;
        padding: 100px 0 60px;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 15px;
    }
    
    .breadcrumbs {
        margin-top: 80px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }

    /* Адаптивность для новой главной страницы */
    .hero-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-excerpt {
        font-size: 1.1rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .footer-contact-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .section-title h2 {
        font-size: 2rem;
    }
    
    .breadcrumbs {
        font-size: 0.75rem;
    }
    
    .page-content h1 {
        font-size: 1.5rem;
    }
}