/* Client Proofing gallery - a deliberately separate visual system (own
 * palette + type pairing) from the rest of the site, scoped entirely to
 * page-proofing.php (this file is enqueued only when that template is
 * active). Carried over from the original standalone prototype largely
 * as-is; the only structural change is renaming its .grid class to
 * .proofing-grid, since the sitewide layout.css already defines its own
 * unrelated .grid utility (loaded on every page) - keeping the original
 * name would have silently collided with it.
 */

#gate,
#gallery,
#lightbox {
  --ink: #1C1A17;
  --bone: #EDE7DA;
  --amber: #C4842A;
  --olive: #5C5F4A;
  --rustgrey: #8A7F6E;
}

/* Hides the shared site header/footer chrome on this template only - the
   proofing gate/gallery is a standalone, full-viewport experience with no
   room designed for the site's own nav. get_header()/get_footer() are
   still called in page-proofing.php so wp_head()/wp_footer() keep firing;
   only the visible markup is hidden. Same technique page-portraits.php
   already uses for .site-footer. */
.page-template-page-proofing-php .site-header {
  display: none;
}

.page-template-page-proofing-php .site-footer {
  display: none;
}

.page-template-page-proofing-php body {
  background: var(--ink);
  color: var(--bone);
  font-family: 'Inter', sans-serif;
}

/* ---------- PASSWORD GATE ---------- */

#gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.6s ease;
}

#gate.unlocking {
  transform: translateX(-100%);
  opacity: 0;
}

#gate .frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 56px 40px;
  border-top: 1px solid var(--rustgrey);
  border-bottom: 1px solid var(--rustgrey);
}

#gate .sprockets {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}
#gate .sprockets.left { left: -18px; }
#gate .sprockets.right { right: -18px; }
#gate .sprockets span {
  display: block;
  width: 8px;
  height: 6px;
  background: var(--rustgrey);
  opacity: 0.5;
  margin: 0 auto;
}

#gate .gate-eyebrow {
  font-size: 13px;
  color: var(--rustgrey);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}

#gate .gate-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 34px;
  line-height: 1.15;
  color: var(--bone);
  margin-bottom: 8px;
}

#gate .gate-sub {
  font-size: 14px;
  color: var(--olive);
  margin-bottom: 36px;
  line-height: 1.5;
}

#gate .field-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#password-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rustgrey);
  color: var(--bone);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  padding: 10px 2px;
  outline: none;
  transition: border-color 0.2s ease;
}
#password-input::placeholder { color: var(--rustgrey); opacity: 0.7; }
#password-input:focus { border-color: var(--amber); }
#password-input:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }

#unlock-btn {
  margin-top: 22px;
  background: var(--amber);
  color: var(--ink);
  border: none;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}
#unlock-btn:hover { background: #d99745; }
#unlock-btn:focus-visible { outline: 2px solid var(--bone); outline-offset: 3px; }

#gate-error {
  margin-top: 16px;
  font-size: 13px;
  color: #c4602a;
  min-height: 18px;
}

/* ---------- GALLERY ---------- */

#gallery {
  display: none;
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 24px 100px;
}

#gallery.visible { display: block; }

#gallery .gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--rustgrey);
  padding-bottom: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
  gap: 16px;
}

#gallery .gallery-title {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 32px;
}

#gallery .gallery-meta {
  font-size: 13px;
  color: var(--olive);
  text-align: right;
}

.proofing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (max-width: 720px) {
  .proofing-grid { grid-template-columns: repeat(2, 1fr); }
}

.proofing-grid .plate {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: #2a2722;
}

.proofing-grid .plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 3 / 2;
  transition: opacity 0.3s ease;
}

.proofing-grid .plate:nth-child(3n+2) img { aspect-ratio: 2 / 3; }

.proofing-grid .plate .neg-number {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-size: 11px;
  color: var(--bone);
  background: rgba(28, 26, 23, 0.7);
  padding: 3px 7px;
  letter-spacing: 0.03em;
}

.proofing-grid .plate:hover img { opacity: 0.85; }

/* ---------- LIGHTBOX ---------- */

#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(12, 11, 9, 0.96);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
#lightbox.visible { display: flex; }

#lightbox img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

#lightbox-caption {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  color: var(--rustgrey);
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: none;
  border: none;
  color: var(--bone);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.lb-close { top: 28px; right: 32px; }
.lb-prev { left: 32px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lb-next { right: 32px; top: 50%; transform: translateY(-50%); font-size: 28px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  #gate { transition: none; }
  .proofing-grid .plate img, #unlock-btn { transition: none; }
}
