/* PhotoGallery styles */

/* ---------- Justified thumbnail rows ---------- */
.pg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--pg-gap, 8px);
}
.pg-grid::after {            /* keeps the last row from stretching */
  content: "";
  flex-grow: 999;
}
.pg-item {
  --ar: 1;
  position: relative;
  flex-grow: var(--ar);
  flex-basis: calc(var(--ar) * var(--pg-row, 220px));
  height: var(--pg-row, 220px);
  max-width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  background: #1c1b19;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
}
.pg-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.001);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1);
}
.pg-item.pg-loaded img { opacity: 1; }
.pg-item.pg-error img { opacity: .15; }
.pg-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 12px 10px;
  color: #fff;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  letter-spacing: .02em;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .pg-item:hover img { transform: scale(1.05); }
  .pg-item:hover .pg-label { opacity: 1; transform: none; }
}
.pg-item:focus-visible { outline: 2px solid #c9a96e; outline-offset: 2px; }
.pg-item:focus-visible .pg-label { opacity: 1; transform: none; }

@media (max-width: 700px) {
  .pg-grid { --pg-row: 150px !important; --pg-gap: 5px !important; }
}
@media (max-width: 420px) {
  .pg-grid { --pg-row: 120px !important; --pg-gap: 4px !important; }
}

/* ---------- Lightbox ---------- */
html.pg-noscroll, html.pg-noscroll body { overflow: hidden; }

.pg-lightbox {
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 9999;
  background: rgba(10, 10, 9, .97);
  opacity: 0;
  transition: opacity .2s ease;
  -webkit-user-select: none;
  user-select: none;
}
.pg-lightbox[hidden] { display: none; }
.pg-lightbox.pg-open { opacity: 1; }

.pg-stage {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 80px;
  box-sizing: border-box;
}
.pg-full {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 50px rgba(0,0,0,.6);
  opacity: 0;
  transform: scale(.985);
  transition: opacity .3s ease, transform .3s ease;
  cursor: pointer;
}
.pg-full.pg-in { opacity: 1; transform: none; }

.pg-spinner {
  position: absolute;
  width: 34px; height: 34px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: #c9a96e;
  border-radius: 50%;
  animation: pg-spin .8s linear infinite;
  display: none;
}
.pg-loading .pg-spinner { display: block; }
@keyframes pg-spin { to { transform: rotate(360deg); } }

/* Overlay text block */
.pg-caption {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(680px, calc(100% - 40px));
  box-sizing: border-box;
  padding: 12px 18px;
  border-radius: 6px;
  background: rgba(20, 19, 17, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f2efe8;
  text-align: center;
  pointer-events: none;
}
.pg-caption[hidden] { display: none; }
.pg-cap-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: .02em;
}
.pg-cap-text {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #cfcac0;
}

.pg-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 10px 12px;
}
.pg-counter {
  margin-right: auto;
  padding-left: 8px;
  color: rgba(255,255,255,.7);
  font-size: 13px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}

.pg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, color .2s ease;
}
.pg-btn[hidden] { display: none; }
.pg-btn svg { width: 24px; height: 24px; }
.pg-btn:hover, .pg-btn:focus-visible { color: #fff; background: rgba(255,255,255,.1); outline: none; }
.pg-info[aria-pressed="true"] { color: #c9a96e; }

.pg-nav {
  position: absolute;
  top: 50%;
  margin-top: -28px;
  width: 56px; height: 56px;
}
.pg-nav svg { width: 32px; height: 32px; }
.pg-prev { left: 12px; }
.pg-next { right: 12px; }

@media (max-width: 700px) {
  .pg-stage { padding: 56px 0 56px; }
  .pg-full { box-shadow: none; }
  .pg-nav {
    top: auto;
    bottom: 6px;
    margin-top: 0;
    width: 48px; height: 48px;
    background: rgba(0,0,0,.35);
  }
  .pg-prev { left: 8px; }
  .pg-next { right: 8px; }
  .pg-caption { bottom: 64px; padding: 10px 14px; }
  .pg-cap-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .pg-item img, .pg-full, .pg-lightbox, .pg-label { transition: none; }
}
