/* The collection has its own palette and layout; other pages keep site.css. */
.collection-shell {
  --collection-paper: #f5f3ee;
  --collection-ink: #242822;
  --collection-muted: #686c63;
  --collection-rule: #d8dbd1;
  --collection-accent: #596444;
  background: var(--collection-paper);
  color: var(--collection-ink);
  min-height: calc(100vh - 100px);
}

.collection {
  width: min(100%, 1512px);
  margin: 0 auto;
  padding: 72px clamp(22px, 4vw, 64px) 64px;
}

.collection [hidden] { display: none !important; }
.collection button, .collection a { -webkit-tap-highlight-color: transparent; }
.collection button { font: inherit; color: inherit; }
.collection a { color: inherit; text-decoration: none; }
.collection a:hover { opacity: 1; }
.collection :is(button, a):focus-visible {
  outline: 2px solid var(--collection-accent);
  outline-offset: 5px;
  border-radius: 0;
}

.collection-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 48px;
}
.collection-eyebrow {
  margin: 0 0 24px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.collection-header h1 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(44px, 5.6vw, 78px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.055em;
}
.collection-header h1 > span { color: var(--collection-accent); }
.collection-intro { padding-bottom: 3px; flex-shrink: 0; }
.collection-intro > p {
  margin: 0 0 19px;
  color: var(--collection-muted);
  font-size: 14px;
  line-height: 1.7;
}
.collection-availability { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.collection-availability > span { width: 6px; height: 6px; border-radius: 50%; background: #6b7657; }

.collection-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  border-top: 1px solid var(--collection-rule);
  border-bottom: 1px solid var(--collection-rule);
}
.collection-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.collection-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  padding: 11px 14px;
  min-height: 44px;
  font-size: 12px !important;
  cursor: pointer;
}
.collection-filter > span { font-size: 10px; opacity: .7; font-variant-numeric: tabular-nums; }
.collection-filter:hover { border-color: var(--collection-rule); }
.collection-filter[aria-pressed='true'] { background: var(--collection-ink); color: #fff; }
.collection-motion {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px;
  min-height: 44px;
  border: 0;
  background: none;
  font-size: 11px !important;
  cursor: pointer;
}
.collection-motion > span:first-child { font-size: 20px; }
.collection-motion:disabled { color: var(--collection-muted); cursor: default; }
.collection-index { display: flex; justify-content: space-between; gap: 24px; padding: 23px 0; }
.collection-index p { margin: 0; color: var(--collection-muted); font-size: 12px; line-height: 1.6; }
.collection-index p:last-child { flex-shrink: 0; font-variant-numeric: tabular-nums; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 42px 26px; }
.gallery-work { min-width: 0; display: flex; flex-direction: column; }
.gallery-work__visual {
  position: relative;
  aspect-ratio: 1 / 1.1;
  background: #eae8e0;
  border: 1px solid #e2e1d9;
  overflow: hidden;
}
.gallery-work__image-link {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  padding: 42px 34px;
}
.collection .gallery-work__image-link:focus-visible { outline-offset: -5px; }
.gallery-work__image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgb(43 40 29 / 13%));
}
.gallery-work__image--fallback { opacity: .3; filter: grayscale(1); }
.gallery-work__placeholder { position: absolute; bottom: 38px; font-size: 12px; color: var(--collection-ink); }
.gallery-work__number { position: absolute; top: 16px; left: 17px; color: #707367; font-size: 10px; letter-spacing: .1em; pointer-events: none; }
.gallery-work__unavailable { position: absolute; top: 14px; right: 15px; padding: 3px 6px; background: var(--collection-paper); color: var(--collection-muted); font-size: 10px; }
.gallery-work__preview {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #d6d6cb;
  background: #f8f7f2;
  font-size: 11px !important;
  cursor: pointer;
}
.gallery-work__preview > span { font-size: 21px; line-height: 1; }
.gallery-work__preview:hover { background: #fff; }
.gallery-work__caption { display: flex; flex-direction: column; flex: 1; padding: 20px 1px 0; }
.gallery-work__artist { margin: 0 0 6px; font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
.gallery-work__title { margin: 0 0 9px; font-family: 'Playfair Display', Georgia, serif; font-size: 16px; font-style: italic; line-height: 1.5; overflow-wrap: anywhere; }
.gallery-work__medium { margin: 0 0 16px; color: var(--collection-muted); font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.gallery-work__actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: auto; border-top: 1px solid var(--collection-rule); }
.gallery-work__actions a { display: inline-flex; align-items: center; gap: 14px; min-height: 44px; font-size: 11px; }
.gallery-work__actions a > span { font-size: 18px; }
.gallery-work__actions a:hover { color: var(--collection-accent); }
.gallery-work__edit { color: var(--collection-muted) !important; }

.collection-endnote { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 66px; padding-top: 32px; border-top: 1px solid var(--collection-rule); }
.collection-endnote p { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(23px, 2.6vw, 34px); margin: 0; letter-spacing: -.025em; }
.collection-endnote a, .collection-empty a { display: inline-flex; align-items: center; gap: 20px; min-height: 44px; font-size: 13px; border-bottom: 1px solid var(--collection-ink); }
.collection-empty { padding: 64px 0 100px; border-top: 1px solid var(--collection-rule); }
.collection-empty h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 400; }
.collection-empty p { color: var(--collection-muted); margin: 20px 0; }

.artwork-viewer {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 40px));
  max-width: none;
  height: min(900px, calc(100dvh - 40px));
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: var(--collection-paper);
  color: var(--collection-ink);
}
.artwork-viewer[open] { display: flex; flex-direction: column; }
.artwork-viewer::backdrop { background: rgb(17 20 16 / 78%); }
.artwork-viewer__toolbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--collection-rule); }
.artwork-viewer__toolbar > span { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.artwork-viewer__close { display: flex; align-items: center; gap: 12px; min-height: 44px; background: none; border: 0; cursor: pointer; font-size: 12px !important; }
.artwork-viewer__close span { font-size: 26px; }
.artwork-viewer__stage { display: flex; justify-content: center; align-items: center; flex: 1; min-height: 0; padding: 24px; background: #eae8e0; }
.artwork-viewer__stage img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 8px 16px rgb(0 0 0 / 12%)); }
.artwork-viewer__bottom { display: flex; align-items: center; flex-wrap: wrap; flex-shrink: 0; gap: 12px 28px; padding: 20px 24px; max-height: 38%; overflow-y: auto; }
.artwork-viewer__caption { flex: 1; min-width: min(240px, 100%); overflow-wrap: anywhere; }
.artwork-viewer__caption > p:first-child { margin: 0 0 5px; font-size: 13px; font-weight: 600; }
.artwork-viewer__caption h2 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 22px; font-weight: 400; }
.artwork-viewer__caption > p:last-child { margin: 8px 0 0; font-size: 11px; color: var(--collection-muted); }
.artwork-viewer__navigation { display: flex; align-items: center; gap: 12px; }
.artwork-viewer__navigation button { min-width: 44px; min-height: 44px; border: 1px solid var(--collection-rule); background: transparent; cursor: pointer; }
.artwork-viewer__navigation span { font-size: 12px; font-variant-numeric: tabular-nums; }
.artwork-viewer__details { display: flex; align-items: center; gap: 20px; min-height: 44px; font-size: 12px; border-bottom: 1px solid var(--collection-ink); }

/* Motion is progressive enhancement and is never required to see a work. */
@media (prefers-reduced-motion: no-preference) {
  .collection[data-motion-enabled='true'] .gallery-work__image {
    transition: transform 500ms cubic-bezier(.2,.65,.3,1), filter 500ms ease;
    transform: perspective(900px) rotateX(var(--art-rx, 0deg)) rotateY(var(--art-ry, 0deg)) scale(var(--art-scale, 1));
  }
  .collection[data-motion-enabled='true'] .gallery-work__visual:is(:hover, :focus-within) { --art-scale: 1.035; }
  .collection[data-motion-enabled='true'] .gallery-work.is-entering { animation: work-arrive 650ms both cubic-bezier(.2,.65,.3,1); }
  @keyframes work-arrive { from { opacity: .3; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
}
@media (hover: hover) and (pointer: fine) {
  .gallery-work__preview { opacity: 0; }
  .gallery-work__visual:is(:hover, :focus-within) .gallery-work__preview { opacity: 1; }
}
@media (max-width: 1050px) {
  .collection-header { align-items: flex-start; }
  .collection-intro { flex-shrink: 1; max-width: 230px; }
  .collection-tools { align-items: flex-start; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .collection { padding-top: 40px; }
  .collection-header { display: block; padding-bottom: 30px; }
  .collection-eyebrow { margin-bottom: 20px; }
  .collection-intro { max-width: none; margin-top: 22px; }
  .collection-intro > p { margin-bottom: 13px; }
  .collection-tools { display: block; }
  .collection-filters { gap: 4px; flex-wrap: nowrap; overflow-x: auto; padding: 5px; margin: -5px; scrollbar-width: thin; }
  .collection-filter { flex-shrink: 0; white-space: nowrap; }
  .collection-filter { padding: 9px 11px; }
  .collection-motion { margin-top: 8px; }
  .gallery-grid { gap: 30px 18px; }
  .gallery-work__image-link { padding: 38px 24px; }
  .collection-endnote { align-items: flex-start; flex-direction: column; margin-top: 40px; }
}
@media (max-width: 520px) {
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-work__visual { aspect-ratio: 1 / 1.05; }
  .gallery-work__image-link { padding: 40px 36px; }
  .collection-index { gap: 14px; }
  .artwork-viewer { width: calc(100% - 16px); height: calc(100dvh - 16px); }
  .artwork-viewer__toolbar, .artwork-viewer__bottom { padding: 12px 16px; }
  .artwork-viewer__stage { padding: 16px; }
  .artwork-viewer__caption { flex-basis: 100%; }
  .artwork-viewer__details { margin-left: auto; }
}
