/* Shared chrome for index + collection so the two pages cannot drift. */

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 15px 34px;
  background: var(--bg);
  gap: 30px;
}
.topbar a {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .03em;
  text-transform: lowercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}
.topbar a:last-child { margin-left: auto; }
.topbar a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .topbar {
    padding: 15px 22px;
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .topbar {
    justify-content: space-between;
    padding: 8px 18px;
    gap: 0;
  }
  .topbar a:last-child { margin-left: 0; }
  .topbar a {
    font-size: clamp(9.5px, 2.4vw, 12px);
    letter-spacing: 0;
  }
}

.landing { width: 100%; }

.sticker {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  visibility: hidden;
}
.sticker.is-placed { visibility: visible; }
.landing,
.content,
.works-grid,
.grid-more,
.collection-sub,
.collection-grid {
  position: relative;
  z-index: 2;
}

.plate {
  position: relative;
  display: inline-block;
  font-family: var(--gothic), Georgia, serif;
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 13px 26px;
  cursor: pointer;
  line-height: 1;
  transition: background .2s ease;
}
.plate::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid var(--ink);
  opacity: .38;
  pointer-events: none;
}
.plate::after {
  content: "❧";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  font-size: 11px;
  line-height: 1;
  color: var(--ink);
  opacity: .5;
  background: var(--bg);
  padding: 0 5px;
}
.plate:hover { background: rgba(17,17,16,.05); }
.plate.is-static { cursor: default; }
.plate.is-static:hover { background: transparent; }
.plate.is-reserved {
  color: #c0392b;
  border-color: #c0392b;
  transform: rotate(-2.5deg);
}
.plate.is-reserved::before { border-color: #c0392b; }
.plate.is-reserved::after  { color: #c0392b; content: "✽"; }

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 999998;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(220, 247, 216, .94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .28s ease;
  padding: 64px 24px 28px;
  box-sizing: border-box;
}
#lightbox.lb-open  { display: flex; }
#lightbox.lb-shown { opacity: 1; }

#lightbox .lb-stage {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(.965);
  transition: transform .34s cubic-bezier(.2,.7,.3,1);
}
#lightbox.lb-shown .lb-stage { transform: scale(1); }

#lightbox .lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lightbox img {
  max-width: min(1100px, 100%);
  max-height: calc(100vh - 220px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  cursor: zoom-out;
  box-shadow: 0 18px 60px rgba(17,17,16,.22);
}

#lightbox .lb-cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faded);
  margin-top: 24px;
  text-align: center;
}

.lb-status {
  position: static;
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.lb-btn {
  background: none;
  border: 0;
  color: var(--ink);
  font-family: var(--serif);
  cursor: pointer;
  line-height: 1;
  padding: 12px;
  opacity: .58;
  transition: opacity .18s ease;
  z-index: 2;
}
.lb-btn:hover { opacity: 1; }

.lb-close {
  position: fixed;
  top: 14px;
  right: 20px;
  font-size: 30px;
}

.lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin-top: 22px;
  flex-shrink: 0;
}
.lb-pager .lb-prev,
.lb-pager .lb-next {
  position: static;
  transform: none;
  font-size: 34px;
  padding: 8px 12px;
}
.lb-count {
  position: static;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--faded);
  min-width: 4.5em;
}

/* Wide screens: arrows sit beside the work only when they will not cover it. */
@media (min-width: 1101px) {
  #lightbox img { max-height: calc(100vh - 160px); }
  .lb-status {
    position: absolute;
    left: calc(100% + 46px);
    top: 50%;
    transform: translateY(-50%);
    margin-top: 0;
    align-items: flex-start;
  }
  #lightbox .lb-cap { margin-top: 14px; }
  .lb-pager .lb-prev,
  .lb-pager .lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
  }
  .lb-pager .lb-prev { left: 14px; }
  .lb-pager .lb-next { right: 14px; }
}

@media (max-width: 640px) {
  #lightbox { padding: 52px 12px 18px; }
  #lightbox img { max-height: calc(100vh - 240px); }
  .plate { font-size: 11px; padding: 11px 20px; letter-spacing: .18em; }
}

@media (prefers-reduced-motion: reduce) {
  #lightbox, #lightbox .lb-stage { transition: none; }
}

.zoomable { cursor: zoom-in; }
.img-inset img { cursor: default; }
.img-inset .inset-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faded);
  text-align: center;
  margin: 10px 0 0;
}

.works-grid .cell { position: relative; display: block; line-height: 0; }
.works-grid .cell.is-hidden { display: none; }
.works-grid img { cursor: zoom-in; }

.grid-more {
  max-width: 900px;
  margin: 30px auto 0;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}
.grid-more .tally {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--faded);
  text-align: center;
}
@media (max-width: 640px) {
  .grid-more { padding: 0 16px; }
}

.temporarily-hidden,
.temporarily-hidden .spec {
  display: none !important;
}

body.wl-locked .wl-audio {
  visibility: hidden;
  pointer-events: none;
}

.wl-audio {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1000000;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faded);
  cursor: pointer;
  opacity: .78;
  transition: color .18s ease, opacity .18s ease;
}
.wl-audio:hover,
.wl-audio:focus-visible {
  color: var(--ink);
  opacity: 1;
}
.wl-audio:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 3px;
}
.wl-audio svg {
  width: 22px;
  height: 22px;
  display: block;
}
.wl-audio .on { display: none; }
.wl-audio.is-on .on { display: block; }
.wl-audio.is-on .off { display: none; }
