/* ===========================================================
   栖光集 · 行迹（旅行影像）— gallery.css
   沿用 style.css 的变量体系：暖米白 / 墨黑 / 黄铜金
   =========================================================== */

/* ---------- Hero ---------- */
.gal-hero { padding: 110px 0 72px; border-bottom: 1px solid var(--line); }
.gal-hero .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 60px; align-items: center; }
.gal-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); line-height: 1.14; margin: 14px 0 20px; }
.gal-hero h1 em { font-style: italic; color: var(--brass); font-weight: 300; }
.gal-hero .lead { font-size: 1.05rem; color: var(--muted); max-width: 460px; line-height: 1.85; }

.gal-hero-art {
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--quote-bg);
}
.gal-hero-art img { width: 100%; height: 100%; object-fit: cover; }

.gal-hero .hero-meta { margin-top: 34px; display: flex; gap: 30px; font-size: .85rem; color: var(--muted); letter-spacing: .04em; }
.gal-hero .hero-meta strong { color: var(--ink); display: block; font-size: 1.5rem; font-family: var(--serif); }

@media (max-width: 880px) {
  .gal-hero { padding: 68px 0 48px; }
  .gal-hero .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .gal-hero-art { aspect-ratio: 16 / 11; }
}

/* ---------- 筛选栏（吸顶） ---------- */
.gal-filter {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 245, 240, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.gal-filter-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 32px;
  display: flex; gap: 9px; align-items: center; overflow-x: auto;
  scrollbar-width: none;
}
.gal-filter-inner::-webkit-scrollbar { display: none; }
.gal-chip {
  flex: 0 0 auto;
  font-size: .84rem; letter-spacing: .04em;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted); background: transparent;
  transition: all .25s ease; white-space: nowrap;
}
.gal-chip:hover { color: var(--brass); border-color: var(--brass); }
.gal-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.gal-chip .n { opacity: .55; margin-left: 6px; font-size: .78em; }
@media (max-width: 720px) { .gal-filter-inner { padding: 12px 20px; } }

/* ---------- 分组 ---------- */
.gal-group { padding: 64px 0 0; scroll-margin-top: 76px; }
.gal-group[hidden] { display: none; }
.gal-group-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding-bottom: 14px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.gal-group-head h2 { margin: 0; font-size: 1.6rem; }
.gal-group-head .cnt { font-size: .82rem; color: var(--muted); letter-spacing: .06em; }
.gal-group-head .sub { margin-left: auto; font-size: .82rem; color: var(--muted); }
.gal-group-blurb { color: var(--muted); font-size: .92rem; margin: 14px 0 26px; max-width: 620px; }

/* ---------- 照片网格 ---------- */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 26px 22px;
}
@media (max-width: 620px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
}
@media (max-width: 360px) {
  .gal-grid { grid-template-columns: 1fr; }
}

.gal-card {
  display: block; cursor: pointer;
  opacity: 0; transform: translateY(14px);
  transition: opacity .7s ease, transform .7s ease;
}
.gal-card.in { opacity: 1; transform: none; }

.gal-frame {
  position: relative; overflow: hidden;
  border-radius: var(--r-md);
  background: var(--quote-bg);
  aspect-ratio: 4 / 3;
}
.gal-frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .3, 1);
}
.gal-card:hover .gal-frame img { transform: scale(1.045); }
.gal-frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,28,28,0) 55%, rgba(28,28,28,.28) 100%);
  opacity: 0; transition: opacity .4s ease;
}
.gal-card:hover .gal-frame::after { opacity: 1; }

.gal-year {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  font-size: .7rem; letter-spacing: .12em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(248, 245, 240, .9); color: var(--ink);
  backdrop-filter: blur(6px);
}
.gal-cap { padding: 11px 2px 0; }
.gal-cap .t { font-size: .95rem; color: var(--ink); line-height: 1.45; }
.gal-cap .p { font-size: .78rem; color: var(--muted); letter-spacing: .04em; margin-top: 3px; }
.gal-cap .c { font-size: .8rem; color: var(--muted); margin-top: 5px; font-style: italic; }

@media (max-width: 620px) {
  .gal-cap .t { font-size: .86rem; }
  .gal-cap .p { font-size: .72rem; }
}

/* ---------- 灯箱 ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 19, 17, .96);
  display: none; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .32s ease;
}
.lb.open { display: flex; opacity: 1; }
.lb-inner {
  position: relative; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 56px 72px;
}
.lb img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 3px;
  opacity: 0; transform: scale(.985);
  transition: opacity .35s ease, transform .35s ease;
}
.lb img.ready { opacity: 1; transform: none; }

.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 28px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: #EDE7DC; font-size: .86rem; letter-spacing: .04em;
  background: linear-gradient(0deg, rgba(20,19,17,.85), rgba(20,19,17,0));
}
.lb-bar .who { font-family: var(--serif); font-size: 1.05rem; }
.lb-bar .who small { display: block; font-family: var(--sans); font-size: .76rem; color: #A79E90; letter-spacing: .08em; margin-top: 3px; }
.lb-bar .idx { color: #A79E90; font-variant-numeric: tabular-nums; }

.lb-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #EDE7DC; background: rgba(255,255,255,.07);
  transition: background .25s ease;
}
.lb-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-close {
  position: absolute; top: 16px; right: 18px;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #EDE7DC; background: rgba(255,255,255,.07);
  font-size: 1.1rem; line-height: 1;
}
.lb-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.lb-loading {
  position: absolute; color: #A79E90; font-size: .8rem; letter-spacing: .2em;
}

@media (max-width: 720px) {
  .lb-inner { padding: 48px 12px 84px; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-prev { left: 6px; }
  .lb-next { right: 6px; }
  .lb-bar { padding: 16px 18px 20px; }
}

/* ---------- 尾部扩展说明 ---------- */
.gal-note {
  margin: 88px 0 20px; padding: 34px 30px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--bg-elev);
}
.gal-note h3 { font-size: 1.15rem; margin: 0 0 10px; }
.gal-note p { font-size: .88rem; color: var(--muted); margin: 0 0 12px; }
.gal-note code {
  font-family: var(--mono); font-size: .82rem;
  background: var(--quote-bg); padding: 2px 6px; border-radius: 4px; color: var(--ink-soft);
}
.gal-note pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  background: var(--quote-bg); border-radius: var(--r-md);
  font-family: var(--mono); font-size: .8rem; line-height: 1.7; color: var(--ink-soft);
}

/* ---------- 空状态 ---------- */
.gal-empty { padding: 80px 0; text-align: center; color: var(--muted); }
