/* Show that linked instruction images can be enlarged. */
.single-post .tasty-recipes-instructions-body a > img {
  cursor: zoom-in;
}

/* Full-screen overlay. */
.tril-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483646;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
  background: rgba(10, 18, 22, 0.92);

  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.tril-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.tril-lightbox__content {
  position: relative;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  max-width: 100%;
  max-height: 100%;
}

.tril-lightbox__image {
  display: block;

  width: auto;
  height: auto;
  max-width: min(92vw, 1200px);
  max-height: 84vh;

  border-radius: 10px;
  box-shadow:
    0 0 0 5px #fffaf4,
    8px 8px 0 #115269,
    0 25px 70px rgba(0, 0, 0, 0.45);
}

.tril-lightbox__caption {
  max-width: 760px;
  margin: 18px 12px 0;

  color: #fff;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.tril-lightbox__caption[hidden] {
  display: none;
}

.tril-lightbox__close {
  position: absolute;
  top: -18px;
  right: -18px;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;
  padding: 0;

  color: #115269;
  background: #fffaf4;
  border: 0;
  border-radius: 50%;

  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;

  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.3);
}

.tril-lightbox__close:hover,
.tril-lightbox__close:focus {
  color: #fffaf4;
  background: #115269;
}

.tril-lightbox__close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

@media (max-width: 600px) {
  .tril-lightbox {
    padding: 18px;
  }

  .tril-lightbox__image {
    max-width: calc(100vw - 36px);
    max-height: 80vh;
    box-shadow:
      0 0 0 4px #fffaf4,
      5px 5px 0 #115269,
      0 18px 50px rgba(0, 0, 0, 0.45);
  }

  .tril-lightbox__close {
    top: -14px;
    right: -10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tril-lightbox {
    transition: none;
  }
}
