/*
 * Полная страница новости
 * Путь: /templates/metallurg-dle-template/css/fullstory.css
 */

.article-full {
    --full-red: var(--red, #c61020);
    --full-gold: var(--gold, #f6c542);
    --full-ink: var(--ink, #141414);
    --full-muted: var(--muted, #6e6e73);
    --full-line: var(--line, #e8e8ea);
    --full-radius: var(--radius, 18px);

    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    padding: clamp(24px, 4vw, 46px);
    color: var(--full-ink);
    border: 1px solid var(--full-line);
    border-radius: var(--full-radius);
    background: #fff;
    box-shadow: 0 16px 42px rgba(20, 20, 20, .06);
}

/* Шапка публикации */
.article-full__header {
    min-width: 0;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--full-line);
}

.article-full__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    color: var(--full-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.article-full__meta a {
    color: var(--full-red);
    font-weight: 900;
}

.article-full__meta a:hover {
    text-decoration: underline;
}

.article-full__header h1 {
    max-width: 100%;
    margin: 13px 0 0;
    color: var(--full-ink);
    font-size: clamp(32px, 4.5vw, 56px);
    font-weight: 900;
    line-height: 1.04;
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

/* Главное изображение */
.article-full__cover {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin: 28px 0;
    border-radius: 15px;
    background: #ececee;
}

.article-full__cover img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Текст публикации */
.article-full__content {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    color: #242424;
    font-size: 17px;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.article-full__content > :first-child {
    margin-top: 0;
}

.article-full__content > :last-child {
    margin-bottom: 0;
}

.article-full__content p {
    max-width: 100%;
    margin: 0 0 1.25em;
}

.article-full__content h2,
.article-full__content h3,
.article-full__content h4 {
    max-width: 100%;
    margin: 1.55em 0 .65em;
    color: var(--full-ink);
    line-height: 1.15;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.article-full__content h2 {
    font-size: clamp(27px, 3.4vw, 38px);
}

.article-full__content h3 {
    font-size: clamp(23px, 2.8vw, 31px);
}

.article-full__content h4 {
    font-size: 21px;
}

.article-full__content a {
    color: var(--full-red);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.article-full__content ul,
.article-full__content ol {
    max-width: 100%;
    margin: 0 0 1.35em;
    padding-left: 1.4em;
}

.article-full__content li {
    margin: .35em 0;
}

/* Любые изображения внутри текста */
.article-full__content img,
.article-full__content picture,
.article-full__content svg,
.article-full__content canvas {
    max-width: 100% !important;
    height: auto !important;
}

.article-full__content img {
    display: block;
    margin: 24px auto;
    border-radius: 12px;
}

/* Видео, iframe, Rutube, VK и другие вставки */
.article-full__content iframe,
.article-full__content video,
.article-full__content embed,
.article-full__content object {
    width: 100% !important;
    max-width: 100% !important;
    display: block;
    border: 0;
    border-radius: 12px;
}

.article-full__content iframe {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9;
}

.article-full__content video {
    height: auto !important;
}

.article-full__content .video-box,
.article-full__content .video-responsive,
.article-full__content .embed-responsive,
.article-full__content .iframe-wrapper {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    background: #111;
}

.article-full__content .video-box iframe,
.article-full__content .video-responsive iframe,
.article-full__content .embed-responsive iframe,
.article-full__content .iframe-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

/* Защита от размеров, прописанных прямо в HTML */
.article-full__content [width] {
    max-width: 100% !important;
}

.article-full__content div[style*="width"],
.article-full__content p[style*="width"],
.article-full__content span[style*="width"] {
    max-width: 100% !important;
}

/* Цитаты */
.article-full__content blockquote {
    margin: 28px 0;
    padding: 20px 22px;
    color: #2a2a2a;
    border-left: 4px solid var(--full-red);
    border-radius: 0 12px 12px 0;
    background: #fff4f5;
}

/* Код и длинные ссылки */
.article-full__content pre {
    max-width: 100%;
    overflow-x: auto;
    padding: 18px;
    color: #f5f5f5;
    border-radius: 12px;
    background: #171717;
    white-space: pre;
}

.article-full__content code {
    overflow-wrap: normal;
    word-break: normal;
}

/* Таблицы не растягивают страницу */
.article-full__content table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.article-full__content .table-responsive,
.article-full__content .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 25px 0;
    -webkit-overflow-scrolling: touch;
}

.article-full__content th,
.article-full__content td {
    padding: 12px;
    border: 1px solid var(--full-line);
    text-align: left;
}

/* Подпись под изображением */
.article-full__content figcaption {
    margin-top: 8px;
    color: var(--full-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

/* Низ публикации */
.article-full__footer {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--full-line);
}

.article-tags {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 11px;
    color: var(--full-red);
    border: 1px solid #efcbd0;
    border-radius: 8px;
    background: #fff7f8;
    font-size: 12px;
    font-weight: 800;
}

.article-rating {
    flex: 0 0 auto;
}

/* Комментарии */
.comments-block {
    min-width: 0;
    margin-top: 38px;
    padding-top: 30px;
    border-top: 1px solid var(--full-line);
}

.comments-block h2 {
    margin: 0 0 22px;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.1;
}

/* Особенно важно для сетки main.tpl */
.content-area,
.page-grid,
.page-main .container {
    min-width: 0;
}

/* Планшеты */
@media (max-width: 900px) {
    .article-full__content {
        font-size: 16px;
    }
}

/* Телефон */
@media (max-width: 640px) {
    .article-full {
        margin: 0;
        padding: 21px 20px 25px;
        border-radius: 14px;
        box-shadow: none;
    }

    .article-full__header {
        padding-bottom: 19px;
    }

    .article-full__header h1 {
        margin-top: 10px;
        font-size: clamp(28px, 9vw, 38px);
        line-height: 1.06;
        letter-spacing: -.035em;
    }

    .article-full__meta {
        font-size: 12px;
    }

    .article-full__cover {
        margin: 21px 0;
        border-radius: 10px;
    }

    .article-full__content {
        font-size: 16px;
        line-height: 1.65;
    }

    .article-full__content img,
    .article-full__content iframe,
    .article-full__content video,
    .article-full__content embed,
    .article-full__content object {
        border-radius: 9px;
    }

    .article-full__content blockquote {
        margin: 22px 0;
        padding: 17px 18px;
    }

    .article-full__footer {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 27px;
    }
}

/* Очень узкие экраны */
@media (max-width: 390px) {
    .article-full {
        padding-right: 16px;
        padding-left: 16px;
    }

    .article-full__header h1 {
        font-size: 27px;
    }

    .article-full__content {
        font-size: 15px;
    }
}

/* Кнопка возврата к новостям */
.article-full__actions {
    display: flex;
    align-items: center;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--full-line, #e8e8ea);
}

.article-back-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 17px;
    color: #fff;
    border-radius: 10px;
    background: var(--full-red, #c61020);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    transition: opacity .2s ease, transform .2s ease;
}

.article-back-link:hover {
    color: #fff;
    opacity: .9;
    transform: translateX(-2px);
}


/* Слайдер галереи image_k */
.article-gallery-slider {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 28px 0;
    overflow: hidden;
    border-radius: 15px;
    background: #151515;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
    outline: none;
}

.article-gallery-slider__viewport {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.article-gallery-slider .xfieldimagegallery {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    columns: auto !important;
}

.article-gallery-slider .xfieldimagegallery > li {
    position: relative;
    display: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    list-style: none !important;
    border-radius: 0 !important;
    background: #151515 !important;
}

.article-gallery-slider .xfieldimagegallery > li::marker {
    content: "";
}

.article-gallery-slider .xfieldimagegallery > li.is-active {
    display: block !important;
    animation: metallurgGalleryFade .28s ease;
}

.article-gallery-slider .xfieldimagegallery > li > a {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 420px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0 !important;
    background: #151515;
    text-decoration: none;
}

.article-gallery-slider .xfieldimagegallery img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 720px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    object-fit: contain !important;
    background: #151515;
}

.article-gallery-slider__button {
    position: absolute;
    top: 50%;
    z-index: 10;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    background: rgba(0, 0, 0, .64);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.article-gallery-slider__button:hover {
    border-color: var(--full-red, #c61020);
    background: var(--full-red, #c61020);
}

.article-gallery-slider__button:active {
    transform: translateY(-50%) scale(.94);
}

.article-gallery-slider__button--prev {
    left: 16px;
}

.article-gallery-slider__button--next {
    right: 16px;
}

.article-gallery-slider__button span {
    display: block;
    font-size: 33px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-2px);
}

.article-gallery-slider__counter {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    min-width: 62px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 12px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;
    background: rgba(0, 0, 0, .68);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
    backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.article-gallery-slider.is-single .article-gallery-slider__button,
.article-gallery-slider.is-single .article-gallery-slider__counter {
    display: none !important;
}

@keyframes metallurgGalleryFade {
    from {
        opacity: .35;
        transform: scale(.992);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 640px) {
    .article-gallery-slider {
        margin: 21px 0;
        border-radius: 10px;
    }

    .article-gallery-slider .xfieldimagegallery > li > a {
        min-height: 260px;
    }

    .article-gallery-slider .xfieldimagegallery img {
        max-height: 520px !important;
    }

    .article-gallery-slider__button {
        width: 40px;
        height: 40px;
    }

    .article-gallery-slider__button--prev {
        left: 9px;
    }

    .article-gallery-slider__button--next {
        right: 9px;
    }

    .article-gallery-slider__button span {
        font-size: 28px;
    }

    .article-gallery-slider__counter {
        right: 9px;
        bottom: 9px;
        min-width: 56px;
        min-height: 32px;
        padding: 0 10px;
        font-size: 12px;
    }
}

/* =====================================================
   Полноэкранный просмотр изображений галереи
   ===================================================== */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(7px);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox__stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__image {
    max-width: min(94vw, 1800px);
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .55);
    user-select: none;
    -webkit-user-drag: none;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .24);
    background: rgba(0, 0, 0, .62);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.gallery-lightbox__close:hover,
.gallery-lightbox__nav:hover {
    background: var(--full-red, #c61020);
}

.gallery-lightbox__close {
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
}

.gallery-lightbox__nav {
    top: 50%;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 36px;
    line-height: 1;
    transform: translateY(-50%);
}

.gallery-lightbox__nav:active {
    transform: translateY(-50%) scale(.94);
}

.gallery-lightbox__nav--prev {
    left: 0;
}

.gallery-lightbox__nav--next {
    right: 0;
}

.gallery-lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 0;
    min-width: 66px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;
    background: rgba(0, 0, 0, .65);
    font-size: 13px;
    font-weight: 900;
    transform: translateX(-50%);
}

.gallery-lightbox.is-single .gallery-lightbox__nav,
.gallery-lightbox.is-single .gallery-lightbox__counter {
    display: none;
}

body.gallery-lightbox-open {
    overflow: hidden;
}

.article-gallery-slider .xfieldimagegallery a {
    cursor: zoom-in;
}

@media (max-width: 640px) {
    .gallery-lightbox {
        padding: 14px;
    }

    .gallery-lightbox__image {
        max-width: 96vw;
        max-height: 86vh;
        border-radius: 5px;
    }

    .gallery-lightbox__close {
        width: 42px;
        height: 42px;
        font-size: 25px;
    }

    .gallery-lightbox__nav {
        width: 42px;
        height: 42px;
        font-size: 30px;
    }

    .gallery-lightbox__nav--prev {
        left: 2px;
    }

    .gallery-lightbox__nav--next {
        right: 2px;
    }
}

/* Клик по изображению слайдера */
.article-gallery-slider .xfieldimagegallery li,
.article-gallery-slider .xfieldimagegallery img {
    cursor: zoom-in !important;
}
