/* ============================================================
   CHANGSHA FRAMES — photos (the album)
   Reference "darkroom album" design (dark page).
   Requires <body class="theme-dark">. Lightbox 3D page-turn
   mechanics driven by photos.js are preserved.
   ============================================================ */

main { position: relative; z-index: 2; }

/* ---------- top bar ---------- */
.p-topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  padding: 22px 48px;
  border-bottom: 1px solid var(--d-line);
  position: sticky; top: 0; z-index: 100;
  background: var(--d-bg);
  transition: padding .3s ease, background-color .3s ease;
}
.p-topbar.scrolled {
  padding: 12px 48px;
  background: rgba(23, 19, 16, .96);
  backdrop-filter: blur(8px);
}
.p-brand { font-size: 17px; font-weight: 900; letter-spacing: .04em; }
.p-brand span { color: var(--d-amber); }
.p-links { display: flex; align-items: center; }
.p-links a {
  position: relative;
  margin-left: 34px;
  font-size: 13px; font-weight: bold;
  color: var(--d-muted);
  transition: color .25s ease;
}
.p-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px;
  width: 100%; height: 2px; background: var(--d-amber);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.p-links a:hover { color: var(--d-text); }
.p-links a:hover::after { transform: scaleX(1); }
.p-links a.on { color: var(--d-text); }
.p-links a.on::after { transform: scaleX(1); }

/* ---------- header ---------- */
.p-head { max-width: 1280px; margin: 0 auto; padding: 90px 48px 60px 48px; }
.p-labelrow {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.p-head-no { font-size: 13px; font-weight: bold; color: var(--d-muted); }
.p-titlerow { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; }
.p-title {
  font-size: clamp(52px, 9.5vw, 120px);
  font-weight: 900; line-height: 1;
}
.p-title em { font-style: normal; color: var(--d-amber); }
.p-title.breathe .ch { animation: p-breathe 5s ease-in-out infinite alternate; }
@keyframes p-breathe {
  from { transform: translateY(0); }
  to   { transform: translateY(-4px); }
}
.p-note { width: 300px; font-size: 13px; color: var(--d-muted); text-align: right; }
.p-sub {
  font-size: clamp(17px, 2vw, 22px);
  color: var(--d-muted); margin-top: 8px;
  display: flex; align-items: center; gap: 14px;
}
.p-sub::before {
  content: ""; width: 34px; height: 2px; background: var(--d-amber);
  flex: 0 0 auto;
}

/* marquee divider */
.p-marquee {
  border-top: 1px solid var(--d-line);
  border-bottom: 1px solid var(--d-line);
  padding: 12px 0;
  font-weight: 900; font-size: 14px; letter-spacing: .08em; text-transform: uppercase;
}
.p-marquee .marquee-track { gap: 34px; }
.p-marquee span { color: var(--d-muted); }
.p-marquee b { color: var(--d-amber); }

/* ---------- intro stats ---------- */
.p-intro { max-width: 1280px; margin: 0 auto; padding: 30px 48px 70px 48px; }
.p-intro h2 { font-size: clamp(28px, 3vw, 34px); font-weight: 900; margin-bottom: 44px; }
.p-stats { display: flex; gap: 60px; }
.p-stat { width: 33%; }
.p-stat b {
  display: block;
  font-size: clamp(42px, 4.5vw, 54px);
  font-weight: 900; line-height: 1.1;
  color: var(--d-amber);
  font-variant-numeric: tabular-nums;
}
.p-stat-label { display: block; font-size: 15px; font-weight: bold; margin-top: 8px; }
.p-stat p { font-size: 13px; color: var(--d-muted); margin-top: 8px; }

/* ---------- banner ---------- */
.p-banner { max-width: 1280px; margin: 0 auto; padding: 0 48px 30px 48px; }
.p-banner figure {
  position: relative; height: 470px;
  border-radius: 26px; overflow: hidden;
}
.p-banner figure::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 8, 6, .65) 100%);
  pointer-events: none;
}
.p-banner img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.p-banner figure:hover img { transform: scale(1.04); }
.p-banner figcaption {
  position: absolute; left: 40px; right: 40px; bottom: 36px; z-index: 2;
  color: var(--cream-2); font-size: clamp(17px, 2vw, 22px); font-weight: 900;
  text-shadow: 1px 1px 10px rgba(20, 15, 10, .8);
  opacity: 0; transform: translateY(14px);
  animation: banner-cap-in .9s var(--ease-out) 1s both;
}
@keyframes banner-cap-in { to { opacity: 1; transform: none; } }

/* ---------- album (masonry) ---------- */
.p-album { max-width: 1280px; margin: 0 auto; padding: 40px 48px 100px 48px; }
.p-album-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  margin-bottom: 28px;
}
.p-album-hint {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--d-muted);
}
.p-grid { column-count: 3; column-gap: 28px; }

/* ---------- film card ---------- */
.p-card {
  break-inside: avoid;
  margin-bottom: 28px;
  background: var(--d-card);
  border: 1px solid var(--d-line);
  border-radius: 16px; overflow: hidden;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.p-card:hover {
  transform: translateY(-8px) rotate(-.4deg);
  border-color: rgba(232, 161, 92, .55);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .55);
}
.p-card:focus-visible { outline: 3px solid var(--d-amber); outline-offset: 3px; }
.film-frame { display: block; cursor: zoom-in; }
.holes {
  display: block; height: 18px;
  background-image: radial-gradient(circle 4px at 50% 50%, var(--d-hole) 3.6px, transparent 4.4px);
  background-size: 30px 18px; background-position: center; background-repeat: repeat-x;
  transition: background-image .35s ease;
}
.p-card:hover .holes {
  background-image: radial-gradient(circle 4px at 50% 50%, var(--d-amber) 3.6px, transparent 4.4px);
}
.ph { position: relative; overflow: hidden; }
.ph img {
  width: 100%; height: 340px; object-fit: cover;
  transition: transform .6s ease, filter .6s ease;
}
.p-card.h-s .ph img { height: 270px; }
.p-card.h-m .ph img { height: 360px; }
.p-card.h-l .ph img { height: 450px; }
.p-card:hover .ph img { transform: scale(1.05); filter: brightness(1.08); }
.p-num {
  position: absolute; top: 10px; left: 12px; z-index: 2;
  background: rgba(10, 8, 6, .65); color: var(--d-amber);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em;
  padding: 4px 10px; border-radius: 999px;
}
.p-card figcaption { padding: 16px 20px 18px 20px; }
.p-card figcaption b { display: block; font-size: 17px; font-weight: 900; color: var(--cream-2); }
.p-card figcaption span {
  font-size: 11px; font-weight: bold; letter-spacing: 2px; text-transform: uppercase;
  color: var(--d-amber);
}

/* ---------- lightbox (JS-driven, 3D page-turn) ---------- */
.lb {
  position: fixed; inset: 0; z-index: 2500;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .45s var(--ease-out), visibility 0s linear .45s;
}
.lb:target { opacity: 1; visibility: visible; transition: opacity .45s var(--ease-out); }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 8, 6, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.lb-fig {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; margin: 0; max-width: 92vw;
  perspective: 1200px;
}
.lb-frame {
  display: flex; flex-direction: column;
  background: var(--d-card);
  border: 1px solid var(--d-line);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .9);
  transform: scale(.94);
  filter: brightness(.35) sepia(.6) saturate(.5);
  transition: transform .7s var(--ease-out), filter .9s var(--ease-out);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.lb:target .lb-frame { transform: none; filter: none; }
.lb-img {
  max-width: 90vw; max-height: 74vh;
  width: auto; height: auto;
  object-fit: contain;
}
.lb-cap {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--d-muted); text-align: center;
  padding: 0 16px;
  transition: opacity .34s var(--ease-out) .08s;
}
.lb-cap.cap-out { opacity: 0; }
.lb-cap b { color: var(--d-amber); font-weight: 400; }
.lb-btn {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 3;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  background: transparent; color: var(--d-text);
  border: 1px solid var(--d-line); border-radius: 999px;
  padding: 14px 20px; cursor: pointer;
  transition: color .3s, background .3s, border-color .3s, transform .2s;
}
.lb-btn:hover { background: var(--d-amber); border-color: var(--d-amber); color: var(--d-bg); }
.lb-btn:active { transform: translateY(-50%) scale(.95); }
.lb-prev { left: 4vw; }
.lb-next { right: 4vw; }
.lb-close {
  position: fixed; top: 24px; right: 4.5vw; z-index: 3;
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: .22em; text-transform: uppercase;
  background: transparent; color: var(--d-muted);
  border: 1px solid var(--d-line); border-radius: 999px;
  padding: 12px 18px; cursor: pointer;
  transition: color .3s, border-color .3s;
}
.lb-close:hover { color: var(--d-amber); border-color: var(--d-amber); }

/* ---------- footer ---------- */
.p-footer {
  border-top: 1px solid var(--d-line);
  padding: 70px 48px 40px 48px;
  position: relative; z-index: 2;
}
.p-foot-name {
  font-size: clamp(38px, 6vw, 72px);
  font-weight: 900; line-height: 1.1;
}
.p-foot-name em { font-style: normal; color: var(--d-amber); }
.p-foot-row {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 12px 30px;
  margin-top: 30px; padding-top: 24px;
  border-top: 1px dashed var(--d-line);
  font-size: 13px; color: var(--d-muted);
}
.p-foot-row a { color: var(--d-amber); font-weight: bold; transition: color .25s ease; }
.p-foot-row a:hover { color: var(--d-text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .p-grid { column-count: 2; }
}

@media (max-width: 900px) {
  .p-topbar { padding: 16px 20px; }
  .p-topbar.scrolled { padding: 12px 20px; }
  .p-brand { font-size: 15px; }
  .p-links { display: none; }
  .p-head { padding: 60px 20px 40px 20px; }
  .p-titlerow { flex-direction: column; align-items: flex-start; gap: 18px; }
  .p-note { display: none; }
  .p-intro { padding: 10px 20px 50px 20px; }
  .p-stats { flex-direction: column; gap: 26px; }
  .p-stat { width: 100%; }
  .p-banner { padding: 0 20px 20px 20px; }
  .p-banner figure { height: 300px; }
  .p-banner figcaption { left: 24px; right: 24px; bottom: 24px; }
  .p-album { padding: 30px 20px 70px 20px; }
  .p-grid { column-count: 1; }
  .p-card.h-s .ph img, .p-card.h-m .ph img, .p-card.h-l .ph img, .ph img { height: 320px; }
  .lb-img { max-width: 94vw; max-height: 62vh; }
  .lb-btn { top: auto; bottom: 20px; transform: none; padding: 10px 16px; }
  .lb-btn:active { transform: scale(.95); }
  .lb-prev { left: 20px; }
  .lb-next { right: 20px; }
  .p-footer { padding: 50px 20px 30px 20px; }
  .p-foot-row { flex-direction: column; gap: 10px; align-items: flex-start; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .p-title.breathe .ch { animation: none !important; }
  .lb-frame, .lb-frame.turn { transition-duration: .01s !important; }
}

/* ---------- pure CSS: no-JS replacements ---------- */

/* film frames are now plain anchors */
.film-frame { text-decoration: none; color: inherit; }

/* reduced-motion cleanup for JS-era classes is no longer needed */
@media (prefers-reduced-motion: reduce) {
  .p-banner figcaption { animation: none; opacity: 1; transform: none; }
}
