/* Self-contained photo viewer. No jQuery, no Bootstrap modal. Replaces
   ekko-lightbox, whose modal opened with no visible way back to the grid. */
.tpplb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  background: rgba(0, 0, 0, 0.92);
  -webkit-tap-highlight-color: transparent;
}
.tpplb.is-open { display: block; }

.tpplb__stage {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5vmin;
  cursor: zoom-out;
}
.tpplb__img {
  max-width: 94vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 44px rgba(0, 0, 0, 0.55);
  cursor: default;
}
.tpplb__cap {
  color: #eaeaea;
  margin-top: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  max-width: 90vw;
}

/* Controls: always visible, so getting back is never a guess. */
.tpplb__btn {
  position: absolute;
  z-index: 2;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: 0;
  cursor: pointer;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.tpplb__btn:hover { background: rgba(200, 30, 30, 0.92); transform: scale(1.06); }
.tpplb__close { top: 18px; right: 18px; }
.tpplb__prev { left: 18px;  top: 50%; transform: translateY(-50%); }
.tpplb__next { right: 18px; top: 50%; transform: translateY(-50%); }
.tpplb__prev:hover, .tpplb__next:hover { transform: translateY(-50%) scale(1.06); }

@media (max-width: 640px) {
  .tpplb__btn { width: 46px; height: 46px; font-size: 26px; }
  .tpplb__close { top: 10px; right: 10px; }
  .tpplb__prev { left: 6px; }
  .tpplb__next { right: 6px; }
}

/* The tile is the positioning context for the heart. The heart sits beside
   the lightbox link rather than inside it: a button nested in an anchor is
   invalid, and a tap would both toggle and open the photo.

   The heart needs a positioned wrapper, but inserting one moved .gallery-item
   out of the grid's direct-child position, and with it the row height that
   align-items:stretch used to give it. .gallery-item's picture and img both
   size at height:100%, so without a definite height on their ancestors they
   fall back to each photo's intrinsic ratio and the uniform crop turns
   ragged. These two rules hand the row height back down the chain. */
.gallery-tile { position: relative; height: 100%; }
.gallery-tile .gallery-item { height: 100%; }
.tpp-fav {
    position: absolute; top: 8px; right: 8px;
    border: 0; border-radius: 999px;
    width: 34px; height: 34px;
    font-size: 18px; line-height: 1;
    background: rgba(0,0,0,.45); color: #fff;
    cursor: pointer;
}
.tpp-fav[aria-pressed="true"] { color: #ff5a5a; }
.tpp-fav:disabled { opacity: .6; cursor: progress; }
