/* ==========================================================================
   serial_card — کارت سینمایی سریال (طرح نئونی)
   رنگ پیش‌فرض آبی؛ داخل .anime-section نارنجی (همان #cf3b1b قبلی انیمه‌ها)
   اندازه‌ها با container query نسبت به عرض خود کارت مقیاس می‌شوند.
   ========================================================================== */

.sc2 {
  --sc-accent: #2f6fed;
  --sc-accent-2: #4d8dff;
  --sc-glow: rgba(47, 111, 237, .55);
  --sc-bg: #050b1c;
  --sc-panel: rgba(6, 13, 32, .72);
  --sc-ink: #eef3ff;
  --sc-muted: #aab7d6;
  --sc-star: #f5b301;
  --sc-age: #e5384b;
  --sc-r: 20px;
  --sc-pad: 22px;
  --sc-top: 14px; /* فاصله‌ی دکمه‌های بالای کارت از لبه */

  position: relative;
  width: 100%;
  margin-bottom: 28px;
  direction: rtl;
  container-type: inline-size;
  container-name: sc2;
}

/* ---------- انیمه: همان نارنجیِ فعلی ---------- */
.anime-section .sc2 {
  --sc-accent: #cf3b1b;
  --sc-accent-2: #ee5a33;
  --sc-glow: rgba(207, 59, 27, .55);
  --sc-bg: #140a07;
  --sc-panel: rgba(22, 10, 6, .72);
}

.sc2 a,
.sc2 button {
  -webkit-tap-highlight-color: transparent;
}

.sc2 a,
.sc2 a:hover,
.sc2 a:focus {
  color: inherit;
  text-decoration: none;
}

.sc2 svg {
  display: block;
  flex: none;
}

/* ---------- قاب ---------- */
@property --sc-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.sc2__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 2px solid color-mix(in srgb, var(--sc-accent) 55%, transparent);
  border-radius: var(--sc-r);
  background: var(--sc-bg);
  /* حالت عادی: بدون هاله‌ی نوری، فقط سایه‌ی ملایم */
  box-shadow: 0 10px 24px rgba(0, 0, 0, .4);
  color: var(--sc-ink);
  isolation: isolate;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

/* حلقه‌ی نوریِ چرخان — فقط روی هاور */
.sc2__frame::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 5;
  padding: 2px;
  border-radius: var(--sc-r);
  background: conic-gradient(
    from var(--sc-angle),
    transparent 0deg,
    transparent 190deg,
    var(--sc-accent) 250deg,
    var(--sc-accent-2) 310deg,
    #fff 345deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity .3s ease;
  animation: sc2-spin 2.6s linear infinite;
  animation-play-state: paused;
  pointer-events: none;
}

@keyframes sc2-spin {
  to {
    --sc-angle: 360deg;
  }
}

.sc2:hover .sc2__frame {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--sc-accent) 25%, transparent);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .5);
}

.sc2:hover .sc2__frame::before {
  opacity: 1;
  animation-play-state: running;
}

.sc2.is-menu-open {
  z-index: 30;
}

/* ---------- تصویر ---------- */
.sc2__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: calc(var(--sc-r) - 2px);
}

.sc2__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 0 !important;
  transition: transform .8s ease;
}

.sc2:hover .sc2__img {
  transform: scale(1.04);
}

.sc2__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, color-mix(in srgb, var(--sc-bg) 94%, transparent) 0%, color-mix(in srgb, var(--sc-bg) 70%, transparent) 36%, transparent 68%),
    linear-gradient(to top, color-mix(in srgb, var(--sc-bg) 92%, transparent) 0%, transparent 46%),
    linear-gradient(to bottom, color-mix(in srgb, var(--sc-bg) 55%, transparent) 0%, transparent 26%);
}

/* ---------- لینک کل کارت ---------- */
.sc2__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

/* ---------- دکمه‌ی پخش (بالا چپ) ---------- */
.sc2__play {
  position: absolute;
  top: var(--sc-top);
  left: var(--sc-pad);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  width: clamp(30px, 4.6cqw, 44px);
  height: clamp(30px, 4.6cqw, 44px);
  border: 2px solid #d7e5ff;
  border-radius: 50%;
  background: rgba(5, 11, 28, .78);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--sc-accent) 45%, transparent);
  color: #fff;
  transition: transform .25s ease, box-shadow .25s ease;
}

.sc2__play svg {
  width: 44%;
  height: 44%;
  margin-left: 4%;
  fill: currentColor;
}

.sc2__play:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 0 2px var(--sc-accent),
    0 0 16px var(--sc-glow);
}

/* ---------- بالا راست: زیرنویس/دوبله + بوکمارک (هم‌اندازه، زیر هم) ---------- */
.sc2__tr {
  position: absolute;
  top: var(--sc-top);
  right: var(--sc-pad);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  direction: ltr;
}

.sc2__flag,
.sc2__bm {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  width: clamp(30px, 4.8cqw, 40px);
  height: clamp(30px, 4.8cqw, 40px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  background: rgba(5, 11, 28, .66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 15px;
  font-size: clamp(13px, 2.2cqw, 18px);
  line-height: 1;
}

.sc2__bm {
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}

.sc2__bm:hover {
  border-color: var(--sc-accent-2);
  background: color-mix(in srgb, var(--sc-accent) 30%, rgba(5, 11, 28, .8));
  transform: scale(1.06);
}

.sc2__bm .fas {
  color: var(--sc-accent-2);
}

/* ---------- بدنه (پایین چپ) ---------- */
.sc2__body {
  position: absolute;
  left: var(--sc-pad);
  bottom: var(--sc-pad);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(7px, 1.6cqw, 13px);
  max-width: 64%;
  direction: ltr;
  pointer-events: none; /* کلیک روی متن به لینک کل کارت می‌رسد */
}

/* ---------- ردیف متا ---------- */
.sc2__meta {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2cqw, 10px);
  max-width: 100%;
  direction: ltr;
}

.sc2__chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 28px;
  height: clamp(24px, 4.4cqw, 36px);
  padding: 0 11px;
  padding: 0 clamp(8px, 1.7cqw, 14px);
  border: 1px solid color-mix(in srgb, var(--sc-accent) 60%, transparent);
  border-radius: 10px;
  background: var(--sc-panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 12px;
  font-size: clamp(11px, 2.5cqw, 17px);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  direction: ltr;
}

.sc2__chip svg {
  width: 1.15em;
  height: 1.15em;
  fill: var(--sc-star);
}

.sc2__age {
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 28px;
  min-width: clamp(26px, 4.9cqw, 40px);
  height: 28px;
  height: clamp(26px, 4.9cqw, 40px);
  padding: 0 4px;
  border-radius: 50%;
  background: var(--sc-age);
  box-shadow: 0 0 14px rgba(229, 56, 75, .5);
  font-size: 11px;
  font-size: clamp(10px, 2.3cqw, 16px);
  font-weight: 800;
  line-height: 1;
  color: #fff;
  direction: ltr;
}

.sc2__genres {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-size: clamp(11px, 2.6cqw, 17px);
  font-weight: 600;
  color: var(--sc-muted);
  direction: rtl;
}

.sc2__genres > span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: .95em;
  margin: 0 .65em;
  background: rgba(255, 255, 255, .28);
  vertical-align: -.1em;
}

/* ---------- هاله‌ی سیاه + خلاصه داستان (فقط روی هاور) ---------- */
.sc2__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(var(--sc-top) + clamp(34px, 5cqw, 46px)) calc(var(--sc-pad) + 56px) 0;
  border-radius: calc(var(--sc-r) - 2px);
  background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .78) 60%, rgba(0, 0, 0, .7) 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s;
  pointer-events: none;
}

.sc2__story {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 0;
  font-size: 12px;
  font-size: clamp(11px, 2.4cqw, 16px);
  line-height: 1.75;
  color: #e6ecfb;
  text-align: justify;
  direction: rtl;
}

@media (hover: hover) {
  .sc2:hover .sc2__veil {
    opacity: 1;
    visibility: visible;
  }
}

@container sc2 (min-width: 480px) {
  .sc2__story {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

/* ---------- عنوان زیر کارت ---------- */
.sc2__cap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
  padding: 0 4px;
  direction: ltr;
}

.sc2__cap-en {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-size: clamp(14px, 3.6cqw, 20px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--sc-ink);
}

.sc2__cap-sep {
  flex: none;
  width: 1px;
  height: 1.1em;
  background: rgba(255, 255, 255, .28);
}

.sc2__cap-fa {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-size: clamp(12px, 2.9cqw, 16px);
  font-weight: 500;
  line-height: 1.3;
  color: rgba(238, 243, 255, .55);
  direction: rtl;
}

.sc2__cap:hover .sc2__cap-en {
  color: var(--sc-accent-2);
}

/* ---------- فصل + قسمت ---------- */
.sc2__actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.5cqw, 12px);
  max-width: 100%;
  direction: ltr;
  pointer-events: auto;
}

.sc2__season {
  position: relative;
  min-width: 0;
}

.sc2__season-btn,
.sc2__ep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  height: clamp(30px, 5.6cqw, 46px);
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-size: clamp(12px, 2.7cqw, 18px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sc2__season-btn {
  max-width: 150px;
  padding: 0 clamp(9px, 1.8cqw, 15px);
  border: 1px solid color-mix(in srgb, var(--sc-accent) 60%, transparent);
  background: var(--sc-panel);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  direction: rtl;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.sc2__season-btn--static {
  cursor: default;
}

.sc2__season-btn:not(.sc2__season-btn--static):hover,
.sc2__season.is-open .sc2__season-btn {
  border-color: var(--sc-accent-2);
  background: color-mix(in srgb, var(--sc-accent) 24%, var(--sc-panel));
}

.sc2__season-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc2__season-btn svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s;
}

.sc2__season.is-open .sc2__season-btn svg {
  transform: rotate(180deg);
}

.sc2__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: none;
  min-width: 100%;
  max-height: 168px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--sc-accent);
  border-radius: 14px;
  background: #0a1226;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .6), 0 0 18px var(--sc-glow);
  direction: rtl;
  overscroll-behavior: contain;
}

.anime-section .sc2__menu {
  background: #170c08;
}

.sc2__season.is-open .sc2__menu {
  display: block;
}

.sc2__season-opt {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #dbe5ff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  cursor: pointer;
}

.sc2__season-opt:hover {
  background: color-mix(in srgb, var(--sc-accent) 30%, transparent);
  color: #fff;
}

.sc2__season-opt.is-selected {
  background: var(--sc-accent);
  color: #fff;
}

.sc2__ep {
  padding: 0 clamp(14px, 2.8cqw, 24px);
  border: 0;
  background: linear-gradient(180deg, var(--sc-accent-2), var(--sc-accent));
  box-shadow: 0 0 18px var(--sc-glow);
  color: #fff;
  direction: rtl;
  transition: transform .2s, box-shadow .2s, filter .2s;
}

.sc2__ep:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px var(--sc-glow);
  filter: brightness(1.08);
}

.sc2__ep svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- آخرین قسمت دیده‌شده (پایین راست) ---------- */
.sc2__progress {
  position: absolute;
  right: var(--sc-pad);
  bottom: var(--sc-pad);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: clamp(7px, 1.4cqw, 12px);
  height: 42px;
  height: clamp(34px, 6.6cqw, 52px);
  padding: 0 14px;
  padding: 0 clamp(10px, 2.2cqw, 20px);
  border: 1px solid color-mix(in srgb, var(--sc-accent) 60%, transparent);
  border-radius: 999px;
  background: var(--sc-panel);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  font-size: clamp(10px, 2.1cqw, 14px);
  color: #dbe5ff;
  direction: rtl;
  white-space: nowrap;
  transition: border-color .2s, background .2s;
}

.sc2__progress:hover {
  border-color: var(--sc-accent-2);
  background: color-mix(in srgb, var(--sc-accent) 22%, var(--sc-panel));
}

.sc2__progress-ico {
  width: 1.9em;
  height: 1.9em;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sc2__progress-count {
  font-weight: 700;
  font-size: 1.1em;
  color: #fff;
  direction: ltr;
}

.sc2__bar {
  display: block;
  width: 64px;
  width: clamp(40px, 8.4cqw, 120px);
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .15);
  direction: ltr;
}

.sc2__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sc-accent), var(--sc-accent-2));
  box-shadow: 0 0 10px var(--sc-glow);
}

/* ==========================================================================
   کارت‌های کوچک‌تر (۳ تا در ردیف / موبایل)
   ========================================================================== */
@container sc2 (max-width: 480px) {
  .sc2__frame {
    aspect-ratio: 16 / 10;
  }

  .sc2__body {
    max-width: 70%;
  }

  .sc2__progress {
    gap: 8px;
    padding: 0 11px;
  }

  .sc2__progress-label {
    display: none;
  }

}

@container sc2 (max-width: 360px) {
  .sc2__bar {
    display: none;
  }

  .sc2__season-btn {
    max-width: 104px;
  }

  .sc2__body {
    max-width: 78%;
  }
}

@media (max-width: 767.98px) {
  .sc2 {
    --sc-pad: 14px;
    --sc-top: 10px;
    --sc-r: 16px;
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc2__frame::before {
    animation: none;
  }

  .sc2__frame,
  .sc2__img,
  .sc2__play,
  .sc2__ep,
  .sc2__bm {
    transition: none;
  }

  .sc2:hover .sc2__frame,
  .sc2:hover .sc2__img {
    transform: none;
  }
}
