/* =====================================================================
   GALERIA WIDEO – dodatki do gallery.css
   Kafelki używają tych samych klas co albumy zdjęć (albums-grid, album-tile,
   album-thumb, album-overlay), więc wyglądają identycznie jak models.php.
   ===================================================================== */

.video-intro {
  font-size: 14px;
  opacity: .7;
  margin: 0 0 24px;
}

/* ===== KAFELEK ===== */
button.album-tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: pointer;
}

.album-tile {
  display: block;
  text-decoration: none;
}

.video-tile .album-thumb {
  background: #111;
}

/* zajawka gra nad okładką po najechaniu */
.video-tile-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .4s ease;
}

.video-tile-preview.is-playing,
.video-tile-preview.is-poster {
  opacity: 1;
}

/* mały znak "play" – od razu widać, że to film, a nie album zdjęć */
.video-tile-play {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.45);
  z-index: 1;
  transition: opacity .3s ease;
}

.video-tile-play::after {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
}

.album-thumb:hover .video-tile-play {
  opacity: 0;
}

.video-tile .album-overlay {
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  text-align: center;
}

.video-tile-meta {
  opacity: .75;
  font-size: 10px;
}

/* SHORTS – kafelki pionowe */
.albums-grid--vertical {
  grid-template-columns: repeat(5, 1fr);
}

.albums-grid--vertical .album-thumb {
  aspect-ratio: 9 / 16;
}

@media (max-width: 1400px) { .albums-grid--vertical { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .albums-grid--vertical { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px)  { .albums-grid--vertical { grid-template-columns: repeat(2, 1fr); } }

/* ===== PODSTRONA FILMU ===== */
.film-player {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  background: #000;
  object-fit: cover;
  overflow: hidden;
}

.film-player.is-vertical {
  aspect-ratio: 9 / 16;
  width: min(100%, 420px);
  max-height: 85vh;
}

button.film-player {
  cursor: pointer;
}

.film-player img,
.film-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.film-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  transition: transform .3s ease;
}

.film-play::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 24px;
  border-style: solid;
  border-width: 12px 0 12px 19px;
  border-color: transparent transparent transparent #000;
}

button.film-player:hover .film-play {
  transform: scale(1.08);
}

.film-stills {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.film-still {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}

.film-player.is-vertical ~ .film-stills {
  grid-template-columns: repeat(3, 1fr);
}

.film-player.is-vertical ~ .film-stills .film-still {
  aspect-ratio: 9 / 16;
}

.film-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .4s ease;
}

.film-still:hover img {
  transform: scale(1.02);
  opacity: .95;
}

.film-still-number {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-size: 10px;
  letter-spacing: .08em;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

.film-title {
  font-size: 17px;
  line-height: 1.3;
  margin: 0;
}

.film-meta {
  font-size: 12px;
  letter-spacing: .06em;
  opacity: .6;
  margin: 4px 0 0;
}

.film-link {
  font-size: 13px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  align-self: flex-start;
  padding-bottom: 2px;
  opacity: .8;
}

.film-link:hover {
  opacity: 1;
}

@media (max-width: 500px) {
  .film-stills { grid-template-columns: 1fr 1fr; gap: 6px; }
}

/* ===== ODTWARZACZ W OKIENKU (klipy) ===== */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  background: rgba(0,0,0,.92);
}

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

.video-modal-stage {
  width: min(100%, 1200px);
}

.video-modal-stage.is-vertical {
  width: min(100%, 420px);
}

.video-modal-stage video,
.video-modal-stage iframe {
  display: block;
  width: 100%;
  max-height: calc(100vh - 96px);
  background: #000;
  border: 0;
}

.video-modal-stage iframe {
  aspect-ratio: 16 / 9;
  height: auto;
}

.video-modal-close {
  position: absolute;
  top: 10px;
  right: 16px;
  background: none;
  border: 0;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: .7;
}

.video-modal-close:hover {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .video-tile-preview,
  .film-still img {
    transition: none;
  }
}
