/*
 * Сторінка «Вічна пам'ять» (шаблон page-memory.php).
 * Вигляд як на старому сайті; Swiper і Font Awesome більше не потрібні.
 */

section.infofoot {
  display: none;
}

.memory-hero {
  background-color: #000;
  color: #fff;
  padding: 30px 0;
  text-align: center;
}

.memory-title {
  font-size: 2.5rem;
  margin: 0 0 30px;
  font-weight: 700;
  line-height: 1.2;
}

.memory-controls {
  margin-bottom: 20px;
}

.memory-controls .btn {
  margin: 0 5px;
  padding: 8px 15px;
  transition: all 0.3s ease;
}

.memory-controls .btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #f8f9fa;
}

.memory-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
}

.memory-slideshow {
  position: relative;
  background-color: #000;
  height: 80vh;
  overflow: hidden;
}

.memory-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}

.memory-slide {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out, visibility 0s linear 1s;
}

.memory-slide.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease-in-out, visibility 0s;
  z-index: 1;
}

.memory-slide .hero-slide {
  text-align: center;
  color: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.memory-slide .hero-image {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.memory-slide .hero-photo {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  filter: brightness(0.7) grayscale(30%);
}

.memory-slide .hero-info {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.5);
  max-width: 80%;
  margin: 0 auto;
  border-radius: 5px;
  opacity: 0;
  transform: translateY(20px);
  font-size: 10px;
  color: #ababab;
}

.memory-slide.is-active .hero-info {
  animation: memory-fade-in-up 1s ease-out 0.5s forwards;
}

@keyframes memory-fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.memory-slide .hero-name {
  font-size: 2.5rem;
  margin: 0 0 10px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.memory-slide .hero-years {
  font-size: 1.5rem;
  margin-bottom: 0;
  font-weight: 500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.memory-empty {
  color: #fff;
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.8) 100%);
  z-index: 2;
  pointer-events: none;
}

/* «Свічка» — легке мерехтіння фото на десктопі */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .memory-slide .hero-photo {
    animation: memory-flicker 3s ease-in-out infinite;
  }
}

@keyframes memory-flicker {
  0%,
  100% {
    filter: brightness(0.7) grayscale(30%);
  }
  50% {
    filter: brightness(0.65) grayscale(30%);
  }
}

/* Повноекранний режим */

body.fullscreen-active {
  overflow: hidden !important;
  scrollbar-width: none;
}

body.fullscreen-active::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

.memory-stage.is-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: #000;
}

.fullscreen-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: none;
  gap: 10px;
}

.memory-stage.is-fullscreen .fullscreen-controls {
  display: flex;
}

.fs-control {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.fs-control:hover,
.fs-control:focus-visible {
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

.fs-control .memory-icon {
  font-size: 18px;
}

.fs-control.exit-fullscreen {
  background-color: rgb(57 57 57 / 60%);
}

.fs-control.exit-fullscreen:hover {
  background-color: rgb(57 57 57 / 90%);
}

.fs-control.fs-play-pause {
  background-color: rgba(0, 80, 120, 0.6);
}

.fs-control.fs-play-pause:hover {
  background-color: rgba(0, 100, 150, 0.8);
}

.fs-control.fs-toggle-sound {
  background-color: rgba(0, 100, 50, 0.6);
}

.fs-control.fs-toggle-sound:hover {
  background-color: rgba(0, 130, 60, 0.8);
}

.memory-stage.is-fullscreen:hover .fs-control {
  opacity: 0.9;
}

@media (max-width: 768px) {
  .memory-slideshow {
    height: 60vh;
  }

  .memory-slide .hero-name {
    font-size: 1.8rem;
  }

  .memory-slide .hero-years {
    font-size: 1.2rem;
  }

  .memory-title {
    font-size: 1.8rem;
  }

  .memory-controls .btn {
    margin: 0 3px;
    padding: 5px 10px;
    font-size: 0.9rem;
  }

  .memory-slide .hero-info {
    max-width: 90%;
    padding: 10px;
    bottom: 30px;
  }

  .memory-slide.is-active .hero-info {
    animation-duration: 0.7s;
  }

  .memory-slide {
    transition-duration: 0.7s, 0s;
  }

  .fullscreen-controls {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .fs-control {
    width: 36px;
    height: 36px;
  }

  .fs-control .memory-icon {
    font-size: 14px;
  }
}
