/* =====================================================================
   Секция «Besuche uns auch auf YouTube»
   Сетка видео-карточек (превью+тег+длительность+заголовок+дата).
   ПК: обычная сетка 3 колонки (Swiper уничтожен, wrapper = display:contents).
   Мобильные (<=900px): слайдер Swiper с частично видимой следующей карточкой.
   Клик по карточке открывает видео в модальном плеере.
   ===================================================================== */

.yt { background: var(--dark); color: #fff; padding: clamp(48px, 7vw, 96px) 0; }
.yt .container { max-width: 1400px; }

.yt__head { text-align: center; max-width: 720px; margin: 0 auto clamp(32px, 5vw, 56px); }
.yt__head .section-title { font-size: 44px; font-weight: 700; }
.yt__head .section-title .accent { color: var(--orange); }
.yt__head p { margin-top: 14px; color: rgba(255,255,255,0.7); font-size: 17px; }

/* --- Сетка / контейнер слайдера --- */
.yt__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
  overflow: visible; /* на ПК ничего не режем */
}

/* На ПК обёртка Swiper «прозрачна»: слайды становятся ячейками грида */
.yt__grid > .swiper-wrapper { display: contents; }

@media (min-width: 769px) {
  .yt__grid > .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 1.8vw, 24px);
    overflow: visible;
  }
}

/* --- Карточка --- */
.yt-card { display: flex; flex-direction: column; gap: 14px; background: #2D2D2D; border: none; border-radius: 24px; text-align: left; cursor: pointer; transition: transform .3s; color: #fff; text-decoration: none; outline: none; padding: 6px; height: 420px; width: 100%; max-width: 100%; }
.yt-card:hover { transform: translateY(-3px); background: #232327; }
.yt-card:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.yt-card__thumb {
  position: relative; display: block; width: 100%; height: 275px; flex: none;
  border-radius: 18px; overflow: hidden;
  background: linear-gradient(135deg, #3a3a40, #202024);
}
.yt-card__play {
  opacity: 0;
  position: absolute; inset: 0; margin: auto; width: 73px; height: 73px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(255,64,2,.92); color: #fff;
  box-shadow: 0px 0px 16px rgba(255, 64, 2, 0.6);
  transition: all .21s ease;
}
.yt-card:hover .yt-card__play {
  opacity: 1;
}
.yt-card__play svg { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.yt-card__tag {
  position: absolute; left: 13px; bottom: 10px;
  padding: 5px 16px; border-radius: 42px; background: #FF4002;
  font-size: 13px; font-weight: 500; font-family: "SF Pro Display", "SF UI Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
.yt-card__dur {
  position: absolute; right: 10px; bottom: 10px;
  padding: 5px 10px; border-radius: 42px; background: rgba(5,5,5,.7);
  font-size: 13px; font-weight: 400; font-family: "SF Pro Display", "SF UI Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
}
.yt-card__title { font-size: 19px; font-weight: 400; line-height: 1.3; font-family: "SF Pro Display", "SF UI Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif; margin: 0 13px; }
.yt-card__date { color: rgba(255,255,255,.32); font-size: 14px; margin: auto 13px 14px 13px; font-family: "SF Pro Display", "SF UI Display", "Inter", -apple-system, BlinkMacSystemFont, sans-serif; }

.yt__more { text-align: center; margin-top: clamp(28px, 4vw, 44px); }
.yt__more .btn { background: #fff; color: #111; }
.yt__more .btn:hover { background: #ececec; }

/* --- Модальный плеер --- */
.yt-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.yt-modal[hidden] { display: none; }
.yt-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(4px); }
.yt-modal__dialog {
/*  position: relative; */
width: min(960px, calc(100% - 32px));
  aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  background: #000; box-shadow: var(--shadow-lg);
}
.yt-modal__frame { 
  position: relative;
  width: 100%; height: 100%; }
.yt-modal__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-modal__placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: rgba(255,255,255,.6); font-size: 15px; text-align: center; padding: 24px;
}
.yt-modal__close {
  z-index: 100;
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: #fff; font-size: 22px; line-height: 1;
}
/*.yt-modal__close:hover { background: rgba(0,0,0,.8); }*/

/* --- Режим слайдера (Swiper активен только здесь) --- */
@media (max-width: 900px) {
  .yt__grid {
    display: block;
    grid-template-columns: none;
    gap: 0;
    overflow: hidden; /* режем только в слайдере */
  }
  .yt__grid > .swiper-wrapper { display: flex; }
  .yt__grid .swiper-slide { height: auto; display: flex; }

  .yt__head .section-title { font-size: 34px; }
  .yt-card { height: 400px; }
}

@media (max-width: 560px) {
  .yt__head .section-title { font-size: 28px; }
  .yt-card { height: 380px; }
  .yt-card__thumb { height: 235px; }
  .yt-card__title { font-size: 18px; }
}

.accent.youtube-btn { display: inline-block; padding: 0; background-color: transparent; border-radius: 8px; transition: background-color 0.25s, transform 0.25s; text-decoration: none; }
.accent.youtube-btn:hover { background-color: transparent; transform: translateY(-2px); }
