/* article.css
 *
 * Стили страницы статьи (news-show / ГОСТ / марка) — вынесены из
 * resources/views/pages/news-show.blade.php (раньше были inline <style>).
 *
 * Подключение: через @push('page_styles') только на страницах статьи.
 */

.news-detail-page {
    padding-bottom: 60px;
}

/* Хлебные крошки */
.breadcrumbs {
    margin: 20px 0;
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumbs__item {
    display: flex;
    align-items: center;
}

.breadcrumbs__item a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumbs__item a:hover {
    color: #f0cf4c;
}

.breadcrumbs__sep {
    margin: 0 8px;
    color: #d1d5db;
    font-size: 10px;
}

.breadcrumb_last {
    color: #1a1a1a;
    font-weight: 500;
}

/* Шапка */
.news-detail-header {
    padding: 30px 0;
    background: #f9fafb;
    margin-bottom: 40px;
}

.news-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6b7280;
}

.news-detail-category {
    color: #6b7280;
    font-size: 14px;
}
.news-detail-category::after {
    content: ' • ';
    margin: 0 4px;
    color: #d1d5db;
}
.news-detail-date {
    color: #f0cf4c;
    font-weight: 500;
}

.gost-article__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 24px;
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}
.gost-article__meta-item {
    display: inline;
}
.gost-article__meta a {
    color: #b8860b;
    text-decoration: none;
}
.gost-article__meta a:hover {
    text-decoration: underline;
}

.news-detail-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .news-detail-title {
        font-size: 22px;
    }
}

/* Контент */
.news-detail-image {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
}

.news-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.news-detail-content {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
}

.news-detail-content p {
    margin: 0 0 16px;
}

.news-detail-content h2,
.news-detail-content h3 {
    font-weight: 700;
    color: #1a1a1a;
    margin: 30px 0 16px;
}

.news-detail-content h2 {
    font-size: 22px;
}

.news-detail-content h3 {
    font-size: 18px;
}

.news-detail-content ul,
.news-detail-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.news-detail-content li {
    margin-bottom: 8px;
}

/* Таблицы в статье */
.news-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.news-detail-content thead {
    background: #f3f4f6;
}

.news-detail-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #e5e7eb;
}

.news-detail-content td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.news-detail-content tbody tr:last-child td {
    border-bottom: none;
}

.news-detail-content tbody tr:hover {
    background: #f9fafb;
}

/* Ссылки в статье */
.news-detail-content a {
    color: #b8860b;
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 134, 11, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.news-detail-content a:hover {
    color: #8b6914;
    border-bottom-color: #b8860b;
}

/* Фото внутри текста статьи */
.news-detail-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@media (max-width: 767px) {
    .news-detail-content table {
        font-size: 14px;
        margin: 16px 0;
        min-width: 320px;
    }

    .news-detail-content th,
    .news-detail-content td {
        padding: 10px 12px;
    }

    .news-detail-content img {
        margin: 16px 0;
        border-radius: 8px;
    }
}

/* Обёртка для горизонтального скролла таблицы на мобильных */
.news-detail-content .table-scroll {
    margin: 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (max-width: 767px) {
    .news-detail-content .table-scroll {
        margin: 16px 0;
        margin-left: calc(-1 * var(--container-padding, 16px));
        margin-right: calc(-1 * var(--container-padding, 16px));
        border-radius: 0;
    }

    .news-detail-content .table-scroll table {
        min-width: 400px;
        margin: 0;
    }
}

/* Другие новости */
.related-news {
    margin-top: 60px;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
}

.related-news-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 991px) {
    .related-news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .related-news-grid {
        grid-template-columns: 1fr;
    }
}

/* Список без фото (для статей справочника ГОСТов) */
.related-news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.related-news-list__link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid #e5e7eb;
    transition: background 0.2s, border-color 0.2s;
}
.related-news-list__link:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}
.related-news-list__title {
    font-weight: 500;
    font-size: 15px;
    flex: 1;
    min-width: 0;
}
.related-news-list__link:hover .related-news-list__title {
    color: #b8860b;
}
.related-news-list__date {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
}

.related-news-card {
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.related-news-card:hover {
    transform: translateY(-4px);
}

.related-news-card__img {
    height: 140px;
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
}

.related-news-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #d1d5db;
}

.related-news-card__placeholder-icon {
    font-size: 32px;
}

.related-news-card__img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-news-card__content {
    padding: 16px;
}

.related-news-card__date {
    font-size: 12px;
    color: #f0cf4c;
    margin-bottom: 6px;
}

.related-news-card__title {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.related-news-card:hover .related-news-card__title {
    color: #f0cf4c;
}

/* Двухколоночный layout: контент + сайдбар */
.news-detail-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 32px;
    align-items: start;
}
.news-detail-main {
    min-width: 0;
}

@media (max-width: 991px) {
    .news-detail-layout {
        grid-template-columns: 1fr;
    }
}

.news-single-sidebar {
    position: sticky;
    top: 24px;
}

.news-sidebar-widget {
    background: #fafbfc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #eef0f2;
}

.news-sidebar-widget:last-child {
    margin-bottom: 0;
}

.news-sidebar-widget__title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}

.news-sidebar-widget__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-sidebar-widget__list li {
    margin-bottom: 6px;
}

.news-sidebar-widget__list li:last-child {
    margin-bottom: 0;
}

.news-sidebar-widget__list a {
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: block;
    padding: 6px 0;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}

.news-sidebar-widget__list a:hover {
    color: #b8860b;
    background: rgba(240, 207, 76, 0.08);
}

.news-sidebar-widget__list .count {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.news-sidebar-widget__date {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Слайдер товаров по ГОСТу */
.gost-products-slider {
    margin-top: 48px;
    margin-bottom: 0;
    overflow: hidden;
    min-width: 0;
    width: 100%;
}
.gost-products-slider .section-title {
    margin-bottom: 20px;
}

/* Слайдер товаров - адаптивный */
.gost-products-slider__wrap {
    position: relative;
    padding: 0;
    max-width: 100%;
    min-width: 0;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

/* ПК (>= 769px) - сетка из 4 товаров без слайдера */
@media (min-width: 769px) {
    .gost-products-swiper {
        overflow: visible !important;
    }
    .gost-products-swiper .swiper-wrapper {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
        transform: none !important;
    }
    .gost-products-swiper .swiper-slide {
        width: 100% !important;
        margin-right: 0 !important;
    }
    .gost-products-swiper-prev,
    .gost-products-swiper-next,
    .gost-products-swiper-pagination {
        display: none !important;
    }
}

/* Мобильные (< 769px) - swiper слайдер */
@media (max-width: 768px) {
    .gost-products-slider__wrap {
        padding: 0 44px;
        overflow: hidden;
    }
    .gost-products-swiper {
        overflow: hidden;
        padding-bottom: 16px;
        width: 100%;
        min-width: 0;
    }
    .gost-products-swiper .swiper-wrapper {
        display: flex;
        align-items: stretch;
    }
    .gost-products-swiper-prev,
    .gost-products-swiper-next {
        display: flex !important;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        margin-top: -18px;
        border-radius: 50%;
        background: #fff;
        border: 1px solid #e5e7eb;
        color: #374151;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        z-index: 10;
        cursor: pointer;
        font-size: 14px;
    }
    .gost-products-swiper-prev:hover,
    .gost-products-swiper-next:hover {
        background: #f0cf4c;
        border-color: #f0cf4c;
        color: #1a1a1a;
    }
    .gost-products-swiper-prev::after,
    .gost-products-swiper-next::after {
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
    }
    .gost-products-swiper-prev::after {
        content: '\\f104';
    }
    .gost-products-swiper-next::after {
        content: '\\f105';
    }
    .gost-products-swiper-prev {
        left: 0;
    }
    .gost-products-swiper-next {
        right: 0;
    }
}

@media (max-width: 640px) {
    .gost-products-slider__wrap {
        padding: 0 36px;
    }
    .gost-products-swiper-prev,
    .gost-products-swiper-next {
        width: 32px;
        height: 32px;
        margin-top: -16px;
    }
}

.gost-products-slide {
    height: auto;
    box-sizing: border-box;
}
.gost-products-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.gost-products-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.gost-products-card__img {
    position: relative;
    padding-top: 75%;
    background: #f9fafb;
    overflow: hidden;
}
.gost-products-card__img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gost-products-card__ph {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #d1d5db;
}
.gost-products-card__body {
    padding: 16px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.gost-products-card__title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    word-break: break-word;
}
.gost-products-card__price {
    font-size: 13px;
    color: #374151;
    margin-bottom: 12px;
}
.gost-products-card__btn {
    margin-top: auto;
    font-size: 13px;
    font-weight: 500;
    color: #b8860b;
}
.gost-products-card:hover .gost-products-card__btn {
    text-decoration: underline;
}
.gost-products-swiper-pagination {
    position: relative;
    margin-top: 16px;
}

/* Скрываем стрелки swiper по умолчанию (будут показаны только на мобильных) */
.gost-products-swiper-prev,
.gost-products-swiper-next {
    display: none;
}
.gost-products-slider__more {
    margin: 16px 0 0;
    text-align: center;
}
.gost-products-slider__more-link {
    font-size: 15px;
    font-weight: 500;
    color: #b8860b;
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 134, 11, 0.35);
}
.gost-products-slider__more-link:hover {
    color: #8b6914;
    border-bottom-color: #b8860b;
}

