/*
FOTOGALERIA
*/

.gallery-page {
  width: min(94vw, 1500px);
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2.75rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.gallery-header {
  text-align: center;
  margin: 0 auto clamp(1.5rem, 3vw, 2.5rem);
  max-width: 850px;
}

.gallery-header h1 {
  margin: 0 0 .45rem;
  color: var(--primary);
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1.15;
  font-weight: 700;
}

.gallery-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: clamp(.9rem, 1.5vw, 1rem);
  line-height: 1.5;
}

/* === PREHĽAD ALBUMOV === */

.album-link {
  position: absolute;
  inset: 0;
  display: block;
  color: inherit;
  text-decoration: none;
}

.gallery-delete-form {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  margin: 0;
}

.gallery-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e63946;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  transition: background .2s ease, transform .2s ease;
}

.gallery-delete-btn:hover {
  background: #c92f3b;
  transform: scale(1.08);
}

.photo-card {
  position: relative;
  min-width: 0;
}

.photo-card .gallery-delete-form {
  top: 10px;
  right: 10px;
}


.album-wrap {
  background-color: #fcfcfc;
}

.gallery-actions {
  display: flex;
  justify-content: center;
  margin: 0 0 1rem;
}

.gallery-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.gallery-add-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

.gallery-add-icon:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.gallery-actions .gallery-add-icon {
  flex: 0 0 auto;
}

.album-wrap {
  position: relative;
}

.album-add-icon {
  margin: 0 auto .75rem;
}

.albums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  width: 100%;
  margin: 0;
  padding: 0;
}

.album {
  position: relative;
  display: block;
  min-width: 0;
  aspect-ratio: 16 / 10;
  background: #fff;
  color: var(--text);
  border: 1px solid #e2e8ee;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: left;
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.album img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.album::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .78) 0%,
    rgba(0, 0, 0, .34) 42%,
    rgba(0, 0, 0, .05) 75%,
    rgba(0, 0, 0, 0) 100%
  );
  pointer-events: none;
}

.album-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 2.8rem 1rem .9rem;
  color: #fff;
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  border: 0;
  transition: color var(--transition);
}

.album:hover {
  transform: translateY(-3px);
  border-color: rgba(10, 126, 194, .35);
  box-shadow: var(--shadow-md);
}

.album:hover img {
  transform: scale(1.04);
}

.album:hover .album-info {
  color: #fff;
}

.album-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .6rem;
  color: var(--primary);
  background: #f8fbfd;
  border: 1px dashed #b8cddd;
  text-align: center;
}

.album-add-card::after {
  display: none;
}

.album-add-card img {
  position: static;
  width: 30px;
  height: 30px;
  object-fit: contain;
  transition: transform var(--transition);
}

.album-add-card span {
  position: static;
  color: var(--primary);
  font-size: .95rem;
  font-weight: 700;
}

.album-add-card:hover {
  background: #f1f7fb;
  border-color: var(--primary);
}

.album-add-card:hover img {
  transform: scale(1.08);
}

/* === DETAIL ALBUMU === */
.album-meta {
  margin: 0 auto 20px;
  color: #555;
  text-align: center;
  font-size: clamp(.9rem, 1.5vw, 1rem);
  line-height: 1.5;
}

.fa-images {
  margin-left: .45rem;
}

.album-title {
  margin: 0 16px .5rem;
  color: var(--primary);
  font-weight: 700;
  font-size: clamp(1.7rem, 3.2vw, 2.35rem);
  line-height: 1.2;
  text-align: center;
}

.photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  width: min(94vw, 1500px);
  margin: 0 auto;
  padding: 0 0 2rem;
  background-color: transparent;
}

.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.photos img:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: var(--shadow-md);
}

/* === LIGHTBOX === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 70px 70px;
  background: rgba(0, 0, 0, .92);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 84vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox.active {
  display: flex;
}

.close, .prev, .next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #fff;
  background: rgba(10, 126, 194, .85);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: var(--shadow-md);
  transition: background var(--transition), transform var(--transition);
}

.close:hover, .prev:hover, .next:hover {
  background: var(--primary);
}

.close {
  top: 20px;
  right: 20px;
}

.prev, .next {
  top: 50%;
  transform: translateY(-50%);
}

.prev { left: 20px; }
.next { right: 20px; }

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

@media (max-width: 700px) {
  .gallery-page {
    width: calc(100% - 24px);
    padding-top: 1.35rem;
  }

  .gallery-header {
    margin-bottom: 1.25rem;
  }

  .gallery-header h1 {
    font-size: clamp(1.6rem, 7vw, 2rem);
  }

  .albums,
  .photos {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .album {
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-md);
  }

  .album-info {
    padding: 2.5rem .85rem .8rem;
    font-size: clamp(.98rem, 4.2vw, 1.15rem);
  }

  .photos {
    width: calc(100% - 24px);
  }

  .lightbox {
    padding: 60px 18px;
  }

  .lightbox img {
    max-width: 94vw;
    max-height: 78vh;
  }

  .close, .prev, .next {
    width: 42px;
    height: 42px;
    font-size: 1.45rem;
  }

  .close {
    top: 12px;
    right: 12px;
  }

  .prev { left: 10px; }
  .next { right: 10px; }
}

@media (max-width: 420px) {
  .gallery-page {
    width: calc(100% - 20px);
  }

  .album-info {
    padding-left: .75rem;
    padding-right: .75rem;
    font-size: .98rem;
  }
}
