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

/* --------------------------------------------------
   1. Базовые стили и типографика
----------------------------------------------------- */
body {
    background-color: #ffffff;
    color: #000000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300; /* ИЗМЕНЕНО: Montserrat Light по умолчанию для всего текста */
    font-size: 18px;
    line-height: 1.6;
    margin: 0;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}
a {
    color: #ed8245; /* ИЗМЕНЕНО: Новый оранжевый цвет для ссылок */
    text-decoration: none;
    transition: color 0.3s;
}
a:hover { color: #000000; } /* При наведении ссылка станет черной */
img { max-width: 100%; height: auto; }

/* Заголовки */
h1, h2, h3, h4, h5, h6 { font-family: 'Montserrat', sans-serif; }

/* ИЗМЕНЕНО: h1 и заголовок сайта теперь Medium */
h1, .site-title a { 
    font-weight: 500; /* Montserrat Medium */
} 
.site-title { font-size: 32px; margin: 0; }
.site-branding .custom-logo { max-width: 180px; } /* Ограничим размер лого */

/* ИЗМЕНЕНО: Остальные заголовки явно Light */
h2, h3, h4, h5, h6 {
    font-weight: 300; /* Montserrat Light */
}
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: #000;
    transition: all 0.3s ease;
}

/* Стили для открытого бургер-меню */
.main-navigation.toggled {
    display: block;
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: #fff;
    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; }

/* Desktop styles (768px и больше) */
@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: #666;
    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: #666; }
.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 #eee;
}
.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: #666; }

@media (min-width: 992px) {
    .footer-widgets { grid-template-columns: repeat(4, 1fr); }
}

/* --------------------------------------------------
   7. 404 Error Page
----------------------------------------------------- */
.error-404-section {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 40px;
}

.error-404-title {
    font-size: 120px;
    font-weight: 500; /* Montserrat Medium */
    color: #000;
    margin: 0;
    line-height: 1;
}

.error-404-subtitle {
    font-size: 24px;
    font-weight: 300; /* Montserrat Light */
    color: #666;
    margin: 10px 0 30px;
}

.error-404-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #ed8245; /* Наш оранжевый цвет */
    color: #ffffff; /* Белый текст */
    font-weight: 500; /* Medium */
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.error-404-button:hover {
    background-color: #000;
    color: #fff;
}

/* Сетка постов на 404 странице */
.recent-posts-404 {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eee;
}

.section-title-404 {
    font-size: 28px;
    font-weight: 500; /* Medium */
    text-align: center;
    margin-bottom: 40px;
}

.posts-grid-404 {
    display: grid;
    grid-template-columns: 1fr; /* 1 колонка на мобильных */
    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: #666;
    text-align: right;
    margin: 0;
    padding-right: 5px;
}

/* Планшеты: 2 колонки */
@media (min-width: 576px) {
    .posts-grid-404 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Десктоп: 4 колонки (2 ряда по 4) */
@media (min-width: 992px) {
    .posts-grid-404 {
        grid-template-columns: repeat(4, 1fr);
    }
}