/* Основные стили для блога */
:root {
    --primary-color: #ff3a3a;
    --secondary-color: #333333;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #666;
    --white: #fff;
    --footer-bg: #222;
    --footer-text: #fff;
    --header-height: 80px;
    --transition: all 0.3s ease;
    --box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    --border-radius: 4px;
}

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

body {
    font-family: 'Roboto', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: var(--box-shadow);
    position: fixed; /* фиксируем, чтобы не было переключений sticky/normal */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--medium-gray);
    margin-bottom: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
}

.logo a {
    color: var(--secondary-color);
    display: flex;
    align-items: center;
}

.logo span {
    color: var(--primary-color);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 30px;
}

.nav-menu a {
    color: var(--secondary-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.contact-info {
    display: flex;
    align-items: center;
}

.contact-info-item {
    margin-left: 20px;
    font-size: 14px;
}

/* Hero Section */
.hero {
    background-color: var(--light-gray);
    padding: 60px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--secondary-color);
}

.hero-subtitle {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--dark-gray);
}

.hero-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

/* Blog Section */
.blog-section {
    padding: 50px 0; /* чуть меньше, чтобы не казался большим отступ под шапкой */
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 36px;
    color: var(--secondary-color);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.blog-card-img {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.blog-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-date {
    font-size: 14px;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.blog-card-title {
    font-size: 20px;
    margin-bottom: 10px;
}

.blog-card-excerpt {
    color: var(--dark-gray);
    margin-bottom: 15px;
}

.blog-card-link {
    margin-top: auto;
    font-weight: 500;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination-item {
    margin: 0 5px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    color: var(--secondary-color);
    font-weight: 500;
    box-shadow: var(--box-shadow);
}

.pagination-link:hover,
.pagination-link.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Single Post */
.single-post {
    padding: 40px 0 60px; /* верхний паддинг меньше, чтобы компенсировать sticky header */
}

.post-header {
    margin-bottom: 30px;
}

.post-title {
    font-size: 36px;
    margin-bottom: 10px;
}

.post-meta {
    color: var(--dark-gray);
    margin-bottom: 20px;
}

.post-content {
    margin-bottom: 40px;
}

.post-content p,
.post-content ul,
.post-content ol {
    margin-bottom: 20px;
}

.post-content h2 {
    font-size: 28px;
    margin: 40px 0 20px;
}

.post-content h3 {
    font-size: 24px;
    margin: 30px 0 15px;
}

.post-content img {
    margin: 20px 0;
    border-radius: var(--border-radius);
}

/* Related Posts */
.related-posts {
    padding: 60px 0;
    background-color: var(--light-gray);
}

/* About Page */
.about-section {
    padding: 60px 0;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Contact Page */
.contact-section {
    padding: 60px 0;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
}

.footer-column {
    flex: 1;
    min-width: 250px;
    margin-bottom: 10px;
}

.footer-title {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--white);
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-menu a {
    color: var(--footer-text);
    opacity: 0.8;
    transition: var(--transition);
    position: relative;
    padding-bottom: 3px;
}

.footer-menu a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-menu a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--primary-color);
}

.footer-contact {
    margin-bottom: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 1200px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        position: relative;
    }
    
    .header-center {
        order: 3;
        width: 100%;
    }
    
    .nav-toggle {
        display: block;
        order: 2;
    }
    
    .nav-menu {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background-color: var(--white);
        flex-direction: column;
        padding: 20px 0;
        box-shadow: var(--box-shadow);
        display: none;
        z-index: 1000;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .header-center.active {
        display: block;
    }
    
    .nav-menu li {
        margin: 0;
        text-align: center;
        padding: 10px 0;
    }
    
    .contact-info {
        display: none;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 36px;
    }
    
    .section-title {
        font-size: 28px;
    }
    
    .footer-column {
        flex: 0 0 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--white);
    font-size: 30px;
    cursor: pointer;
}
