/* Lehká video galerie – načítá jen náhledy, přehrávač až po kliknutí. */

.video-page .entry2 {
  box-sizing: border-box;
  padding: 28px 24px 36px;
}

#header h1 a {
  display: block;
  width: 100%;
  height: 100%;
}

.video-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.video-intro p {
  margin: 0;
  color: #c8c8c8;
  font-size: 15px;
}

.youtube-channel {
  flex: none;
  padding: 9px 14px;
  border: 1px solid #555;
  border-radius: 4px;
  color: #eee;
  font-weight: bold;
  transition: background-color .2s ease, border-color .2s ease;
}

.youtube-channel:hover,
.youtube-channel:focus-visible {
  border-color: #d9d9d9;
  background: #292929;
}

.video-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.video-filters button {
  padding: 7px 12px;
  border: 1px solid #444;
  border-radius: 999px;
  background: #171717;
  color: #aaa;
  font: inherit;
  cursor: pointer;
}

.video-filters button:hover,
.video-filters button:focus-visible,
.video-filters button.is-active {
  border-color: #aaa;
  background: #333;
  color: #fff;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.video-card {
  overflow: hidden;
  border: 1px solid #333;
  background: #141414;
  box-shadow: 0 5px 16px rgba(0, 0, 0, .25);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.video-card:hover,
.video-card:focus-within {
  transform: translateY(-2px);
  border-color: #a8a8a8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .42);
}

.video-card:focus-within,
.video-card:active {
  outline: 2px solid #ddd;
  outline-offset: 3px;
}

.video-card__button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
}

.video-card__image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #090909;
}

.video-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease, opacity .2s ease;
}

.video-card:hover .video-card__image img {
  transform: scale(1.035);
  opacity: .88;
}

.video-card__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: rgba(210, 0, 0, .94);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .55);
}

.video-card__play::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 23px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #fff;
}

.video-card__body {
  min-height: 74px;
  padding: 13px 14px 15px;
}

.video-card__body h3 {
  margin: 0 0 7px;
  color: #eee;
  font-size: 15px;
  line-height: 1.35;
  text-transform: none;
}

.video-card__meta {
  color: #888;
  font-size: 12px;
}

.video-empty,
.video-noscript {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
}

.video-modal[hidden] {
  display: none;
}

.video-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  height: 100dvh;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-right: max(24px, env(safe-area-inset-right));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  padding-left: max(24px, env(safe-area-inset-left));
  overflow: auto;
  overscroll-behavior: contain;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .88);
}

.video-modal__dialog {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: 100%;
  max-width: 960px;
  min-width: 0;
  max-height: 100%;
  margin: auto;
  padding: 12px 12px 16px;
  border: 1px solid #444;
  border-radius: 7px;
  background: #111;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .7);
}

.video-modal__frame {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.video-modal__frame iframe {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  border: 0;
}

.video-modal__dialog h3 {
  margin: 13px 4px 5px;
  color: #eee;
  font-size: 17px;
  text-transform: none;
}

.video-modal__dialog > a {
  margin-left: 4px;
  color: #aaa;
}

.video-modal__close {
  position: absolute;
  z-index: 2;
  top: -17px;
  right: -17px;
  width: 38px;
  height: 38px;
  border: 1px solid #777;
  border-radius: 50%;
  background: #181818;
  color: #fff;
  font-size: 27px;
  line-height: 32px;
  cursor: pointer;
}

body.has-video-modal {
  overflow: hidden;
}

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

@media (max-width: 620px) {
  #header {
    height: auto;
    min-height: 260px;
  }

  #header h1 {
    position: relative;
    top: 45px;
    max-width: 100%;
  }

  #header ul {
    padding-top: 13em;
    padding-bottom: 18px;
    line-height: 2;
  }

  #header li a {
    padding-inline: .55em;
  }

  .video-page .entry2 {
    padding: 22px 14px 30px;
  }

  .video-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-modal {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-right: max(10px, env(safe-area-inset-right));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .video-modal__close {
    top: 5px;
    right: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-card,
  .video-card__image img {
    transition: none;
  }
}
