/*
Theme Name: WithoutProblemsWordPress
Theme URI: https://1promtai.ru
Author: Ведерников Сергей
Author URI: https://1promtai.ru
Description: Тема на основе Underscores с ModernGrid стилем
Version: 1.0.0
Requires PHP: 8.3
License: GPLv2 or later
Text Domain: withoutproblemswordpress
*/

/* ============================================
   ПЕРЕМЕННЫЕ
   ============================================ */

:root {
    --primary-color: #1f2937;
    --secondary-color: #3b82f6;
    --accent-color: #ef4444;
    --background-color: #f8fafc;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --header-bg: #1f2937;
    --footer-bg: #1f2937;
    --card-bg: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.10);
}

/* ============================================
   БАЗОВЫЕ СБРОСЫ
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-style: none;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #2563eb;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
}

ul, ol {
    margin: 0 0 1rem 1.5rem;
}

/* ============================================
   КОНТЕЙНЕР
   ============================================ */

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

/* ============================================
   ШАПКА (HEADER)
   ============================================ */

.site-header {
    background: var(--header-bg);
    color: #ffffff;
    padding: 16px 0;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
}
.site-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}
.site-title a:hover {
    color: #9ca3af;
}

.site-description {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ============================================
   НАВИГАЦИЯ (МЕНЮ)
   ============================================ */

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.main-navigation a {
    display: block;
    padding: 8px 16px;
    color: #e5e7eb;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}
.main-navigation a:hover {
    background: #374151;
    color: #ffffff;
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #4b5563;
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-toggle:hover {
    background: #374151;
}

/* ============================================
   ОСНОВНАЯ СЕТКА — ВСЕГДА ВИДИМЫЕ САЙДБАРЫ
   ============================================ */

.four-column-layout {
    display: grid;
    grid-template-areas: "ads article aside reklama";
    grid-template-columns: 0.5fr 1fr 0.5fr 0.5fr;
    gap: 24px;
    max-width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

.widget-area-left {
    grid-area: ads;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.site-main {
    grid-area: article;
    min-width: 0;
}

.widget-area-right {
    grid-area: aside;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.widget-area-ad {
    grid-area: reklama;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============================================
   САЙДБАРЫ
   ============================================ */

.widget {
    background: var(--card-bg);
    padding: 16px 20px;
    margin-bottom: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.widget ul li:last-child {
    border-bottom: none;
}
.widget ul li a {
    color: var(--text-color);
    transition: color 0.2s;
}
.widget ul li a:hover {
    color: var(--secondary-color);
}

/* Рекламный блок */
.ad-widget {
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    position: sticky;
    top: 100px;
}

.ad-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #9ca3af;
    letter-spacing: 0.05em;
    margin: 0 0 12px;
}

/* ============================================
   ГЛАВНАЯ (HOME GRID КАРТОЧКИ)
   ============================================ */

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    padding-top: 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--border-color);
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f3f4f6;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}
.card-image-wrapper:hover .card-image {
    transform: scale(1.05);
}

.card-content {
    padding: 16px 20px 24px;
}

.card-category {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}
.card-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}
.card-title a:hover {
    color: var(--secondary-color);
}

.card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

/* ============================================
   ЗАПИСИ (SINGLE)
   ============================================ */

.single-container {
    max-width: 100%;
}

.single-article {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px 32px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.single-thumbnail {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f3f4f6;
    margin: -32px -32px 24px -32px;
}
.single-thumbnail img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.single-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 12px;
}

.single-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.single-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

.single-content .alignleft {
    float: left;
    margin: 0 20px 20px 0;
    max-width: 50%;
}
.single-content .alignright {
    float: right;
    margin: 0 0 20px 20px;
    max-width: 50%;
}
.single-content .aligncenter {
    display: block;
    margin: 20px auto;
}

.single-content blockquote {
    margin: 24px 0;
    padding: 16px 24px;
    background: #f8fafc;
    border-left: 4px solid var(--secondary-color);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-light);
}

.single-tags {
    margin: 24px 0;
}
.single-tags a {
    display: inline-block;
    background: #f3f4f6;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 0 4px 4px 0;
    color: var(--text-color);
    transition: all 0.2s;
}
.single-tags a:hover {
    background: var(--secondary-color);
    color: #ffffff;
}

.single-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}
.single-navigation a {
    color: var(--text-color);
    transition: color 0.2s;
}
.single-navigation a:hover {
    color: var(--secondary-color);
}

/* ============================================
   СТРАНИЦЫ (PAGE)
   ============================================ */

.page-article {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 16px;
}

.page-content {
    font-size: 1.05rem;
    line-height: 1.8;
}
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* ============================================
   АРХИВЫ (ARCHIVE)
   ============================================ */

.archive-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.archive-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}

.archive-description {
    color: var(--text-light);
    font-size: 1rem;
    margin-top: 8px;
}

/* ============================================
   ПОИСК (SEARCH)
   ============================================ */

.search-header {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.search-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0;
}
.search-query {
    color: var(--secondary-color);
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.search-no-results .search-form {
    max-width: 400px;
    margin: 20px auto 0;
}

/* ============================================
   404
   ============================================ */

.error-404 {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.error-title {
    font-size: 6rem;
    font-weight: 900;
    color: var(--secondary-color);
    margin: 0;
    line-height: 1;
}

.error-subtitle {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0 16px;
}

.error-text {
    max-width: 500px;
    margin: 0 auto 30px;
    color: var(--text-light);
}

.error-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.error-actions .search-form {
    width: 100%;
    max-width: 400px;
}

.button-home {
    display: inline-block;
    background: var(--secondary-color);
    color: #ffffff;
    padding: 12px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}
.button-home:hover {
    background: #2563eb;
    color: #ffffff;
}

/* ============================================
   ГАЛЕРЕЯ (slg-gallery)
   ============================================ */

.slg-gallery {
    display: flex;
    flex-wrap: wrap;
    margin: 10px -5px;
}

.slg-gallery a {
    display: block;
    margin: 5px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #f3f4f6;
    aspect-ratio: 4 / 3;
    flex: 1 1 calc(25% - 10px);
    min-width: 150px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s ease;
}
.slg-gallery a:hover {
    box-shadow: var(--shadow-hover);
}

.slg-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}
.slg-gallery a:hover img {
    transform: scale(1.05);
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--secondary-color);
    color: #ffffff;
    border-color: var(--secondary-color);
}
.pagination .current {
    background: var(--secondary-color);
    color: #ffffff;
    border-color: var(--secondary-color);
}

/* ============================================
   ФОРМЫ
   ============================================ */

.search-form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    min-width: 200px;
    transition: border-color 0.2s;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.search-form button {
    padding: 10px 24px;
    background: var(--secondary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover {
    background: #2563eb;
}

/* ============================================
   ПОДВАЛ (FOOTER)
   ============================================ */

.site-footer {
    background: var(--footer-bg);
    color: #d1d5db;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 1px solid #374151;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.footer-info p {
    margin: 0;
    font-size: 0.95rem;
}
.footer-info a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}
.footer-info a:hover {
    color: #ffffff;
}

.footer-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-menu-list a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-menu-list a:hover {
    color: #ffffff;
}

/* ============================================
   КНОПКА НАВЕРХ
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--secondary-color);
    color: #ffffff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    border: none;
    cursor: pointer;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* ============================================
   АДАПТИВ — САЙДБАРЫ ПЕРЕСТРАИВАЮТСЯ, НО НЕ ИСЧЕЗАЮТ
   ============================================ */

/* Планшеты */
@media (max-width: 992px) {
    .four-column-layout {
        grid-template-areas: 
            "ads ads"
            "article article"
            "aside reklama";
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        padding: 0 15px;
        margin: 20px auto;
    }
    .widget-area-left {
        grid-area: ads;
        display: block !important;
    }
    .widget-area-right {
        grid-area: aside;
        display: block !important;
    }
    .widget-area-ad {
        grid-area: reklama;
        display: block !important;
    }
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .slg-gallery a {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 120px;
    }
    .single-article {
        padding: 24px;
    }
    .single-thumbnail {
        margin: -24px -24px 20px -24px;
    }
    .page-article {
        padding: 24px;
    }
}

/* Телефоны */
@media (max-width: 600px) {
    .four-column-layout {
        grid-template-areas: 
            "ads"
            "article"
            "aside"
            "reklama";
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 10px;
        margin: 10px auto;
    }
    .widget-area-left,
    .widget-area-right,
    .widget-area-ad {
        display: block !important;
        grid-area: auto !important;
    }
    .home-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .slg-gallery a {
        flex: 1 1 calc(50% - 10px);
        min-width: 100px;
    }
    .single-title {
        font-size: 1.6rem;
    }
    .single-article {
        padding: 16px;
    }
    .single-thumbnail {
        max-height: 300px;
        margin: -16px -16px 16px -16px;
    }
    .single-thumbnail img {
        max-height: 300px;
    }
    .page-article {
        padding: 16px;
    }
    .page-title {
        font-size: 1.6rem;
    }
    .archive-title,
    .search-title {
        font-size: 1.6rem;
    }
    .error-title {
        font-size: 4rem;
    }
    .error-subtitle {
        font-size: 1.4rem;
    }
    .menu-toggle {
        display: block;
    }
    .main-navigation ul {
        display: none;
        flex-direction: column;
        gap: 4px;
        padding-top: 12px;
        width: 100%;
    }
    .main-navigation.toggled ul {
        display: flex;
    }
    .main-navigation a {
        text-align: center;
        padding: 10px;
        background: #374151;
        border-radius: 6px;
    }
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    .search-form {
        flex-direction: column;
    }
    .search-form input[type="search"] {
        min-width: auto;
    }
}

/* Маленькие телефоны */
@media (max-width: 480px) {
    .single-title {
        font-size: 1.3rem;
    }
    .single-thumbnail {
        max-height: 220px;
        margin: -16px -16px 16px -16px;
    }
    .single-thumbnail img {
        max-height: 220px;
    }
    .page-title {
        font-size: 1.3rem;
    }
    .archive-title,
    .search-title {
        font-size: 1.3rem;
    }
    .slg-gallery a {
        flex: 1 1 calc(100% - 10px);
    }
    .pagination a,
    .pagination span {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
    .error-title {
        font-size: 3rem;
    }
    .error-subtitle {
        font-size: 1.2rem;
    }
    .site-title {
        font-size: 1.3rem;
    }
    .card-title {
        font-size: 1rem;
    }
    .card-content {
        padding: 12px 16px 18px;
    }
    .single-content {
        font-size: 0.95rem;
    }
    .single-content .alignleft,
    .single-content .alignright {
        float: none;
        max-width: 100%;
        margin: 0 0 16px 0;
    }
}

/* ============================================
   ПОЛЬЗОВАТЕЛЬСКИЕ КЛАССЫ
   ============================================ */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none; }
.visible { display: block; }

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ============================================
   САЙДБАРЫ — ВСЕ ВИДЖЕТЫ В ОДНОЙ СЕТКЕ
   ============================================ */

.widget-area-left,
.widget-area-right,
.widget-area-ad {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    position: relative !important;
    z-index: 1 !important;
}

.widget {
    position: relative !important;
    z-index: 1 !important;
    margin-bottom: 0 !important;  /* Убираем отступы, оставляем gap */
    flex-shrink: 0 !important;    /* Запрещаем сжиматься */
}

/* А теперь сбрасываем всё, что может вырывать календарь */
.widget_calendar {
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;  /* Не даём вылезти за пределы */
}

.widget_calendar table {
    width: 100% !important;
    table-layout: fixed !important;
}

.widget_calendar td,
.widget_calendar th {
    padding: 4px 2px !important;
    text-align: center !important;
    font-size: 0.85rem !important;
}

/* Сбрасываем абсолютное позиционирование у всего, что внутри календаря */
.widget_calendar * {
    position: relative !important;
    z-index: 1 !important;
}

/* ============================================
   ФИКС ДЛЯ ДЛИННЫХ ТЕКСТОВ (ColorHarmonyWheelPro)
   ============================================ */

/* Принудительный перенос длинных слов */
.widget,
.entry-content,
.single-content,
.page-content,
.color-wheel-wrapper,
.color-harmony-content {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    hyphens: auto !important;
}

/* Фикс для контейнера шорткода */
.color-wheel-wrap,
.color-harmony-wrap {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Принудительный перенос для всех длинных строк */
.color-harmony-content p,
.color-harmony-content div,
.color-harmony-content span {
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Для ссылок и кнопок внутри виджетов */
.widget a,
.entry-content a {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Специальный фикс для превью кода */
pre,
.code-block,
.wp-block-code {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* ============================================
   КОММЕНТАРИИ — ПОЛНЫЙ НАБОР
   ============================================ */

/* ----- ОБЩАЯ ОБЛАСТЬ ----- */
.comments-area {
    max-width: 820px;
    margin: 40px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

/* ----- ЗАГОЛОВОК ----- */
.comments-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f5;
    margin-bottom: 25px;
}

/* ----- СПИСОК ----- */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.comment-list li {
    list-style: none;
}

/* ----- ОДИН КОММЕНТАРИЙ ----- */
.comment {
    display: flex;
    gap: 15px;
    padding: 18px 20px;
    margin-bottom: 12px;
    background: #f8f9fb;
    border-radius: 10px;
    border: 1px solid #eef0f5;
    transition: all 0.3s ease;
}

.comment:hover {
    background: #f5f6fa;
}

/* ----- АВАТАР ----- */
.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ----- ТЕЛО КОММЕНТАРИЯ ----- */
.comment-body {
    flex: 1;
    min-width: 0;
}

/* ----- МЕТА-ИНФОРМАЦИЯ ----- */
.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 16px;
    color: #1a1a2e;
}

.comment-author a {
    color: #1a5fb4;
    text-decoration: none;
}

.comment-author a:hover {
    text-decoration: underline;
}

.comment-metadata {
    font-size: 13px;
    color: #999;
}

.comment-metadata a {
    color: #999;
    text-decoration: none;
}

.comment-metadata a:hover {
    color: #1a5fb4;
}

/* ----- ТЕКСТ КОММЕНТАРИЯ ----- */
.comment-content {
    font-size: 15px;
    line-height: 1.7;
    color: #444;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

/* ----- МОДЕРАЦИЯ ----- */
.comment-awaiting-moderation {
    color: #e67e22;
    font-size: 13px;
    font-style: italic;
    margin-top: 5px;
}

/* ----- КНОПКА "ОТВЕТИТЬ" ----- */
.comment-reply {
    margin-top: 10px;
}

.comment-reply-link {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #1a5fb4;
    text-decoration: none;
    padding: 4px 14px;
    border-radius: 20px;
    background: rgba(26, 95, 180, 0.08);
    transition: all 0.3s ease;
}

.comment-reply-link:hover {
    background: #1a5fb4;
    color: #ffffff;
}

/* ----- ВЛОЖЕННЫЕ ----- */
.children {
    list-style: none;
    padding-left: 30px;
    margin-top: 15px;
    border-left: 3px solid #e8ecf1;
}

.children .comment {
    background: #fafbfc;
}

/* ----- АВТОР ПОСТА ----- */
.bypostauthor > .comment {
    border-left: 4px solid #1a5fb4;
}

/* ----- ЧЁТНЫЕ/НЕЧЁТНЫЕ ----- */
.comment.odd {
    background: #f8f9fb;
}

.comment.even {
    background: #f2f4f8;
}

/* ----- ПАГИНАЦИЯ ----- */
.comment-pagination {
    text-align: center;
    padding: 20px 0 10px;
}

.comment-pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 3px;
    background: #f0f2f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.comment-pagination .page-numbers:hover {
    background: #1a5fb4;
    color: #ffffff;
}

.comment-pagination .page-numbers.current {
    background: #1a5fb4;
    color: #ffffff;
}

.comment-pagination .page-numbers.dots {
    background: transparent;
    color: #999;
}

/* ----- ФОРМА ----- */
.comment-respond {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #f0f0f5;
}

.comment-reply-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-form p {
    margin: 0;
}

.comment-form label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.comment-form .required {
    color: #e74c3c;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e8ecf1;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #fafbfc;
    box-sizing: border-box;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: #1a5fb4;
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.08);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

/* ----- КНОПКА ОТПРАВКИ ----- */
.submit-comment {
    background: #1a5fb4;
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(26, 95, 180, 0.3);
    width: auto;
    display: inline-block;
}

.submit-comment:hover {
    background: #0d3b7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(26, 95, 180, 0.4);
}

/* ----- ЕСЛИ НЕ АВТОРИЗОВАН ----- */
.must-log-in {
    font-size: 14px;
    color: #777;
}

.must-log-in a {
    color: #1a5fb4;
    text-decoration: none;
}

.must-log-in a:hover {
    text-decoration: underline;
}

/* ----- КОММЕНТАРИИ ЗАКРЫТЫ ----- */
.comments-closed {
    padding: 20px;
    text-align: center;
    background: #f8f9fb;
    border-radius: 8px;
    color: #999;
}

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    .comments-area {
        padding: 20px 15px;
        margin: 20px 10px;
    }

    .comment {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .comment-avatar img {
        width: 40px;
        height: 40px;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }

    .children {
        padding-left: 15px;
    }

    .comment-pagination .page-numbers {
        padding: 6px 12px;
        font-size: 13px;
    }

    .submit-comment {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .comments-area {
        padding: 15px 10px;
    }

    .comment {
        padding: 12px;
    }

    .comment-content {
        font-size: 14px;
    }

    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"] {
        font-size: 14px;
    }
}

/* ============================================
   АРХИВЫ — КАРТОЧКИ КАК НА ГЛАВНОЙ
   ============================================ */

/* ----- ОСНОВНАЯ ОБЛАСТЬ ----- */
.archive-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ----- ЗАГОЛОВОК ----- */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 10px;
}

.archive-description {
    font-size: 16px;
    color: #777;
    max-width: 600px;
    margin: 0 auto;
}

/* ----- СЕТКА КАРТОЧЕК ----- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* ----- ОДНА КАРТОЧКА ----- */
.post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f2f5;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.10);
    border-color: #e0e5ef;
}

/* ----- КАРТИНКА ----- */
.post-card-thumb {
    display: block;
    overflow: hidden;
    height: 200px;
}

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

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

/* ----- КОНТЕНТ ----- */
.post-card-content {
    padding: 20px 22px 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
}

.post-card-title a {
    color: #1a1a2e;
    text-decoration: none;
}

.post-card-title a:hover {
    color: #1a5fb4;
}

/* ----- МЕТА ----- */
.post-card-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.post-card-meta span {
    margin-right: 12px;
}

.post-card-meta a {
    color: #1a5fb4;
    text-decoration: none;
}

.post-card-meta a:hover {
    text-decoration: underline;
}

/* ----- ТЕКСТ ----- */
.post-card-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    flex: 1;
}

.post-card-excerpt p:last-child {
    margin-bottom: 0;
}

/* ----- КНОПКА ----- */
.post-card-readmore {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: #1a5fb4;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.post-card-readmore:hover {
    color: #0d3b7a;
    transform: translateX(4px);
}

/* ============================================
   ПАГИНАЦИЯ
   ============================================ */

.pagination {
    text-align: center;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 3px;
    background: #f0f2f5;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background: #1a5fb4;
    color: #ffffff;
}

.pagination .page-numbers.current {
    background: #1a5fb4;
    color: #ffffff;
}

.pagination .page-numbers.dots {
    background: transparent;
    color: #999;
}

/* ============================================
   ПУСТОЙ РЕЗУЛЬТАТ
   ============================================ */

.archive-empty {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #999;
}

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    .archive-main {
        padding: 20px 15px;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 20px;
    }

    .page-title {
        font-size: 26px;
    }

    .post-card-thumb {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .archive-main {
        padding: 15px 10px;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .post-card-thumb {
        height: 200px;
    }

    .post-card-title {
        font-size: 17px;
    }

    .post-card-content {
        padding: 16px 18px 20px;
    }

    .page-title {
        font-size: 22px;
    }

    .pagination .page-numbers {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ============================================
   SINGLE — ОТДЕЛЬНАЯ ЗАПИСЬ
   ============================================ */

.single-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* ----- ЗАГОЛОВОК ----- */
.single-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f5;
}

.single-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
    line-height: 1.3;
}

.single-meta {
    font-size: 14px;
    color: #999;
}

.single-meta span {
    margin-right: 18px;
}

.single-meta a {
    color: #1a5fb4;
    text-decoration: none;
}

.single-meta a:hover {
    text-decoration: underline;
}

/* ----- КАРТИНКА ----- */
.single-thumbnail {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.single-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* ----- КОНТЕНТ ----- */
.single-content {
    font-size: 17px;
    line-height: 1.8;
    color: #333;
}

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

.single-content h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 40px 0 15px;
}

.single-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 30px 0 12px;
}

.single-content ul,
.single-content ol {
    margin: 0 0 20px 25px;
}

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

.single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.single-content blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    background: #f8f9fb;
    border-left: 4px solid #1a5fb4;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.single-content blockquote p:last-child {
    margin-bottom: 0;
}

.single-content .wp-block-image {
    margin: 20px 0;
}

/* ----- ТЕГИ ----- */
.single-tags {
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #f0f0f5;
    font-size: 14px;
    color: #999;
}

.single-tags a {
    display: inline-block;
    padding: 4px 12px;
    margin: 3px 4px 3px 0;
    background: #f0f2f5;
    color: #555;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.single-tags a:hover {
    background: #1a5fb4;
    color: #ffffff;
}

/* ----- НАВИГАЦИЯ ----- */
.single-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    margin-top: 20px;
    border-top: 1px solid #f0f0f5;
    border-bottom: 1px solid #f0f0f5;
}

.single-navigation a {
    color: #1a5fb4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.single-navigation a:hover {
    color: #0d3b7a;
}

.nav-previous {
    max-width: 45%;
}

.nav-next {
    max-width: 45%;
    text-align: right;
}

/* ============================================
   АДАПТИВ
   ============================================ */

@media (max-width: 768px) {
    .single-main {
        padding: 20px 15px;
    }

    .single-title {
        font-size: 26px;
    }

    .single-content {
        font-size: 16px;
    }

    .single-content h2 {
        font-size: 22px;
    }

    .single-content h3 {
        font-size: 19px;
    }

    .single-meta span {
        display: inline-block;
        margin-right: 12px;
        margin-bottom: 4px;
    }

    .single-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .nav-previous,
    .nav-next {
        max-width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .single-main {
        padding: 15px 10px;
    }

    .single-title {
        font-size: 22px;
    }

    .single-content {
        font-size: 15px;
    }

    .single-content h2 {
        font-size: 20px;
    }

    .single-content h3 {
        font-size: 17px;
    }

    .single-content blockquote {
        padding: 15px 18px;
    }

    .single-tags a {
        padding: 3px 10px;
        font-size: 12px;
    }
}
/* ===== ВСЕМ ЗАПИСЯМ ===== */
.site-content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 30px 20px !important;
}

#primary {
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* Комментарии всем */
.comments-area {
    max-width: 820px !important;
    margin: 0 auto !important;
}

/* Палитра */
.my-palette-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
}

.colors-grid-container {
    max-width: 100% !important;
    overflow-x: auto !important;
}

/* Телевизоры */
@media (min-width: 1920px) {
    .site-content {
        max-width: 1600px !important;
        padding: 40px !important;
    }
}

/* ===== ЛЕЙАУТ С САЙДБАРАМИ ===== */

.single-layout,
.archive-layout {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar-left,
.sidebar-right {
    min-width: 0;
}

.sidebar-left {
    order: 1;
}

.single-main,
.archive-main {
    order: 2;
    min-width: 0;
}

.sidebar-right {
    order: 3;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 1024px) {
    .single-layout,
    .archive-layout {
        grid-template-columns: 1fr 250px;
    }
    
    .sidebar-left {
        display: none;
    }
}

@media (max-width: 768px) {
    .single-layout,
    .archive-layout {
        grid-template-columns: 1fr;
        padding: 15px;
    }
    
    .sidebar-left,
    .sidebar-right {
        display: none;
    }
}