/* =========================================================
   妍序設計 YANXU DESIGN — 🔒 LOCKED: Works accordion + Lightbox
   Copied verbatim from the original site. Do not alter behaviour.
   ========================================================= */

/* ---- Works 展開式面板（Accordion）---- */
.works-acc { display: flex; gap: 10px; height: clamp(440px, 62vh, 620px); }
.acc-panel {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-radius: 4px;
  cursor: pointer; transition: flex-grow .65s var(--ease), box-shadow .6s var(--ease);
  background: var(--c-navy-deep);
  box-shadow: 0 18px 40px -26px rgba(40,32,24,.5);
}
.acc-panel.active { flex-grow: 3; box-shadow: 0 30px 64px -28px rgba(40,32,24,.6); }
.acc-panel__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease), filter .6s var(--ease); }
.acc-panel:not(.active) .acc-panel__bg { filter: grayscale(.35) brightness(.62); transform: scale(1.06); }
.acc-panel::after { content: ""; position: absolute; inset: 0; transition: background .6s var(--ease);
  background: linear-gradient(180deg, rgba(40,32,24,.12) 28%, rgba(40,32,24,.82) 100%); }
.acc-panel:not(.active)::after { background: linear-gradient(180deg, rgba(40,32,24,.5), rgba(40,32,24,.78)); }

.acc-panel__label {
  position: absolute; left: 50%; bottom: 1.7rem; transform: translateX(-50%);
  writing-mode: vertical-rl; font-family: var(--f-serif); font-size: 1.12rem;
  letter-spacing: .34em; color: #fff; white-space: nowrap; z-index: 2;
  transition: opacity .35s var(--ease); text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
.acc-panel.active .acc-panel__label { opacity: 0; pointer-events: none; }

.acc-panel__full {
  position: absolute; inset: auto 0 0 0; z-index: 2; padding: clamp(1.5rem, 2.6vw, 2.6rem);
  color: #fff; opacity: 0; transform: translateY(16px);
  transition: opacity .5s .25s var(--ease), transform .6s .25s var(--ease); pointer-events: none;
}
.acc-panel.active .acc-panel__full { opacity: 1; transform: none; pointer-events: auto; }
.acc-panel__index { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.9rem,3vw,2.7rem); color: var(--c-accent-soft); line-height: 1; font-variant-numeric: lining-nums; }
.acc-panel__title { font-family: var(--f-serif); font-size: clamp(1.5rem,2.6vw,2.1rem); letter-spacing: .05em; margin: .15rem 0 .7rem; color: #fff; }
.acc-panel__meta { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.68); margin-bottom: .8rem; }
.acc-panel__desc { color: rgba(255,255,255,.84); max-width: 46ch; margin-bottom: 1.3rem; font-size: .95rem; word-break: keep-all; }
.acc-cta { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: #fff; border-bottom: 1px solid rgba(255,255,255,.5); padding-bottom: 4px; }
.acc-cta span { transition: transform .4s var(--ease); }
.acc-panel:hover .acc-cta span { transform: translateX(5px); }

/* =========================================================
   Lightbox
   ========================================================= */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(32,26,20,.96); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: none; }
.lightbox.open { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: 4.5rem clamp(1rem,5vw,4rem) 1.6rem; }
.lb-img { max-width: 90vw; max-height: 64vh; object-fit: contain; opacity: 1; transition: opacity .35s var(--ease); box-shadow: 0 30px 80px rgba(0,0,0,.5); border-radius: 2px; }
.lb-btn { position: absolute; color: #fff; font-size: 2rem; width: 54px; height: 54px; display: flex; align-items: center; justify-content: center; opacity: .65; transition: opacity .3s, background .3s; border-radius: 50%; z-index: 2; }
.lb-btn:hover { opacity: 1; background: rgba(255,255,255,.08); }
.lb-close { top: 1.4rem; right: 1.6rem; }
.lb-prev { left: clamp(.4rem,2vw,1.5rem); top: 50%; transform: translateY(-50%); }
.lb-next { right: clamp(.4rem,2vw,1.5rem); top: 50%; transform: translateY(-50%); }
.lb-caption { text-align: center; color: rgba(255,255,255,.82); font-family: var(--f-mono); font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; }
.lb-thumbs { display: flex; gap: .5rem; max-width: 92vw; overflow-x: auto; padding: .3rem .2rem; scrollbar-width: thin; }
.lb-thumbs::-webkit-scrollbar { height: 5px; }
.lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 3px; }
.lb-thumb { width: 70px; height: 50px; object-fit: cover; flex: none; opacity: .42; cursor: pointer; border-radius: 2px; transition: opacity .3s var(--ease), outline-color .3s var(--ease); outline: 1.5px solid transparent; outline-offset: 2px; }
.lb-thumb:hover { opacity: .8; }
.lb-thumb.active { opacity: 1; outline-color: var(--c-accent-soft); }

/* ---- Works RWD (≤880px)：直向堆疊、全部展開（locked behaviour） ---- */
@media (max-width: 880px) {
  .works-acc { flex-direction: column; height: auto; gap: 14px; }
  .acc-panel, .acc-panel.active { flex: none; height: 360px; }
  .acc-panel__bg, .acc-panel:not(.active) .acc-panel__bg { filter: none; transform: none; }
  .acc-panel::after, .acc-panel:not(.active)::after { background: linear-gradient(180deg, rgba(40,32,24,.1) 22%, rgba(40,32,24,.8)); }
  .acc-panel__label { display: none; }
  .acc-panel__full { opacity: 1; transform: none; pointer-events: auto; }
}
