/*
Theme Name: My Custom Theme
Author: Your Name
Text Domain: mycustomtheme
*/

/* =========================================
   ПУЛЬТ УПРАВЛЕНИЯ ЦВЕТАМИ (CSS Variables)
   Меняйте цвета здесь, и они изменятся везде
   ========================================= */
:root {
    /* Ваш новый фиолетовый цвет */
    --main-accent-color: #7421B2; 
    
    /* Цвет ссылок (можно сделать таким же или другим) */
    --link-color: #7421B2;
    
    /* Базовые цвета */
    --text-color: #000000;
    --bg-color: #ffffff;
    --grey-text: #666666;
    --light-border: #eeeeee;
}

/* --------------------------------------------------
   1. Базовые стили и типографика
----------------------------------------------------- */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
a {
    color: var(--link-color); /* Используем переменную */
    text-decoration: none;
    transition: color 0.3s;
}
a:hover { color: var(--text-color); }
img { max-width: 100%; height: auto; }

/* Заголовки */
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }
h1, .site-title a { font-weight: 500; } 
.site-title { font-size: 32px; margin: 0; }

/* Логотип */
.site-branding .custom-logo {
    max-height: 150px;
    width: auto;
    max-width: 100%;
}

h2, h3, h4, h5, h6 { font-weight: 300; }
h2.section-title { font-weight: 500; font-size: 28px; text-align: center; margin-bottom: 40px; }

/* --------------------------------------------------
   2. Шапка и навигация
----------------------------------------------------- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}
.main-navigation { display: none; }
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 24px;
    padding: 0;
    z-index: 1001;
}
.menu-toggle .line {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
}
.main-navigation.toggled {
    display: block;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
}
.main-navigation.toggled ul {
    flex-direction: column;
    align-items: flex-end; 
    padding: 20px 30px 20px 0; 
}
.main-navigation.toggled li { margin: 10px 0; }

@media (min-width: 768px) {
    .menu-toggle { display: none; }
    .main-navigation { display: block; }
    .main-navigation ul {
        display: flex;
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .main-navigation li { margin-left: 25px; }
    .main-navigation a { font-weight: 500; font-size: 16px; }
}

/* --------------------------------------------------
   3. Главная страница и сетка постов
----------------------------------------------------- */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
.grid-item .post-thumbnail-link img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 16 / 10;
}
.grid-item .post-title {
    font-size: 22px;
    font-weight: 300;
    margin: 10px 0 5px;
}
.grid-item .post-author {
    font-size: 14px;
    color: var(--grey-text);
    text-align: right;
    margin: 0;
    padding-right: 5px;
}
section { margin-bottom: 60px; }

@media (min-width: 768px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --------------------------------------------------
   4. Страница одного поста (single.php)
----------------------------------------------------- */
.single-post .entry-header { text-align: center; margin-bottom: 30px; }
.single-post .post-category {
    display: inline-block;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.single-post .entry-title { font-size: 42px; font-weight: 500; margin: 0 0 15px; }
.single-post .entry-meta { font-size: 16px; color: var(--grey-text); }
.single-post .post-thumbnail { margin-bottom: 30px; }
.single-post .entry-content p { font-size: 18px; }
.single-post .author-box {
    margin-top: 40px;
    padding: 30px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    gap: 20px;
}
.author-box .author-avatar img { border-radius: 50%; }
.author-box .author-title { margin: 0 0 5px; font-weight: 500; }
.author-box .author-bio { margin: 0; font-size: 15px; }

/* --------------------------------------------------
   5. Подвал
----------------------------------------------------- */
.site-footer {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--light-border);
}
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}
.footer-widgets .widget-title { font-size: 16px; font-weight: 500; }
.site-info { text-align: center; font-size: 14px; color: var(--grey-text); }
@media (min-width: 992px) {
    .footer-widgets { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------
   6. Блок похожих постов (Related Articles)
----------------------------------------------------- */
.related-articles-carousel {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--light-border);
    width: 100%;
    overflow: hidden;
}
.related-articles-carousel h2 {
    font-size: 28px;
    font-weight: 500;
    text-align: center;
    margin-bottom: 40px;
}
.related-scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding-bottom: 20px;
    padding-right: 20px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f9f9f9;
}
.related-article-item {
    flex: 0 0 80%;
    width: 80%;
}
.related-article-thumbnail img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    margin-bottom: 15px;
}
.related-article-title {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.4;
    margin: 0;
}
.related-article-title a { color: var(--text-color); }
.related-article-title a:hover { color: var(--main-accent-color); /* Акцентный цвет */ }

@media (min-width: 768px) {
    .related-article-item { flex: 0 0 300px; width: 300px; }
}

/* --------------------------------------------------
   7. 404 Error Page
----------------------------------------------------- */
.error-404-section { text-align: center; padding: 40px 0; }
.error-404-title { font-size: 120px; font-weight: 500; color: var(--text-color); margin: 0; line-height: 1; }
.error-404-subtitle { font-size: 24px; font-weight: 300; color: var(--grey-text); margin: 10px 0 30px; }
.error-404-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--main-accent-color); /* Акцентный цвет */
    color: #ffffff;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
}
.error-404-button:hover { background-color: var(--text-color); color: #fff; }
.recent-posts-404 { margin-top: 60px; padding-top: 40px; border-top: 1px solid var(--light-border); }
.section-title-404 { font-size: 28px; font-weight: 500; text-align: center; margin-bottom: 40px; }
.posts-grid-404 { display: grid; grid-template-columns: 1fr; gap: 30px; text-align: left; }
.posts-grid-404 .grid-item .post-title { font-size: 22px; font-weight: 300; margin: 10px 0 5px; }
.posts-grid-404 .grid-item .post-author { font-size: 14px; color: var(--grey-text); text-align: right; margin: 0; padding-right: 5px; }
@media (min-width: 576px) { .posts-grid-404 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .posts-grid-404 { grid-template-columns: repeat(4, 1fr); } }

/* --------------------------------------------------
   8. Archive Pages
----------------------------------------------------- */
.archive-header { text-align: center; margin-bottom: 50px; padding-bottom: 30px; border-bottom: 1px solid var(--light-border); }
.archive-title { font-size: 36px; font-weight: 500; margin: 0 0 10px; }
.archive-description { font-size: 18px; color: var(--grey-text); font-weight: 300; }
.pagination { margin-top: 50px; border-top: 1px solid var(--light-border); padding-top: 30px; }
.nav-links { display: flex; justify-content: center; align-items: center; gap: 10px; }
.nav-links .page-numbers { display: block; padding: 8px 15px; font-size: 16px; font-weight: 500; }
.nav-links .page-numbers.current { background-color: var(--text-color); color: #fff; }
.nav-links .page-numbers:not(.current):hover { background-color: #f4f4f4; color: var(--text-color); }

/* --------------------------------------------------
   9. Single Post Image (Desktop)
----------------------------------------------------- */
@media (min-width: 768px) {
    .single-post .post-thumbnail { max-width: 850px; margin-left: auto; margin-right: auto; }
}