/* =========================================================
   p02 갤러리 사진&영상 / p02b 갤러리 상세 공통 컴포넌트
   ========================================================= */

/* 소형 원형 화살표 (shelf) */
.arrow-btn { width: 44px; height: 44px; border-radius: 9999px; display: grid; place-items: center; background: #f2f1ed; color: var(--text); font-size: 16px; transition: background .2s, color .2s, opacity .2s; }
.arrow-btn:hover:not(:disabled) { background: var(--blue); color: #fff; }
.arrow-btn:disabled { opacity: .4; cursor: default; }
.arrow-btn.is-white { background: #fff; border: 1px solid var(--border); }

/* 사진 위 버튼 */
.btn-photo { display: inline-flex; align-items: center; height: 44px; padding: 0 24px; border-radius: 9999px; background: #fff; color: var(--text); font-size: 15px; font-weight: 500; border: 1px solid #fff; transition: background .2s, color .2s; }
.btn-photo:hover { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-photo.is-outline { background: transparent; color: #fff; }
.btn-photo.is-outline:hover { background: #fff; color: var(--text); }

/* ---------- intro ---------- */
.gl-intro { padding: 120px 0 56px; text-align: center; }
.gl-intro__title { font-family: var(--font-en); font-weight: 400; font-size: 52px; line-height: 1.3; }
.gl-intro__sub { margin-top: 16px; font-size: 20px; color: var(--muted); }
.gl-cats { margin-top: 48px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.gl-cat { height: 56px; padding: 0 28px; border: 1px solid var(--border); background: #fff; font-size: 16px; color: var(--text); transition: background .2s, color .2s, border-color .2s; }
.gl-cat:hover { border-color: var(--blue); color: var(--blue); }
.gl-cat.is-active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ---------- toolbar ---------- */
.gl-toolbar { padding-bottom: 40px; }
.gl-toolbar .inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.gl-count { font-weight: 600; }
.gl-count b { color: var(--blue); font-weight: 600; }
.search { display: flex; gap: 8px; }
.search input { width: 240px; height: 44px; padding: 0 12px; border: 1px solid var(--border); font: inherit; font-size: 16px; color: var(--text); background: #fff; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--blue); }
.search button { height: 44px; padding: 0 16px; background: var(--blue); color: #fff; font-weight: 600; transition: background .2s; }
.search button:hover { background: var(--navy); }

/* ---------- full-bleed photo band ---------- */
.photo-band { position: relative; height: 860px; display: flex; align-items: flex-end; padding-bottom: 56px; color: #fff; background: var(--navy) center/cover no-repeat; overflow: hidden; }
.photo-band::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 340px; background: linear-gradient(180deg, rgba(29,34,36,0), rgba(29,34,36,.72)); }
.photo-band .inner { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.photo-band__cat { font-size: 15px; font-weight: 500; }
.photo-band__title { margin-top: 6px; font-size: 36px; font-weight: 700; line-height: 1.3; }
.photo-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-band__play { position: absolute; left: 50%; top: 50%; width: 88px; height: 88px; margin: -44px 0 0 -44px; border-radius: 9999px; background: #fff; color: var(--blue); display: grid; place-items: center; font-size: 30px; transition: transform .25s, background .25s, color .25s; }
.photo-band__play .icon { margin-left: 4px; }
.photo-band__play:hover { transform: scale(1.08); background: var(--blue); color: #fff; }

/* ---------- shelf (가로 카드 캐러셀) ---------- */
.shelf { padding: 90px 0; }
.shelf--sand { background: var(--sand); }
.shelf__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.shelf__title { font-size: 36px; font-weight: 700; line-height: 1.3; }
.shelf__sub { margin-top: 8px; color: var(--muted); }
.shelf__actions { display: flex; align-items: center; gap: 16px; flex: none; }
.shelf__arrows { display: flex; gap: 8px; }
.shelf__viewport { margin-top: 32px; padding-left: max(var(--gutter), calc((100vw - var(--inner)) / 2)); overflow-x: auto; scrollbar-width: none; scroll-snap-type: x mandatory; scroll-padding-left: max(var(--gutter), calc((100vw - var(--inner)) / 2)); cursor: grab; }
.shelf__viewport::-webkit-scrollbar { display: none; }
.shelf__viewport.is-drag { cursor: grabbing; scroll-snap-type: none; }
.shelf__track { display: flex; gap: 24px; width: max-content; padding-right: var(--gutter); }
.shelf-card { width: 404px; flex: none; scroll-snap-align: start; }
.shelf-card a { display: block; }
.shelf-card__img { height: 300px; overflow: hidden; background: var(--sand); }
.shelf-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s; pointer-events: none; }
.shelf-card a:hover .shelf-card__img img { transform: scale(1.05); }
.shelf-card__cap { margin-top: 14px; }
.shelf-card__cap strong { display: block; font-size: 16px; font-weight: 600; line-height: 1.6; }
.shelf-card__cap span { display: block; margin-top: 2px; color: var(--muted); line-height: 1.6; }
.shelf--lg .shelf-card { width: 560px; }
.shelf--lg .shelf-card__img { height: 400px; }

/* ---------- surroundings ---------- */
.gl-around { padding: 90px 0; background: var(--sand); }
.gl-around .inner { display: grid; grid-template-columns: 480px 1fr; gap: 36px; align-items: center; }
.gl-around .btn-line { margin-top: 24px; height: 44px; padding: 0 24px; }
.gl-around__imgs { justify-self: end; display: grid; grid-template-columns: repeat(2, 360px); gap: 24px; }
.gl-around .shelf-card { width: auto; }
.gl-around .shelf-card__img { height: 440px; }

/* ---------- 필터 결과 그리드 ---------- */
.gl-result { padding: 0 0 120px; }
.gl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 24px; }
.gl-grid .shelf-card { width: auto; }
.gl-grid .shelf-card__img { height: auto; aspect-ratio: 404/300; position: relative; }
.gl-grid .is-video .shelf-card__img::after { content: ""; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M6 3.5v11l9-5.5z' fill='%2305507d'/%3E%3C/svg%3E") 56% 50%/24px no-repeat; }
.gl-empty { padding: 80px 0; text-align: center; color: var(--muted); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.gl-empty strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 8px; }


/* ---------- responsive ---------- */
@media (max-width: 1420px) {
  .photo-band { height: 720px; }
  .gl-around .inner { grid-template-columns: 1fr 1.6fr; }
  .gl-around__imgs { grid-template-columns: repeat(2, 1fr); width: 100%; }
}
@media (max-width: 1023px) {
  .gl-intro { padding: 80px 0 40px; }
  .gl-intro__title { font-size: 40px; }
  .gl-cat { height: 48px; padding: 0 20px; }
  .photo-band { height: 560px; padding-bottom: 40px; }
  .photo-band .inner { flex-direction: column; align-items: flex-start; }
  .shelf, .gl-around { padding: var(--sec-pad-s) 0; }
  .shelf__title { font-size: 30px; }
  .shelf-card { width: 320px; }
  .shelf-card__img { height: 240px; }
  .shelf--lg .shelf-card { width: 420px; }
  .shelf--lg .shelf-card__img { height: 300px; }
  .gl-around .inner { grid-template-columns: 1fr; }
  .gl-around .shelf-card__img { height: auto; aspect-ratio: 360/440; }
  .gl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .gl-intro__title { font-size: 26px; }
  .gl-intro__sub { font-size: 16px; margin-top: 8px; }
  .gl-cats { margin-top: 32px; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding: 0 var(--gutter); scrollbar-width: none; }
  .gl-cat { flex: none; height: 44px; padding: 0 16px; font-size: 15px; }
  .gl-toolbar .inner { flex-direction: column; align-items: stretch; gap: 12px; }
  .search input { flex: 1; width: auto; min-width: 0; }
  .photo-band { height: 440px; padding-bottom: 32px; }
  .photo-band__title { font-size: 24px; }
  .photo-band__play { width: 64px; height: 64px; margin: -32px 0 0 -32px; font-size: 22px; }
  .shelf__head { flex-direction: column; align-items: flex-start; gap: 16px; }
  .shelf__title { font-size: 24px; }
  .shelf__actions { width: 100%; justify-content: space-between; }
  .shelf-card, .shelf--lg .shelf-card { width: 72vw; }
  .shelf-card__img, .shelf--lg .shelf-card__img { height: auto; aspect-ratio: 4/3; }
  .gl-around__imgs { grid-template-columns: 1fr 1fr; gap: 12px; }
  .gl-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* =========================================================
   p02b 갤러리 상세
   ========================================================= */
.gd-viewer { background: var(--navy); padding-bottom: 24px; }
.gd-stage { position: relative; height: 880px; overflow: hidden; background: #0b2233; touch-action: pan-y; }
.gd-stage__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.gd-stage__img.is-active { opacity: 1; }
.gd-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 340px; background: linear-gradient(180deg, rgba(29,34,36,0), rgba(29,34,36,.6)); pointer-events: none; }
.gd-stage__bar { position: absolute; left: 0; right: 0; bottom: 46px; z-index: 1; display: flex; align-items: flex-end; justify-content: space-between; color: #fff; }
.gd-chip { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 500; }
.gd-stage__title { margin-top: 12px; font-size: 56px; font-weight: 700; line-height: 1.3; }
.gd-stage__count { font-family: var(--font-en); font-weight: 500; font-size: 20px; }
.gd-stage__nav { position: absolute; top: 50%; z-index: 2; width: 64px; height: 64px; margin-top: -32px; border-radius: 9999px; background: #fff; color: var(--text); display: grid; place-items: center; font-size: 22px; transition: background .2s, color .2s; }
.gd-stage__nav:hover { background: var(--blue); color: #fff; }
.gd-stage__nav--prev { left: 40px; }
.gd-stage__nav--next { right: 40px; }
.gd-stage__zoom { position: absolute; inset: 0; z-index: 1; cursor: zoom-in; }
.gd-thumbs { margin-top: 24px; display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; }
.gd-thumbs::-webkit-scrollbar { display: none; }
.gd-thumb { position: relative; flex: none; width: 200px; height: 120px; overflow: hidden; opacity: .6; transition: opacity .2s; }
.gd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gd-thumb:hover { opacity: 1; }
.gd-thumb.is-active { opacity: 1; }
.gd-thumb.is-active::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--light-blue); }

.gd-info { padding: 90px 0; }
.gd-info .inner { display: grid; grid-template-columns: 1fr 360px; gap: 100px; align-items: start; }
.gd-info__eyebrow { font-family: var(--font-en); font-weight: 500; font-size: 16px; color: var(--blue); }
.gd-info__text { margin-top: 16px; font-size: 32px; font-weight: 600; line-height: 1.4; }
.meta-list div { display: flex; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); font-weight: 500; }
.meta-list div:last-child { border-bottom: 1px solid var(--border); }
.meta-list dt { color: var(--muted); }
.board-actions { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn-fill, .btn-outline { display: inline-flex; align-items: center; justify-content: center; height: 48px; border-radius: 9999px; font-weight: 600; transition: background .2s, color .2s, border-color .2s; }
.btn-fill { background: var(--navy); color: #fff; }
.btn-fill:hover { background: var(--blue); }
.btn-outline { border: 1px solid var(--text); color: var(--text); }
.btn-outline:hover { background: var(--text); color: #fff; }

.gd-related { padding: 90px 0; background: var(--sand); }
.gd-related .shelf__viewport { padding-left: 0; scroll-padding-left: 0; margin-top: 32px; }
.gd-related .shelf__track { padding-right: 0; }
.gd-related .shelf-card__cap strong { font-size: 18px; }

@media (max-width: 1420px) { .gd-stage { height: 680px; } .gd-stage__title { font-size: 44px; } }
@media (max-width: 1023px) {
  .gd-stage { height: 520px; }
  .gd-stage__title { font-size: 36px; }
  .gd-stage__nav { width: 52px; height: 52px; margin-top: -26px; }
  .gd-stage__nav--prev { left: 16px; } .gd-stage__nav--next { right: 16px; }
  .gd-thumb { width: 160px; height: 96px; }
  .gd-info, .gd-related { padding: var(--sec-pad-s) 0; }
  .gd-info .inner { grid-template-columns: 1fr; gap: 40px; }
  .gd-info__text { font-size: 26px; }
}
@media (max-width: 767px) {
  .gd-stage { height: 360px; }
  .gd-stage__bar { bottom: 24px; }
  .gd-stage__title { font-size: 26px; margin-top: 8px; }
  .gd-chip { height: 32px; padding: 0 12px; font-size: 14px; }
  .gd-stage__count { font-size: 16px; }
  .gd-stage__nav { width: 44px; height: 44px; margin-top: -22px; font-size: 18px; }
  .gd-thumbs { margin-top: 16px; gap: 8px; }
  .gd-thumb { width: 104px; height: 64px; }
  .gd-info__text { font-size: 20px; }
}

/* 피그마 자간 맞춤 (p02·p02b) */
.gl-intro__title { letter-spacing: -0.01em; }
.gd-info__eyebrow { letter-spacing: 1.5px; }
