/* Project details: a sheet that rises from the bottom with the page's large rounded corners. */
html.is-sheet-open { overflow: hidden; }

.sheet {
  width: min(1040px, 100vw);
  max-width: none;
  height: 90dvh;
  max-height: none;
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 40px 40px 0 0;
  background: var(--surface-light);
  color: var(--ink);
}
.sheet[open] { animation: sheet-up 340ms cubic-bezier(0.32, 0.72, 0, 1); }
.sheet.is-closing { animation: sheet-down 200ms ease-in forwards; }
.sheet::backdrop { background: rgba(22, 22, 22, .32); animation: sheet-fade-in 240ms ease; }
.sheet.is-closing::backdrop { animation: sheet-fade-out 180ms ease forwards; }

@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes sheet-fade-in { from { opacity: 0; } }
@keyframes sheet-fade-out { to { opacity: 0; } }

.sheet-scroll { height: 100%; padding: 24px clamp(18px, 4vw, 40px) 40px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-block: 0 12px;
  margin-inline: auto 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .08);
  cursor: pointer;
}
.sheet-body { container-type: inline-size; }

.viewer-stage { position: relative; overflow: hidden; border-radius: 18px; touch-action: pan-y; }
.viewer-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--tint); cursor: zoom-in; }
.viewer-img { display: block; width: 100%; max-height: 62dvh; aspect-ratio: 16 / 11; object-fit: contain; transition: opacity 200ms ease; }

/* While a picture is still on its way, a soft light sweeps across the stage */
.viewer-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .5) 50%, transparent 70%) 0 0 / 220% 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
.viewer-open.is-loading::after { opacity: 1; animation: viewer-shimmer 1.4s ease-in-out infinite; }
.viewer-open.is-loading .viewer-img { opacity: .35; }
@keyframes viewer-shimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) {
  .viewer-open.is-loading::after { animation: none; opacity: .6; }
}
.viewer-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #161616;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 4px 14px rgba(0, 0, 0, .1);
  cursor: pointer;
  transform: translateY(-50%);
}
.viewer-arrow span { width: 10px; height: 10px; border-block-start: 2px solid; border-inline-start: 2px solid; }
.viewer-prev { inset-inline-start: 12px; }
.viewer-next { inset-inline-end: 12px; }
.viewer-prev span { transform: translateX(calc(2px * var(--flip, 1))) rotate(calc(-45deg * var(--flip, 1))); }
.viewer-next span { transform: translateX(calc(-2px * var(--flip, 1))) rotate(calc(135deg * var(--flip, 1))); }
[dir="rtl"] .viewer-arrow { --flip: -1; }
.viewer-dots { display: flex; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.viewer-dot { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.viewer-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background-color 160ms ease, transform 160ms ease; }
.viewer-dot[aria-current="true"]::before { background: var(--ink); transform: scale(1.25); }
.viewer-lightbox { width: 100vw; max-width: none; height: 100dvh; max-height: none; padding: 16px; overflow: hidden; border: 0; background: rgba(18, 18, 18, .94); touch-action: pan-y; }
.viewer-lightbox[open] { display: grid; place-items: center; }
.viewer-lightbox::backdrop { background: transparent; }
.viewer-lightbox-img { max-width: 100%; max-height: calc(100dvh - 32px); border-radius: 10px; }
.viewer-lightbox-close { position: absolute; top: 14px; inset-inline-end: 14px; z-index: 1; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #161616; cursor: pointer; }

.sheet-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 14px 24px; margin-top: 26px; }
.sheet-name { font-family: var(--font-display); font-size: 1.875rem; font-weight: 500; letter-spacing: -.035em; }
.sheet-type { margin-top: 6px; color: var(--ink-soft); font-size: .9375rem; }
.sheet-visit {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding-inline: 22px;
  border-radius: 999px;
  background: var(--btn);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 160ms ease;
}
.sheet-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sheet-meta span { padding: 5px 12px; border-radius: 999px; background: var(--surface); color: var(--ink-soft); font-size: .75rem; font-weight: 500; }

.sheet-columns { display: grid; gap: 30px; margin-top: 34px; }
.sheet-block h3 { padding-bottom: 12px; border-bottom: 1px solid var(--line); font-size: .9375rem; font-weight: 600; }
.sheet-item { margin-top: 16px; }
.sheet-item strong { display: block; font-size: .875rem; font-weight: 600; }
.sheet-item p { margin-top: 3px; color: var(--ink-soft); font-size: .875rem; line-height: 1.55; }

.sheet-note { margin-top: 4px; color: var(--ink-soft); font-size: .8125rem; text-align: center; }

.sheet-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); }
.sheet-nav button {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: 600 .8125rem var(--font-text);
  cursor: pointer;
  transition: color 160ms ease;
}
.sheet-close:focus-visible, .sheet-visit:focus-visible, .sheet-nav button:focus-visible, .viewer-open:focus-visible, .viewer-arrow:focus-visible, .viewer-dot:focus-visible, .viewer-lightbox-close:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

@container (min-width: 620px) {
  .sheet-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
}

@media (hover: hover) and (pointer: fine) {
  .sheet-visit:hover { background: #383838; }
  .sheet-nav button:hover { color: var(--ink-fade); }
}

@media (max-width: 759px) {
  .sheet { height: 94dvh; border-radius: 28px 28px 0 0; }
  .viewer-stage .viewer-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet[open], .sheet::backdrop { animation: sheet-fade-in 120ms ease; }
}
