/* =========================================================
   EN BABA GLOBAL VIDEO SYSTEM
   Poster-first, click-to-play, portrait/landscape responsive.
========================================================= */

.enb-video-card {
  --enb-video-accent: #e11d48;
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  color: #0f172a;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, .32);
  border-radius: 22px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .11);
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.enb-video-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--enb-video-accent) 42%, transparent);
  box-shadow: 0 24px 56px rgba(15, 23, 42, .16);
}

.enb-video-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--enb-video-accent) 42%, transparent);
  outline-offset: 4px;
}

.enb-video-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.enb-video-card__media[data-ratio="9:16"] { aspect-ratio: 9 / 16; max-height: 500px; }
.enb-video-card__media[data-ratio="4:5"] { aspect-ratio: 4 / 5; max-height: 500px; }
.enb-video-card__media[data-ratio="1:1"] { aspect-ratio: 1 / 1; }
.enb-video-card__media[data-ratio="4:3"] { aspect-ratio: 4 / 3; }

.enb-video-card__poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), opacity .25s ease;
}

.enb-video-card:hover .enb-video-card__poster { transform: scale(1.035); }

.enb-video-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2,6,23,.04) 28%, rgba(2,6,23,.68) 100%);
  pointer-events: none;
}

.enb-video-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(255,255,255,.76);
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255,255,255,.93);
  box-shadow: 0 12px 34px rgba(2,6,23,.3);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(10px);
  transition: transform .22s ease, background-color .22s ease;
}

.enb-video-card__play svg { width: 28px; height: 28px; fill: currentColor; transform: translateX(2px); }
.enb-video-card:hover .enb-video-card__play { transform: translate(-50%, -50%) scale(1.07); background: #fff; }

.enb-video-card__duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: rgba(2,6,23,.76);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.enb-video-card__body { display: grid; gap: 6px; padding: 17px 18px 19px; }
.enb-video-card__eyebrow { color: var(--enb-video-accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.enb-video-card__title { color: inherit; font-size: clamp(17px, 2vw, 21px); line-height: 1.25; }
.enb-video-card__description { color: #64748b; font-size: 14px; line-height: 1.6; }
.enb-video-card__place { justify-self: start; margin-top: 2px; padding: 5px 9px; color: #334155; font-size: 12px; font-weight: 750; background: #f1f5f9; border-radius: 999px; }

.enb-video-modal {
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: 100dvh;
  overscroll-behavior: contain;
}

.enb-video-modal__dialog {
  width: min(94vw, 1180px);
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 18px);
  color: #e2e8f0;
  background: #020617;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 26px;
  box-shadow: 0 34px 100px rgba(0,0,0,.55);
  transition: width .2s ease, max-width .2s ease;
}

.enb-video-modal[data-enb-video-orientation="portrait"] .enb-video-modal__dialog { width: min(92vw, 560px); }
.enb-video-modal[data-enb-video-orientation="square"] .enb-video-modal__dialog { width: min(92vw, 760px); }
.enb-video-modal[data-enb-video-orientation="classic"] .enb-video-modal__dialog { width: min(92vw, 900px); }

.enb-video-modal__header { min-width: 0; }
.enb-video-modal__title { padding-right: 52px; font-size: 16px; line-height: 1.35; }
.enb-video-modal__desc { padding-right: 30px; line-height: 1.5; }

.enb-video-modal__frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 180px;
  max-height: 74dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(99,102,241,.16), transparent 40%),
    #000;
}

.enb-video-modal__player {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 72dvh;
  margin: auto;
  object-fit: contain;
  object-position: center center;
  background: #000;
}

.enb-video-modal[data-enb-video-orientation="portrait"] .enb-video-modal__player {
  width: auto;
  max-width: 100%;
  height: min(70dvh, 900px);
}

.enb-video-modal__status {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  max-width: calc(100% - 28px);
  padding: 7px 11px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: rgba(2,6,23,.78);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.enb-video-modal__status:empty { display: none; }
.enb-video-modal__close { box-shadow: 0 8px 20px rgba(0,0,0,.28); }
.enb-video-modal__close:focus-visible { outline: 3px solid rgba(255,255,255,.5); outline-offset: 3px; }

@media (max-width: 639px) {
  .enb-video-card { border-radius: 18px; }
  .enb-video-card__play { width: 58px; height: 58px; }
  .enb-video-card__body { padding: 14px 15px 16px; }

  .enb-video-modal { align-items: flex-end !important; padding: 0 !important; }
  .enb-video-modal__dialog {
    width: 100% !important;
    max-width: 100%;
    max-height: 94dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }
  .enb-video-modal__frame { max-height: 68dvh; }
  .enb-video-modal__player { max-height: 66dvh; }
  .enb-video-modal[data-enb-video-orientation="portrait"] .enb-video-modal__player {
    width: auto;
    height: min(66dvh, 760px);
  }
}

@media (max-width: 380px), (max-height: 640px) {
  .enb-video-modal__desc { display: none; }
  .enb-video-modal__frame { max-height: 62dvh; }
  .enb-video-modal__player { max-height: 60dvh; }
  .enb-video-modal[data-enb-video-orientation="portrait"] .enb-video-modal__player { height: 60dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .enb-video-card,
  .enb-video-card__poster,
  .enb-video-card__play,
  .enb-video-modal__dialog { transition: none !important; }
}

html[data-theme="dark"] .enb-video-card,
body.dark .enb-video-card,
.dark .enb-video-card {
  color: #f8fafc;
  background: #0f172a;
  border-color: rgba(148,163,184,.24);
  box-shadow: 0 20px 50px rgba(0,0,0,.34);
}

html[data-theme="dark"] .enb-video-card__description,
body.dark .enb-video-card__description,
.dark .enb-video-card__description { color: #cbd5e1; }

html[data-theme="dark"] .enb-video-card__place,
body.dark .enb-video-card__place,
.dark .enb-video-card__place { color: #e2e8f0; background: #1e293b; }

/* =========================================================
   VIDEO PLAYLIST V2
   Birden fazla videoda tek oynatıcı + mobil seçim şeridi.
========================================================= */

.enb-video-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  min-width: 0;
}

.enb-video-modal__content {
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.enb-video-modal__counter {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  min-width: 54px;
  padding: 6px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: center;
  background: rgba(2, 6, 23, .78);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
}

.enb-video-modal__nav {
  position: absolute;
  top: 50%;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #fff;
  background: rgba(2, 6, 23, .72);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  transform: translateY(-50%);
  backdrop-filter: blur(10px);
  transition: opacity .18s ease, transform .18s ease, background-color .18s ease;
}

.enb-video-modal__nav:hover:not(:disabled) {
  background: rgba(15, 23, 42, .92);
  transform: translateY(-50%) scale(1.05);
}

.enb-video-modal__nav:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .55);
  outline-offset: 3px;
}

.enb-video-modal__nav:disabled {
  opacity: .26;
  cursor: default;
}

.enb-video-modal__nav--prev { left: 12px; }
.enb-video-modal__nav--next { right: 12px; }

.enb-video-playlist {
  padding: 12px 14px 14px;
  background: #07101f;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.enb-video-playlist__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #e2e8f0;
  font-size: 12px;
}

.enb-video-playlist__head strong {
  font-size: 13px;
  font-weight: 850;
}

.enb-video-playlist__head span {
  color: #94a3b8;
  font-weight: 700;
}

.enb-video-playlist__rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 240px);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, .42) transparent;
  -webkit-overflow-scrolling: touch;
}

/* Kartlar masaüstünde raya sığıyorsa grup olarak ortalanır.
   İçerik genişliği aşarsa max-width rayı sınırlar ve yatay kaydırma korunur. */
@media (min-width: 640px) {
  .enb-video-playlist__rail {
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
  }
}

.enb-video-playlist__item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 7px;
  color: #e2e8f0;
  text-align: left;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(148, 163, 184, .2);
  border-radius: 14px;
  scroll-snap-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.enb-video-playlist__item:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(148, 163, 184, .42);
}

.enb-video-playlist__item.is-active {
  background: rgba(37, 99, 235, .18);
  border-color: rgba(96, 165, 250, .9);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .16);
}

.enb-video-playlist__item:focus-visible {
  outline: 3px solid rgba(96, 165, 250, .5);
  outline-offset: 2px;
}

.enb-video-playlist__thumb {
  display: block;
  width: 74px;
  height: 56px;
  object-fit: cover;
  background: #020617;
  border-radius: 10px;
}

.enb-video-playlist__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.enb-video-playlist__copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.enb-video-playlist__copy span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.enb-video-modal__after:empty { display: none; }

.enb-video-modal__seen {
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 8px 12px;
  color: #047857;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
}

.enb-video-modal__actions {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr);
  gap: 9px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
}

.enb-video-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  border-radius: 13px;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.enb-video-modal__cta:hover { transform: translateY(-1px); }
.enb-video-modal__cta:focus-visible { outline: 3px solid rgba(255, 255, 255, .45); outline-offset: 2px; }
.enb-video-modal__cta--primary { color: #fff; background: #16a34a; border: 1px solid #22c55e; }
.enb-video-modal__cta--primary:hover { background: #15803d; }
.enb-video-modal__cta--secondary { color: #fff; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .12); }
.enb-video-modal__cta--secondary:hover { background: rgba(255, 255, 255, .14); }

@media (max-width: 900px) {
  .enb-video-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
  .enb-video-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(82vw, 330px);
    grid-template-columns: none;
    gap: 12px;
    margin-inline: -16px;
    padding: 2px 16px 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .enb-video-gallery::-webkit-scrollbar { display: none; }
  .enb-video-gallery > .enb-video-card { scroll-snap-align: center; }

  .enb-video-modal__header {
    padding-top: 13px !important;
    padding-bottom: 10px !important;
  }

  .enb-video-modal__title {
    padding-right: 48px;
    font-size: 14px;
  }

  .enb-video-modal__desc {
    padding-right: 42px;
    font-size: 11px;
    line-height: 1.4;
  }

  .enb-video-modal__close {
    top: 9px !important;
    right: 9px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .enb-video-modal__counter {
    top: 9px;
    left: 9px;
    min-width: 48px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .enb-video-modal__nav {
    width: 40px;
    height: 40px;
  }

  .enb-video-modal__nav--prev { left: 8px; }
  .enb-video-modal__nav--next { right: 8px; }

  .enb-video-modal.has-playlist .enb-video-modal__frame { max-height: 54dvh; }
  .enb-video-modal.has-playlist .enb-video-modal__player { max-height: 52dvh; }
  .enb-video-modal.has-playlist[data-enb-video-orientation="portrait"] .enb-video-modal__player {
    height: min(52dvh, 650px);
  }

  .enb-video-playlist {
    padding: 10px 10px 11px;
  }

  .enb-video-playlist__head {
    margin-bottom: 7px;
    padding-inline: 2px;
  }

  .enb-video-playlist__rail {
    grid-auto-columns: minmax(154px, 68vw);
    gap: 8px;
    padding-bottom: 3px;
  }

  .enb-video-playlist__item {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 62px;
    padding: 6px;
    border-radius: 12px;
  }

  .enb-video-playlist__thumb {
    width: 58px;
    height: 48px;
    border-radius: 8px;
  }

  .enb-video-playlist__copy strong { font-size: 11px; }
  .enb-video-modal__after { padding: 8px 10px !important; }
  .enb-video-modal__seen { padding: 7px 10px; font-size: 11px; }

  .enb-video-modal__actions {
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .enb-video-modal__cta {
    min-height: 44px;
    padding: 10px 9px;
    font-size: 12px;
    border-radius: 12px;
  }
}

@media (max-width: 359px) {
  .enb-video-modal__actions { grid-template-columns: 1fr; }
  .enb-video-modal__cta { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .enb-video-modal__nav,
  .enb-video-playlist__item,
  .enb-video-modal__cta { transition: none !important; }
}
