/* ========================================================================
   yoo_everest - Photo gallery (Phoca Gallery override)
   Albums grid, photo mosaic and full screen viewer
 ========================================================================== */

.eg-gallery {
  --eg-accent: #52b2d8;
  --eg-accent-dark: #3a93b8;
  --eg-card: rgba(255, 255, 255, 0.04);
  --eg-card-border: rgba(255, 255, 255, 0.08);
  --eg-muted: rgba(255, 255, 255, 0.65);
  --eg-radius: 14px;
  color: #fff;
}

/* ---------- Header ---------- */

.eg-hero {
  position: relative;
  margin: 0 0 30px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--eg-card-border);
}

.eg-trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 20px;
  color: var(--eg-muted);
}
.eg-trail a {
  color: var(--eg-muted);
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--eg-card);
  border: 1px solid var(--eg-card-border);
  transition: background .2s, color .2s, border-color .2s;
}
.eg-trail a:hover,
.eg-trail a:focus { color: #fff; background: var(--eg-accent); border-color: var(--eg-accent); }
.eg-trail span { color: #fff; font-weight: 400; }
.eg-trail-sep { opacity: .4; font-size: 11px; }

.eg-title {
  margin: 0;
  font-size: 34px;
  line-height: 42px;
  font-weight: 300;
  letter-spacing: .5px;
  color: #fff;
}
.eg-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--eg-accent), rgba(82, 178, 216, 0));
}

.eg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
}
.eg-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  background: rgba(82, 178, 216, 0.15);
  color: #bfe6f5;
}
.eg-desc { margin-top: 16px; color: var(--eg-muted); }

/* ---------- Albums ---------- */

.eg-albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin-bottom: 40px;
}

.eg-album {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--eg-radius);
  background: #1b222b;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  isolation: isolate;
  transform: translateZ(0);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
}
.eg-album:hover,
.eg-album:focus-visible {
  color: #fff;
  text-decoration: none;
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 0 2px var(--eg-accent);
  outline: none;
}

.eg-album-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: -1;
}
.eg-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .8s cubic-bezier(.2, .8, .2, 1), filter .5s;
  filter: saturate(.95);
}
.eg-album:hover .eg-album-cover img { transform: scale(1.12); filter: saturate(1.15); }
.eg-album-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0) 35%, rgba(10, 16, 24, .55) 65%, rgba(10, 16, 24, .92) 100%);
}
.eg-album-empty .eg-album-cover {
  background:
    radial-gradient(circle at 30% 25%, rgba(82, 178, 216, .35), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(216, 120, 60, .35), transparent 50%),
    #1b222b;
}
.eg-album-cover > i {
  font-size: 64px;
  color: rgba(255, 255, 255, 0.18);
  transform: translateY(-14px);
}

.eg-album-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px;
}
.eg-album-title {
  display: block;
  font-size: 18px;
  line-height: 24px;
  font-weight: 400;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 40px;
}
.eg-album-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}
.eg-album-meta i { color: var(--eg-accent); margin-right: 3px; }

.eg-album-go {
  position: absolute;
  right: 16px;
  bottom: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--eg-accent);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity .3s, transform .3s;
}
.eg-album:hover .eg-album-go,
.eg-album:focus-visible .eg-album-go { opacity: 1; transform: none; }

/* ---------- Photos mosaic ---------- */

.eg-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  grid-auto-rows: 150px;
  grid-auto-flow: dense;
  gap: 10px;
  margin-bottom: 30px;
}
.eg-photo {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #1b222b;
  cursor: zoom-in;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  animation: eg-fade-in .6s ease both;
}
/* rhythm: some bigger tiles to break the grid */
.eg-photo:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
.eg-photo:nth-child(11n + 6) { grid-row: span 2; }
.eg-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .4s;
}
.eg-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10, 16, 24, .6));
  opacity: 0;
  transition: opacity .3s;
}
.eg-photo:hover img,
.eg-photo:focus-visible img { transform: scale(1.08); filter: brightness(1.05); }
.eg-photo:hover::after,
.eg-photo:focus-visible::after { opacity: 1; }
.eg-photo:focus-visible { outline: 2px solid var(--eg-accent); outline-offset: 2px; }
.eg-photo-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  color: #26303b;
  font-size: 13px;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s, transform .3s;
}
.eg-photo:hover .eg-photo-zoom,
.eg-photo:focus-visible .eg-photo-zoom { opacity: 1; transform: none; }

@keyframes eg-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .eg-title { font-size: 26px; line-height: 34px; }
  .eg-albums { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .eg-album-title { font-size: 15px; }
  .eg-album-go { display: none; }
  .eg-photos { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; gap: 6px; }
  .eg-photo:nth-child(7n + 1) { grid-column: span 2; grid-row: span 2; }
  .eg-photo:nth-child(11n + 6) { grid-row: span 1; }
}

/* ---------- Empty + pagination ---------- */

.eg-empty { text-align: center; padding: 50px 0; color: var(--eg-muted); }
.eg-empty i { font-size: 50px; opacity: .4; }
.eg-pagination { text-align: center; margin-top: 10px; }
.eg-pagination .uk-pagination { justify-content: center; }
.eg-pagination-counter { margin: 8px 0 0; font-size: 12px; color: var(--eg-muted); }

@media (prefers-reduced-motion: reduce) {
  .eg-album, .eg-album-cover img, .eg-photo, .eg-photo img { transition: none; animation: none; }
}

/* ========================================================================
   Viewer (lightbox)
 ========================================================================== */

.eg-viewer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 18, 0.96);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
  font-family: 'Open Sans', sans-serif;
  -webkit-user-select: none;
  user-select: none;
}
.eg-viewer.is-open { opacity: 1; visibility: visible; }
.eg-viewer-backdrop {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(.35) saturate(1.3);
  opacity: .9;
  transition: background-image .4s;
  z-index: -1;
}

.eg-viewer-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
}
.eg-viewer-counter { font-size: 14px; letter-spacing: 1px; opacity: .85; margin-right: auto; padding-left: 4px; }
.eg-viewer-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, transform .2s;
}
.eg-viewer-btn:hover,
.eg-viewer-btn:focus-visible { background: #52b2d8; color: #fff; outline: none; transform: scale(1.06); }
.eg-viewer-btn.is-active { background: #52b2d8; }

.eg-viewer-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  min-height: 0;
}
.eg-viewer-img {
  max-width: calc(100% - 140px);
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transition: opacity .35s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.eg-viewer-img.is-loading { opacity: 0; transform: scale(.97); }
.eg-viewer-spinner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .15);
  border-top-color: #52b2d8;
  animation: eg-spin .8s linear infinite;
  opacity: 0;
  transition: opacity .2s;
}
.eg-viewer.is-loading .eg-viewer-spinner { opacity: 1; }
@keyframes eg-spin { to { transform: rotate(360deg); } }

.eg-viewer-nav {
  position: absolute;
  top: 50%;
  width: 54px;
  height: 54px;
  margin-top: -27px;
  font-size: 22px;
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.eg-viewer-prev { left: 18px; }
.eg-viewer-next { right: 18px; }

.eg-viewer-caption {
  min-height: 24px;
  padding: 8px 20px 0;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}

.eg-viewer-progress {
  height: 3px;
  margin: 8px 20px 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .3s;
}
.eg-viewer.is-playing .eg-viewer-progress { opacity: 1; }
.eg-viewer-progress span { display: block; height: 100%; width: 0; background: #52b2d8; }
.eg-viewer.is-playing .eg-viewer-progress span { animation: eg-progress linear forwards; }
@keyframes eg-progress { to { width: 100%; } }

.eg-viewer-strip {
  display: flex;
  gap: 8px;
  padding: 12px 20px 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.eg-viewer-strip button {
  flex: 0 0 auto;
  width: 74px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  background: #1b222b;
  opacity: .45;
  cursor: pointer;
  transition: opacity .2s, border-color .2s, transform .2s;
}
.eg-viewer-strip button:hover { opacity: .85; }
.eg-viewer-strip button.is-current { opacity: 1; border-color: #52b2d8; transform: translateY(-2px); }
.eg-viewer-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

body.eg-viewer-lock { overflow: hidden; }

@media (max-width: 640px) {
  .eg-viewer-img { max-width: 100%; border-radius: 0; }
  .eg-viewer-nav { display: none; }
  .eg-viewer-btn { width: 38px; height: 38px; font-size: 15px; }
  .eg-viewer-strip button { width: 56px; height: 40px; }
}
