/* Основные стили сайта */
:root {
    --primary-color: rgb(5, 107, 182);
    --secondary-color: #343a40;
    --accent-color: #dc3545;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
}

/* Переопределение цветов Bootstrap */
.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    color: #333;
    background-color: #f5f5f5;
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Шапка сайта */
.logo-container {
    max-height: 80px;
    padding: 10px 0;
}

.logo-container img {
    max-height: 60px;
}

/* Новые стили навигации */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0;
    position: relative;
    overflow: visible !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    padding: 1rem 1.2rem;
    transition: all 0.3s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Стили для dropdown меню - совместимы с Bootstrap 5 */
.navbar-nav {
    position: static;
    overflow: visible !important;
}

.navbar-nav .dropdown {
    position: static;
    overflow: visible !important;
}

.navbar-nav .dropdown-menu {
    border: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0;
    padding: 0.5rem 0;
    min-width: 200px;
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    background-color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.navbar-nav .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #333 !important;
    background-color: transparent;
}

.navbar-nav .dropdown-item:hover,
.navbar-nav .dropdown-item:focus {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Убираем все overflow ограничения */
.container {
    overflow: visible !important;
}

.navbar-collapse {
    overflow: visible !important;
}

.collapse {
    overflow: visible !important;
}

.navbar-expand-lg .navbar-nav {
    overflow: visible !important;
}

/* Фиксируем проблему с позиционированием */
@media (min-width: 992px) {
    .navbar-nav .dropdown {
        position: relative;
    }
    
    .navbar-nav .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: auto;
        bottom: auto;
        transform: none;
    }
    
    .navbar-nav .dropdown-menu.show {
        display: block;
    }
}

/* Мобильные стили */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        border: none;
        border-radius: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        background-color: rgba(255, 255, 255, 0.95) !important;
        margin-top: 2px;
        padding: 0.5rem 0;
        position: static !important;
        z-index: auto;
        min-width: auto;
        width: 100%;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .navbar-nav .dropdown-item {
        color: #333 !important;
        padding: 0.7rem 1.5rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
        font-weight: 500;
    }
    
    .navbar-nav .dropdown-item:last-child {
        border-bottom: none;
    }
    
    .navbar-nav .dropdown-item:hover,
    .navbar-nav .dropdown-item:focus,
    .navbar-nav .dropdown-item:active {
        background-color: var(--primary-color) !important;
        color: #fff !important;
    }
    
    /* Стили для открытого dropdown в мобильной версии */
    .navbar-nav .dropdown.show .dropdown-menu,
    .navbar-nav .dropdown-menu.show {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    /* Принудительный показ для мобильной версии */
    .navbar-nav .dropdown-menu[style*="display: block"] {
        display: block !important;
    }
    
    /* Супер-принудительный класс для мобильного dropdown */
    .force-show-mobile {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        transform: none !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: none !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15) !important;
        border-radius: 0 0 5px 5px !important;
        z-index: 9999 !important;
        width: 100% !important;
        min-height: auto !important;
        margin-top: 2px !important;
        padding: 0.5rem 0 !important;
    }
    
    /* Убираем стрелочку dropdown в мобильной версии для лучшего вида */
    .navbar-nav .dropdown-toggle::after {
        margin-left: 0.5rem;
    }
}

/* Карточки статей */
.article-card {
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    background-color: #fff;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.article-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.article-card .card-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.article-card .card-text {
    color: #6c757d;
}

.article-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 10px;
}

/* Детальная страница статьи */
.article-header {
    margin-bottom: 30px;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.article-meta-detail {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-image {
    margin: 20px 0;
    border-radius: 5px;
    overflow: hidden;
}

.article-image img {
    width: 100%;
}

/* Категории */
.category-header {
    background-color: var(--light-gray);
    padding: 30px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-description {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Футер */
footer {
    background-color: var(--dark-gray);
}

footer h5 {
    font-weight: 700;
    margin-bottom: 20px;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.social-icons a {
    font-size: 1.2rem;
    display: inline-block;
    margin-right: 10px;
    transition: transform 0.3s;
}

.social-icons a:hover {
    transform: scale(1.2);
}

/* Карусель на главной странице */
.hero-carousel .carousel-item {
    position: relative;
}

.hero-carousel .carousel-image-container {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.hero-carousel .carousel-caption {
    text-align: left;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    padding: 40px 0;
}

.hero-carousel .carousel-caption .bg-dark {
    border-radius: 8px;
}

.hero-carousel h1.display-5 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.hero-carousel p.lead {
    font-size: 1rem;
    margin-bottom: 15px;
}

.hero-carousel .carousel-indicators {
    bottom: 10px;
}

.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}

.hero-carousel .carousel-control-prev {
    left: 20px;
}

.hero-carousel .carousel-control-next {
    right: 20px;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.7);
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    .hero-carousel .carousel-image-container {
        height: 400px !important;
    }
    
    .hero-carousel .carousel-caption .col-md-7 {
        width: 100%;
    }
    
    .hero-carousel h1 {
        font-size: 1.5rem;
    }
    
    .hero-carousel p.lead {
        font-size: 0.9rem;
    }
    
    /* Адаптивные стили для статей */
    .article-title {
        font-size: 1.8rem;
    }
    
    .article-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    /* Адаптивные изображения в статьях */
    .article-content img {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
        display: block;
        margin: 15px auto;
        border-radius: 5px;
    }
    
    /* Адаптивные изображения в карточках */
    .article-card .card-img-top {
        height: 180px;
        object-fit: cover;
        width: 100%;
    }
    
    /* Адаптивная сетка для похожих статей */
    .related-articles .col-md-4 {
        margin-bottom: 20px;
    }
    
    /* Адаптивные кнопки социальных сетей */
    .social-share .btn {
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }
    
    /* Адаптивная навигация */
    .navbar-nav {
        text-align: center;
    }
    
    /* Адаптивный поиск */
    .search-box {
        margin-bottom: 15px;
        width: 100%;
    }
    
    .search-box .d-flex {
        width: 100%;
    }
    
    .search-box input {
        flex: 1;
    }
    
    /* Адаптивный header */
    header .row {
        text-align: center;
    }
    
    header .col-md-4,
    header .col-md-8 {
        margin-bottom: 15px;
    }
    
    .logo-container {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .social-icons {
        justify-content: center;
        display: flex;
    }
    
    /* Адаптивная форма поиска в header */
    .search-box form {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .article-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .article-meta-detail {
        font-size: 0.8rem;
    }
    
    .article-content {
        font-size: 0.95rem;
    }
    
    /* Изображения на очень маленьких экранах */
    .article-content img {
        margin: 10px auto;
        border-radius: 3px;
    }
    
    /* Карточки статей на маленьких экранах */
    .article-card .card-img-top {
        height: 150px;
    }
    
    .article-card .card-title {
        font-size: 1.1rem;
    }
    
    .article-card .card-text {
        font-size: 0.9rem;
    }
    
    /* Социальные кнопки на маленьких экранах */
    .social-share .btn {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
}

/* Общие адаптивные стили для всех изображений */
img {
    max-width: 100%;
    height: auto;
}

/* Предотвращение переполнения контейнеров */
.container,
.container-fluid {
    overflow-x: hidden;
}

/* Класс для адаптивных изображений */
.img-responsive {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 15px auto;
}

/* Стили для изображений в контенте статей */
.article-content img,
.single-article img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
    display: block;
    margin: 15px auto;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Стили для figure элементов */
.article-content figure,
.single-article figure {
    margin: 20px 0;
    text-align: center;
    max-width: 100% !important;
    width: auto !important;
}

.article-content figure img,
.single-article figure img {
    margin: 0 auto;
}

.article-content figcaption,
.single-article figcaption {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
    text-align: center;
}

/* Адаптивные таблицы */
.article-content table,
.single-article table {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.article-content table th,
.article-content table td,
.single-article table th,
.single-article table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.article-content table th,
.single-article table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Обертка для горизонтальной прокрутки таблиц на мобильных */
.table-responsive-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .article-content table,
    .single-article table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .article-content table th,
    .article-content table td,
    .single-article table th,
    .single-article table td {
        padding: 6px 8px;
        min-width: 100px;
    }
} 