/*
Theme Name: Кинолента
Theme URI: https://example.com/kinolenta
Author: Кинолента
Description: Светлая журнальная тема для каталога фильмов и сериалов: полки-подборки, карточка фильма в две колонки, таблица раздач с сортировкой, рубрики в боковой шторке. Интеграция с Кинопоиском и внешней базой торрентов.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kinolenta
*/

/* =================================================================
   1. ТОКЕНЫ
   ================================================================= */
:root {
  --paper:      #f6f1e7;
  --paper-2:    #eee6d6;
  --card:       #fffdf8;
  --ink:        #1c1a17;
  --ink-2:      #4a453d;
  --muted:      #7a7366;
  --rule:       #d8cfbd;
  --accent:     #c0391b;
  --accent-2:   #962a12;
  --good:       #2e7d4f;
  --avg:        #a8741a;
  --bad:        #b0382d;

  --serif: 'Playfair Display', 'Times New Roman', Georgia, serif;
  --sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1240px;
  --gutter: 24px;
  --r: 4px;
}

/* =================================================================
   2. БАЗА
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.kl-lock { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.kl-skip {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r);
}
.kl-skip:focus { top: 12px; }

.kl-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.kl-wrap--narrow { max-width: 820px; }
.kl-main { flex: 1 0 auto; padding-bottom: 72px; }

/* =================================================================
   3. ШАПКА
   ================================================================= */
.kl-masthead { background: var(--paper); }

.kl-topbar { border-bottom: 1px solid var(--rule); font-size: 13px; color: var(--ink-2); }
.kl-topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.kl-topbar__date { text-transform: capitalize; color: var(--muted); letter-spacing: .02em; }
.kl-topbar__tools { display: flex; align-items: center; gap: 16px; }
.kl-topbar__rubrics {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 0;
}
.kl-topbar__rubrics:hover { color: var(--accent); }

.kl-search { position: relative; display: flex; align-items: center; }
.kl-search__input {
  width: 240px; height: 34px; padding: 0 38px 0 14px;
  background: var(--card); border: 1px solid var(--rule); border-radius: 999px;
  font-size: 14px; transition: border-color .2s, width .25s;
}
.kl-search__input:focus { outline: none; border-color: var(--ink); width: 300px; }
.kl-search__btn { position: absolute; right: 4px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.kl-search__btn:hover { color: var(--accent); }

.kl-brand { text-align: center; padding-top: 28px; padding-bottom: 20px; }
.kl-brand__name {
  display: inline-block;
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(34px, 6vw, 68px); line-height: 1; letter-spacing: -.02em;
}
.kl-brand__name:hover { color: var(--accent); }
.kl-brand__tag { margin-top: 10px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.kl-nav { border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); background: var(--paper); }
.kl-nav .kl-wrap { display: flex; justify-content: center; }
.kl-nav__toggle { display: none; padding: 12px 0; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
.kl-nav__list ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 28px; }
.kl-nav__list a {
  display: block; padding: 12px 0; position: relative;
  font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.kl-nav__list a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 6px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.kl-nav__list a:hover { color: var(--ink); }
.kl-nav__list a:hover::after,
.kl-nav__list .current-menu-item > a::after,
.kl-nav__list .current_page_item > a::after { transform: scaleX(1); }
.kl-nav__list .current-menu-item > a,
.kl-nav__list .current_page_item > a { color: var(--ink); }

/* =================================================================
   4. ОБЩИЕ ЭЛЕМЕНТЫ
   ================================================================= */
.kl-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}

.kl-sechead { display: flex; align-items: baseline; gap: 16px; margin: 0 0 24px; padding-bottom: 12px; border-bottom: 1px solid var(--ink); }
.kl-sechead__title { font-family: var(--serif); font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; }

.kl-button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 13px 28px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  border-radius: var(--r); transition: background .2s, transform .15s;
}
.kl-button:hover { background: var(--accent-2); transform: translateY(-1px); }

.kl-chip {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  min-width: 36px; padding: 3px 7px; border-radius: 3px;
  font-size: 12px; font-weight: 800; line-height: 1.3; text-align: center; color: #fff;
  background: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.kl-chip--good { background: var(--good); }
.kl-chip--avg  { background: var(--avg); }
.kl-chip--bad  { background: var(--bad); }

/* =================================================================
   5. ПОЛКИ (карусели)
   ================================================================= */
.kl-shelf { padding: 40px 0 8px; }
.kl-shelf + .kl-shelf { border-top: 1px solid var(--rule); }
.kl-shelf__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.kl-shelf__title-wrap { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.kl-shelf__no { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--accent); }
.kl-shelf__title a:hover { color: var(--accent); }
.kl-shelf__title { font-family: var(--serif); font-weight: 800; font-size: 30px; line-height: 1.1; letter-spacing: -.01em; }
.kl-shelf__tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.kl-shelf__all {
  margin-right: 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  border-bottom: 2px solid var(--accent); padding-bottom: 1px;
}
.kl-shelf__all:hover { color: var(--accent); }
.kl-arrow {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 50%; transition: background .2s, color .2s;
}
.kl-arrow:hover { background: var(--ink); color: var(--paper); }

.kl-shelf__track {
  display: flex; gap: 20px; overflow-x: auto; padding: 4px 0 18px;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--rule) transparent;
}
.kl-shelf__track::-webkit-scrollbar { height: 6px; }
.kl-shelf__track::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.kl-mini { flex: 0 0 168px; scroll-snap-align: start; }
.kl-mini__link { display: block; }
.kl-mini__cover { position: relative; display: block; aspect-ratio: 2 / 3; background: var(--paper-2); overflow: hidden; border-radius: var(--r); }
.kl-mini__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.kl-mini__link:hover .kl-mini__cover img { transform: scale(1.04); }
.kl-mini__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 10px; font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.25;
}
.kl-mini__link:hover .kl-mini__title { color: var(--accent); }
.kl-mini__year { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

/* =================================================================
   6. СЕТКА КАТАЛОГА
   ================================================================= */
.kl-catalog { padding-top: 48px; }
.kl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 36px 24px; }

.kl-film__link { display: block; }
.kl-film__cover { position: relative; display: block; aspect-ratio: 2 / 3; background: var(--paper-2); overflow: hidden; border-radius: var(--r); box-shadow: 0 1px 0 var(--rule); }
.kl-film__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.kl-film__link:hover .kl-film__cover img { transform: scale(1.04); }
.kl-film__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 12px; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.25;
}
.kl-film__link:hover .kl-film__title { color: var(--accent); }
.kl-film__meta { margin-top: 5px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 10px; }
.kl-film__meta span:first-child:not(:last-child)::after { content: ""; }

/* Пагинация */
.navigation.pagination { margin-top: 56px; }
.navigation.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.navigation.pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 12px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: var(--card); border-radius: var(--r);
  font-weight: 700; font-size: 14px; transition: border-color .2s, color .2s, background .2s;
}
.navigation.pagination a.page-numbers:hover { border-color: var(--ink); }
.navigation.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.navigation.pagination .page-numbers.dots { border-color: transparent; background: none; }

/* =================================================================
   7. АРХИВЫ, СТРАНИЦЫ, 404
   ================================================================= */
.kl-archive-head { text-align: center; padding: 56px 0 44px; max-width: 760px; margin: 0 auto; }
.kl-archive-head--left { text-align: left; margin: 0; padding-bottom: 28px; }
.kl-archive-head__title { margin-top: 10px; font-family: var(--serif); font-weight: 800; font-size: clamp(30px, 4.5vw, 52px); line-height: 1.1; letter-spacing: -.015em; }
.kl-archive-head__desc { margin-top: 16px; color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.kl-empty { text-align: center; padding: 60px 0; color: var(--muted); font-size: 18px; }

.kl-page { padding-top: 24px; }

.kl-prose { font-size: 17px; line-height: 1.8; color: var(--ink-2); }
.kl-prose > * + * { margin-top: 1.1em; }
.kl-prose h2 { font-family: var(--serif); font-weight: 800; font-size: 26px; line-height: 1.2; color: var(--ink); margin-top: 1.8em; }
.kl-prose h3 { font-family: var(--serif); font-weight: 600; font-size: 21px; color: var(--ink); margin-top: 1.5em; }
.kl-prose a { color: var(--accent); border-bottom: 1px solid currentColor; }
.kl-prose a:hover { color: var(--accent-2); }
.kl-prose ul { list-style: disc; padding-left: 1.4em; }
.kl-prose ol { list-style: decimal; padding-left: 1.4em; }
.kl-prose li + li { margin-top: .4em; }
.kl-prose blockquote { padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-family: var(--serif); font-style: italic; color: var(--ink); }
.kl-prose img { margin: 1.4em 0; border-radius: var(--r); }
.kl-prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.kl-prose th, .kl-prose td { padding: 8px 12px; border: 1px solid var(--rule); text-align: left; }

.kl-404 { text-align: center; padding: 80px var(--gutter); }
.kl-404__code { font-family: var(--serif); font-weight: 800; font-size: clamp(110px, 22vw, 240px); line-height: .9; color: var(--paper-2); -webkit-text-stroke: 2px var(--rule); }
.kl-404__text { margin: 14px 0 28px; color: var(--ink-2); font-size: 18px; }

/* =================================================================
   8. СТРАНИЦА ФИЛЬМА
   ================================================================= */
.kl-single { padding-top: 24px; }
.kl-crumbs { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.kl-crumbs a:hover { color: var(--accent); }

.kl-spread { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 56px; align-items: start; }
.kl-spread__cover { position: sticky; top: 24px; aspect-ratio: 2 / 3; background: var(--paper-2); border-radius: var(--r); overflow: hidden; box-shadow: 10px 10px 0 var(--paper-2), 0 0 0 1px var(--rule); }
.kl-spread__cover img { width: 100%; height: 100%; object-fit: cover; }

.kl-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.kl-tag {
  display: inline-block; padding: 5px 12px; border: 1px solid var(--ink); border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: background .2s, color .2s;
}
a.kl-tag:hover { background: var(--ink); color: var(--paper); }
.kl-tag--solid { background: var(--ink); color: var(--paper); }

.kl-spread__title { margin-top: 18px; font-family: var(--serif); font-weight: 800; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.05; letter-spacing: -.02em; }
.kl-spread__original { margin-top: 10px; font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); }

.kl-scores { display: flex; flex-wrap: wrap; gap: 14px 36px; margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); }
.kl-score { display: flex; align-items: center; gap: 14px; }
.kl-score__num { font-family: var(--serif); font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -.02em; }
.kl-score--good .kl-score__num { color: var(--good); }
.kl-score--avg  .kl-score__num { color: var(--avg); }
.kl-score--bad  .kl-score__num { color: var(--bad); }
.kl-score--imdb .kl-score__num { color: var(--ink); }
.kl-score__label { display: flex; flex-direction: column; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.kl-score__label small { margin-top: 3px; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }

.kl-slogan { margin-top: 24px; padding-left: 18px; border-left: 3px solid var(--accent); font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.4; color: var(--ink-2); }

.kl-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; margin: 28px 0; border-top: 1px solid var(--rule); }
.kl-facts > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); }
.kl-facts dt { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kl-facts dd { margin-top: 4px; font-weight: 500; font-size: 16px; }

.kl-block { padding-top: 56px; }
.kl-block--shelves { padding-top: 24px; }
.kl-lede { font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--ink); margin-bottom: 22px; }

/* Похожие */
.kl-strip { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.kl-strip__item { flex: 0 0 150px; scroll-snap-align: start; }
.kl-strip__cover { display: block; aspect-ratio: 2 / 3; background: var(--paper-2); border-radius: var(--r); overflow: hidden; }
.kl-strip__cover img { width: 100%; height: 100%; object-fit: cover; }
.kl-strip__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 8px; font-family: var(--serif); font-weight: 600; font-size: 15px; line-height: 1.25;
}
.kl-strip__item:hover .kl-strip__title { color: var(--accent); }

/* Создатели */
.kl-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; }
.kl-person { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.kl-person__photo { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.kl-person__text { display: flex; flex-direction: column; min-width: 0; }
.kl-person__name { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.25; }
.kl-person__role { margin-top: 2px; font-size: 13px; color: var(--muted); }

/* =================================================================
   9. ТОРРЕНТЫ
   ================================================================= */
.kl-torrents { min-height: 300px; }
.kl-torrents.is-loaded { min-height: 0; }
.kl-torrents__loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 44px 0; color: var(--muted); font-size: 14px; }
.kl-spinner { width: 22px; height: 22px; border: 3px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: kl-spin .8s linear infinite; }
@keyframes kl-spin { to { transform: rotate(360deg); } }
.kl-torrents__error { text-align: center; padding: 28px 0; color: var(--muted); }

.kl-dl { user-select: text; -webkit-user-select: text; }
.kl-dl * { user-select: text; -webkit-user-select: text; }
.kl-dl__table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--ink); font-size: 14px; }
.kl-dl__table thead th {
  position: relative; padding: 14px 14px; text-align: left; white-space: nowrap; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  transition: background .2s;
}
.kl-dl__table thead th[data-col="download"] { cursor: default; }
.kl-dl__table thead th:not([data-col="download"]):hover { background: #34302a; }
.kl-dl__sort { margin-left: 4px; opacity: .5; font-size: 10px; }
.kl-dl__table thead th[data-sort-direction] .kl-dl__sort { opacity: 1; color: #f2b8a8; }
.kl-dl__table tbody tr { border-bottom: 1px solid var(--rule); transition: background .15s; }
.kl-dl__table tbody tr:last-child { border-bottom: 0; }
.kl-dl__table tbody tr:hover { background: var(--paper); }
.kl-dl__table td { padding: 14px; vertical-align: middle; color: var(--ink); }
.kl-dl__size { white-space: nowrap; font-weight: 600; }
.kl-dl__voice-cell { min-width: 180px; }
.kl-dl__voice { font-weight: 600; }
.kl-dl__seeds { white-space: nowrap; }
.kl-seed { color: var(--good); font-weight: 800; }
.kl-peer { color: var(--bad); font-weight: 700; font-size: 13px; }
.kl-dl__tech { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }

.kl-q {
  display: inline-block; padding: 3px 9px; border-radius: 3px;
  background: var(--paper-2); color: var(--ink-2);
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
}
.kl-q--4k  { background: #2a2118; color: #f4d58a; }
.kl-q--fhd { background: var(--accent); color: #fff; }
.kl-q--hd  { background: #34527a; color: #fff; }
.kl-q--web { background: #dce8dd; color: #1f5a37; }

.kl-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; white-space: nowrap;
  border: 1px solid var(--ink); border-radius: var(--r);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  transition: background .2s, color .2s, border-color .2s;
}
.kl-btn--torrent { background: var(--ink); color: var(--paper) !important; }
.kl-btn--torrent:hover { background: var(--accent); border-color: var(--accent); }
.kl-btn--magnet { background: transparent; color: var(--ink) !important; }
.kl-btn--magnet:hover { background: var(--ink); color: var(--paper) !important; }
.kl-btn-none { color: var(--muted); }

/* =================================================================
   10. ШТОРКА РУБРИК
   ================================================================= */
.kl-scrim { position: fixed; inset: 0; z-index: 400; background: rgba(28,26,23,.55); }
.kl-scrim[hidden] { display: none; }
.kl-drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 410;
  width: min(500px, 92vw); display: flex; flex-direction: column;
  background: var(--paper); border-right: 3px double var(--ink);
  transform: translateX(-102%); visibility: hidden;
  transition: transform .3s ease, visibility 0s linear .3s;
}
.kl-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.kl-drawer:focus { outline: none; }
.kl-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--ink); }
.kl-drawer__title { font-family: var(--serif); font-weight: 800; font-size: 26px; }
.kl-drawer__close { width: 40px; height: 40px; font-size: 28px; line-height: 1; border: 1px solid var(--ink); border-radius: 50%; transition: background .2s, color .2s; }
.kl-drawer__close:hover { background: var(--ink); color: var(--paper); }
.kl-drawer__body { flex: 1; overflow-y: auto; padding: 8px 24px 40px; }

.kl-rubrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.kl-rubrics a { display: block; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kl-rubrics a:hover { color: var(--accent); }
.kl-rubrics a.is-hot { color: var(--accent); font-weight: 700; }
.kl-rubric-group { margin-top: 28px; }
.kl-rubric-group__title { margin-bottom: 6px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); padding-bottom: 6px; border-bottom: 2px solid var(--ink); }

/* =================================================================
   11. ПОДВАЛ И КНОПКА «НАВЕРХ»
   ================================================================= */
.kl-footer { border-top: 3px double var(--ink); background: var(--paper-2); padding: 40px 0; }
.kl-footer__in { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.kl-footer__name { font-family: var(--serif); font-weight: 800; font-size: 28px; letter-spacing: -.01em; }
.kl-footer__name:hover { color: var(--accent); }
.kl-footer__copy { margin-top: 6px; font-size: 13px; color: var(--muted); }
.kl-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.kl-footer__nav a { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.kl-footer__nav a:hover { color: var(--accent); }

.kl-totop {
  position: fixed; right: 20px; bottom: 20px; z-index: 300; width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper); border-radius: 50%;
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, background .2s;
}
.kl-totop.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.kl-totop:hover { background: var(--accent); }

/* =================================================================
   12. АДАПТИВ
   ================================================================= */
@media (max-width: 1000px) {
  .kl-spread { grid-template-columns: 240px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 760px) {
  :root { --gutter: 16px; }

  .kl-topbar__date { display: none; }
  .kl-topbar__in { min-height: 52px; }
  .kl-topbar__tools { width: 100%; gap: 14px; }
  .kl-search { flex: 1; min-width: 0; order: 1; }
  .kl-search__input, .kl-search__input:focus { width: 100%; }
  .kl-topbar__rubrics { order: 2; flex-shrink: 0; white-space: nowrap; }

  .kl-brand { padding-top: 20px; padding-bottom: 16px; }

  .kl-nav .kl-wrap { display: block; }
  .kl-nav__toggle { display: block; width: 100%; text-align: center; }
  .kl-nav__list { display: none; padding-bottom: 8px; }
  .kl-nav__list.is-open { display: block; }
  .kl-nav__list ul { flex-direction: column; gap: 0; }
  .kl-nav__list a { padding: 10px 0; border-top: 1px solid var(--rule); text-align: center; }
  .kl-nav__list a::after { display: none; }

  .kl-shelf { padding-top: 28px; }
  .kl-shelf__title { font-size: 23px; }
  .kl-arrow { display: none; }
  .kl-shelf__all { margin-right: 0; }
  .kl-mini { flex-basis: 132px; }
  .kl-shelf__track { gap: 14px; }

  .kl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .kl-film__title { font-size: 16px; }
  .kl-catalog { padding-top: 32px; }
  .kl-sechead__title { font-size: 24px; }

  .kl-archive-head { padding: 36px 0 28px; }

  .kl-spread { grid-template-columns: 1fr; gap: 28px; }
  .kl-spread__cover { position: static; width: 56%; max-width: 240px; margin: 0 auto; box-shadow: 8px 8px 0 var(--paper-2), 0 0 0 1px var(--rule); }
  .kl-spread__title { font-size: 32px; }
  .kl-score__num { font-size: 38px; }
  .kl-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kl-button { width: 100%; }
  .kl-block { padding-top: 40px; }
  .kl-lede { font-size: 19px; }
  .kl-strip__item { flex-basis: 120px; }
  .kl-people { grid-template-columns: 1fr; }

  .kl-rubrics { grid-template-columns: 1fr; }

  /* Таблица торрентов превращается в карточки */
  .kl-dl__table, .kl-dl__table tbody, .kl-dl__table tr, .kl-dl__table td { display: block; width: 100%; }
  .kl-dl__table { border: 0; background: none; }
  .kl-dl__table thead { display: none; }
  .kl-dl__table tbody tr { margin-bottom: 14px; padding: 14px; background: var(--card); border: 1px solid var(--ink); border-radius: var(--r); }
  .kl-dl__table tbody tr:hover { background: var(--card); }
  .kl-dl__table td { padding: 5px 0; }
  .kl-dl__table td::before {
    content: attr(data-label); display: inline-block; min-width: 92px; margin-right: 8px;
    font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  }
  .kl-dl__table td.kl-dl__get { margin-top: 8px; padding-bottom: 0; }
  .kl-dl__table td.kl-dl__get::before { display: none; }
  .kl-dl__get .kl-btn { width: 100%; justify-content: center; padding: 11px 16px; }
  .kl-dl__get .kl-btn svg { display: none; }
  .kl-dl__size { white-space: normal; }
  .kl-dl__voice-cell { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
