/* Navigation styles */
.nav-link-about {
    color: #E30A18 !important;
}

.nav-link-about:hover,
.nav-link-about:focus {
    color: #b8291a !important;
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    height: 60px;
}

.footer > .container {
    padding-right: 15px;
    padding-left: 15px;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(255, 255, 255, 0.5);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}

/* News styles */
.btn-news {
    background-color: #E30A18;
    color: #ffffff !important;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-news,
.btn-news a {
    color: #ffffff !important;
}

.btn-news:hover,
.btn-news:focus,
.btn-news:hover a,
.btn-news:focus a {
    background-color: #b8291a;
    color: #ffffff !important;
    text-decoration: none;
}

.btn-news:active,
.btn-news:active a {
    background-color: #9e2215;
    color: #ffffff !important;
}

/* Цвет ссылок в заголовках карточек новостей - переопределяем main.css */
.news-swiper-wrapper .card-body a:not(.btn),
.news-swiper .card-body a:not(.btn),
.news-index .card-body a:not(.btn),
.news-view .card-body a:not(.btn),
.news-swiper-wrapper .card .card-body .card-title a,
.news-swiper .card .card-body .card-title a,
.news-index .card .card-body .card-title a,
.news-view .card .card-body .card-title a,
.news-swiper-wrapper .card-title a,
.news-swiper .card-title a,
.news-index .card-title a,
.news-view .card-title a {
    color: #E30A18 !important;
    text-decoration: none !important;
}

.news-swiper-wrapper .card-body a:not(.btn):hover,
.news-swiper .card-body a:not(.btn):hover,
.news-index .card-body a:not(.btn):hover,
.news-view .card-body a:not(.btn):hover,
.news-swiper-wrapper .card .card-body .card-title a:hover,
.news-swiper .card .card-body .card-title a:hover,
.news-index .card .card-body .card-title a:hover,
.news-view .card .card-body .card-title a:hover,
.news-swiper-wrapper .card-title a:hover,
.news-swiper .card-title a:hover,
.news-index .card-title a:hover,
.news-view .card-title a:hover {
    color: #b8291a !important;
    text-decoration: underline !important;
}

.other-news-section {
    background-color: #f8f9fa;
    padding: 40px 0;
}

.other-news-section h2 {
    color: #333;
    font-size: 1.75rem;
    font-weight: 600;
}

.news-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}


/* Empty state message */
.empty-state {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 40px 20px;
    text-align: center;
    margin: 30px 0;
}

.empty-state p {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
}

/* Pagination styles */
.pagination {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination .page-link {
    color: #E30A18;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #ffffff;
    background-color: #E30A18;
    border-color: #E30A18;
}

.pagination .page-item.active .page-link {
    background-color: #E30A18;
    border-color: #E30A18;
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: #dee2e6;
}

/* News content styles - ограничение размера изображений */
.news-body img,
.news-content img,
.news-body p img,
.news-content p img,
.news-body figure img,
.news-content figure img,
.news-body div img,
.news-content div img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 15px auto;
}

.news-body,
.news-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Универсальные стили для всех изображений в контенте новостей */
.news-view .container img,
.news-view img,
.news-view .news-body img,
.news-view .news-content img,
.news-view .news-body * img,
.news-view .news-content * img {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
}

/* Стили для изображений внутри контента новости (из редактора) */
.news-body * img,
.news-content * img,
.news-body table img,
.news-content table img,
.news-body ul img,
.news-content ul img,
.news-body ol img,
.news-content ol img {
    max-width: 100% !important;
    height: auto !important;
    box-sizing: border-box;
}

/* Дополнительные стили для страницы просмотра новости */
.news-view .news-body,
.news-view .news-content {
    max-width: 100%;
    overflow: hidden;
}

.news-view .news-body img,
.news-view .news-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Стрелки за пределами блока */
.news-swiper-button-prev,
.news-swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: transparent;
    opacity: 0.7;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 0;
}

.news-swiper-button-prev {
    left: -70px;
}

.news-swiper-button-next {
    right: -70px;
}

.news-swiper-button-prev:hover,
.news-swiper-button-next:hover {
    opacity: 1;
}

.news-swiper-button-prev svg,
.news-swiper-button-next svg {
    width: 14px;
    height: 25px;
}

.news-swiper-button-prev::after,
.news-swiper-button-next::after {
    display: none;
}

/* Исправление отображения карточек в Swiper */
.news-swiper .swiper-slide {
    width: auto;
    height: auto;
    display: flex;
}

.news-swiper .swiper-slide .card {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.news-swiper .swiper-wrapper {
    align-items: stretch;
}

@media (max-width: 991px) {
    .news-swiper {
        padding: 0 40px;
    }
    
    .news-swiper-button-prev {
        left: -50px;
    }
    
    .news-swiper-button-next {
        right: -50px;
    }
}

@media (max-width: 767px) {
    .news-swiper {
        padding: 0 20px;
    }
    
    .news-swiper-button-prev,
    .news-swiper-button-next {
        display: none;
    }
}

/* Соотношение сторон 16:9 для изображений в карточках новостей */
.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 соотношение (9/16 = 0.5625) */
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}