/* The public gallery entrance and album directory share the same print palette. */
:root {
  --cover-wine: #2b0d1b;
  --cover-paper: #fff3e9;
  --cover-rose: #ffabc2;
  --cover-rule: #d9bec5;
}

.palace-cover {
  --cover-flash: #ff648c;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
  color: var(--cover-paper);
  background: radial-gradient(ellipse at 0 110%, #740e32 0%, #300d1b 48%, #170c11 90%);
  border-radius: 3px;
}

.cover-copy {
  align-self: center;
  padding: clamp(26px, 5vw, 70px);
}

.cover-kicker,
.cover-caption small,
.open-set-caption small {
  font: 800 0.69rem/1.4 var(--font-body);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.cover-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0;
}

.cover-kicker span {
  padding-left: 1rem;
  border-left: 1px solid currentColor;
  color: var(--cover-rose);
}

.palace-cover .cover-kicker {
  justify-content: space-between;
  padding-block: 7px;
  border-block: 1px solid #a56076;
  letter-spacing: 0.09em;
}

.palace-cover .cover-kicker span {
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.palace-cover h1,
.gallery-masthead h1,
.open-sets-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.055em;
}

.palace-cover h1 {
  margin: clamp(18px, 2.8vw, 35px) 0 18px;
  color: var(--cover-paper);
  font-size: clamp(3.8rem, 7.8vw, 6.9rem);
  font-weight: 750;
  line-height: 0.94;
}

.palace-cover h1 em {
  display: block;
  color: var(--cover-flash);
  font-weight: 550;
  white-space: nowrap;
}

.cover-note {
  max-width: 29ch;
  margin: 0 0 22px;
  color: var(--cover-paper);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.45;
}

.cover-actions {
  align-items: center;
  gap: 6px 18px;
}

.cover-actions a,
.cover-consent,
.open-sets-heading a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 800 0.9rem/1.25 var(--font-body);
}

.cover-enter {
  gap: 0.9em;
  padding: 12px 18px;
  color: #fff8ef;
  background: #ac1643;
  border: 1px solid #fc799c;
  border-radius: 2px;
  text-decoration: none;
}

.cover-enter:hover {
  color: var(--cover-wine);
  background: var(--cover-paper);
}

.cover-clips,
.cover-consent {
  color: var(--cover-paper);
  text-underline-offset: 0.26em;
}

.cover-consent {
  margin-top: 2px;
  color: #e7c9d4;
  font-size: 0.78rem;
  font-weight: 600;
}

.cover-clips:hover,
.cover-consent:hover {
  color: var(--cover-rose);
}

.cover-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 24px 0 0;
  padding-top: 14px;
  border-top: 1px solid #704354;
}

.cover-stats div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.cover-stats dt { font-weight: 800; }
.cover-stats dd { margin: 0; color: #e7c9d4; }

.palace-cover .cover-photo {
  position: relative;
  order: 0;
  min-height: 0;
  border: 0;
  background: #210e17;
}

/* A strip of film perforations frames the actual cover photograph. */
.cover-photo::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 11px;
  background: repeating-linear-gradient(to bottom, transparent 0 13px, #c29e9d 13px 18px, transparent 18px 22px) center / 5px 22px repeat-y, #1d0d13;
  pointer-events: none;
}

.palace-cover .cover-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.cover-photo::after {
  background: linear-gradient(0deg, rgb(24 4 13 / 96%), rgb(24 4 13 / 46%) 19%, transparent 48%);
}

.cover-photo .cover-caption {
  inset: auto clamp(16px, 2.3vw, 32px) clamp(14px, 2.3vw, 32px);
  grid-template-columns: minmax(0, 1fr) auto;
  color: white;
  line-height: 1.1;
}

.cover-caption small {
  grid-column: 1;
  margin-bottom: 4px;
  font-family: var(--font-body);
}

.palace-cover .cover-caption small { font-family: ui-monospace, monospace; }

.cover-caption strong { grid-column: 1; }
.cover-caption b { grid-column: 2; grid-row: 1 / 3; }

.palace-cover a:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.palace-cover .cover-photo:focus-visible {
  outline-offset: -6px;
  z-index: 1;
}

.open-sets-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--cover-rule);
}

.open-sets-heading h2 { font-size: clamp(1.85rem, 3.8vw, 3rem); }
.open-sets-heading em,
.gallery-masthead em { color: var(--hot-deep); }
.open-sets-heading a { gap: 6px; }

.open-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: clamp(12px, 2vw, 26px);
}

.open-set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
}

.open-set img {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 3px;
  background: var(--blush);
}

.open-set-caption { display: grid; gap: 3px; }
.open-set-caption small { color: var(--ink-soft); letter-spacing: 0.08em; }
.open-set-caption strong { font: 600 clamp(1.05rem, 2vw, 1.4rem)/1.15 var(--font-display); }
.set-arrow { color: var(--hot-deep); font-size: 1.25rem; }
.open-set:hover strong { text-decoration: underline; text-underline-offset: 0.16em; }

.gallery-masthead {
  padding: clamp(20px, 4vw, 44px) 0 clamp(18px, 3vw, 32px);
  border-block: 1px solid var(--cover-rule);
  margin-bottom: 18px;
}

.gallery-masthead h1 { margin: 8px 0 12px; font-size: clamp(2.65rem, 6vw, 5rem); }
.gallery-masthead p:last-child { margin: 0; color: var(--ink-soft); }
.gallery-masthead .cover-kicker span { color: var(--hot-deep); }
.gallery-masthead .album-total {
  display: inline-block;
  margin-left: 0.5em;
  padding: 2px 8px;
  color: var(--hot-deep);
  background: var(--blush);
  box-shadow: none;
}

.album-directory .folder,
.album-directory .folder-body {
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  background: transparent;
}

.album-directory .folder-media { border: 0; border-radius: 3px; }
.album-directory .folder-copy { padding: 9px 0 14px; }
.album-directory .folder-label { font-size: clamp(1rem, 1.7vw, 1.3rem); }
.album-directory .folder:hover .folder-body { transform: none; }
.album-directory .folder:hover .folder-label { text-decoration: underline; }
.album-directory .newtag { inset: 8px 8px auto auto; animation: none; }
.album-directory .seen-badge { inset: auto 8px 8px auto; }

@media (min-width: 651px) {
  .open-set-grid:not(:has(.open-set:nth-child(2):not([hidden]))) .open-set {
    grid-template-columns: 128px minmax(0, 1fr) auto;
    gap: 18px;
  }
  .open-set-grid:not(:has(.open-set:nth-child(2):not([hidden]))) img { grid-column: 1; }
}

@media (max-width: 650px) {
  .palace-cover { grid-template-columns: minmax(0, 1fr); }
  .cover-copy { padding: 22px 20px 10px; }
  .palace-cover .cover-photo { grid-row: 1; aspect-ratio: 2.25 / 1; }
  .palace-cover h1 { margin: 14px 0 12px; font-size: clamp(2.5rem, 10.5vw, 4.4rem); }
  .palace-cover h1 em { display: inline-block; }
  .cover-note { margin-bottom: 12px; }
  .cover-stats { margin-top: 14px; padding-top: 10px; }
  .open-set-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .open-set { grid-template-columns: 88px minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--cover-rule); }
  .open-set img { grid-column: 1; aspect-ratio: 1.4 / 1; }
  .open-sets-heading { align-items: center; margin-bottom: 0; }
}

@media (max-width: 360px) {
  body { min-width: 0; }
  .site-header-inner { gap: 6px; }
  .site-brand { gap: 5px; }
  .site-brand .brand-mark { width: 32px; height: 32px; }
  .ob-pill { padding-right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .palace-cover .cover-photo img,
  .album-directory .folder-media img { transform: none; transition: none; }
}
