/* ============================================================
   个人摄影作品集 · 样式
   设计方向：摄影杂志 / 编辑排版
   ============================================================ */

/* ---------- 字体（自托管，无第三方请求） ---------- */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
  --bg: #f7f5f1;            /* 微暖纸白 */
  --bg-soft: #efebe4;
  --ink: #171512;           /* 墨黑 */
  --ink-soft: #3d3933;
  --muted: #7d766b;
  --line: #e3ddd2;
  --line-strong: #d3ccc0;
  --accent: #a34a2b;        /* 陶土色，极少使用 */
  --figure-bg: #eae6de;

  --serif: "Fraunces", "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --pad: clamp(20px, 5vw, 56px);
  --maxw: 1440px;
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 排版 ---------- */
.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-title {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-top: 0.4rem;
}
.page-title {
  font-family: var(--serif);
  font-weight: 460;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0.35em 0 0.35em;
}

/* ---------- 头部 / 导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 520;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: clamp(20px, 3vw, 36px); }
.site-nav a {
  font-size: 0.86rem; letter-spacing: 0.06em; color: var(--ink-soft);
  position: relative; padding: 4px 0;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); }

.nav-toggle { display: none; position: relative; z-index: 60; width: 40px; height: 40px;
  align-items: center; justify-content: center; }
.nav-toggle span {
  display: block; width: 20px; height: 1.5px; background: var(--ink);
  position: absolute; transition: transform 0.3s var(--ease);
}
.nav-toggle span:first-child { transform: translateY(-4px); }
.nav-toggle span:last-child { transform: translateY(4px); }
body.nav-open .nav-toggle span:first-child { transform: translateY(0) rotate(45deg); }
body.nav-open .nav-toggle span:last-child { transform: translateY(0) rotate(-45deg); }

@media (max-width: 719px) {
  .js .nav-toggle { display: flex; }
  .js .site-nav {
    position: fixed; inset: 0; z-index: 55;
    background: var(--bg);
    flex-direction: column; justify-content: center; gap: 6px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  .js .site-nav a { font-family: var(--serif); font-size: 2rem; letter-spacing: 0; padding: 12px 0; }
  .js .site-nav a::after { display: none; }
  body.nav-open .site-nav { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }
}

/* ---------- 首页主视觉（左右分栏，竖图不裁切） ---------- */
.hero--split { border-bottom: 1px solid var(--line); }
.hero-split {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 48px);
  padding-block: clamp(32px, 6vh, 72px);
}
.hero-copy { max-width: 560px; }
.hero-copy .kicker { color: var(--muted); }
.hero-name {
  font-family: var(--serif); font-weight: 460;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 1.04; letter-spacing: -0.015em;
  margin: 0.3em 0 0.2em;
}
.hero-tagline { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--ink-soft); letter-spacing: 0.02em; }
.hero-media { display: flex; align-items: center; justify-content: center; }
.hero-media img {
  width: auto; height: auto;
  max-width: 100%;
  max-height: min(78vh, 900px);
}
@media (min-width: 720px) {
  .hero-split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(40px, 7vw, 110px);
    min-height: min(80vh, 900px);
  }
  .hero-media { justify-content: flex-end; min-height: min(80vh, 900px); }
  .hero-media img { max-height: min(80vh, 900px); }
}

/* ---------- 分节标题 ---------- */
.section { padding-block: clamp(56px, 10vh, 120px); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin-bottom: clamp(28px, 5vw, 56px);
}
.section-link {
  font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink-soft);
  padding-bottom: 4px; border-bottom: 1px solid var(--line-strong);
  transition: color 0.3s, border-color 0.3s; white-space: nowrap;
}
.section-link:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 首页编辑式排版（依据 data/photos.json 的 home 版面） ---------- */
.spread { margin-bottom: clamp(56px, 10vh, 140px); }
.spread-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: clamp(16px, 3vw, 28px);
}
.spread-body {
  display: flex;
  align-items: flex-start;
  gap: clamp(14px, 3vw, 40px);
}
.spread-item { min-width: 0; }
.spread--lead .spread-item { width: 100%; }
.spread--duo .spread-item { flex: 1 1 0; }
.spread--duo .spread-item:nth-child(even) { margin-top: clamp(28px, 6vw, 130px); }
.spread--trio .spread-item { flex: 1 1 0; }
.spread--pair .spread-item:first-child { flex: 1.63 1 0; }
.spread--pair .spread-item:last-child { flex: 1 1 0; margin-top: clamp(48px, 9vw, 150px); }
.spread--strip .spread-body { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.spread--strip .spread-item { flex: 0 0 21%; min-width: 120px; }
.spread--full .spread-item { width: 100%; }

.spread-open { display: block; width: 100%; padding: 0; background: var(--figure-bg); }
.spread-open img { width: 100%; height: auto; transition: transform 0.8s var(--ease); }
.spread-open:hover img { transform: scale(1.02); }

@media (min-width: 720px) {
  .spread--lead .spread-body { justify-content: center; }
  .spread--lead .spread-item { width: min(56%, 640px); }
  .spread--trio .spread-body { gap: clamp(12px, 2.5vw, 32px); }
}

/* ---------- 作品页 · 系列索引（卡片） ---------- */
.gallery-head { padding-block: clamp(40px, 7vh, 80px) clamp(20px, 4vh, 44px); }
.gallery-count { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.04em; }
.gallery-body { padding-bottom: clamp(48px, 9vh, 96px); }

.series-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(20px, 4vw, 48px);
}
@media (min-width: 720px) { .series-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1120px) { .series-grid { grid-template-columns: repeat(4, 1fr); } }

.series-card { display: block; }
.series-cover {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--figure-bg);
}
.series-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.series-card:hover .series-cover img { transform: scale(1.04); }
.series-cover--all {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.series-meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-top: 12px;
}
.series-name { font-family: var(--serif); font-weight: 460; font-size: 1.05rem; }
.series-count { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }

/* ---------- 作品页 · 系列详情 / 全部（简洁瀑布流） ---------- */
.back-link {
  display: inline-block;
  font-size: 0.85rem; letter-spacing: 0.04em; color: var(--ink-soft);
  margin-bottom: clamp(20px, 4vh, 36px);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
}
.back-link:hover { color: var(--accent); border-color: var(--accent); }
.series-title {
  font-family: var(--serif); font-weight: 460;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: clamp(24px, 4vh, 40px);
}

.gallery-masonry { column-count: 1; column-gap: clamp(18px, 3vw, 40px); }
@media (min-width: 640px) { .gallery-masonry { column-count: 2; } }
@media (min-width: 1120px) { .gallery-masonry { column-count: 3; } }

.gallery-item { break-inside: avoid; margin: 0 0 clamp(20px, 3.5vw, 48px); }
.gallery-open { display: block; width: 100%; padding: 0; background: var(--figure-bg); }
.gallery-open img { width: 100%; height: auto; transition: transform 0.8s var(--ease); }
.gallery-open:hover img { transform: scale(1.02); }

.all-group { margin-bottom: clamp(48px, 8vh, 96px); }
.all-group-title {
  font-family: var(--serif); font-weight: 460;
  font-size: 1.15rem;
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 12px; margin-bottom: clamp(20px, 4vh, 36px);
  border-bottom: 1px solid var(--line);
}
.all-group-title .series-count { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }

.gallery-empty { padding: 40px 0; color: var(--muted); }

/* ---------- 大图灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(13, 12, 10, 0.97);
  visibility: hidden; opacity: 0; pointer-events: none;
  transition: opacity 0.32s var(--ease), visibility 0.32s;
}
.lightbox.is-open { visibility: visible; opacity: 1; pointer-events: auto; }
body.lb-open { overflow: hidden; }

.lb-figure {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(56px, 9vh, 88px) clamp(16px, 8vw, 120px);
}
.lb-img {
  max-width: 100%; max-height: calc(100vh - 150px);
  width: auto; height: auto; object-fit: contain;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.lb-cap {
  margin-top: 18px; color: rgba(255, 255, 255, 0.78);
  display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; justify-content: center;
  font-size: 0.82rem; letter-spacing: 0.02em;
}
.lb-cap .lb-count { font-family: var(--serif); color: rgba(255, 255, 255, 0.55); }
.lb-cap .lb-title { color: rgba(255, 255, 255, 0.85); }
.lb-cap .lb-tags { color: rgba(255, 255, 255, 0.5); }

.lb-btn {
  position: absolute; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, 0.85); transition: color 0.2s;
}
.lb-btn:hover { color: #fff; }
.lb-close { top: 14px; right: 16px; width: 48px; height: 48px; }
.lb-close svg { width: 24px; height: 24px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; }
.lb-prev svg, .lb-next svg { width: 30px; height: 30px; }

@media (max-width: 640px) {
  .lb-img { max-height: calc(100vh - 190px); }
  .lb-prev { left: 0; }
  .lb-next { right: 0; }
}

/* ---------- 关于 / 联系 ---------- */
.page { padding-block: clamp(24px, 6vh, 64px); }
.prose { max-width: 620px; color: var(--ink-soft); font-size: 1.02rem; }
.prose p + p { margin-top: 0.8em; }
.prose .placeholder { color: var(--muted); font-style: italic; }

.cat-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.cat-list li {
  font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-soft);
  padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
}

.equipment { margin-top: clamp(32px, 6vh, 56px); }
.equipment h2 { font-family: var(--serif); font-weight: 460; font-size: 1.4rem; margin-bottom: 4px; }
.equipment h3 { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.equipment ul { list-style: none; }
.equipment li { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.75; }

.contact { margin-top: clamp(40px, 8vh, 72px); padding-top: 32px; border-top: 1px solid var(--line); }
.contact h2 { font-family: var(--serif); font-weight: 460; font-size: 1.4rem; margin-bottom: 14px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px 36px; }
.contact-row a, .contact-row .pending { font-size: 0.95rem; color: var(--ink-soft); }
.contact-row a { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.contact-row a:hover { color: var(--accent); border-color: var(--accent); }
.contact-row .pending { color: var(--muted); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(40px, 7vh, 72px); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 24px 48px;
  align-items: flex-start; justify-content: space-between;
}
.site-footer .brand { font-size: 1.1rem; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.footer-contact a { color: var(--ink-soft); border-bottom: 1px solid transparent; }
.footer-contact a:hover { color: var(--accent); border-color: var(--accent); }
.footer-contact .pending { color: var(--muted); }
.site-footer small { display: block; margin-top: 32px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.02em; }

/* ---------- 404 ---------- */
.error-page { min-height: 68vh; display: flex; flex-direction: column; justify-content: center; }
.error-code {
  font-family: var(--serif); font-size: clamp(5rem, 18vw, 12rem);
  line-height: 1; letter-spacing: -0.02em;
}
.error-page p { color: var(--ink-soft); margin: 16px 0 28px; }
.error-page .section-link { display: inline-block; }

/* ---------- 滚动显现 ---------- */
.js [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001s !important; animation-duration: 0.001s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
