/* --- Global Styles & Variables --- */
:root {
    --color-cream: #FEFDFB;
    --color-sage: #728A7B;
    --color-dusty-rose: #EAD2AC;
    --color-dark-blue: #2C3E50;
    --color-gray: #6c757d;
    --color-light-gray: #f8f9fa;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-cream);
    color: var(--color-dark-blue);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex-grow: 1;
}

h1, h2, h3, h4 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    line-height: 1.3;
}

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

a:hover {
    color: var(--color-dark-blue);
}

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

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

/* --- Focus Styles --- */
a:focus-visible, button:focus-visible {
    outline: 2px solid var(--color-sage);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ============================================= */
/* HEADER STYLES */
/* ============================================= */

/* Blog Header (фиксированный) */
.blog-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 20px 0;
    background-color: var(--color-cream);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.blog-header.scrolled {
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* Header Content Layout */
.hero-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Logo */
.logo-placeholder {
    flex-shrink: 0;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
}

/* Navigation */
.blog-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.blog-nav a {
    color: var(--color-dark-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.blog-nav a:hover {
    background-color: var(--color-sage);
    color: #fff;
    transform: translateY(-2px);
}

.blog-nav a.active {
    background-color: var(--color-sage);
    color: #fff;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-dark-blue);
    transition: 0.3s;
    border-radius: 2px;
}

/* ============================================= */
/* BLOG PAGE STYLES */
/* ============================================= */

.blog-main {
    padding-top: 120px;
    padding-bottom: 80px;
}

.blog-page-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-dark-blue);
}

.blog-page-subtitle {
    font-size: 1.2rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    color: var(--color-gray);
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.post-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover img {
    transform: scale(1.05);
}

.post-content {
    padding: 2rem;
}

.post-content h3 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: var(--color-dark-blue);
}

.post-excerpt {
    font-size: 1rem;
    color: var(--color-gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.read-more {
    color: var(--color-sage);
    font-weight: 600;
    font-size: 0.95rem;
}

/* ============================================= */
/* ARTICLE PAGE STYLES */
/* ============================================= */

.article-main {
    padding-top: 120px;
    padding-bottom: 80px;
}

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

/* Breadcrumbs */
.breadcrumbs {
    padding: 20px 0;
    font-size: 0.9rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumbs li:not(:last-child)::after {
    content: '→';
    margin-left: 10px;
    color: var(--color-gray);
}

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

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs li:last-child span {
    color: var(--color-gray);
}

/* Article Header */
.article-header {
    text-align: center;
    border-bottom: 1px solid var(--color-light-gray);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--color-gray);
}

.author-link {
    color: var(--color-sage);
    font-weight: 600;
}

.reading-time {
    color: #999;
}

/* Article Image */
.article-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* Article Content */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-content h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-dark-blue);
}

.article-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-dark-blue);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background-color: var(--color-light-gray);
    border-left: 5px solid var(--color-dusty-rose);
    font-style: italic;
}

.article-content blockquote p {
    margin: 0;
}

.article-content img {
    border-radius: 8px;
    margin: 2rem 0;
}

/* Table of Contents */
.article-toc {
    background-color: var(--color-light-gray);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.article-toc h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.article-toc ul {
    list-style: none;
    padding-left: 0;
}

.article-toc li {
    margin-bottom: 0.5rem;
}

.article-toc a {
    color: var(--color-sage);
    font-weight: 500;
}

/* Article Footer */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-light-gray);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.tag {
    background-color: var(--color-light-gray);
    color: var(--color-sage);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tag:hover {
    background-color: var(--color-sage);
    color: #fff;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-light-gray);
}

.related-posts h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* ============================================= */
/* FOOTER STYLES */
/* ============================================= */

.main-footer {
    background-color: var(--color-dark-blue);
    color: #fff;
    padding: 40px 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-left p {
    font-size: 0.9rem;
    color: #ccc;
}

.footer-center {
    display: flex;
    gap: 20px;
}

.footer-icon {
    color: #ccc;
    transition: color 0.3s ease;
}

.footer-icon:hover {
    color: var(--color-dusty-rose);
}

.footer-right {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-dusty-rose);
}

/* ============================================= */
/* RESPONSIVE DESIGN */
/* ============================================= */

@media (max-width: 768px) {
    /* Header Mobile */
    .logo-img {
        height: 45px;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .blog-nav {
        position: fixed;
        top: 85px;
        right: -100%;
        width: 250px;
        height: calc(100vh - 85px);
        background-color: var(--color-cream);
        flex-direction: column;
        padding: 2rem;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        gap: 0;
    }
    
    .blog-nav.active {
        right: 0;
    }
    
    .blog-nav a {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    /* Content Mobile */
    .blog-main {
        padding-top: 100px;
    }
    
    .article-main {
        padding-top: 100px;
    }
    
    .blog-page-title {
        font-size: 2rem;
    }
    
    .blog-page-subtitle {
        font-size: 1rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-toc {
        padding: 1rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer Mobile */
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .blog-page-title {
        font-size: 1.8rem;
    }
    
    .post-content {
        padding: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.3rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
}
