/* ============================================================
   Eva Apartman – Gallery Page Styles
   Imported only by gallery.html
   ============================================================ */

/* ── Sticky section tab bar ─────────────────────────────────── */
.gallery-page-nav {
  position: sticky;
  top: 65px;           /* sits just below the collapsed fixed navbar */
  z-index: 100;
  background: var(--color-white);
  border-bottom: 2px solid var(--color-border);
  box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.gallery-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gallery-tabs::-webkit-scrollbar { display: none; }

.gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 1.05rem 1.8rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;          /* cover nav's own 2px border */
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-text-light);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition);
}

.gallery-tab svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: stroke var(--transition);
}

.gallery-tab-count {
  background: var(--color-bg-dark);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  letter-spacing: 0;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
}

.gallery-tab:hover {
  color: var(--color-primary);
  background: var(--color-bg);
}

.gallery-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-secondary);
}

.gallery-tab.active .gallery-tab-count {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: var(--color-primary-dark);
}

/* ── Gallery section scroll offset ─────────────────────────── */
.gallery-section {
  scroll-margin-top: 125px;   /* navbar + tab bar combined */
}

/* ── Section label / header ─────────────────────────────────── */
.gallery-section-label {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 2.8rem;
  flex-wrap: wrap;
}

.gallery-section-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(232, 200, 64, 0.35);
}

.gallery-section-icon-wrap svg {
  width: 26px;
  height: 26px;
  stroke: var(--color-primary-dark);
}

.gallery-section-text { flex: 1; min-width: 0; }
.gallery-section-text h2 { margin: 0 0 0.3rem; }
.gallery-section-text p  { margin: 0; font-size: 0.95rem; }

.gallery-photo-count {
  flex-shrink: 0;
  background: var(--color-bg-dark);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
}

/* ── CSS Masonry grid ───────────────────────────────────────── */
.gallery-masonry {
  columns: 3 260px;
  column-gap: 1.1rem;
}

/* ── Individual photo tile ──────────────────────────────────── */
.gm-item {
  break-inside: avoid;
  margin-bottom: 1.1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  display: block;
  outline: none;
}

/* Focus ring for keyboard users */
.gm-item:focus-visible {
  box-shadow: 0 0 0 3px var(--color-secondary), 0 0 0 5px var(--color-primary);
}

.gm-item img {
  width: 100%;
  display: block;
  transition: transform 0.45s ease;
}

/* Hover overlay */
.gm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 24, 24, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.32s ease;
}

.gm-zoom-icon {
  width: 42px;
  height: 42px;
  stroke: white;
  opacity: 0;
  transform: scale(0.75);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.gm-item:hover img,
.gm-item:focus-visible img { transform: scale(1.045); }

.gm-item:hover .gm-overlay,
.gm-item:focus-visible .gm-overlay { background: rgba(30, 24, 24, 0.44); }

.gm-item:hover .gm-zoom-icon,
.gm-item:focus-visible .gm-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

/* ── Placeholder (when image hasn't loaded) ─────────────────── */
.gm-placeholder {
  width: 100%;
  aspect-ratio: 4/3;       /* overridden by JS via inline style */
  background: linear-gradient(140deg, var(--color-bg-dark) 0%, var(--color-border) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--color-text-light);
  font-size: 0.82rem;
  font-style: italic;
  padding: 1.5rem;
  text-align: center;
}

.gm-placeholder svg {
  width: 38px;
  height: 38px;
  stroke: var(--color-border);
}

/* ── Enhanced Lightbox ──────────────────────────────────────── */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(12, 8, 8, 0.96);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gallery-lightbox.open { display: flex; }

/* Centre image wrapper */
.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(90vw, 1100px);
  max-height: 84vh;
}

.lb-img {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
  user-select: none;
  outline: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Close button */
.lb-close {
  position: fixed;
  top: 1.1rem;
  right: 1.1rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), transform var(--transition);
  z-index: 1;
}
.lb-close:hover { background: rgba(255,255,255,0.22); transform: scale(1.08); }

/* Prev / Next arrows */
.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), opacity var(--transition),
              transform var(--transition);
  z-index: 1;
}
.lb-arrow svg { width: 22px; height: 22px; stroke: white; stroke-width: 2.5; }
.lb-arrow:hover { background: rgba(255,255,255,0.22); transform: translateY(-50%) scale(1.05); }
.lb-arrow:disabled {
  opacity: 0.18;
  cursor: default;
  pointer-events: none;
}
.lb-prev { left: 1.2rem; }
.lb-next { right: 1.2rem; }

/* Counter */
.lb-counter {
  position: fixed;
  top: 1.3rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  pointer-events: none;
}

/* Caption pill */
.lb-caption {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 8, 8, 0.72);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.78);
  padding: 0.42rem 1.3rem;
  border-radius: 30px;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  pointer-events: none;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gallery-masonry { columns: 2 220px; }
  .gallery-section-label { gap: 1rem; }
  .gallery-photo-count { order: 3; }
}

@media (max-width: 600px) {
  .gallery-page-nav { top: 60px; }
  .gallery-section  { scroll-margin-top: 115px; }

  .gallery-masonry { columns: 1; }

  .gallery-tab { padding: 0.9rem 1.2rem; font-size: 0.8rem; }

  .lb-arrow { width: 42px; height: 42px; }
  .lb-prev  { left: 0.5rem; }
  .lb-next  { right: 0.5rem; }

  .lb-caption { font-size: 0.78rem; }

  .gallery-section-icon-wrap { width: 46px; height: 46px; }
  .gallery-section-icon-wrap svg { width: 20px; height: 20px; }
}
