/* 
 * Main theme styles
 */

/* Global Styles */
html {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
    min-height: 100vh; /* Используем vh вместо 100% для лучшей поддержки мобильных браузеров */
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    max-width: 100%;
}

#page {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Используем min-height вместо flex: 1 */
}

.site-main {
    flex: 1 0 auto; /* Это заставит main растягиваться на всю доступную высоту */
}

.site-footer {
    flex-shrink: 0; /* Предотвращает сжатие футера */
}

a {
    transition: color 0.3s ease;
}

a:hover {
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header Styles */
.site-header {
    margin-bottom: 30px;
}

.site-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.site-description {
    margin: 0;
    color: #6c757d;
}

/* Navigation */
.dropdown-menu {
    border-radius: 0;
    margin-top: 0;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Content Styles */
.entry-title {
    margin-bottom: 0.5rem;
}

.entry-meta {
    margin-bottom: 1rem;
}

.entry-meta .posted-on,
.entry-meta .byline {
    margin-right: 15px;
}

.entry-content {
    margin-top: 1.5rem;
}

.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
}

.entry-footer {
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.entry-footer .cat-links,
.entry-footer .tags-links,
.entry-footer .comments-link,
.entry-footer .edit-link {
    display: block;
    margin-bottom: 0.5rem;
}

/* Comments */
.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
    border-radius: 0.25rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.comment-list {
    margin-bottom: 2rem;
    padding-left: 0;
}

.comment-list .children {
    list-style: none;
    padding-left: 2.5rem;
    margin-top: 1.5rem;
}

.comment-item {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 1.5rem;
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

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

.comment-actions .reply .comment-reply-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s ease-in-out;
}

.comment-actions .reply .comment-reply-link:hover {
    background-color: #e9ecef;
    color: #212529;
}

.comment-form label {
    font-weight: 500;
}

.comment {
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.comment-metadata {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* Widgets */
.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Footer */
.site-footer {
    padding: 2rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.site-info {
    font-size: 0.875rem;
}

/* Footer Widget Styles */
.footer-widget {
    margin-bottom: 20px;
}

.footer-widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #495057;
}

.footer-widget ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget ul li a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-widget ul li a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.footer-widget p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .navbar-nav {
        margin-top: 15px;
    }
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -9999rem;
    top: 2.5rem;
    z-index: 999;
    background-color: #fff;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    text-decoration: none;
    text-align: center;
}

.skip-link:focus {
    left: 0;
    right: 0;
    width: auto;
}

/* Layout styles */

/* Стили для пагинации */
.pagination {
    margin: 2rem 0;
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary, #0d6efd);
    border-color: var(--bs-primary, #0d6efd);
    color: #fff;
}

.pagination .page-link {
    color: var(--bs-primary, #0d6efd);
}

.pagination .page-link:hover {
    z-index: 2;
    color: var(--bs-primary-dark, #0a58ca);
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Search form styles */
.navbar-search {
    margin-left: 15px;
}

.navbar-search .search-form {
    position: relative;
}

.navbar-search .search-field {
    min-width: 200px;
    padding-right: 40px;
    transition: width 0.3s ease;
}

@media (max-width: 991.98px) {
    .navbar-search {
        margin: 10px 0 0;
        width: 100%;
    }
    
    .navbar-search .search-field {
        width: 100%;
    }
}

/* Вариант с увеличением поля при фокусе */
@media (min-width: 992px) {
    .navbar-search .search-field:focus {
        min-width: 250px;
    }
}

/* Поддержка блоков во всю ширину и широких блоков */
.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.alignwide {
    margin-left: auto;
    margin-right: auto;
    max-width: 1320px; /* Соответствует максимальной ширине контейнера Bootstrap */
    width: 100%;
    position: relative;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 1400px) {
    .alignwide {
        max-width: 1400px; /* Немного шире стандартного контейнера на больших экранах */
    }
}

@media (max-width: 1200px) {
    .alignwide {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .alignwide {
        max-width: 960px;
    }
}

@media (max-width: 768px) {
    .alignwide {
        max-width: 720px;
    }
}

@media (max-width: 576px) {
    .alignwide {
        max-width: 100%;
    }
}

/* Обеспечиваем правильное отображение контента внутри широких блоков */
.alignfull .container,
.alignwide .container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Стили для блоков с фоном */
.has-background {
    padding: 40px 0;
}

/* Исправление для слайдера во всю ширину */
.alignfull .bootstrap-slider,
.alignfull .bootstrap-multi-slider {
    margin-bottom: 0;
}

/* Стили для редактора Gutenberg - одинаковая ширина для всех блоков */
.editor-styles-wrapper .block-editor-block-list__block {
    max-width: 840px !important; /* Стандартная ширина блока в редакторе */
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Добавляем визуальные индикаторы для разных типов выравнивания */
.editor-styles-wrapper .block-editor-block-list__block.alignfull {
    border-left: 4px solid #0073aa;
}

.editor-styles-wrapper .block-editor-block-list__block.alignwide {
    border-left: 4px solid #46b450;
}

/* Добавляем подсказку о том, что блок будет отображаться иначе на фронтенде */
.editor-styles-wrapper .block-editor-block-list__block.alignfull::before,
.editor-styles-wrapper .block-editor-block-list__block.alignwide::before {
    content: "Этот блок будет отображаться шире на фронтенде";
    display: block;
    font-size: 11px;
    color: #666;
    padding: 4px 0;
    font-style: italic;
}

/* Исправление для редактора, чтобы избежать горизонтального скролла */
.wp-block {
    max-width: 100%;
}

.block-editor-block-list__layout {
    overflow-x: hidden;
}

/* Стили для области виджетов в хедере */
.header-widgets-area {
    margin-left: 15px;
    display: flex;
    align-items: center;
    height: 100%;
}

.header-widget {
    margin: 0 5px;
    display: flex;
    align-items: center;
}

/* Выравнивание внутренних элементов виджетов */
.header-widget > * {
    display: flex;
    align-items: center;
}

/* Адаптивные стили для области виджетов в хедере */
@media (max-width: 991px) {
    .header-widgets-area {
        margin-top: 15px;
        margin-left: 0;
        justify-content: center;
    }
}

/* Стили для эффекта смены логотипа при наведении */
.rwt-logo-container {
    position: relative;
    width: 50px;
    height: 50px;
}

.rwt-logo-default,
.rwt-logo-hover {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease-in-out;
}

.rwt-logo-default {
    opacity: 1;
}

.rwt-logo-hover {
    opacity: 0;
}

.rwt-logo-container:hover .rwt-logo-default {
    opacity: 0;
}

.rwt-logo-container:hover .rwt-logo-hover {
    opacity: 1;
}