/*
 * Video Galerisi — stil katmanı.
 * Eşi: inc/bbb-video.php (markup) + assets/js/bbb-video.js (davranış)
 *
 * Grid ilkesi: dikey (9:16) ve yatay (16:9) kartlar AYNI standart CSS Grid
 * kolon şemasında (fotoğraf galerisiyle aynı breakpoint'ler — bkz.
 * bbb-gallery.css) yan yana durur. Her kart kendi aspect-ratio'sunu korur,
 * satırda üste hizalanır (align-items:start). Bu, masonry DEĞİLDİR — kartlar
 * sıkı bir satır/kolon ızgarasında kalır, sadece kısa kartın altında normal
 * bir boşluk oluşabilir. Sıfır JS, sıfır span hesaplaması.
 */

/* ══ Grid ═══════════════════════════════════════════════════ */

.bbb-vid__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  gap: 16px;
}
@media (min-width: 560px)  { .bbb-vid__grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1024px) { .bbb-vid__grid { grid-template-columns: repeat(4, 1fr); } }

/* ══ Kart ═══════════════════════════════════════════════════ */

.bbb-vid__card {
  position: relative;
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.bbb-vid__card--dikey { aspect-ratio: 9 / 16; }
.bbb-vid__card--yatay { aspect-ratio: 16 / 9; }

.bbb-vid__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Kapak görseli girilmemiş video: --surface (açık gri) yerine, marka
   renkleriyle kasıtlı bir gradyan — "boş/bozuk" değil, tasarımlı görünür.
   Poster zorunlu değil; editör istemezse hiç görsel yüklemeden yayınlayabilir. */
.bbb-vid__card--noposter,
.bbb-vid-hero--noposter,
.bbb-vid-player--noposter {
  background: linear-gradient(135deg, var(--navy), var(--navy-dk));
}

.bbb-vid__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease, background-color .18s ease;
}

.bbb-vid__meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bbb-vid__title {
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bbb-vid__sub {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.75);
}

@media (hover: hover) {
  .bbb-vid__card:hover .bbb-vid__play { transform: translate(-50%, -50%) scale(1.08); background: var(--navy); }
}
@media (prefers-reduced-motion: reduce) {
  .bbb-vid__play { transition: none; }
}

/* ══ Filtre çubuğu ══════════════════════════════════════════ */

.bbb-vid-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.bbb-vid-filter--active { background: var(--navy); color: #fff; }
.bbb-vid-filter__count { opacity: 0.65; font-weight: 500; }

.bbb-vid-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  max-width: 220px;
}

/* ══ Öne Çıkan Video Hero ═══════════════════════════════════ */

.bbb-vid-hero {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  min-height: 220px;
  max-height: 420px;
  border: none; padding: 0; margin: 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-dark);
}
.bbb-vid-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bbb-vid-hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.1) 55%);
}
.bbb-vid-hero__content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px clamp(16px, 4vw, 40px);
  color: #fff;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
}
.bbb-vid-hero__eyebrow { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); }
.bbb-vid-hero__title { font-size: clamp(1.25rem, 3vw, 1.875rem); font-weight: 900; letter-spacing: -0.02em; }
.bbb-vid-hero__meta { font-size: 0.8125rem; color: rgba(255,255,255,0.7); }
.bbb-vid-hero__cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: 0.8125rem; font-weight: 700;
}

/* ══ Tekil video oynatıcı (single-video.php) ═══════════════ */

.bbb-vid-player {
  position: relative;
  display: block;
  width: 100%;
  border: none; padding: 0; margin: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-dark);
}
.bbb-vid-player--dikey { max-width: 420px; aspect-ratio: 9 / 16; margin-inline: auto; }
.bbb-vid-player--yatay { aspect-ratio: 16 / 9; }
.bbb-vid-player__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bbb-vid-player__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%;
  background: rgba(17, 24, 39, 0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ══ Modal ══════════════════════════════════════════════════ */

.bbb-vid-modal {
  position: fixed; inset: 0; z-index: 9998;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(8, 12, 22, 0.88);
  padding: 24px;
}
.bbb-vid-modal.is-open { display: flex; }

.bbb-vid-modal__panel {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.bbb-vid-modal__panel--dikey { max-width: 380px; aspect-ratio: 9 / 16; }
.bbb-vid-modal__panel--yatay { max-width: 960px; aspect-ratio: 16 / 9; }

.bbb-vid-modal__panel video,
.bbb-vid-modal__panel iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}

.bbb-vid-modal__link {
  display: flex; align-items: center; justify-content: center;
  height: 100%; width: 100%;
  color: #fff; font-weight: 700; font-size: 0.9375rem;
  text-decoration: none;
  padding: 24px; text-align: center;
}

/* .bbb-vid-modal'ın (position:fixed, tüm ekran) doğrudan çocuğu — panelin
   overflow:hidden'ından etkilenmez, panele sonradan eklenen video/iframe'in
   altında kalmaz. Format (dikey/yatay) ne olursa olsun hep aynı köşede. */
.bbb-vid-modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 18px; line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .bbb-vid-modal { padding: 0; }
  .bbb-vid-modal__panel--yatay { max-width: 100%; }
}
