/* ============================================================
   이벤트 팝업 — 지점 홈
   ------------------------------------------------------------
   A4 세로 카드 묶음 (2026-11-26 원장님).
     · 뒤는 어둡게 + 흐리게. 메인 영상은 팝업이 닫힐 때 처음부터 돈다(JS).
     · 카드는 오른쪽에서 한 장씩 날아와 가운데에 겹쳐 펼쳐진다 — 트럼프 카드처럼.
     · PC(900 이상): 펼친 부채. 마우스를 올리면 그 카드가 떠오르고, 누르면 그 이벤트로.
     · 폰(900 미만): 가운데 한 장 + 양옆이 살짝 보이는 줄. 옆으로 밀어 넘긴다.
       손가락에는 «올림»이 없어서다. 옆 카드를 누르면 가운데로 오고, 가운데를 누르면 이동.

   칸은 A4(1:√2) 로 정하고 그림은 cover 로 채운다 — 받는 그림이 1240×1754 라 안 잘린다.
   --n(장 수)·--i(몇 번째)는 PHP 가 적고, 숨긴 장을 빼면 JS 가 다시 적는다.
   ============================================================ */

.artium-pop {
  --a4: 1.4142;
  --pop-ease: cubic-bezier(.16, 1, .3, 1);
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  overflow: hidden;
}
.artium-pop[hidden] { display: none; }

.artium-pop__veil {
  position: absolute; inset: 0;
  background: color-mix(in srgb, #0b0d10 66%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(.85);
  backdrop-filter: blur(14px) saturate(.85);
  cursor: pointer;
  animation: artium-pop-fade .25s ease-out both;
}
@keyframes artium-pop-fade { from { opacity: 0; } }

.artium-pop__stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-6);
  max-width: 100%;
}
/* 열 때 포커스를 받는 자리다. 조작하는 물건이 아니라 «틀»이라 테두리를 안 그린다 */
.artium-pop__stage:focus { outline: none; }

/* ── 카드 묶음 ── */
.artium-pop__deck {
  /* 카드 높이 — 아래 단추 줄과 위아래 숨을 뺀 만큼 */
  /* 화면에 비해 컸다(2026-11-26 원장님) — 680 → 540 */
  --h: min(calc(100svh - 18rem), 540px);
  --w: calc(var(--h) / var(--a4));
  --gaps: max(calc(var(--n) - 1), 1);
  /* 겹침 간격: 카드 폭의 45% 를 넘지 않고, 화면(70vw, 최대 1100)에 다 들어오게.
     부채로 기울면 양 끝 카드가 바깥으로 더 나가서 가장자리 숨을 남겨 둔다.
     62%·80vw 였을 때 화면을 거의 다 덮었다(2026-11-26 원장님: 화면에 비해 크다) */
  --step: min(calc(var(--w) * .45), calc((min(70vw, 1100px) - var(--w)) / var(--gaps)));
  position: relative;
  width: calc(var(--w) + var(--step) * (var(--n) - 1));
  height: var(--h);
  margin: 0; padding: 0; list-style: none;
}

.artium-pop__card {
  position: absolute; top: 0;
  left: calc(var(--step) * var(--i));
  width: var(--w);
  aspect-ratio: 1 / var(--a4);
  /* 부채꼴 — 카드 아래 먼 곳을 축으로 돌리면 가장자리가 저절로 둥글게 처진다 */
  transform-origin: 50% 170%;
  rotate: calc((var(--i) - (var(--n) - 1) / 2) * 1.6deg);
  z-index: var(--i);
  border-radius: 6px;
  box-shadow: 0 1.25rem 2.5rem -.75rem rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .06);
  transition: translate .35s var(--pop-ease), scale .35s var(--pop-ease), box-shadow .35s var(--pop-ease);
  /* 오른쪽에서 한 장씩 — backwards 라 끝나면 아래 올림(hover)이 막힘없이 먹는다 */
  animation: artium-card-in .55s var(--pop-ease) backwards;
  animation-delay: calc(.05s + var(--i) * .07s);
}
.artium-pop__card[hidden] { display: none; }

@keyframes artium-deck-in { from { translate: 100vw 0; } }
@keyframes artium-card-rise { from { opacity: 0; translate: 0 1.5rem; } }

@keyframes artium-card-in {
  from { translate: 85vw -6vh; rotate: 18deg; opacity: 0; }
  30%  { opacity: 1; }
}

.artium-pop__shot {
  display: block; width: 100%; height: 100%;
  border-radius: inherit; overflow: hidden; line-height: 0;
  outline: none;
}
.artium-pop__shot img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}

/* 마우스를 올리거나 자판으로 옮겨 오면 그 카드가 맨 위로 떠오른다.
   축이 카드 아래 먼 곳(170%)이라 조금만 키워도 위로 많이 솟는다 — 3% 면 충분하다 */
@media (hover: hover) and (min-width: 900px) {
  .artium-pop__card:hover { z-index: 50; translate: 0 -3%; scale: 1.03; }
}
.artium-pop__card:focus-within { z-index: 50; translate: 0 -3%; scale: 1.03; }
.artium-pop__card:hover,
.artium-pop__card:focus-within {
  box-shadow: 0 2rem 3.5rem -1rem rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .12);
}
.artium-pop__shot:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ── 아래 단추 줄 ──
   카덴스가 button 의 hover/focus/active 에 배경과 «글자색»을 밀어 넣는다(2026-09-16 사장님 지적).
   색을 직접 쓰므로 세 상태를 모두 못박는다. */
.artium-pop__bar {
  display: flex; gap: var(--sp-4);
  animation: artium-pop-fade .5s ease-out both;
  animation-delay: calc(.2s + var(--n, 1) * .07s);
}
.artium-pop__btn,
.artium-pop__btn:is(:hover, :focus, :active) {
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.artium-pop__btn {
  min-width: 8.5rem; min-height: 2.75rem;
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--sp-3) var(--sp-6);
  font: inherit; font-size: var(--fs-sm); line-height: 1.2; letter-spacing: .02em;
  border: 1px solid rgb(255 255 255 / .45);
  border-radius: 999px;
  cursor: pointer; white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease;
}
.artium-pop__btn:is(:hover, :focus-visible) {
  background: rgb(255 255 255 / .14);
  border-color: rgb(255 255 255 / .8);
}
.artium-pop__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.artium-pop__dots { display: none; }

/* ── 폰: 가운데 한 장 + 옆으로 밀기 ── */
@media (max-width: 899px) {
  .artium-pop__stage { width: 100vw; gap: var(--sp-5); }

  .artium-pop__deck {
    --w: min(64vw, calc((100svh - 14rem) / var(--a4)));
    display: flex; align-items: center; gap: 4vw;
    width: 100vw; height: auto;
    padding: 1.5rem calc((100vw - var(--w)) / 2);
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .artium-pop__deck::-webkit-scrollbar { display: none; }

  /*
    폰에서는 «줄 전체»가 오른쪽에서 들어온다. 카드 하나하나를 화면 밖에서 날리면
    그동안 밀 수 있는 폭이 늘어나 스냅이 두 번째 카드에 걸려 버렸다(2026-11-26 측정).
    카드는 제자리에서 차례로 떠오르기만 한다.
  */
  .artium-pop__deck { animation: artium-deck-in .5s var(--pop-ease) backwards .05s; }

  .artium-pop__card {
    position: relative; left: auto; top: auto;
    flex: 0 0 var(--w);
    scroll-snap-align: center;
    rotate: 3deg;
    scale: .88;
    opacity: .7;
    transform-origin: 50% 50%;
    transition: scale .35s var(--pop-ease), rotate .35s var(--pop-ease), opacity .35s ease;
    animation-name: artium-card-rise;
  }
  .artium-pop__card.is-on { rotate: 0deg; scale: 1; opacity: 1; z-index: 5; }
  .artium-pop__card:focus-within { translate: none; scale: 1; }

  .artium-pop__dots { display: flex; gap: var(--sp-3); margin-top: calc(var(--sp-3) * -1); }
  .artium-pop__dot {
    width: .4rem; height: .4rem; border-radius: 50%;
    background: rgb(255 255 255 / .4);
    transition: background-color .2s ease, scale .2s ease;
  }
  .artium-pop__dot.is-on { background: #fff; scale: 1.3; }

  .artium-pop__btn { min-width: 7.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .artium-pop__veil, .artium-pop__deck, .artium-pop__card, .artium-pop__bar { animation: none; }
  .artium-pop__card, .artium-pop__btn { transition: none; }
}
