/* Layout for the published hole sponsor signs on the public site.
   Deliberately separate from gallery.css so the photo galleries are untouched. */

.hole-sign-grid {
  display: grid;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hole-sign-grid .hole-sponsor-sign {
  cursor: zoom-in;
}

/* Keeps the grid cell occupied while a sign is open in the lightbox. */
.hole-sign-placeholder {
  width: 100%;
  aspect-ratio: 1632 / 1056;
}

/* ---- Lightbox ----
   The sign must keep its 17:11 ratio, so the frame is sized from the shorter
   of the available width and height. Never set the sign to 100vw x 100vh. */
.hole-sign-lightbox {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  padding: 1rem;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.hole-sign-lightbox-inner {
  width: 100%;
  max-width: calc((100vh - 2rem) * 1632 / 1056);
  max-width: calc((100dvh - 2rem) * 1632 / 1056);
}

.hole-sign-lightbox .hole-sponsor-sign {
  width: 100%;
  cursor: default;
}

.hole-sign-lightbox-close {
  position: absolute;
  z-index: 2;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

body.hole-sign-lightbox-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .hole-sign-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 620px) {
  .hole-sign-grid {
    grid-template-columns: 1fr;
  }

  .hole-sign-lightbox {
    padding: 0.5rem;
  }

  .hole-sign-lightbox-inner {
    max-width: calc((100vh - 1rem) * 1632 / 1056);
    max-width: calc((100dvh - 1rem) * 1632 / 1056);
  }

  .hole-sign-lightbox-close {
    top: max(0.6rem, env(safe-area-inset-top));
    right: max(0.6rem, env(safe-area-inset-right));
  }
}
