:root {
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --color-bg: #fff;
  --color-text: #111;
  --nav-height: 64px;
  --gallery-max-width: 1400px;
  --gallery-gap: 0px; /* keep the unit: a bare 0 makes calc() and max() invalid */
  --gallery-gutter: 0px;
  --bar-padding: 16px;
  --menu-duration: 200ms;
}

@media (min-width: 1024px) {
  :root {
    --gallery-gutter: 24px;
    --bar-padding: 24px;
  }
}

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

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.4;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* Navbar (shared by the page and the menu) */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(var(--nav-height) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top)
    max(var(--bar-padding), env(safe-area-inset-right)) 0
    max(var(--bar-padding), env(safe-area-inset-left));
  background: var(--color-bg);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.burger {
  position: relative;
  width: 44px;
  height: 44px;
  margin-right: -10px; /* align the lines with the bar padding */
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.burger span {
  position: absolute;
  left: 10px;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--menu-duration) ease, opacity var(--menu-duration) ease;
}

.burger span:nth-child(1) { top: 15px; }
.burger span:nth-child(2) { top: 21.25px; }
.burger span:nth-child(3) { top: 27.5px; }

.menu.is-open .burger span:nth-child(1) { transform: translateY(6.25px) rotate(45deg); }
.menu.is-open .burger span:nth-child(2) { opacity: 0; }
.menu.is-open .burger span:nth-child(3) { transform: translateY(-6.25px) rotate(-45deg); }

/* Full-screen menu */

.menu {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--color-bg);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--menu-duration) ease, visibility 0s linear var(--menu-duration);
}

.menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity var(--menu-duration) ease;
}

.menu .bar {
  flex: none;
}

.menu-links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding: 24px max(var(--bar-padding), env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(var(--bar-padding), env(safe-area-inset-left));
}

.menu-links a {
  font-size: clamp(2.5rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu.is-open,
  .burger span {
    transition: none;
  }
}

/* Gallery */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gallery-gap);
  max-width: calc(var(--gallery-max-width) + 2 * var(--gallery-gutter));
  margin: 0 auto;
  padding: calc(var(--nav-height) + env(safe-area-inset-top) + var(--gallery-gutter))
    max(var(--gallery-gutter), env(safe-area-inset-right)) var(--gallery-gutter)
    max(var(--gallery-gutter), env(safe-area-inset-left));
}

.gallery-item {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  appearance: none;
  cursor: zoom-in;
  touch-action: manipulation;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--color-text);
  outline-offset: -3px;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* Viewer: download button for the page on screen (the default skin has no icon for it) */

/* Two classes, so it beats the skin's `.pswp--svg .pswp__button` icon-sheet background
   (used on high-resolution screens), which would otherwise show behind the arrow. */
.pswp .pswp__button--download {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: #fff;
}

.pswp__button--download svg {
  pointer-events: none;
}

/* Viewer zoom (mouse): magnifier before zooming in, zoom-out while the image follows the mouse */

.pswp--zoom-allowed .pswp__img {
  cursor: zoom-in;
}

.pswp--zoomed-in .pswp__img,
.pswp--zoomed-in .pswp__img:active {
  cursor: zoom-out;
}
