/* ═════════════════════════════════════════════════════════════════
   REDLINE — страницы кейсов: /cases/ и /cases/<slug>/.
   Шаблоны: templates/redline/cases/. Классы с префиксом rl-cs-.
   ═════════════════════════════════════════════════════════════════ */

/* ── Общее: скриншот в рамке с жёсткой тенью ───────────────────── */
.rl-cs-shot {
    position: relative; border: 2px solid var(--rl-black); background: #fff;
    box-shadow: 6px 6px 0 var(--rl-red);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.rl-cs-shot img { display: block; width: 100%; height: auto; max-height: 680px; object-fit: contain; }
.rl-cs-shot--amber { box-shadow: 6px 6px 0 var(--rl-amber); }
.rl-cs-shot--black { box-shadow: 6px 6px 0 var(--rl-black); }
.rl-cs-shot--empty {
    aspect-ratio: 16 / 9;
    background-color: rgba(12, 12, 10, .04);
    background-image: repeating-linear-gradient(45deg, rgba(12, 12, 10, .18), rgba(12, 12, 10, .18) 1px, transparent 1px, transparent 9px);
}
.rl-cs-shot--empty span { font-family: var(--rl-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .2em; background: var(--rl-white); border: 1px solid var(--rl-black); padding: 6px 10px; color: rgba(12, 12, 10, .65); }
.rl-cs-shot--hero { border-color: var(--rl-white); box-shadow: 6px 6px 0 var(--rl-red); }

.rl-cs-noimg { font-family: var(--rl-druk); font-size: clamp(28px, 4vw, 48px); text-transform: uppercase; color: rgba(12, 12, 10, .14); letter-spacing: -.02em; }

/* ══ СПИСОК КЕЙСОВ ═════════════════════════════════════════════ */
.rl-cs-hero__body { padding-top: 72px; padding-bottom: 88px; }
.rl-cs-hero__title { font-size: clamp(40px, 6.4vw, 112px); margin-bottom: calc(48px + 3vw); }
.rl-cs-hero__row { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: end; }
.rl-cs-hero__row > * { min-width: 0; }
.rl-cs-hero__tiles .rl-tile { padding: 16px; }
.rl-cs-hero__tiles .rl-tile b { font-size: 30px; }
@media (max-width: 900px) { .rl-cs-hero__row { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .rl-cs-hero__body { padding-top: 48px; padding-bottom: 64px; }
    .rl-cs-hero__title { font-size: clamp(30px, 8vw, 60px); }
}

/* Фильтр */
.rl-cs-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; position: relative; z-index: 1; }
.rl-cs-filter__pill {
    padding: 10px 16px; border: 2px solid var(--rl-black); background: var(--rl-white);
    font-family: var(--rl-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em;
    cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s, color .15s;
}
.rl-cs-filter__pill:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--rl-black); }
.rl-cs-filter__pill.is-active { background: var(--rl-red); border-color: var(--rl-red); color: var(--rl-white); box-shadow: 4px 4px 0 var(--rl-black); transform: translate(-2px, -2px); }
.rl-cs-filter__pill:focus-visible { outline: 3px solid var(--rl-amber); outline-offset: 3px; }
@media (max-width: 640px) {
    .rl-cs-filter { flex-wrap: nowrap; overflow-x: auto; padding: 4px 8px 10px 4px; margin: 0 -16px 28px; padding-left: 16px; scrollbar-width: none; }
    .rl-cs-filter__pill { flex: 0 0 auto; }
}

/* Выделенный кейс */
.rl-cs-featured {
    display: grid; grid-template-columns: 1fr; margin-bottom: 40px; position: relative; z-index: 1;
    border: 2px solid var(--rl-black); background: var(--rl-black); color: var(--rl-white);
    box-shadow: 8px 8px 0 var(--rl-red); transition: transform .15s, box-shadow .15s;
}
.rl-cs-featured:hover { transform: translate(-3px, -3px); box-shadow: 11px 11px 0 var(--rl-red); }
.rl-cs-featured > * { min-width: 0; }
.rl-cs-featured__body { padding: 40px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.rl-cs-featured__body::before { content: ''; position: absolute; inset: 0; pointer-events: none; background-image: repeating-linear-gradient(85deg, transparent 0 18px, rgba(242, 240, 232, .07) 18px 19px, transparent 19px 70px); }
.rl-cs-featured__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; position: relative; }
.rl-cs-featured__top .rl-label { font-size: 10px; letter-spacing: .2em; }
.rl-cs-featured__title { font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; font-size: clamp(22px, 3vw, 40px); line-height: 1.02; position: relative; }
.rl-cs-featured__sub { color: rgba(242, 240, 232, .75); line-height: 1.6; position: relative; }
.rl-cs-featured__metrics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; }
.rl-cs-featured__metrics li { border: 1px solid var(--rl-hair-light); padding: 12px; min-width: 0; }
.rl-cs-featured__metrics b { display: block; font-family: var(--rl-mono); font-weight: 700; font-size: 18px; color: var(--rl-amber); overflow-wrap: anywhere; }
.rl-cs-featured__metrics span { display: block; margin-top: 4px; font-size: 12px; line-height: 1.35; color: rgba(242, 240, 232, .6); }
.rl-cs-featured__btn { margin-top: auto; align-self: flex-start; display: inline-flex; gap: 10px; align-items: center; padding: 12px 22px; background: var(--rl-red); font-family: var(--rl-druk); font-size: 14px; text-transform: uppercase; position: relative; transition: background .15s, color .15s; }
.rl-cs-featured:hover .rl-cs-featured__btn { background: var(--rl-amber); color: var(--rl-black); }
.rl-cs-featured__img { border-left: 2px solid var(--rl-black); background: var(--rl-white); display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 320px; }
.rl-cs-featured__img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: grayscale(1) contrast(1.1); transition: filter .3s; }
.rl-cs-featured:hover .rl-cs-featured__img img { filter: none; }
@media (max-width: 900px) {
    .rl-cs-featured { grid-template-columns: 1fr; }
    .rl-cs-featured__img { order: -1; border-left: 0; border-bottom: 2px solid var(--rl-black); min-height: 0; aspect-ratio: 16 / 9; }
    .rl-cs-featured__body { padding: 26px 20px; }
}
@media (max-width: 560px) { .rl-cs-featured__metrics { grid-template-columns: 1fr; } }

/* Сетка карточек */
.rl-cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; position: relative; z-index: 1; }
.rl-cs-card { display: flex; flex-direction: column; min-width: 0; border: 2px solid var(--rl-black); background: var(--rl-white); box-shadow: 6px 6px 0 var(--rl-black); transition: transform .15s, box-shadow .15s; }
.rl-cs-card:nth-child(3n+2) { box-shadow: 6px 6px 0 var(--rl-red); }
.rl-cs-card:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--rl-red); }
.rl-cs-card__img {
    position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 2px solid var(--rl-black);
    display: flex; align-items: center; justify-content: center;
    background-color: rgba(12, 12, 10, .04);
    background-image: repeating-linear-gradient(45deg, rgba(12, 12, 10, .14), rgba(12, 12, 10, .14) 1px, transparent 1px, transparent 8px);
}
.rl-cs-card__img img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: grayscale(1) contrast(1.1); transition: filter .3s, transform .4s; }
.rl-cs-card:hover .rl-cs-card__img img { filter: none; transform: scale(1.03); }
.rl-cs-card__num { position: absolute; top: 0; left: 0; background: var(--rl-black); color: var(--rl-white); font-family: var(--rl-mono); font-size: 11px; letter-spacing: .15em; padding: 4px 8px; }
.rl-cs-card:hover .rl-cs-card__num { background: var(--rl-red); }
.rl-cs-card__body { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 22px 24px 24px; }
.rl-cs-card h3 { font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; font-size: 19px; line-height: 1.12; overflow-wrap: anywhere; }
.rl-cs-card p { line-height: 1.55; color: rgba(12, 12, 10, .75); flex: 1; font-size: 14px; }
.rl-cs-card:hover .rl-case__more { color: var(--rl-red); }
@media (max-width: 1100px) { .rl-cs-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .rl-cs-grid { grid-template-columns: 1fr; } .rl-cs-card__body { padding: 18px 18px 20px; } }

.rl-cs-featured.is-hidden, .rl-cs-card.is-hidden { display: none; }
.rl-cs-empty { font-family: var(--rl-mono); font-size: 13px; text-transform: uppercase; letter-spacing: .15em; color: rgba(12, 12, 10, .6); padding: 40px 0; }
.rl-cs-none { text-align: center; padding: 64px 0; color: rgba(12, 12, 10, .6); }
.rl-cs-none i { font-size: 64px; color: var(--rl-red); }
.rl-cs-none p { margin-top: 12px; font-size: 18px; }
.rl-cs-none .rl-label { font-size: 11px; }

/* ══ СТРАНИЦА КЕЙСА ════════════════════════════════════════════ */
.rl-cs-dhero .rl-strip a { text-decoration: underline; text-underline-offset: 3px; }
.rl-cs-dhero .rl-strip a:hover { color: var(--rl-amber); }
.rl-cs-dhero__body { position: relative; z-index: 1; padding-top: 64px; padding-bottom: 72px; }
.rl-cs-dhero__grid { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; align-items: center; }
.rl-cs-dhero__grid > * { min-width: 0; }
.rl-cs-dhero__tags { margin-bottom: 28px; color: var(--rl-white); }
.rl-cs-dhero__title {
    font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; color: var(--rl-red);
    font-size: clamp(30px, 5.2vw, 80px); line-height: .98; letter-spacing: -.02em; margin: 0;
    overflow-wrap: break-word; hyphens: manual; -webkit-hyphens: manual;
}
.rl-cs-dhero__title .rl-tilt { display: inline; transform: none; }
@media (min-width: 641px) { .rl-cs-dhero__title .rl-tilt { display: inline-block; transform: rotate(3deg); } }
.rl-cs-dhero__divider { width: 120px; height: 4px; background: var(--rl-amber); margin: 36px 0 24px; }
.rl-cs-dhero__sub { color: rgba(242, 240, 232, .8); line-height: 1.65; font-size: 17px; max-width: 620px; margin-bottom: 32px; }
@media (max-width: 1000px) { .rl-cs-dhero__grid { grid-template-columns: 1fr; gap: 48px; } }
@media (max-width: 640px) {
    .rl-cs-dhero__body { padding-top: 40px; padding-bottom: 56px; }
    .rl-cs-dhero__title { font-size: clamp(24px, 7.6vw, 44px); }
    .rl-cs-dhero__sub { font-size: 15px; }
}

/* Карточка метрик в шапке */
.rl-cs-mcard { position: relative; border: 2px solid var(--rl-amber); background: rgba(12, 12, 10, .7); backdrop-filter: blur(4px); padding: 30px 26px 26px; box-shadow: 6px 6px 0 var(--rl-red); }
.rl-cs-mcard__tag { position: absolute; top: -11px; left: 16px; background: var(--rl-amber); color: var(--rl-black); font-family: var(--rl-mono); font-size: 10px; letter-spacing: .2em; padding: 2px 8px; }
.rl-cs-mcard__title { display: flex; align-items: center; gap: 10px; font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; font-size: 18px; margin-bottom: 20px; }
.rl-cs-mcard__title i { color: var(--rl-amber); font-size: 22px; }
.rl-cs-mcard__metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.rl-cs-mcard__metric { border: 1px solid var(--rl-hair-light); padding: 14px 12px; min-width: 0; }
.rl-cs-mcard__metric b { display: block; font-family: var(--rl-mono); font-weight: 700; font-size: clamp(17px, 1.8vw, 24px); line-height: 1.15; color: var(--rl-amber); overflow-wrap: anywhere; }
.rl-cs-mcard__metric:first-child { background: var(--rl-red); border-color: var(--rl-red); }
.rl-cs-mcard__metric:first-child b { color: var(--rl-white); }
.rl-cs-mcard__metric span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.35; color: rgba(242, 240, 232, .7); }
.rl-cs-mcard__note { font-size: 13px; line-height: 1.55; color: rgba(242, 240, 232, .7); border-left: 2px solid var(--rl-amber); padding-left: 12px; margin-bottom: 20px; }
@media (max-width: 400px) { .rl-cs-mcard { padding: 26px 16px 18px; } .rl-cs-mcard__metrics { grid-template-columns: 1fr; } }

/* Навигация по этапам */
.rl-cs-stages { position: relative; z-index: 1; background: var(--rl-red); border-top: 2px solid var(--rl-black); border-bottom: 2px solid var(--rl-black); }
.rl-cs-stages__inner { display: flex; }
.rl-cs-stages__item { flex: 1; display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-right: 2px solid var(--rl-black); color: var(--rl-white); font-family: var(--rl-druk); font-size: 15px; text-transform: uppercase; transition: background .15s, color .15s; min-width: 0; }
.rl-cs-stages__item:first-child { border-left: 2px solid var(--rl-black); }
.rl-cs-stages__item b { font-family: var(--rl-mono); font-weight: 500; font-size: 12px; color: var(--rl-amber); }
.rl-cs-stages__item:hover { background: var(--rl-black); }
@media (max-width: 640px) {
    .rl-cs-stages .rl-wrap { padding: 0; }
    .rl-cs-stages__item { flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 10px; font-size: 11px; }
    .rl-cs-stages__item:first-child { border-left: 0; }
    .rl-cs-stages__item:last-child { border-right: 0; }
}

/* Видео */
.rl-cs-video { padding: 56px 0; border-bottom: 2px solid var(--rl-red); }
.rl-cs-video__inner { max-width: 1100px; margin: 0 auto; border: 2px solid var(--rl-white); box-shadow: 8px 8px 0 var(--rl-red); background: #000; }
.rl-cs-video__player { display: block; width: 100%; height: auto; max-height: 80vh; }

/* Этапы: текст + картинка */
.rl-cs-step { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; position: relative; z-index: 1; padding-bottom: 88px; margin-bottom: 88px; border-bottom: 1px solid var(--rl-hair-dark); scroll-margin-top: 90px; }
.rl-cs-step:last-of-type { border-bottom: 0; margin-bottom: 0; }
.rl-cs-step > * { min-width: 0; }
.rl-cs-step--rev .rl-cs-step__text { order: 2; }
.rl-cs-step__badge { display: inline-block; background: var(--rl-red); color: var(--rl-white); font-family: var(--rl-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .2em; padding: 6px 12px; margin-bottom: 20px; }
.rl-cs-step__badge--amber { background: var(--rl-amber); color: var(--rl-black); }
.rl-cs-step__badge--dark { background: var(--rl-black); }
.rl-cs-step__h { font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; font-size: clamp(24px, 3.4vw, 48px); line-height: 1; letter-spacing: -.02em; margin: 0 0 36px; }
.rl-cs-step__h .rl-tilt { transform: rotate(3deg); }
@media (max-width: 640px) { .rl-cs-step__h { font-size: clamp(22px, 7vw, 32px); } .rl-cs-step__h .rl-tilt { transform: none; } }
.rl-cs-step__metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; }
.rl-cs-step__metrics div { border: 2px solid var(--rl-black); padding: 14px; min-width: 0; background: #fff; }
.rl-cs-step__metrics b { display: block; font-family: var(--rl-mono); font-weight: 700; font-size: 20px; line-height: 1.15; color: var(--rl-red); overflow-wrap: anywhere; }
.rl-cs-step__metrics span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: rgba(12, 12, 10, .65); }
@media (max-width: 900px) {
    .rl-cs-step { grid-template-columns: 1fr; gap: 36px; padding-bottom: 64px; margin-bottom: 64px; }
    .rl-cs-step .rl-cs-step__media { order: -1; }
    .rl-cs-step--rev .rl-cs-step__text { order: 0; }
}
@media (max-width: 400px) { .rl-cs-step__metrics { grid-template-columns: 1fr; } }

/* Текст из CKEditor */
.rl-cs-rich { font-size: 16px; line-height: 1.7; color: rgba(12, 12, 10, .82); }
.rl-cs-rich > * + * { margin-top: 14px; }
.rl-cs-rich strong { color: var(--rl-black); font-weight: 700; }
.rl-cs-rich em { font-style: italic; }
.rl-cs-rich ul, .rl-cs-rich ol { padding: 0; list-style: none; display: grid; gap: 8px; }
.rl-cs-rich ul li { position: relative; padding-left: 26px; }
.rl-cs-rich ul li::before { content: '▢'; position: absolute; left: 0; top: 0; color: var(--rl-red); font-family: var(--rl-mono); }
.rl-cs-rich ol { counter-reset: rl-cs-ol; }
.rl-cs-rich ol li { position: relative; padding-left: 34px; counter-increment: rl-cs-ol; }
.rl-cs-rich ol li::before { content: counter(rl-cs-ol, decimal-leading-zero); position: absolute; left: 0; top: 2px; font-family: var(--rl-mono); font-size: 13px; color: var(--rl-red); }
.rl-cs-rich a { color: var(--rl-red); text-decoration: underline; }
@media (max-width: 640px) { .rl-cs-rich { font-size: 15px; } }

.rl-cs-site { display: flex; justify-content: center; margin-top: 72px; position: relative; z-index: 1; }
.rl-cs-site .rl-btn { box-shadow: 6px 6px 0 var(--rl-black); padding: 18px 32px; font-size: 16px; }

/* Результаты в цифрах */
.rl-cs-nums__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; z-index: 1; }
.rl-cs-nums__item { border: 1px solid rgba(242, 240, 232, .2); padding: 24px 20px; min-width: 0; background: rgba(12, 12, 10, .6); transition: transform .15s, box-shadow .15s, border-color .15s; }
.rl-cs-nums__item:hover { border-color: var(--rl-amber); transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--rl-amber); }
.rl-cs-nums__item .rl-label { font-size: 10px; letter-spacing: .2em; color: rgba(242, 240, 232, .45); }
.rl-cs-nums__item b { display: block; margin: 14px 0 10px; font-family: var(--rl-mono); font-weight: 700; font-size: clamp(22px, 2.4vw, 32px); line-height: 1.1; color: var(--rl-amber); overflow-wrap: anywhere; hyphens: auto; -webkit-hyphens: auto; }
.rl-cs-nums__item p { font-size: 14px; line-height: 1.5; color: rgba(242, 240, 232, .75); }
.rl-cs-nums__item--red { background: var(--rl-red); border-color: var(--rl-red); }
.rl-cs-nums__item--red b { color: var(--rl-white); }
.rl-cs-nums__item--red .rl-label { color: rgba(242, 240, 232, .75); }
.rl-cs-nums__item--red p { color: rgba(242, 240, 232, .9); }
@media (max-width: 1100px) { .rl-cs-nums__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .rl-cs-nums__grid { grid-template-columns: 1fr; } }

/* Предыдущий / следующий кейс */
.rl-cs-pn { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--rl-red); }
.rl-cs-pn__half { position: relative; overflow: hidden; min-height: 280px; display: flex; align-items: flex-end; padding: 40px; isolation: isolate; transition: background .2s; min-width: 0; }
.rl-cs-pn__half + .rl-cs-pn__half { border-left: 2px solid var(--rl-red); justify-content: flex-end; text-align: right; }
.rl-cs-pn__bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: top center; filter: grayscale(1); opacity: .25; transition: opacity .3s, filter .3s, transform .4s; }
.rl-cs-pn__half::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--rl-black) 15%, rgba(12, 12, 10, .55)); }
.rl-cs-pn__half:hover .rl-cs-pn__bg { opacity: .5; filter: none; transform: scale(1.03); }
.rl-cs-pn__content { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.rl-cs-pn__half--next .rl-cs-pn__content { align-items: flex-end; }
.rl-cs-pn__half--next .rl-tags { justify-content: flex-end; }
.rl-cs-pn__dir { display: inline-flex; align-items: center; gap: 10px; font-family: var(--rl-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--rl-amber); }
.rl-cs-pn__dir i { font-size: 18px; transition: transform .2s; }
.rl-cs-pn__half--prev:hover .rl-cs-pn__dir i { transform: translateX(-6px); }
.rl-cs-pn__half--next:hover .rl-cs-pn__dir i { transform: translateX(6px); }
.rl-cs-pn__title { font-family: var(--rl-druk); font-weight: 400; text-transform: uppercase; font-size: clamp(18px, 2.2vw, 30px); line-height: 1.08; overflow-wrap: anywhere; transition: color .15s; }
.rl-cs-pn__half:hover .rl-cs-pn__title { color: var(--rl-red); }
@media (max-width: 760px) {
    .rl-cs-pn { grid-template-columns: 1fr; }
    .rl-cs-pn__half { min-height: 200px; padding: 28px 16px; }
    .rl-cs-pn__half + .rl-cs-pn__half { border-left: 0; border-top: 2px solid var(--rl-red); }
}

/* Карточки без обложек: шапка с номером вместо картинки */
.rl-cs-card__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 2px solid var(--rl-black); }
.rl-cs-card__head .rl-label { font-size: 11px; letter-spacing: .2em; }
.rl-cs-card__head i { font-size: 22px; color: var(--rl-red); transition: transform .15s; }
.rl-cs-card:hover .rl-cs-card__head i { transform: translate(3px, -3px); }
.rl-cs-featured__body { max-width: 980px; }
