/* Oink v2 — ближе к live.tatnet.app/kino */
html.pl-theme-oink,
body.pl-theme-oink {
  --oink-bg: #000;
  --oink-elev: #0f0f0f;
  --oink-card: #161616;
  --oink-border: rgba(255,255,255,.08);
  --oink-text: #fff;
  --oink-muted: #8a8a8a;
  --oink-orange: #ff6a00;
  --oink-top: 60px;
  --oink-bottom: 56px;
  background: #000 !important;
  color: #fff !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  margin: 0 !important;
}

html.pl-theme-oink .site-header,
html.pl-theme-oink header.site-header,
html.pl-theme-oink .main-header,
html.pl-theme-oink #site-footer,
html.pl-theme-oink footer,
html.pl-theme-oink .app-bottom-nav,
html.pl-theme-oink .mobile-nav-bar {
  display: none !important;
}

/* На главной прячем родной контент StreamLife — только Oink-оболочка */
html.pl-theme-oink.oink-home:not(.oink-on-catalog) body > .container,
html.pl-theme-oink.oink-home:not(.oink-on-catalog) body > main,
html.pl-theme-oink.oink-home:not(.oink-on-catalog) .hero-banner,
html.pl-theme-oink.oink-home:not(.oink-on-catalog) .type-tabs {
  display: none !important;
}
/* catalog: сезоны сверху, сетка каналов остаётся */
html.pl-theme-oink.oink-on-catalog .oink-main {
  margin-bottom: 20px;
}
html.pl-theme-oink.oink-on-catalog .oink-hero {
  display: none !important; /* на каталоге без огромного hero */
}

.oink-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10050;
  height: var(--oink-top);
  display: flex; align-items: center; gap: 28px;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(0,0,0,.95) 0%, rgba(0,0,0,.7) 60%, transparent);
}
.oink-logo {
  display: flex; flex-direction: column; text-decoration: none;
  line-height: 1; flex-shrink: 0; min-width: 72px;
}
.oink-logo-mark {
  font-weight: 900; font-size: 26px; letter-spacing: .02em;
  color: #fff; font-style: italic;
}
.oink-logo-mark span { color: var(--oink-orange); }
.oink-logo-sub {
  font-size: 7px; letter-spacing: .22em; color: var(--oink-orange);
  margin-top: 3px; font-weight: 700; text-transform: uppercase;
}
.oink-nav { display: flex; gap: 22px; align-items: center; }
.oink-nav a {
  color: rgba(255,255,255,.78); text-decoration: none;
  font-size: 14px; font-weight: 500;
}
.oink-nav a:hover, .oink-nav a.on { color: #fff; }
.oink-search-wrap {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: rgba(30,30,30,.9); border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px; padding: 8px 16px; min-width: 200px;
}
.oink-search-wrap input {
  border: 0; background: transparent; color: #fff; outline: none;
  font-size: 13px; width: 160px;
}
.oink-search-wrap input::placeholder { color: #777; }

html.pl-theme-oink body {
  padding-top: 0 !important;
  padding-bottom: calc(var(--oink-bottom) + 8px) !important;
}

/* Hero fullscreen cinema */
.oink-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: flex-end;
  padding: 0 48px calc(var(--oink-bottom) + 40px);
  background: #0a0a0a center/cover no-repeat;
  box-sizing: border-box;
}
.oink-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.88) 0%, rgba(0,0,0,.45) 42%, rgba(0,0,0,.2) 100%),
    linear-gradient(0deg, rgba(0,0,0,.92) 0%, transparent 42%);
  pointer-events: none;
}
.oink-hero-inner { position: relative; z-index: 1; max-width: 640px; padding-bottom: 24px; }
.oink-hero-meta {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px; font-size: 13px; color: #cfcfcf; font-weight: 500;
}
.oink-badge {
  background: #e11d48; color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 9px; border-radius: 4px; letter-spacing: .03em;
}
.oink-hero-title {
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 900; line-height: .95;
  color: var(--oink-orange);
  margin: 0 0 22px;
  text-transform: uppercase;
  letter-spacing: -.01em;
  text-shadow: 0 6px 32px rgba(0,0,0,.55);
}
.oink-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.oink-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 10px; border: 0;
  font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.oink-btn-primary { background: #fff; color: #111; }
.oink-btn-primary:hover { background: #f0f0f0; }
.oink-btn-ghost {
  background: rgba(36,36,36,.88); color: #fff;
  border: 1px solid rgba(255,255,255,.1);
}
.oink-btn-ghost:hover { background: rgba(55,55,55,.95); }

/* Content below hero */
.oink-main {
  position: relative;
  z-index: 2;
  margin-top: -80px;
  padding: 0 0 32px;
  background: linear-gradient(180deg, transparent 0%, #000 80px);
}
.oink-row { padding: 12px 28px 18px; }
.oink-row-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.oink-row-head h2 {
  margin: 0; font-size: 17px; font-weight: 800; color: #fff;
}
.oink-row-head a {
  font-size: 13px; color: var(--oink-orange); text-decoration: none; font-weight: 600;
}
.oink-rail {
  display: flex; gap: 14px; overflow-x: auto;
  padding: 4px 2px 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.oink-rail::-webkit-scrollbar { height: 4px; }
.oink-rail::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.oink-card {
  flex: 0 0 auto; width: 148px;
  scroll-snap-align: start;
  text-decoration: none; color: #fff;
  transition: transform .15s ease;
}
.oink-card:hover { transform: translateY(-4px); }
.oink-card-thumb {
  position: relative; aspect-ratio: 2/3;
  border-radius: 8px; overflow: hidden; background: #1a1a1a;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.oink-card-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.oink-card-thumb .oink-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(160deg, #1c1c24, #2c2c36); font-size: 26px;
}
.oink-card-live {
  position: absolute; top: 8px; left: 8px;
  background: #e50914; color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 3px;
}
.oink-card-title {
  margin-top: 8px; font-size: 12px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.3; color: #eee;
}
.oink-card-sub { font-size: 11px; color: #777; margin-top: 2px; }

/* Bottom */
.oink-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10050;
  height: var(--oink-bottom);
  display: flex; justify-content: space-around; align-items: center;
  background: #0a0a0a; border-top: 1px solid rgba(255,255,255,.06);
}
.oink-bottom a {
  flex: 1; text-align: center; text-decoration: none; color: #6a6a6a;
  font-size: 10px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0;
}
.oink-bottom a.on { color: var(--oink-orange); }
.oink-bottom .oink-ico { font-size: 20px; line-height: 1; }

@media (min-width: 960px) {
  .oink-bottom { display: none; }
  html.pl-theme-oink body { padding-bottom: 0 !important; }
  .oink-hero { padding-bottom: 64px; }
  .oink-card { width: 168px; }
  .oink-main { margin-top: -100px; }
}
@media (max-width: 720px) {
  .oink-nav { display: none; }
  .oink-topbar { padding: 0 14px; gap: 12px; }
  .oink-search-wrap { min-width: 0; flex: 1; }
  .oink-search-wrap input { width: 100%; }
  .oink-hero { padding: 0 16px calc(var(--oink-bottom) + 28px); min-height: 100svh; }
  .oink-row { padding: 10px 12px 14px; }
  .oink-logo-mark { font-size: 22px; }
}

/* Внутренние страницы (не home) */
html.pl-theme-oink:not(.oink-home) body {
  padding-top: calc(var(--oink-top) + 8px) !important;
}
html.pl-theme-oink .container,
html.pl-theme-oink main {
  max-width: 1200px; margin: 0 auto; padding: 8px 16px 40px;
}
html.pl-theme-oink .card,
html.pl-theme-oink .video-card,
html.pl-theme-oink .channel-card {
  background: #141414 !important;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.06);
}
html.pl-theme-oink a { color: #ff8a2a; }
html.pl-theme-oink .yt-player-box,
html.pl-theme-oink .player-wrap {
  border-radius: 10px; overflow: hidden;
}

/* ===== v3: search modal ===== */
.oink-search-wrap {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  background: rgba(30,30,30,.9); border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px; padding: 8px 16px; min-width: 160px;
  cursor: pointer; color: #888; font-size: 13px; border-style: solid;
  font-family: inherit;
}
.oink-search-placeholder { color: #777; }
.oink-search-modal {
  position: fixed; inset: 0; z-index: 200000;
  background: rgba(0,0,0,.72); backdrop-filter: blur(10px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 24px; box-sizing: border-box;
}
.oink-search-modal.open { display: flex; }
html.oink-search-open { overflow: hidden; }
.oink-search-panel {
  width: min(640px, 100%);
  background: #121212;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  max-height: 75vh;
  display: flex; flex-direction: column;
}
.oink-search-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.oink-search-head input {
  flex: 1; border: 0; background: transparent; color: #fff;
  font-size: 17px; outline: none; padding: 8px 4px;
}
.oink-search-close {
  border: 0; background: rgba(255,255,255,.08); color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px;
}
.oink-search-hints {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px;
}
.oink-search-hints button {
  border: 1px solid rgba(255,255,255,.12); background: #1c1c1c; color: #ddd;
  border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}
.oink-search-hints button:hover { border-color: var(--oink-orange); color: #fff; }
.oink-search-results {
  overflow-y: auto; padding: 4px 8px 12px; flex: 1;
}
.oink-search-empty {
  padding: 24px 12px; text-align: center; color: #777; font-size: 14px;
}
.oink-search-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; border-radius: 10px; text-decoration: none; color: #eee;
}
.oink-search-item:hover { background: rgba(255,255,255,.06); }
.oink-search-item img,
.oink-search-ph {
  width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
  background: #222; flex-shrink: 0;
  display: grid; place-items: center; font-size: 18px;
}
.oink-search-title { font-size: 14px; font-weight: 600; }
.oink-search-sub { font-size: 12px; color: #888; margin-top: 2px; }
.oink-search-more {
  display: block; text-align: center; padding: 12px;
  color: var(--oink-orange); text-decoration: none; font-size: 13px; font-weight: 600;
}

/* Season countdown + rows visibility */
.oink-season-bar {
  margin: 8px 16px 16px;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(30,60,120,.45), rgba(10,10,20,.9));
  border: 1px solid rgba(100,160,255,.2);
  text-align: center;
  color: #9ec5ff;
  font-size: 14px;
  font-weight: 600;
}
.oink-season-bar b { color: #ffd15a; font-weight: 800; }
.oink-main {
  position: relative;
  z-index: 5;
  margin-top: 0 !important;
  padding-top: 8px;
  background: #000;
}
.oink-row {
  padding: 16px 20px 22px !important;
}
.oink-row-head h2 {
  font-size: 20px !important;
  color: #fff !important;
}
html.pl-theme-oink.oink-home .oink-main {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Канал ТВ/радио — обложка/лого, не постер фильма */
.oink-card-channel { width: min(200px, 46vw) !important; }
.oink-card-channel .oink-card-thumb {
  aspect-ratio: 16 / 10 !important;
  background: #141414;
}
.oink-card-channel .oink-card-thumb img {
  object-fit: contain !important;
  background: #0a0a0a;
  padding: 8px;
}
/* Видео — вертикальный/постерный превью */
.oink-card-video { width: min(148px, 40vw) !important; }
.oink-card-video .oink-card-thumb {
  aspect-ratio: 2 / 3 !important;
}
.oink-card-video .oink-card-thumb img {
  object-fit: cover !important;
}
.oink-card-kind {
  position: absolute; right: 8px; bottom: 8px;
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: rgba(0,0,0,.65); color: #ccc;
}
.oink-card-video .oink-card-kind { color: #ffb86b; }
.oink-card-channel .oink-card-kind { color: #7dd3fc; }

/* Нативная сетка каталога: каналы не как video-poster */
html.pl-theme-oink .channel-card img,
html.pl-theme-oink .card.channel img,
html.pl-theme-oink [data-type="channel"] img {
  object-fit: contain !important;
  background: #111;
}
html.pl-theme-oink .video-card img,
html.pl-theme-oink [data-type="video"] img {
  object-fit: cover !important;
}

/* Каталог: карточки-ссылки на channel.php = ТВ, video.php = превью */
html.pl-theme-oink a[href*="channel.php"] img,
html.pl-theme-oink a[href*="channel.php"] .thumb img,
html.pl-theme-oink .channel-card img {
  object-fit: contain !important;
  background: #0a0a0a !important;
  aspect-ratio: 16 / 10;
  width: 100%;
}
html.pl-theme-oink a[href*="video.php"] img,
html.pl-theme-oink .video-card img {
  object-fit: cover !important;
  aspect-ratio: 2 / 3;
  width: 100%;
}
html.pl-theme-oink .channel-card,
html.pl-theme-oink a[href*="channel.php"].card {
  max-width: 220px;
}
