/*
Theme Name: Tech Minimal Theme
Description: Быстрая, SEO и мобильная тема с технологичным минимализмом.
Author: Олег
Version: 1.0
*/

/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #F5F7FA;
    color: #333;
    line-height: 1.6;
    font-size: 18px; /* УВЕЛИЧЕН */
}

a {
    text-decoration: none;
    color: #0A74DA;
}

a:hover {
    color: #00C853;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1240px; /* Ограничиваем общую ширину макета */
    margin: 0 auto;     /* Центрируем весь макет */
}

.sidebar {
    width: 300px;
    background-color: #fff;
    padding: 20px;
    border-right: 1px solid #eee;
    display: flex;
    flex-direction: column;
    position: sticky; /* Прилипает к родительскому контейнеру */
    top: 0;           /* Прилипает к верхней части */
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar .site-title {
    font-size: 28px; /* УВЕЛИЧЕН */
    margin-bottom: 10px;
    color: #0A74DA;
    animation: fadeInDown 0.6s ease;
}

.sidebar .site-description {
    font-size: 18px; /* УВЕЛИЧЕН */
    color: #777;
    margin-bottom: 20px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.sidebar nav li {
    position: relative;
    margin-bottom: 5px;
}

.sidebar nav a {
    display: block;
    padding: 10px 15px;
    background-color: #f0f7ff;
    color: #0A74DA;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.3s;
    text-decoration: none;
    font-size: 16px; 
}

.sidebar nav a:hover {
    background-color: #0A74DA;
    color: #fff;
}

.sidebar nav ul ul {
    display: none;
    position: static;
    margin-top: 5px;
    margin-left: 15px;
    background-color: #fff;
    border: 1px solid #eee;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sidebar nav li:hover > ul {
    display: block;
}

.sidebar nav ul ul li {
    width: 100%;
}

.sidebar nav ul ul a {
    padding: 8px 12px;
    min-width: 100%;
}

.sidebar .widget {
    margin-bottom: 20px;
}

.content {
    flex: 1;
    margin-left: 0;
    padding: 20px;
}

/* ОГРАНИЧЕНИЕ ШИРИНЫ КОНТЕНТА НА ШИРОКИХ ЭКРАНАХ */
.main-content-wrapper {
    max-width: 900px; /* Оптимальная ширина для статей */
    margin: 0 auto;  /* Центрирование внутри отведенного места */
}
/* КОНЕЦ: ОГРАНИЧЕНИЕ ШИРИНЫ КОНТЕНТА */

.post {
    display: flex;
    flex-wrap: wrap;
    background-color: #fff;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    align-items: flex-start;
}

.post.reverse {
    flex-direction: row-reverse;
}

.post-image-container {
    width: 30%;
    height: 200px; /* Фиксированная высота для списка постов */
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eee;
    margin-right: 20px;
}

.post.reverse .post-image-container {
    margin-right: 0;
    margin-left: 20px;
}

.post-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.no-image {
    background: linear-gradient(135deg, #f0f2f5 0%, #dfe3e8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px; /* УВЕЛИЧЕН */
}

.post-text {
    width: 65%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-title {
    font-size: 24px; /* УВЕЛИЧЕН */
    margin-bottom: 10px;
    color: #0A74DA;
}

.post-meta {
    color: #777;
    font-size: 16px; /* УВЕЛИЧЕН */
    margin-top: 10px;
}

.post-excerpt {
    font-size: 18px; /* УВЕЛИЧЕН */
    color: #555;
    margin-top: 10px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    color: #0A74DA;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #f0f7ff;
}

/* Одиночная запись */
.single-post .post-content {
    margin-top: 20px;
    font-size: 20px; /* УВЕЛИЧЕН */
    line-height: 1.8;
}

.single-post .post-content h1,
.single-post .post-content h2,
.single-post .post-content h3,
.single-post .post-content h4,
.single-post .post-content h5,
.single-post .post-content h6 {
    border-bottom: 2px solid #0A74DA;
    padding-bottom: 8px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.single-post .post-content p {
    margin-bottom: 15px;
}

.single-post .post-content ul,
.single-post .post-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.single-post .post-content li {
    margin-bottom: 5px;
}

.single-post .post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.single-post .post-content table th,
.single-post .post-content table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.single-post .post-content table th {
    background-color: #f0f7ff;
}

.single-post .post-image-container {
    width: 100%;
    height: auto; /* ФИКС: Установили высоту auto, чтобы избежать наследования 200px */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eee;
    margin-bottom: 15px;
    border-radius: 4px;
    overflow: hidden;
}

.single-post .post-image-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.single-post .post-navigation {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    width: 100%;
}

.single-post .nav-link {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    background-color: #f0f7ff;
    color: #0A74DA;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.single-post .nav-link:hover {
    background-color: #0A74DA;
    color: #fff;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 16px; /* УВЕЛИЧЕН */
}

/* Комментарии */
.comments-area {
    margin-top: 40px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
    width: 100%;
    text-align: center;
}

.comments-area h3 {
    font-size: 24px; /* УВЕЛИЧЕН */
    margin-bottom: 20px;
    color: #0A74DA;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: left;
}

.comment .children {
    margin-left: 30px;
}

.comment-author {
    font-weight: bold;
    color: #0A74DA;
}

.comment-meta {
    color: #777;
    font-size: 16px; /* УВЕЛИЧЕН */
    margin-bottom: 10px;
}

.comment-body {
    margin-top: 10px;
}

/* Гамбургер-меню */
.hamburger {
    display: none;
    position: fixed;
    top: 60px;
    left: 15px;
    cursor: pointer;
    font-size: 28px; /* УВЕЛИЧЕН */
    z-index: 101;
    background: rgba(10, 116, 218, 0.5);
    color: white;
    padding: 8px;
    border-radius: 4px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }
    
    /* ИСПРАВЛЕНИЕ ДЛЯ ПОДМЕНЮ НА СМАРТФОНЕ */
    .sidebar nav ul ul {
        display: block; /* Показывает подменю сразу на мобильных */
    }
    
    .sidebar nav li:hover > ul {
        /* Отключаем десктопный hover для мобильных */
        display: block; 
    }
    /* КОНЕЦ ИСПРАВЛЕНИЯ */

    .content {
        margin-left: 0;
    }

    .post {
        flex-direction: column !important;
    }

    .post-image-container {
        width: 100%;
        height: 150px;
        margin: 0 0 10px 0 !important;
    }

    .post-text {
        width: 100%;
    }

    .single-post .post-navigation {
        flex-direction: column;
        align-items: center;
    }

    .single-post .nav-link {
        width: 100%;
        text-align: center;
    }
}