/* What the site's behaviour modules draw (src/scripts/site.js and its modules; contractor-free rewrite
   slice 3). YBH's own: written here, no library's stylesheet. */

/* The parallax picture (parallax-picture.js): a layer inside its block, which clips it. */
[data-ybh-parallax-started] {
  position: relative;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  max-width: none;
  pointer-events: none;
  will-change: transform;
}

/* The blog grid (blog-grid.js): a filter's moves glide, every other layout is instant. */
#post-grid.is-moving > .post-card {
  transition: left 0.4s ease, top 0.4s ease;
}

/* The lightbox (lightbox.js): a modal <dialog> over a dark backdrop. */
html.site-lightbox-open {
  overflow: hidden;
}

.site-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #eee;
  overflow: hidden;
}

.site-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: site-lightbox-in 0.366s ease;
}

.site-lightbox::backdrop {
  background: rgba(30, 30, 30, 0.87);
}

@keyframes site-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.site-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 44px;
  box-sizing: border-box;
}

.site-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
}

.site-lightbox__frame,
.site-lightbox__video {
  display: block;
  width: min(100%, (100vh - 88px) * 16 / 9);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 100%;
  border: 0;
  background: #000;
}

.site-lightbox__button {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  background: rgba(30, 30, 30, 0.6);
  color: #ccc;
  cursor: pointer;
}

.site-lightbox__button:hover,
.site-lightbox__button:focus-visible {
  color: #fff;
}

.site-lightbox__button:focus-visible {
  outline: 3px solid rgba(32, 76, 229, 0.65);
  outline-offset: 0;
}

.site-lightbox__button[disabled] {
  cursor: default;
  opacity: 0.35;
}

.site-lightbox__button[hidden] {
  display: none;
}

.site-lightbox__button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.site-lightbox__close {
  top: 0;
  right: 0;
}

.site-lightbox__prev,
.site-lightbox__next {
  top: 50%;
  width: 70px;
  height: 100px;
  padding: 31px 23px;
  margin-top: -50px;
  background: transparent;
}

.site-lightbox__prev {
  left: 0;
}

.site-lightbox__next {
  right: 0;
}

.site-lightbox__counter {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  font: 13px/44px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #ccc;
}

.site-lightbox__caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 25px 44px;
  font: 14px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #eee;
  text-align: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}

.site-lightbox__counter[hidden],
.site-lightbox__caption[hidden] {
  display: none;
}

@media (max-width: 767px) {
  .site-lightbox__stage {
    padding: 44px 6px;
  }

  .site-lightbox__prev,
  .site-lightbox__next {
    width: 44px;
    padding: 31px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-lightbox[open] {
    animation: none;
  }

  #post-grid.is-moving > .post-card {
    transition: none;
  }
}
