/*
 * Ovod Theme Styles
 * Версия 1.0.2
 * Автор: Gemini
 */

/* ==========================================================================
   1. Базовые стили и обнуление
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f4f4f9;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   2. Шапка и навигация
   ========================================================================== */
.site-header {
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    color: #fff;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.site-branding {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 700;
}

.site-title a {
    color: #fff;
    text-decoration: none;
}

.site-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    margin-top: 5px;
}

.header-right {
    position: relative;
}

.search-toggle {
    background: none;
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.2rem;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-toggle:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.search-form-container {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 100;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.search-form-container.active {
    display: block;
}

.search-form {
    display: flex;
}

.search-form .search-field {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 4px;
    outline: none;
}

.search-form .search-submit {
    background-color: #2575fc;
    color: #fff;
    border: none;
    padding: 8px 12px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* Навигация */
.main-navigation {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.main-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.main-menu li {
    position: relative;
}

.main-menu li a {
    display: block;
    padding: 10px 15px;
    color: #333;
    font-weight: 500;
    text-transform: uppercase;
    transition: color 0.3s, background-color 0.3s;
}

.main-menu li a:hover {
    color: #2575fc;
}

/* Подменю */
.main-menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    list-style: none;
    min-width: 200px;
    z-index: 10;
}

.main-menu li:hover > ul {
    display: block;
}

.main-menu ul li a {
    padding: 10px 20px;
    text-transform: none;
    font-weight: normal;
}

/* ==========================================================================
   3. Основной контент и сайдбар
   ========================================================================== */
.site-content {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    gap: 30px;
}

.content-area {
    flex: 1;
}

.widget-area {
    width: 300px;
}

.sticky-sidebar {
    position: sticky;
    top: 30px;
    align-self: flex-start;
}

.widget {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.widget a {
    font-size: 1.1rem; /* Увеличение размера шрифта для ссылок в сайдбаре */
}

/* ==========================================================================
   4. Вывод постов
   ========================================================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.post-thumbnail-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail-gradient {
    background: linear-gradient(to bottom, #d9e2ef, #c9d6de);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-date-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 5px;
}

.entry-header {
    padding: 15px;
}

.entry-title {
    font-size: 1.2rem;
    margin: 0;
    line-height: 1.4;
}

.entry-title a {
    color: #333;
    transition: color 0.3s;
}

.entry-title a:hover {
    color: #2575fc;
}

/* ==========================================================================
   5. Полная новость (single.php)
   ========================================================================== */
.post-image-wrap {
    position: relative;
    margin-bottom: 20px;
}

.post-image-wrap img {
    border-radius: 8px;
}

.post-meta-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    display: flex;
    gap: 15px;
}

.entry-content p {
    font-size: 1.1rem; /* Увеличение размера шрифта для основного текста */
    margin-bottom: 15px;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
    font-size: 1.8rem; /* Увеличение размера шрифта для заголовков */
    margin: 20px 0 10px;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.post-navigation a {
    display: block;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.post-navigation a:hover {
    background-color: #2575fc;
    color: #fff;
    border-color: #2575fc;
}

/* ==========================================================================
   6. Постраничная навигация
   ========================================================================== */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    color: #333;
}

.pagination a:hover {
    background-color: #f0f0f0;
}

.pagination .current {
    background-color: #2575fc;
    color: #fff;
    border-color: #2575fc;
}

/* ==========================================================================
   7. Подвал
   ========================================================================== */
.site-footer {
    background-color: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

.site-footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   8. Адаптивность (Медиазапросы)
   ========================================================================== */
@media (max-width: 992px) {
    .site-content {
        flex-direction: column;
    }

    .widget-area {
        width: 100%;
    }

    .sticky-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .site-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .site-branding {
        flex-direction: column;
        align-items: center;
    }

    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .main-menu {
        flex-direction: column;
        align-items: stretch;
    }

    .main-menu li a {
        padding: 10px;
        text-align: center;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-menu ul {
        position: static;
        box-shadow: none;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}