/* Kadrowanie i powiększanie zdjęć na stronie Kibicowanie */

.fan-photo figure {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.fan-lightbox-link {
  display: block;
  position: relative;
  background: linear-gradient(135deg, rgba(20,45,78,.06), rgba(243,211,107,.12));
  text-decoration: none;
}

.fan-lightbox-link::after {
  content: "Kliknij, aby powiększyć";
  position: absolute;
  right: .75rem;
  bottom: .75rem;
  padding: .32rem .55rem;
  border-radius: 999px;
  background: rgba(20,45,78,.78);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.fan-lightbox-link:hover::after,
.fan-lightbox-link:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.fan-photo img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  object-position: center center;
  background: linear-gradient(135deg, rgba(20,45,78,.06), rgba(243,211,107,.10));
}

.fan-photo figcaption {
  flex: 1;
}

body.fan-lightbox-open {
  overflow: hidden;
}

.fan-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(6,17,31,.88);
  backdrop-filter: blur(8px);
}

.fan-lightbox.is-open {
  display: flex;
}

.fan-lightbox-figure {
  max-width: min(1100px, 92vw);
  max-height: 90vh;
  margin: 0;
  display: grid;
  gap: .85rem;
}

.fan-lightbox-figure img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.42);
  background: rgba(255,255,255,.04);
}

.fan-lightbox-figure figcaption {
  color: #fff;
  text-align: center;
  line-height: 1.55;
  font-size: .98rem;
}

.fan-lightbox-close,
.fan-lightbox-prev,
.fan-lightbox-next {
  position: fixed;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  transition: background .18s ease, transform .18s ease;
}

.fan-lightbox-close:hover,
.fan-lightbox-prev:hover,
.fan-lightbox-next:hover {
  background: rgba(243,211,107,.92);
  color: #142d4e;
  transform: scale(1.04);
}

.fan-lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
  line-height: 1;
}

.fan-lightbox-prev,
.fan-lightbox-next {
  top: 50%;
  width: 3.3rem;
  height: 3.3rem;
  font-size: 2.5rem;
  line-height: 1;
}

.fan-lightbox-prev { left: 1rem; }
.fan-lightbox-next { right: 1rem; }

@media (max-width: 720px) {
  .fan-photo img { height: 230px; }
  .fan-lightbox { padding: 1rem; }
  .fan-lightbox-prev,
  .fan-lightbox-next {
    top: auto;
    bottom: 1rem;
  }
  .fan-lightbox-prev { left: calc(50% - 4rem); }
  .fan-lightbox-next { right: calc(50% - 4rem); }
}
