/* Soften the moving wallpaper on photography pages; artwork sits on its own layer. */
.studio-photography > .ambient-halo {
  inset: -28px;
  filter: blur(16px);
  opacity: .43;
}
.studio-photography .gallery-page {
  --photo-serif: "Songti SC", "STSong", Georgia, serif;
  width: min(100%, 1440px);
  max-width: none;
  margin: 0 auto;
  padding: 16px clamp(22px, 6vw, 94px) 64px;
}
.gallery-page img { display: block; width: 100%; height: auto; }
.studio-photography:has(.photo-overture) .studio-brand { font-size: 17px; font-weight: 550; }
.gallery-page:has(.photo-overture) {
  --profile-serif: Baskerville, Georgia, "Songti SC", "Noto Serif CJK SC", SimSun, serif;
}
.photo-overture, .photographer, .photo-collection {
  width: min(100%, 20rem);
  margin-inline: auto;
}
.photo-overture {
  display: grid;
  place-content: center end;
  min-height: clamp(7rem, 25svh, 15rem);
  color: var(--heading);
  font: 550 clamp(1.875rem, 3vw, 2.875rem)/1.12 var(--font-ui);
  letter-spacing: -.035em;
}
.photographer, .photo-collection {
  font: 400 .90625rem/1.65 var(--profile-serif);
}
.photographer {
  display: grid;
  gap: 1.25rem;
}
.photographer > figure { width: 75%; justify-self: end; }
.photographer-copy > h2 {
  font: 400 1.25rem/1.3 var(--profile-serif);
  margin-bottom: .625rem;
}
#photographer-name [lang] { display: inline-block; }
#photographer-name [lang="zh-CN"] { font-size: .9em; letter-spacing: .06em; }
#photographer-name [aria-hidden] { font-size: .7em; vertical-align: .12em; color: var(--muted); }
.photographer-copy p + p { margin-top: .8em; }
.photo-collection { margin-block-start: clamp(2.75rem, 7vw, 5.25rem); }
.photo-collection > h2 { margin-bottom: 1rem; font: 550 .9375rem/1.45 var(--font-ui); }
.photo-collection.album-index {
  width: min(100%, 72rem);
  margin-block-start: clamp(6rem, 13vw, 11.5rem);
}
.exhibition-list { display: grid; gap: 2rem; }
.album-list, .album-spread { display: grid; gap: clamp(2.5rem, 6vw, 5rem); }
.album-cover { display: block; min-width: 0; max-width: 100%; color: var(--ink); overflow-wrap: anywhere; }
.album-cover:has(img) { width: fit-content; }
.album-cover img { width: auto; max-width: 100%; max-height: 78svh; }
.album-cover:has(img) .album-caption { contain: inline-size; }
.album-cover:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.album-cover:hover { text-decoration: none; }
.album-cover:is(:hover, :focus-visible) .album-caption > :first-child { text-decoration: underline; text-underline-offset: .25em; }
.album-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .2rem .8rem;
  margin-block-start: .65rem;
}
.album-caption > :first-child { margin-right: auto; font: 500 1rem/1.45 var(--font-ui); }
.album-caption time, .album-caption > :last-child {
  color: var(--muted);
  font: 400 .8125rem/1.5 var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.exhibition-list figure { justify-self: start; max-width: 100%; }
.exhibition-list img { width: auto; max-height: 20rem; }
.exhibition-list figcaption { contain: inline-size; margin-top: .65rem; font: 500 1rem/1.45 var(--font-ui); }
.album-reading { width: min(100%, 54rem); margin: clamp(3rem, 9vw, 7rem) auto 0; }
.album-reading h2 { margin-bottom: .75rem; font: 400 1.125rem/1.45 var(--photo-serif); }
.album-reading ul { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0; padding: 0; list-style: none; }
.album-reading a { display: inline-block; padding: .35rem 0; color: var(--ink); font-size: .9rem; }
.album-heading a { font: inherit; font-size: 14px; color: var(--ink); }
.album-reading a, .album-heading a { text-decoration: underline; text-underline-offset: .32em; }
.album-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: .45rem 1.3rem; }
.album-heading p { flex-basis: 100%; color: var(--muted); }
.album-heading h1 { font: 500 24px/1.4 var(--photo-serif); }
.photo-work {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0 clamp(12px, 1.8vw, 32px);
  align-items: end;
  padding: clamp(45px, 8vh, 90px) 0;
}
.photo-work + .photo-work { margin-top: clamp(40px, 7vw, 100px); }
.photo-print {
  display: block;
  grid-area: 1 / 3 / 2 / 12;
  width: min(100%, 98svh);
  justify-self: end;
  cursor: zoom-in;
}
.photo-work figcaption { grid-area: 1 / 1 / 2 / 3; }
.photo-work--small .photo-print { grid-column: 2 / 7; justify-self: start; width: min(100%, 53svh); }
.photo-work--small figcaption { grid-column: 7 / 10; }
.photo-work--small:nth-child(4n) .photo-print { grid-column: 7 / 12; justify-self: end; }
.photo-work--small:nth-child(4n) figcaption { grid-column: 4 / 7; }
.photo-work h2 { font: 500 clamp(21px, 2vw, 30px)/1.35 var(--photo-serif); }
.photo-work p, .photo-work time { color: var(--ink); font-size: 14px; }
.photo-work p { margin: 8px 0 10px; line-height: 1.7; }
.photo-work time { font: 13px/1.5 Georgia, serif; font-variant-numeric: tabular-nums; }
.photo-print, .photo-print img, .photo-viewer img { border: 0; padding: 0; border-radius: 0; box-shadow: none; background: transparent; }
.photo-print:focus-visible { outline: none; }
.photo-print:focus-visible + figcaption h2 { text-decoration: underline 2px; text-underline-offset: .25em; }
.photo-viewer {
  width: 100%; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 16px clamp(15px, 4vw, 64px);
  border: 0; color: var(--ink); background: transparent;
}
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.photo-viewer::backdrop { background: transparent; }
.studio-photography:has(.photo-viewer[open]) { overflow: hidden; }
.studio-photography:has(.photo-viewer[open]) > :is(.studio-header, .studio-footer),
.gallery-page:has(.photo-viewer[open]) > :not(dialog) { visibility: hidden; }
.photo-viewer form { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.photo-viewer img { width: 100%; height: 100%; object-fit: contain; }
.photo-viewer p { text-align: center; font-size: 14px; }
.viewer-close { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); cursor: pointer; }
@supports (animation-timeline: view()) {
  @media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
    .photo-work--small .photo-print {
      animation: photo-arrive linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
    @keyframes photo-arrive { from { transform: translateY(12px); } to { transform: none; } }
  }
}
@media (max-width: 900px) {
  .photo-work { display: block; padding: 0; margin: 32px 0 0; }
  .photo-work + .photo-work { margin-top: 84px; }
  .photo-work .photo-print { width: 100%; }
  .photo-work--small { width: 73%; margin-left: auto; }
  .photo-work--small:nth-child(4n) { margin-left: 0; }
  .photo-work figcaption { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; margin-top: 12px; }
  .photo-work time { grid-area: 1 / 2; }
  .photo-work p { grid-column: 1 / -1; margin: 0; }
}
@media (max-width: 700px) and (prefers-reduced-motion: no-preference) {
  .studio-photography { --halo-scale: 1.07; --halo-x: 1.1%; --halo-y: -.9%; }
  :root[data-color=light] .studio-photography .ambient-art--light,
  :root[data-color=dark] .studio-photography .ambient-art--dark {
    animation: studio-halo-drift 12s ease-in-out infinite alternate;
    animation-delay: var(--halo-phase, 0ms);
    transform-origin: 35% 50%;
  }
}

@media (min-width: 46em) {
  .photo-overture, .photographer, .photo-collection { width: min(100%, 56rem); }
  .photographer, .exhibition-list {
    display: grid;
    align-items: start;
    gap: clamp(2rem, 5vw, 4.5rem);
  }
  .photographer, .exhibition-list { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); }
  .photographer > figure { width: min(100%, 17.5rem); justify-self: start; }
  .photographer-copy { max-width: 25rem; justify-self: end; }
}
@media (min-width: 36em) and (max-width: 59.999em) {
  .album-spread > :first-child { max-width: 90%; justify-self: end; }
  .album-spread > :nth-child(2) { max-width: 82%; }
}
@media (min-width: 60em) {
  .album-index { display: grid; grid-template-areas: "albums"; }
  .album-index > h2, .album-list { grid-area: albums; }
  .album-index > h2 { place-self: start; z-index: 1; max-width: 30%; }
  .album-spread {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.618fr);
    column-gap: clamp(2rem, 4.2vw, 4.5rem);
    align-items: start;
  }
  .album-spread > :first-child { grid-area: 1 / 2; justify-self: end; }
  .album-spread > :nth-child(2) { grid-area: 1 / 1; margin-block-start: clamp(9rem, 19vw, 17rem); }
  .album-spread:nth-child(even) { grid-template-columns: minmax(0, 1.618fr) minmax(0, 1fr); }
  .album-spread:nth-child(even) > :first-child { grid-column: 1; justify-self: start; }
  .album-spread:nth-child(even) > :nth-child(2) { grid-column: 2; justify-self: end; }
  .album-spread:not(:first-child):has(> :only-child) { width: 55%; justify-self: center; grid-template-columns: minmax(0,1fr); }
  .album-spread:not(:first-child) > :only-child { grid-column: 1; justify-self: center; }
}
@media (max-width: 420px) {
  .studio-photography:has(.photo-overture) .studio-header { min-height: 3.5rem; padding-block: .375rem; }
  .studio-photography:has(.photo-overture) .studio-header nav { width: auto; order: 0; margin-inline: auto; }
}
