/*
 * article-scenes.css — «Сцены» для статей KOZYR SMP: каждый новый раздел открывается
 * фоновой картинкой на всю ширину экрана (как шапка статьи), поверх неё лежит цветной
 * заголовок раздела. Картинка плавно растворяется в фоне страницы сверху и снизу,
 * дальше текст и демонстрационные фото идут как обычно.
 * Подключается после article-base.css. JavaScript не нужен.
 * Разметка и правила — articles/README.md, раздел «Сцены: фоновые картинки у заголовков».
 */

/* --- Раздел-сцена --- */
.kz-scene {
    --scene-accent: var(--kz-accent);
    --scene-accent-2: var(--kz-gold-light);
    position: relative;
    z-index: 1;
    margin-top: 40px;
}

/* Полоса с фото у заголовка раздела */
.kz-scene-cover {
    position: relative;
    isolation: isolate;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 120px 0 34px;
}
.kz-scene-cover.tall {
    min-height: 480px;
}
.kz-scene-cover.low {
    min-height: 280px;
    padding-top: 90px;
}
.kz-scene-cover::before,
.kz-scene-cover::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    pointer-events: none;
}
.kz-scene-cover::before {
    z-index: -2;
    background: var(--scene-bg) center var(--scene-pos, 50%) / cover no-repeat;
    image-rendering: pixelated;
}
/* Растворение в фон страницы сверху и снизу + затемнение слева под текстом */
.kz-scene-cover::after {
    z-index: -1;
    background:
        linear-gradient(180deg,
            var(--kz-bg) 0%,
            rgba(15, 12, 20, 0.45) 18%,
            rgba(15, 12, 20, 0.20) 45%,
            rgba(15, 12, 20, 0.70) 80%,
            var(--kz-bg) 100%),
        linear-gradient(90deg,
            rgba(15, 12, 20, 0.55) 0%,
            rgba(15, 12, 20, 0.15) 55%,
            rgba(15, 12, 20, 0) 100%);
}

.kz-scene-kicker {
    align-self: flex-start;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    line-height: 1;
    text-transform: uppercase;
    padding: 8px 10px 6px;
    border-radius: 4px;
    color: #0f0c14;
    background: linear-gradient(90deg, var(--scene-accent), var(--scene-accent-2));
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    margin-bottom: 16px;
}
.kz-scene-cover h2 {
    margin: 0 0 12px;
    max-width: 820px;
    font-size: clamp(26px, 4.4vw, 42px);
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 8px 32px rgba(0, 0, 0, 0.6);
}
.kz-scene-cover h2 .hl {
    background: linear-gradient(90deg, var(--scene-accent), var(--scene-accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
}
.kz-scene-lead {
    max-width: 680px;
    margin: 0 0 18px;
    font-size: 16.5px;
    line-height: 1.65;
    color: #f2edf9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8), 0 4px 18px rgba(0, 0, 0, 0.6);
}
.kz-scene-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kz-scene-chips span {
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    color: #fff;
    background: rgba(15, 12, 20, 0.55);
    border: 1px solid color-mix(in srgb, var(--scene-accent) 70%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* Тело раздела — обычный текст на фоне страницы */
.kz-scene-body {
    padding: 8px 0 8px;
}
.kz-scene-body h3 {
    margin: 28px 0 10px;
    font-size: 20px;
    color: #fff;
}
.kz-scene-body h3::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    background: var(--scene-accent);
    box-shadow: 3px 3px 0 color-mix(in srgb, var(--scene-accent) 45%, transparent);
    vertical-align: 2px;
}

/* --- Фото для прямой демонстрации внутри текста --- */
.kz-figure {
    margin: 24px 0 28px;
}
.kz-figure img,
.kz-article-content .kz-figure img {
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: none;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    image-rendering: pixelated;
    /* Без рамки: края фото мягко растворяются в фоне страницы */
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 12%, #000 86%, transparent 100%);
    mask-composite: intersect;
    filter: saturate(0.92) brightness(0.94);
}
.kz-figure figcaption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--kz-text-dim);
}
.kz-figure-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0 28px;
}
.kz-figure-row .kz-figure {
    margin: 0;
}

/* Источник фото внизу статьи */
.kz-credits {
    margin-top: 32px;
    font-size: 12.5px;
    color: var(--kz-text-dim);
}
.kz-credits a {
    color: var(--kz-text-muted);
}

/* --- Высокая шапка статьи со своим фото (новости и гайды) --- */
.kz-hero-backdrop.tall .kz-hero-bg {
    object-position: center 45%;
}
.kz-hero-backdrop.tall .kz-hero-overlay {
    background: linear-gradient(
        180deg,
        rgba(15, 12, 20, 0.20) 0%,
        rgba(15, 12, 20, 0.35) 40%,
        rgba(15, 12, 20, 0.80) 78%,
        rgba(15, 12, 20, 1.00) 100%
    );
}

@media (max-width: 680px) {
    .kz-scene-cover {
        min-height: 300px;
        padding: 90px 0 26px;
    }
    .kz-scene-cover.tall {
        min-height: 380px;
    }
    .kz-scene-cover.low {
        min-height: 240px;
    }
    .kz-scene-lead {
        font-size: 15px;
    }
    .kz-figure-row {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
 * СПРАВОЧНИК: каталог блоков/предметов и карточки крафта
 * ========================================================= */

/* --- Каталог: иконка + название --- */
.kz-items-group {
    margin: 26px 0 30px;
}
.kz-items-group > h4 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--kz-text);
}
.kz-items-group > h4 span {
    font-weight: 400;
    color: var(--kz-text-dim);
    margin-left: 6px;
}
.kz-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.kz-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    background: rgba(26, 20, 36, 0.6);
    border: 1px solid var(--kz-border);
    border-radius: 6px;
    min-width: 0;
}
.kz-item img,
.kz-palette img,
.kz-slot img {
    image-rendering: pixelated;
    border: 0;
    border-radius: 0;
    margin: 0;
    display: block;
    -webkit-mask-image: none;
    mask-image: none;
    filter: none;
}
.kz-item img {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
}
.kz-item b {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--kz-text-body);
    line-height: 1.25;
}
.kz-item small {
    display: block;
    font-size: 11.5px;
    color: var(--kz-text-dim);
    line-height: 1.3;
    overflow-wrap: anywhere;
}

/* --- Палитра из 16 цветов --- */
.kz-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px;
    background: rgba(26, 20, 36, 0.6);
    border: 1px solid var(--kz-border);
    border-radius: 6px;
    width: fit-content;
    max-width: 100%;
}
.kz-palette img {
    width: 32px;
    height: 32px;
}
.kz-palette-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-bottom: 10px;
}
.kz-palette-row > span {
    min-width: 170px;
    font-size: 13.5px;
    color: var(--kz-text-body);
}
.kz-palette-row > span small {
    display: block;
    font-size: 11.5px;
    color: var(--kz-text-dim);
}

/* --- Карточки крафта в стиле игрового верстака --- */
.kz-crafts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin: 18px 0 28px;
}
.kz-craft {
    padding: 14px 14px 12px;
    background: rgba(26, 20, 36, 0.6);
    border: 1px solid var(--kz-border);
    border-radius: 8px;
}
.kz-craft h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--kz-text);
}
.kz-craft p {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--kz-text-muted);
}
.kz-craft-ui {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: #c6c6c6;
    border: 2px solid;
    border-color: #ffffff #555555 #555555 #ffffff;
    box-shadow: 0 0 0 2px #000;
}
.kz-grid {
    display: grid;
    grid-template-columns: repeat(3, 36px);
    grid-auto-rows: 36px;
}
.kz-grid.one {
    grid-template-columns: 36px;
}
.kz-slot {
    position: relative;
    width: 36px;
    height: 36px;
    background: #8b8b8b;
    border: 2px solid;
    border-color: #373737 #ffffff #ffffff #373737;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kz-slot img {
    width: 32px;
    height: 32px;
}
.kz-slot.out {
    width: 52px;
    height: 52px;
}
.kz-slot .n {
    position: absolute;
    right: 1px;
    bottom: 0;
    font-family: 'Press Start 2P', monospace;
    font-size: 9px;
    color: #fff;
    text-shadow: 1px 1px 0 #3f3f3f;
    pointer-events: none;
}
.kz-craft-arrow {
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid #8b8b8b;
    position: relative;
    margin-left: 8px;
}
.kz-craft-arrow::before {
    content: '';
    position: absolute;
    left: -24px;
    top: -3px;
    width: 12px;
    height: 6px;
    background: #8b8b8b;
}
.kz-craft-tag {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--kz-text-dim);
    vertical-align: 1px;
}
.kz-craft-alt {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 12.5px;
    color: var(--kz-text-muted);
}
.kz-craft-alt .kz-craft-ui {
    padding: 5px;
    gap: 8px;
}

/* --- Полоска иконок для новостей --- */
.kz-icon-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 24px;
}
.kz-icon-strip a,
.kz-icon-strip span {
    display: flex;
    padding: 6px;
    background: rgba(26, 20, 36, 0.6);
    border: 1px solid var(--kz-border);
    border-radius: 6px;
}
.kz-icon-strip img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    border: 0;
    margin: 0;
}

@media (max-width: 680px) {
    .kz-items {
        grid-template-columns: 1fr 1fr;
    }
    .kz-crafts {
        grid-template-columns: 1fr;
    }
    .kz-palette-row > span {
        min-width: 100%;
    }
}

/* --- Переносы: длинные названия не вылезают за карточку --- */
.kz-item > div {
    flex: 1 1 auto;
    min-width: 0;
}
.kz-item b,
.kz-item small,
.kz-craft h4,
.kz-palette-row > span {
    overflow-wrap: anywhere;
    hyphens: auto;
}
.kz-craft {
    min-width: 0;
}
.kz-craft-ui {
    max-width: 100%;
}

/* =========================================================
 * Плавное увеличение при наведении
 * ========================================================= */
.kz-figure {
    overflow: hidden;
}
.kz-figure img {
    transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .6s ease;
    transform-origin: center;
}
.kz-figure:hover img {
    transform: scale(1.06);
    filter: saturate(1.05) brightness(1.02);
}

.kz-item,
.kz-craft,
.kz-icon-strip a {
    transition: border-color .25s ease, background-color .25s ease, transform .25s ease;
}
.kz-item:hover,
.kz-icon-strip a:hover {
    border-color: var(--kz-border-hover);
    background: rgba(34, 26, 48, 0.85);
}
.kz-item img,
.kz-icon-strip img,
.kz-palette img,
.kz-slot img {
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
    transform-origin: center;
    position: relative;
}
.kz-item:hover img {
    transform: scale(1.55);
}
.kz-icon-strip a:hover img {
    transform: scale(1.4);
}
.kz-palette img {
    cursor: zoom-in;
}
.kz-palette img:hover {
    transform: scale(2.1);
    z-index: 3;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}
.kz-craft:hover {
    border-color: var(--kz-border-hover);
}
.kz-slot:hover {
    z-index: 2;
}
.kz-slot:hover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}
.kz-slot:hover img {
    transform: scale(1.5);
    z-index: 3;
}

@media (hover: none) {
    .kz-figure:hover img,
    .kz-item:hover img,
    .kz-palette img:hover,
    .kz-slot:hover img {
        transform: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .kz-figure img,
    .kz-item img,
    .kz-palette img,
    .kz-slot img,
    .kz-icon-strip img {
        transition: none;
    }
}
