/* ==========================================================================
   کارت جدید فیلم — kfc
   - پوستر ۲:۳ با گوشه‌ی گرد، امتیاز IMDb و رتبه‌ی TOP بالا
   - برچسب دوبله (نارنجی) / زیرنویس (آبی) پایین پوستر + نوار رنگی لبه‌ی پایین
     دوبله + زیرنویس: هر دو برچسب و نوار گرادیان نارنجی→آبی
   - هاور دسکتاپ: خلاصه داستان + دکمه پخش
   - عنوان انگلیسی | فارسی + سال و ژانر زیر پوستر
   ========================================================================== */

.kfc {
  --kfc-accent: var(--primaryColor, #4d6bff);
  --kfc-dub: #ff7a1a;
  --kfc-dub-2: #ff4d2e;
  --kfc-sub: #3d8bff;
  --kfc-sub-2: #5b5cff;
  --kfc-radius: 16px;
  --kfc-line: color-mix(in srgb, var(--text, #cce1ff) 10%, transparent);
  --kfc-edge: transparent;
  position: relative;
  margin-bottom: 18px;
  text-align: right;
  transition: none;
}

.kfc--dub  { --kfc-edge: linear-gradient(90deg, var(--kfc-dub), var(--kfc-dub-2)); }
.kfc--sub  { --kfc-edge: linear-gradient(90deg, var(--kfc-sub), var(--kfc-sub-2)); }
.kfc--both { --kfc-edge: linear-gradient(90deg, var(--kfc-sub) 0%, var(--kfc-sub-2) 45%, var(--kfc-dub-2) 55%, var(--kfc-dub) 100%); }

.kfc__link {
  display: block;
  color: inherit !important;
  text-decoration: none !important;
  outline: none;
}

/* ---------- پوستر ---------- */
.kfc__poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--kfc-radius);
  overflow: hidden;
  isolation: isolate;
  background: color-mix(in srgb, var(--bg_lighter, #14253e) 80%, #000);
  box-shadow:
    0 0 0 1px var(--kfc-line),
    0 10px 24px -14px rgba(0, 0, 0, .8);
  transform: translateZ(0);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}

/* نوار رنگی دوبله/زیرنویس در لبه‌ی پایین پوستر */
.kfc__poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--kfc-edge);
  z-index: 4;
  pointer-events: none;
}

.film_cat.kfc .kfc__img,
.kfc .kfc__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: cover;
  border-radius: 0 !important;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .35s ease;
}

.kfc__img--empty {
  background:
    radial-gradient(80% 60% at 50% 30%, color-mix(in srgb, var(--kfc-accent) 30%, transparent), transparent),
    color-mix(in srgb, var(--bg_lighter, #14253e) 90%, #000);
}

.kfc__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 8, 16, .55) 0%, rgba(4, 8, 16, 0) 22%),
    linear-gradient(0deg, rgba(4, 8, 16, .82) 0%, rgba(4, 8, 16, .25) 26%, rgba(4, 8, 16, 0) 42%);
}

/* ---------- بالا: IMDb و TOP ---------- */
.kfc__top {
  position: absolute;
  inset: 8px 8px auto 8px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: row-reverse; /* IMDb چپ، رتبه راست (RTL) */
  gap: 6px;
  pointer-events: none;
}

.kfc__imdb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 25px;
  padding: 0 8px;
  border-radius: 9px;
  direction: ltr;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: rgba(8, 12, 22, .62);
  border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.kfc__imdb svg {
  width: 13px;
  height: 13px;
  fill: #f5c518;
}

.kfc__rank {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  height: 25px;
  padding: 0 8px;
  border-radius: 9px;
  direction: ltr;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  color: #1a1300;
  background: linear-gradient(135deg, #ffd84d, #f5b301);
  box-shadow: 0 6px 14px -6px rgba(245, 179, 1, .7);
}

.kfc__rank small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
  opacity: .75;
}

.kfc__type {
  display: inline-flex;
  align-items: center;
  height: 25px;
  padding: 0 9px;
  border-radius: 9px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: color-mix(in srgb, var(--kfc-accent) 78%, transparent);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.kfc__type--series {
  background: rgba(124, 92, 255, .82);
}

/* ---------- پایین پوستر: دوبله / زیرنویس ---------- */
.kfc__langs {
  position: absolute;
  inset: auto 8px 11px 8px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  pointer-events: none;
  transition: opacity .25s ease, transform .3s ease;
}

.kfc__lang {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .9);
}

.kfc__lang svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kfc__lang b {
  display: inline-grid;
  place-items: center;
  height: 14px;
  padding: 0 3px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: .2px;
  font-family: Arial, sans-serif;
}

.kfc__lang--dub {
  background: linear-gradient(135deg, var(--kfc-dub), var(--kfc-dub-2));
}

.kfc__lang--sub {
  background: linear-gradient(135deg, var(--kfc-sub), var(--kfc-sub-2));
}

.kfc__lang--cen {
  background: rgba(30, 36, 52, .85);
  border: 1px solid rgba(255, 255, 255, .14);
  color: #d5dcef;
}

/* ---------- هاور ---------- */
.kfc__hover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 14px;
  text-align: center;
  background:
    radial-gradient(90% 60% at 50% 40%, color-mix(in srgb, var(--kfc-accent) 28%, transparent), transparent 70%),
    rgba(5, 9, 18, .78);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.kfc__play {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: var(--kfc-accent);
  box-shadow:
    0 0 0 6px color-mix(in srgb, var(--kfc-accent) 25%, transparent),
    0 14px 30px -10px color-mix(in srgb, var(--kfc-accent) 90%, #000);
  transform: scale(.75);
  transition: transform .35s cubic-bezier(.2, 1.4, .4, 1);
}

.kfc__play svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  margin-right: -3px; /* مرکز بصری مثلث */
}

.kfc__story {
  margin: 0;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(235, 241, 255, .88);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: translateY(8px);
  transition: transform .35s ease;
}

.kfc__cta {
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
}

@media (hover: hover) and (min-width: 768px) {
  .kfc__link:hover .kfc__poster,
  .kfc__link:focus-visible .kfc__poster {
    transform: translateY(-5px);
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--kfc-accent) 70%, transparent),
      0 22px 40px -18px color-mix(in srgb, var(--kfc-accent) 75%, #000);
  }

  .kfc__link:hover .kfc__img {
    transform: scale(1.06);
    filter: saturate(1.1);
  }

  .kfc__link:hover .kfc__hover,
  .kfc__link:focus-visible .kfc__hover {
    opacity: 1;
    visibility: visible;
  }

  .kfc__link:hover .kfc__play { transform: scale(1); }
  .kfc__link:hover .kfc__story { transform: none; }
  .kfc__link:hover .kfc__langs { opacity: 0; }

  .kfc__link:hover .kfc__t-main { color: #fff; }
}

/* ---------- اطلاعات زیر پوستر ---------- */
.kfc__info {
  padding: 10px 4px 0;
}

.film_cat.kfc h2.kfc__title,
.kfc__title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 4px !important;
  min-width: 0;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1.6 !important;
  color: var(--text, #cce1ff);
  white-space: nowrap;
  text-align: right;
}

.kfc__t-main {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: color-mix(in srgb, var(--text, #cce1ff) 92%, #fff);
  transition: color .2s ease;
}

.kfc__t-alt {
  flex: 0 10 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 7px;
  border-right: 1px solid color-mix(in srgb, var(--text, #cce1ff) 22%, transparent);
  font-size: 12.5px;
  font-weight: 500;
  color: color-mix(in srgb, var(--text, #cce1ff) 55%, transparent);
}

.kfc__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--text, #cce1ff) 52%, transparent);
  white-space: nowrap;
}

.kfc__year {
  flex: none;
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 700;
  color: color-mix(in srgb, var(--text, #cce1ff) 80%, transparent);
  background: color-mix(in srgb, var(--text, #cce1ff) 8%, transparent);
}

.kfc__genres {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- موبایل ---------- */
@media (max-width: 576px) {
  .kfc { --kfc-radius: 13px; margin-bottom: 14px; }
  .kfc__top { inset: 6px 6px auto 6px; }
  .kfc__imdb, .kfc__rank, .kfc__type { height: 22px; font-size: 11.5px; padding: 0 6px; border-radius: 7px; }
  .kfc__langs { inset: auto 6px 9px 6px; gap: 4px; }
  .kfc__lang { height: 21px; font-size: 10.5px; padding: 0 6px; border-radius: 7px; gap: 4px; }
  .kfc__lang svg { width: 11px; height: 11px; }
  .film_cat.kfc h2.kfc__title, .kfc__title { font-size: 13px !important; }
  .kfc__t-alt { font-size: 11.5px; }
  .kfc__meta { font-size: 11px; }
}

/* ---------- حالت روشن قالب (در این قالب کلاس html.dark یعنی تم روشن) ---------- */
html.dark .kfc {
  --kfc-line: rgba(20, 40, 80, .1);
}
html.dark .kfc__poster {
  box-shadow: 0 0 0 1px rgba(20, 40, 80, .08), 0 12px 24px -14px rgba(20, 40, 80, .45);
}
html.dark .kfc__t-main { color: var(--text, #10223d); }
html.dark .kfc__link:hover .kfc__t-main { color: var(--primaryColor, #4050b5); }

/* داخل ردیف انیمه‌ی صفحه اصلی رنگ تاکید نارنجی (هماهنگ با کارت سریال) */
.anime-section .kfc { --kfc-accent: #ff6a2b; }

/* ---------- رفع بزرگ/کوچک شدن کارت‌ها در گرید صفحه اصلی ----------
   ستون‌های 1fr با عنوان بلند (nowrap) پهن می‌شدند؛ minmax(0,1fr) همه را هم‌اندازه می‌کند. */
@media (min-width: 1200px) {
  body.home .film_cat_carousel .owl-stage {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

.owl-item:has(> .kfc) { min-width: 0; }

.kfc,
.kfc__info {
  min-width: 0;
  max-width: 100%;
}

.kfc__info { overflow: hidden; }
