/* ── IMAGES PAGE ────────────────────────────────────────────── */

.images-section-wrap .photo-sub-row {
  display: flex; align-items: center; gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 1.4rem;
  flex-shrink: 0;
}
.images-section-wrap .photo-sub-row .page-sub {
  margin-bottom: 0;
}
.images-section-wrap .photo-zoom-hint {
  display: inline-block;
  width: fit-content;
  margin: 0;
  padding: 0.1rem 0.8rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.74rem; font-style: normal;
  letter-spacing: 0.04em;
  color: #f3dede;
  background: rgb(187 0 0 / 38%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgb(149 123 127 / 40%);
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.right {
  overflow: hidden;
  display: flex; flex-direction: column;
  min-height: 0;
}

.images-section-wrap {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column;
  padding: 3rem 4vw 2rem;
  background: rgba(0,0,0,0.2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 15px;
  border-left: 3px solid #ffffff57;
  overflow: hidden;
}

/* Gallery view fills the section as a column so .photo-gallery-wrap can
   resolve flex:1 against a bounded height and scroll internally. When the
   reader is open this is display:none and .photo-reader takes over. */
#galleryView {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
}

/* ── Gallery (flattened, justified rows) ─────────────────────── */
.photo-gallery-wrap {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(184,146,42,0.2) transparent;
}
.photo-gallery-wrap::-webkit-scrollbar { width: 3px; }
.photo-gallery-wrap::-webkit-scrollbar-thumb { background: rgba(184,146,42,0.2); }

.photo-gallery {
  display: flex; flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.photo-tile {
  position: relative; overflow: hidden;
  border-radius: 10px;
  cursor: zoom-in;
  flex-grow: 0; flex-shrink: 0;
  transition: transform 0.25s;
}
.photo-tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  box-sizing: border-box;
  border-radius: 10px;
  border: 5px solid rgba(255,255,255,0.3);
  filter: brightness(0.85);
  transition: filter 0.25s, transform 0.3s;
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
}
.photo-tile:hover img {
  filter: brightness(1.05); transform: scale(1.05);
}
.photo-tile:hover {
  z-index: 2;
}
.photo-tile-alt {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; gap: 0.4rem;
  padding: 0.55rem 0.7rem;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 55%);
  opacity: 0; transition: opacity 0.22s;
  pointer-events: none;
}
.photo-tile:hover .photo-tile-alt { opacity: 1; }
.photo-tile:hover .photo-tile-alt-toggle { pointer-events: auto; }
.photo-tile-alt-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.8rem; font-style: italic;
  color: #e8e0d0; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.photo-tile-alt.is-expanded .photo-tile-alt-text {
  -webkit-line-clamp: unset; overflow: visible;
}
.photo-tile-alt-toggle {
  flex-shrink: 0; align-self: flex-end;
  pointer-events: none;
  background: none; border: none; padding: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.75rem; font-style: italic;
  color: #f3ecd9; text-decoration: underline;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  cursor: pointer;
}
.photo-tile-alt-toggle:hover { color: #fff; }

/* ── Reader view (in-panel) ──────────────────────────────────── */
.photo-reader {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  gap: 1rem;
}
.photo-reader-back {
  align-self: flex-start; flex-shrink: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem; font-style: italic;
  color: var(--bone); opacity: 0.7;
  background: none; border: none; cursor: pointer;
  padding: 0; transition: opacity 0.2s, color 0.2s;
}
.photo-reader-back:hover { opacity: 1; color: var(--bright-gold); }
.photo-reader-stage {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.photo-reader-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; display: block;
  border-radius: 10px;
  border: 5px solid rgba(255,255,255,0.3);
  box-sizing: border-box;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none;
}
.photo-reader-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; line-height: 1; color: var(--parchment);
  background: rgba(0,0,0,0.35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}
.photo-reader-arrow:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.photo-reader-prev { left: 0.5rem; }
.photo-reader-next { right: 0.5rem; }
.photo-reader-caption {
  flex-shrink: 0; text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem; font-style: italic; line-height: 1.5;
  color: var(--parchment); opacity: 0.85;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.photo-reader-caption:empty { display: none; }

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 1520px) {
  .right { overflow: visible; flex: none; }
  .images-section-wrap { position: relative; height: auto; min-height: auto; overflow: visible; }
  .photo-gallery-wrap { overflow: visible; max-height: none; }
  .photo-viewer-card { padding: 15px; }
  .photo-viewer-img { max-height: 55vh; }
  /* Alt overlay is hover-only; on touch, show it persistently for context. */
  .photo-tile-alt { opacity: 1; background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%); }
  .photo-tile-alt-toggle { pointer-events: auto; }
}
