/*
Theme Name: Inal Theme
Theme URI: https://hosting-fabrika.ru
Author: Хостинг-Фабрика
Author URI: https://hosting-fabrika.ru
Description: Легкая, адаптивная тема для статейного сайта
Version: 1.0.0
License: GPL v2 or later
Text Domain: inal-theme
*/

/* ==========================================
   RESET & БАЗОВЫЕ СТИЛИ
========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.7;
    color: #1a1a2e;
    background: #f8f9fa;
}

a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #e94560;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   КОНТЕЙНЕР
========================================== */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================
   ШАПКА (HEADER)
========================================== */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255,255,255,0.95);
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    text-decoration: none;
}

.site-title:hover {
    color: #e94560;
}

/* ==========================================
   НАВИГАЦИОННОЕ МЕНЮ
========================================== */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin: 0;
    padding: 0;
}

.nav-menu a {
    color: #1a1a2e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: block;
    white-space: nowrap;
}

.nav-menu a:hover {
    background: #f0f0f5;
    color: #e94560;
}

.nav-menu .current-menu-item a,
.nav-menu .current_page_item a {
    color: #e94560;
    background: rgba(233, 69, 96, 0.08);
}

/* ==========================================
   КНОПКА БУРГЕРА (СКРЫТА НА ДЕСКТОПЕ)
========================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #1a1a2e;
    padding: 5px 10px;
    line-height: 1;
}

/* ==========================================
   ОСНОВНАЯ СЕТКА (2 КОЛОНКИ)
========================================== */
.main-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin: 40px 0;
}

/* ==========================================
   СЕТКА ПОСТОВ НА ГЛАВНОЙ
========================================== */
/* ==========================================
   АДАПТИВНАЯ СЕТКА ПОСТОВ
   (Максимум колонок, сколько влезет)
========================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* ==========================================
   КАРТОЧКА ПОСТА
========================================== */
.post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.post-card-content {
    padding: 20px;
}

.post-card-content h2 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.post-card-content h2 a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

.post-card-content h2 a:hover {
    color: #e94560;
}

.post-excerpt {
    font-size: 15px;
    color: #555;
    margin-bottom: 12px;
}

.post-meta {
    font-size: 13px;
    color: #888;
    margin-top: 12px;
    margin-bottom:10px;
}

/* ==========================================
   САЙДБАР (ЧИТАЙТЕ ТАКЖЕ)
========================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    border-bottom: 3px solid #e94560;
    padding-bottom: 8px;
}

.sidebar-post {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}

.sidebar-post {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    align-items: flex-start;
}

/* Фиксируем контейнер картинки */
.sidebar-post .post-thumb {
    flex-shrink: 0;          /* блок не сжимается */
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f0f0;     /* заливка, пока грузится картинка */
}

.sidebar-post .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* картинка заполняет блок без искажений */
    display: block;
}

.sidebar-post h4 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

.sidebar-post h4 a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-post h4 a:hover {
    color: #e94560;
}

/* ==========================================
   ОДИНОЧНАЯ ЗАПИСЬ (SINGLE)
========================================== */

article.single-post {
padding:20px;
}

article.single-post a{
color:#d63851;
}

article.single-post ul,
article.single-post ol{
margin-left:50px;
}

article.single-post h2,
article.single-post h3{
margin-top:30px;
}

.single-post {
    background: #ffffff;
  
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.single-post h1 {
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 16px;
}

.single-post p {
    margin-bottom: 20px;
}

/* ==========================================
   ПАГИНАЦИЯ
========================================== */
.pagination {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
    color: #1a1a2e;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

.pagination .current {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

/* ==========================================
   ПОДВАЛ (FOOTER)
========================================== */
.site-footer {
    background: #1a1a2e;
    color: #aaa;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
}

.site-footer a:hover {
    color: #e94560;
}

.footer-wrap {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copy {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #333;
    margin-top: 20px;
    font-size: 14px;
}

/* ==========================================
   АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ (ширина <= 1024px)
========================================== */
@media (max-width: 1024px) {
    .header-wrap {
        position: relative;
        padding-right: 50px;
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #ffffff;
        padding: 15px 0;
        margin-top: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.12);
        border-radius: 12px;
        border: 1px solid #f0f0f0;
        order: 3;
        flex-basis: 100%;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        padding: 12px 20px;
        font-size: 16px;
        border-bottom: 1px solid #f0f0f5;
        white-space: normal;
        border-radius: 0;
    }

    .nav-menu li:last-child a {
        border-bottom: none;
    }

    .nav-menu a:hover {
        background: #f8f9fa;
    }

    .site-title {
        padding-right: 50px;
        font-size: 20px;
    }
}

/* ==========================================
   АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ (ширина <= 768px)
========================================== */
@media (max-width: 768px) {
    .main-wrap {
        grid-template-columns: 1fr;
        gap: 30px;
    }

 .posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}


    .single-post h1 {
        font-size: 26px;
    }

    .sidebar-post {
        gap: 12px;
    }

    .sidebar-post img {
        width: 60px;
        height: 60px;
    }
}

/* ==========================================
   АДАПТАЦИЯ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ
========================================== */
@media (max-width: 480px) {
    .site-title {
        font-size: 18px;
        padding-right: 40px;
    }

    .menu-toggle {
        font-size: 24px;
        right: 0;
    }

    .nav-menu a {
        font-size: 15px;
        padding: 10px 16px;
    }

    .post-card-content {
        padding: 15px;
    }

    .post-card-content h2 {
        font-size: 16px;
    }

    .container {
        padding: 0 12px;
    }
}

/* ==========================================
   БЛОК ПОД ПОСТОМ (post-footer)
========================================== */

.post-footer {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f5;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* --- Рубрики и теги --- */
.post-taxonomies {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
}

.post-taxonomies a {
    color: #1a1a2e;
    text-decoration: none;
    padding: 2px 10px;
    background: #f0f0f5;
    border-radius: 4px;
    transition: all 0.2s;
}

.post-taxonomies a:hover {
    background: #e94560;
    color: #fff;
}

.tax-label {
    font-weight: 600;
    color: #1a1a2e;
}

/* --- Информация о посте --- */
.post-info {
    display: flex;
    flex-wrap: wrap;
    gap: 20px 30px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 15px;
}

.post-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-icon {
    font-size: 18px;
}

.info-label {
    color: #888;
}

.info-value {
    font-weight: 500;
    color: #1a1a2e;
}

/* --- Кнопка "Поделиться" --- */
.post-share {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.share-button {
    background: #e94560;
    color: #fff!important;
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.share-button:hover {
    background: #d63851;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.4);
}

/* --- Попап "Поделиться" --- */
.share-popup {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    background: #ffffff;
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    min-width: 280px;
    z-index: 50;
    border: 1px solid #f0f0f0;
}

.share-popup.active {
    display: block;
    animation: popupFadeIn 0.3s ease;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.share-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.share-close:hover {
    color: #1a1a2e;
}

.share-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
    color: #1a1a2e;
}

.share-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    color: #fff!important;
}

.share-link svg {
    flex-shrink: 0;
}

.share-link.vk {
    background: #4a76a8;
}
.share-link.vk:hover {
    background: #3b6390;
}

.share-link.ok {
    background: #f58220;
}
.share-link.ok:hover {
    background: #d6721a;
}

.share-link.tg {
    background: #0088cc;
}
.share-link.tg:hover {
    background: #0077b3;
}

/* --- Адаптация для мобильных --- */
@media (max-width: 768px) {
    .post-info {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }

    .post-share {
        justify-content: center;
    }

    .share-popup {
        right: 50%;
        transform: translateX(50%);
        min-width: 260px;
        padding: 20px;
    }

    .share-popup.active {
        transform: translateX(50%) scale(1);
    }

    .share-button {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   ПАГИНАЦИЯ ВНУТРИ ПОСТА (wp_link_pages)
========================================== */
.post-pagination {
    margin-top: 30px;
    padding: 15px 0;
    border-top: 2px solid #f0f0f5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.post-pagination .pages-label {
    font-weight: 600;
    color: #1a1a2e;
    margin-right: 10px;
    font-size: 15px;
}

.post-pagination .page-link {
    display: inline-block;
    padding: 8px 16px;
    background: #f8f9fa;
    color: #1a1a2e;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.post-pagination .page-link:hover {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
}

/* Текущая страница */
.post-pagination .page-link.current {
    background: #e94560;
    color: #fff;
    border-color: #e94560;
    pointer-events: none;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .post-pagination {
        gap: 6px;
    }
    .post-pagination .page-link {
        padding: 6px 12px;
        font-size: 14px;
    }
}

/* ==========================================
   БЛОК ПОДПИСКИ
========================================== */
.post-subscribe {
    margin-top: 10px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    text-align: center;
}

.subscribe-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #1a1a2e;
}

.subscribe-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    color: #fff!important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.subscribe-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    color: #fff;
}

.subscribe-btn .btn-icon {
    font-size: 18px;
}

.subscribe-btn.vk {
    background: #4a76a8;
}
.subscribe-btn.vk:hover {
    background: #3b6390;
}

.subscribe-btn.tg {
    background: #0088cc;
}
.subscribe-btn.tg:hover {
    background: #0077b3;
}

.subscribe-btn.max {
    background: #ff6b35;
}
.subscribe-btn.max:hover {
    background: #e55a2b;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .post-subscribe {
        padding: 15px;
    }
    .subscribe-buttons {
        flex-direction: column;
        align-items: center;
    }
    .subscribe-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================
   ОЦЕНКА ПОСТА (5 ЗВЕЗД)
========================================== */
.post-rating {
    margin-top: 30px;
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.rating-title {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a2e;
}

.rating-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    /* Убираем direction: rtl */
}

.rating-stars .star {
    font-size: 36px;
    color: #ddd;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

.rating-stars .star:hover,
.rating-stars .star.active,
.rating-stars .star.hover {
    color: #f5c518;
}

.rating-stars .star.active {
    color: #f5c518;
}

.rating-result {
    font-size: 15px;
    color: #666;
}

.rating-score {
    font-weight: 700;
    color: #1a1a2e;
    font-size: 18px;
}

.rating-count {
    font-weight: 600;
    color: #1a1a2e;
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .post-rating {
        padding: 15px;
    }
    .rating-stars .star {
        font-size: 28px;
    }
}

/* ==========================================
   КОММЕНТАРИИ
========================================== */

.post-comments-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f5;
}

.comments-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #1a1a2e;
}

/* --- Форма комментариев --- */
.comment-form-wrapper {
    margin-bottom: 30px;
}

.comment-form-wrapper textarea {
    width: 100%;
    padding: 14px 18px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #ffffff;
    resize: vertical;
    min-height: 100px;
    box-sizing: border-box;
}

.comment-form-wrapper textarea:focus {
    border-color: #e94560;
    outline: none;
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

/* --- Кнопка отправки в стандартной форме --- */
.comment-form-wrapper .submit {
    padding: 12px 30px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.comment-form-wrapper .submit:hover {
    background: #d63851;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

/* --- Гостевая форма (кнопка "Добавить") --- */
.guest-comment .comment-field-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.comment-submit-btn {
    align-self: flex-end;
    padding: 12px 35px;
    background: #e94560;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.comment-submit-btn:hover {
    background: #d63851;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.4);
}

.comment-auth-hint {
    font-size: 14px;
    color: #888;
    margin: 8px 0 0 0;
}

/* --- Модальное окно --- */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.auth-modal.show {
    display: flex;
    animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-modal-content {
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 28px;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}

.auth-modal-close:hover {
    color: #1a1a2e;
}

.auth-modal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1a1a2e;
}

.auth-modal-hint {
    font-size: 14px;
    color: #888;
    margin: 15px 0 0 0;
}

/* --- Список комментариев --- */
.comments-list {
    margin-top: 30px;
}

.comment {
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f5;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author .avatar {
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    color: #1a1a2e;
}

.comment-metadata {
    font-size: 13px;
    color: #888;
}

.comment-content {
    margin: 8px 0 0 0;
    font-size: 15px;
    line-height: 1.7;
}

.comment-respond {
    margin-top: 30px;
}

.comments-closed {
    color: #888;
    font-style: italic;
}

/* --- Адаптация для мобильных --- */
@media (max-width: 480px) {
    .auth-modal-content {
        padding: 25px 20px;
    }
    
    .comment-submit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .auth-modal-title {
        font-size: 18px;
    }
}


/* ===== КНОПКА УДАЛЕНИЯ КОММЕНТАРИЯ ===== */
.delete-comment-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    transition: color 0.2s;
}

.delete-comment-btn:hover {
    color: #b02a37;
    text-decoration: underline;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.comment-actions a,
.comment-actions button {
    font-size: 13px;
    text-decoration: none;
    color: #888;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.comment-actions a:hover,
.comment-actions button:hover {
    color: #e94560;
}

.comment-actions .comment-delete-link {
    color: #dc3545;
}

.comment-actions .comment-delete-link:hover {
    color: #b02a37;
    text-decoration: underline;
}

.comment-reply-link {
    font-size: 13px;
    text-decoration: none;
    color: #888;
    transition: color 0.2s;
}

.comment-reply-link:hover {
    color: #e94560;
}