/**
 * Post Images Lightbox Styles - Uproszczona wersja
 * Style dla lightbox obrazków w postach - tylko w .entry-content
 */

/* Podstawowe style dla linków lightbox */
.post-image-lightbox {
  display: inline-block;
  position: relative;
  cursor: zoom-in;
  width: 100%;
}

/* Ikona powiększenia w prawym górnym rogu */
.post-image-lightbox::before {
  content: '🔍';
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  pointer-events: none;
}

.post-image-lightbox:hover::before {
  opacity: 1;
}

/* Style dla lightbox popup */
.post-lightbox-popup .mfp-figure {
  margin: 0;
}

.post-lightbox-popup .mfp-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  line-height: 0;
  box-sizing: border-box;
  padding: 40px 0 40px;
  margin: 0 auto;
}

/* Przycisk zamknięcia */
.post-lightbox-popup .mfp-close {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  line-height: 44px;
  transition: background 0.3s ease;
}

.post-lightbox-popup .mfp-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Przyciski nawigacji z ikonkami */
.post-lightbox-popup .mfp-arrow {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  transition: background 0.3s ease;
  width: 44px;
  height: 44px;
  margin-top: -22px;
}

.post-lightbox-popup .mfp-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Dodaj ikonki do przycisków nawigacji */
.post-lightbox-popup .mfp-arrow:before {
  font-family: Arial, sans-serif;
  font-size: 18px;
  line-height: 44px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
}

.post-lightbox-popup .mfp-arrow-left:before {
  content: '‹';
}

.post-lightbox-popup .mfp-arrow-right:before {
  content: '›';
}

/* Tło lightbox */
.post-lightbox-popup.mfp-bg {
  background: rgba(0, 0, 0, 0.9);
}

/* Responsywność */
@media screen and (max-width: 800px) {
  .post-lightbox-popup .mfp-img {
    padding: 20px 0;
  }

  .post-lightbox-popup .mfp-close {
    width: 36px;
    height: 36px;
    line-height: 36px;
    top: 10px;
    right: 10px;
  }
}

@media screen and (max-width: 480px) {
  .post-lightbox-popup .mfp-img {
    padding: 10px 0;
  }

  /* Ukryj ikonę powiększenia na małych ekranach */
  .post-image-lightbox::before {
    display: none;
  }
}

/* Style gdy lightbox jest aktywny */
body.lightbox-active {
  overflow: hidden;
}

/* Wskaźnik ładowania */
.post-image-lightbox.loading-lightbox::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

/* Animacja ładowania */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Style dla lightbox popup */
.post-lightbox-popup.mfp-zoom-in .mfp-content {
  opacity: 0;
  transition: all 0.3s ease-in-out;
  transform: scale(0.8);
}

.post-lightbox-popup.mfp-zoom-in.mfp-ready .mfp-content {
  opacity: 1;
  transform: scale(1);
}

.post-lightbox-popup.mfp-zoom-in.mfp-removing .mfp-content {
  transform: scale(0.8);
  opacity: 0;
}

/* Specjalne style dla SVG */
.post-lightbox-popup.mfp-svg-lightbox .mfp-img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
}

/* Dostosowania dla lightbox */
.post-lightbox-popup .mfp-figure {
  margin: 0;
}

.post-lightbox-popup .mfp-img {
  width: auto;
  max-width: 100%;
  height: auto;
  display: block;
  line-height: 0;
  box-sizing: border-box;
  padding: 40px 0 40px;
  margin: 0 auto;
}

/* Style tytułu */
.post-lightbox-popup .mfp-title {
  text-align: center;
  padding: 16px;
  color: #ffffff;
  word-wrap: break-word;
  line-height: 1.2;
}

.post-lightbox-popup .mfp-title small {
  display: block;
  font-size: 0.8em;
  opacity: 0.8;
  margin-bottom: 4px;
}

/* Przyciski nawigacji */
.post-lightbox-popup .mfp-arrow {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.post-lightbox-popup .mfp-arrow:hover {
  background: rgba(0, 0, 0, 0.8);
}

.post-lightbox-popup .mfp-arrow:active {
  margin-top: 1px;
}

/* Przycisk zamknięcia */
.post-lightbox-popup .mfp-close {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  line-height: 44px;
  transition: all 0.3s ease;
}

.post-lightbox-popup .mfp-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

/* Licznik obrazków */
.post-lightbox-popup .mfp-counter {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
}

/* Dodatkowy panel dolny */
.post-lightbox-popup .mfp-bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 20px;
  text-align: center;
}

.post-lightbox-popup .mfp-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}

.post-lightbox-popup .mfp-image-loaded {
  animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tło lightbox */
.post-lightbox-popup.mfp-bg {
  background: rgba(0, 0, 0, 0.9);
}

/* Responsywność */
@media screen and (max-width: 800px) {
  .post-lightbox-popup .mfp-img {
    padding: 20px 0;
  }

  .post-lightbox-popup .mfp-title {
    padding: 12px;
    font-size: 14px;
  }

  .post-lightbox-popup .mfp-close {
    width: 36px;
    height: 36px;
    line-height: 36px;
    top: 10px;
    right: 10px;
  }

  .post-lightbox-popup .mfp-arrow {
    width: 36px;
    height: 36px;
  }
}

@media screen and (max-width: 480px) {
  .post-lightbox-popup .mfp-img {
    padding: 10px 0;
  }

  .post-lightbox-popup .mfp-title {
    padding: 8px;
    font-size: 13px;
  }
}

/* Dodatki dla lepszej dostępności */
.post-lightbox-popup .mfp-close:focus,
.post-lightbox-popup .mfp-arrow:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Style gdy lightbox jest aktywny */
body.lightbox-active {
  overflow: hidden;
}

/* Ikona powiększenia na hover */
.post-image-lightbox::before {
  content: '🔍';
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  pointer-events: none;
}

.post-image-lightbox:hover::before {
  opacity: 1;
}

/* Specjalne style dla galerii WordPress */
.wp-block-gallery .post-image-lightbox::before,
.gallery .post-image-lightbox::before {
  top: 5px;
  right: 5px;
  font-size: 10px;
  padding: 2px 4px;
}

/* Dodatkowe style dla galerii */
.gallery-group {
  border: 2px solid transparent;
  border-radius: 4px;
  transition: border-color 0.3s ease;
}

.gallery-group:hover {
  border-color: rgba(0, 123, 255, 0.3);
}

/* Ukryj ikonę powiększenia na urządzeniach mobilnych */
@media (max-width: 768px) {
  .post-image-lightbox::before {
    display: none;
  }
}

/* Ukryj dolny pasek z tytułem i licznikiem */
.post-lightbox-popup .mfp-bottom-bar,
.post-lightbox-popup .mfp-title,
.post-lightbox-popup .mfp-counter {
  display: none !important;
}

/* Ukryj też inne elementy z tekstem */
.post-lightbox-popup .mfp-figure:after {
  display: none !important;
}

.mfp-image-holder .mfp-content {
  width: 100%;

  background: white;
}
