/* ========================================
   ОСНОВНЫЕ СТИЛИ
   ======================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

a {
    transition: color 0.2s ease;
}

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

/* ========================================
   САЙДБАР
   ======================================== */
.sidebar-widget {
    background: #fff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-widget h5 {
    border-bottom: 2px solid #0d6efd;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li {
    padding: 0.25rem 0;
}

.sidebar-widget ul li a {
    color: #495057;
    text-decoration: none;
}

.sidebar-widget ul li a:hover {
    color: #0d6efd;
}

/* ========================================
   КАРТОЧКИ ПОСТОВ
   ======================================== */
.post-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.post-card .post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .post-body {
    padding: 1.25rem;
}

.post-card .post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.post-card .post-title a:hover {
    color: #0d6efd;
}

.post-card .post-meta {
    color: #6c757d;
    font-size: 0.875rem;
}

.post-card .post-excerpt {
    color: #495057;
    margin: 0.5rem 0;
}

.post-card .post-tags .badge {
    background-color: #e9ecef;
    color: #495057;
    text-decoration: none;
    margin-right: 0.25rem;
    font-weight: 400;
}

.post-card .post-tags .badge:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* Карточки с текстом на картинке (главная) */
.featured-main-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.featured-main-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.small-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
}

.small-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12) !important;
}

/* ========================================
   ОБЛАКО ТЕГОВ
   ======================================== */
.tag-cloud .badge {
    background-color: #e9ecef;
    color: #495057;
    text-decoration: none;
    margin: 0.2rem;
    font-weight: 400;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-cloud .badge:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* ========================================
   КОНТЕНТ ПОСТА
   ======================================== */
.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #212529;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.post-content h1 { font-size: 2rem; }
.post-content h2 { font-size: 1.75rem; }
.post-content h3 { font-size: 1.5rem; }
.post-content h4 { font-size: 1.25rem; }

.post-content p {
    margin-bottom: 1rem;
}

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

.post-content blockquote {
    border-left: 4px solid #0d6efd;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
    color: #495057;
    font-style: italic;
}

.post-content blockquote p {
    margin-bottom: 0;
}

.post-content ul,
.post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
}

.post-content table th,
.post-content table td {
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.post-content table th {
    background-color: #e9ecef;
    font-weight: 600;
}

.post-content pre {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.post-content code {
    background: #f1f3f4;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Мета-информация поста */
.post-meta {
    font-size: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
}

/* Похожие посты */
.related-posts .card {
    transition: transform 0.2s ease;
}

.related-posts .card:hover {
    transform: translateY(-2px);
}

/* ========================================
   ПАГИНАЦИЯ
   ======================================== */
.pagination .page-link {
    color: #0d6efd;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    margin: 0 0.1rem;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
    color: #0a58ca;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    background: transparent;
}

/* ========================================
   МНОГОУРОВНЕВОЕ МЕНЮ
   ======================================== */
/* Базовые стили для dropdown */
.dropdown:hover > .dropdown-menu {
    display: block;
}

.dropdown > .dropdown-menu {
    display: none;
    margin-top: 0;
}

/* Темное выпадающее меню */
.dropdown-menu-dark {
    background-color: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem;
    min-width: 220px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.dropdown-menu-dark .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-weight: 400;
}

.dropdown-menu-dark .dropdown-item:hover,
.dropdown-menu-dark .dropdown-item:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-dark .dropdown-item:active {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Стрелки для подменю */
.dropdown-menu-dark .dropdown-toggle::after {
    margin-left: auto;
}

/* Подменю второго уровня */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu > .dropdown-menu {
    display: none;
    top: -0.5rem;
    left: 100%;
    margin-top: 0;
    margin-left: 0.25rem;
    border-radius: 0.5rem;
}

.dropdown-submenu .dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dropdown-submenu .dropdown-item i {
    margin-right: 0.5rem;
}

/* Стрелка у пункта с подменю */
.dropdown-submenu > .dropdown-item::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    margin-left: 0.75rem;
    opacity: 0.6;
    transition: transform 0.25s ease;
}

.dropdown-submenu:hover > .dropdown-item::after {
    transform: translateX(4px);
    opacity: 1;
}

/* Плавное появление меню */
.dropdown-menu-dark {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.dropdown:hover > .dropdown-menu-dark,
.dropdown-submenu:hover > .dropdown-menu-dark {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

/* Планшеты и маленькие ноутбуки */
@media (max-width: 992px) {
    /* Меню — раскрытие по клику */
    .dropdown:hover > .dropdown-menu {
        display: none;
    }

    .dropdown.show > .dropdown-menu {
        display: block;
    }

    .dropdown-submenu:hover > .dropdown-menu {
        display: none;
    }

    .dropdown-submenu.show > .dropdown-menu {
        display: block;
    }

    .dropdown-menu-dark {
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding-left: 1.25rem;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
    }

    .dropdown-menu-dark .dropdown-item {
        color: rgba(255, 255, 255, 0.75);
        padding: 0.4rem 1rem;
    }

    .dropdown-menu-dark .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .dropdown-submenu > .dropdown-menu {
        padding-left: 1.25rem;
        background-color: transparent;
        border: none;
        box-shadow: none;
    }

    .dropdown-submenu > .dropdown-item::after {
        content: '\f078';
    }

    .dropdown-submenu.show > .dropdown-item::after {
        transform: rotate(180deg);
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .post-card .post-image {
        height: 150px;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h1 { font-size: 1.5rem; }
    .post-content h2 { font-size: 1.25rem; }
    .post-content h3 { font-size: 1.125rem; }

    .post-content table {
        font-size: 0.85rem;
    }

    .post-content table th,
    .post-content table td {
        padding: 0.25rem 0.5rem;
    }

    .sidebar-widget {
        padding: 1rem;
    }

    .featured-main-card .position-relative {
        height: 250px !important;
    }

    .small-card .position-relative {
        height: 150px !important;
    }
}

/* Маленькие телефоны */
@media (max-width: 576px) {
    .featured-main-card .position-relative {
        height: 220px !important;
    }
}

/* ========================================
   УВЕЛИЧЕНИЕ КАРТИНКИ ПРИ НАВЕДЕНИИ (РАБОЧАЯ ВЕРСИЯ)
   ======================================== */

.image-zoom-wrap {
    overflow: hidden !important;
    position: relative;
}

.image-zoom {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    will-change: transform;
}

/* Наведение на ссылку (обертка карточки) */
a:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Наведение на карточку */
.card:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Наведение на контейнер */
.image-zoom-wrap:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* Универсальный селектор на всякий случай */
[class*="card"]:hover .image-zoom {
    transform: scale(1.1) !important;
}

/* ========================================
   ВСТРАИВАЕМЫЕ ВИДЕО
   ======================================== */

.video-embed-wrapper {
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .video-embed iframe {
        height: 300px;
    }

    .video-embed-wrapper {
        padding: 0.25rem;
    }
}

/* ========================================
   COOKIE СОГЛАСИЕ (GDPR) - БАННЕР ВНИЗУ
   ======================================== */

.cookie-consent {
    position: fixed;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #1a1a2e !important;
    color: #fff !important;
    padding: 0.75rem 2rem !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 99999 !important;
    border-top: 2px solid rgba(255, 255, 255, 0.08) !important;
    display: none;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-text {
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    min-width: 200px;
    color: #fff;
}

.cookie-text i {
    color: #fbbf24;
    font-size: 1.1rem;
}

.cookie-link {
    color: #60a5fa !important;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: #93bbfc !important;
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.cookie-buttons .btn-primary {
    background: #3b82f6 !important;
    border: none !important;
    padding: 0.4rem 1.2rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    transition: background 0.2s ease;
    color: #fff !important;
}

.cookie-buttons .btn-primary:hover {
    background: #2563eb !important;
}

.cookie-buttons .btn-outline-secondary {
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #d1d5db !important;
    padding: 0.4rem 1.2rem !important;
    font-size: 0.85rem !important;
    border-radius: 6px !important;
    background: transparent !important;
    transition: all 0.2s ease;
}

.cookie-buttons .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* ========================================
   АДАПТИВ ДЛЯ COOKIE
   ======================================== */

@media (max-width: 768px) {
    .cookie-consent {
        padding: 0.6rem 1rem !important;
    }

    .cookie-consent-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .cookie-text {
        font-size: 0.8rem;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: flex-end;
    }

    .cookie-buttons .btn-primary,
    .cookie-buttons .btn-outline-secondary {
        padding: 0.3rem 1rem !important;
        font-size: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .cookie-consent {
        padding: 0.5rem 0.75rem !important;
    }

    .cookie-text {
        font-size: 0.7rem;
    }

    .cookie-buttons {
        gap: 0.3rem;
    }

    .cookie-buttons .btn-primary,
    .cookie-buttons .btn-outline-secondary {
        padding: 0.2rem 0.75rem !important;
        font-size: 0.7rem !important;
    }
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 8px;
    }
}