/* solarmidnight.io - full bleed photo wall */

:root {
  --bg: #0a0a0a;
  /* no matte on the wall: photos sit directly on the background */
  --frame: 0px;
  /* the enlarged photo keeps a thin white matte */
  --frame-enlarged: 3px;
  /* whitespace between photos, and from photo to browser edge */
  --gap: 22px;
}

@media (max-width: 720px) {
  :root {
    --gap: 12px;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: #eaeaea;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.lightbox-open {
  overflow: hidden;
}

/* ---------- the wall ---------- */

#wall {
  position: relative;
  display: block;
  padding: var(--gap);
  /* height is set in JS once the layout is measured */
}

.tile {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  /* buttons get a 2px outset border from the UA stylesheet, which renders
     light on top/left and dark on bottom/right */
  border: 0;
  -webkit-appearance: none;
  appearance: none;
  padding: var(--frame);
  /* a placeholder while the photo decodes. never white, or every tile
     would flash a white rectangle before fading in. */
  background: #141414;
  cursor: zoom-in;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #141414;
  opacity: 0;
  transition: opacity 420ms ease-out;
}

.tile img.loaded {
  opacity: 1;
}

@media (hover: hover) {
  .tile {
    transition: filter 220ms ease-out;
  }
  .tile:hover {
    filter: brightness(1.08);
  }
}

.tile:focus-visible {
  outline: 2px solid #6cf;
  outline-offset: 4px;
}

/* a hairline between albums. deliberately faint: it should register as a
   pause rather than a heading. */
.divider {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
  background: rgba(6, 6, 6, 0.94);
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 200ms ease-out;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.lightbox.visible {
  opacity: 1;
}

.lightbox[hidden] {
  display: none;
}

/* the only white matte on the site */
.lightbox-frame {
  padding: var(--frame-enlarged);
  background: #fff;
  line-height: 0;
  cursor: zoom-out;
  max-width: 100%;
  max-height: 100%;
  transform: scale(0.985);
  transition: transform 200ms ease-out;
}

.lightbox.visible .lightbox-frame {
  transform: scale(1);
}

.lightbox-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - (var(--gap) * 2) - (var(--frame-enlarged) * 2));
  max-height: calc(100vh - (var(--gap) * 2) - (var(--frame-enlarged) * 2));
  max-height: calc(100dvh - (var(--gap) * 2) - (var(--frame-enlarged) * 2));
}

.noscript {
  padding: 2rem;
  text-align: center;
  color: #9e9e9e;
}

@media (prefers-reduced-motion: reduce) {
  .tile img,
  .lightbox,
  .lightbox-frame {
    transition: none;
  }
}
