:root{
  --bg:#ffffff;
  --fg:#111111;
  --muted:#666666;
  --line:#e9e9e9;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",sans-serif;

  /* layout */
  --frameW: 430px;          /* PC에서 모바일 프레임 폭 */

  /* brand + menu */
  --brandLeft: 5vw;         /* 모바일 기준(PC에선 아래 media에서 프레임 기준으로 보정) */
  --brandBottom: 22px;
  --menuBtnTop: 22px;
  --menuBtnRight: 22px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:#f2f2f2;       /* PC 프레임 바깥 배경 */
  color:var(--fg);
  font-family:var(--font);
  letter-spacing:0.02em;
}
a{color:inherit;text-decoration:none}
a:hover{opacity:.85}

/* ====== Mobile frame on PC ====== */
.page{
  max-width: var(--frameW);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
  position: relative;
  z-index: 1;
}

/* main wrapper */
.main{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding: 14vh 0 18vh;
}

/* ====== Brand (Bottom bar) ====== */
.brand{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;

  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: transparent;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;

  text-transform: uppercase;
  line-height: 1.15;

  pointer-events: auto !important;
  cursor: pointer;
}

.brand-sub{display:block;font-size:12px;letter-spacing:0.26em}
.brand-main{display:block;margin-top:6px;font-size:12px;letter-spacing:0.26em}

/* ====== Hamburger ====== */
.menu-toggle{
  position: fixed;
  top: var(--menuBtnTop);
  right: var(--menuBtnRight);
  z-index: 100000;

  color: #111;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;

  padding: 6px 10px;
  font-size: 22px;
  line-height: 1;
  opacity: 0.75;
  cursor: pointer;
}

/* ====== Slide menu ====== */
.menu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
  z-index: 99990;
}

.side-menu{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(78vw, 320px);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-left: 1px solid rgba(0,0,0,.08);
  transform: translateX(100%);
  transition: transform .22s ease;
  z-index: 99991;
  padding: 72px 22px 24px;

  display: flex;
  flex-direction: column;
  gap: 14px;

  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 13px;
}

.side-menu a{opacity:.85}
.side-menu a.active{opacity:1}
.side-menu a:hover{opacity:1}

body.menu-open .menu-overlay{opacity:1;pointer-events:auto}
body.menu-open .side-menu{transform:translateX(0)}

/* ====== Gallery ====== */
.gridWrap{
  width: 100%;
  padding: 16px;
}

.grid{
  column-count: 2;
  column-gap: 10px;
}

.card{
  position: relative;
  break-inside: avoid;
  margin-bottom: 10px;
  border: 0;               /* ✅ 테두리 제거 */
  border-radius: 0;        /* ✅ 라운딩 제거 */
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  display: block;
}

.card img{
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transform: scale(1.01);
}

.card:hover img{
  transform: scale(1.05);
  transition: transform .35s ease;
}

/* label overlay */
.card-label{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  padding:12px;
  opacity:0;
  transition:opacity .16s ease;
  font-size:12px;
  letter-spacing:0.22em;
  text-transform:uppercase;
  color:rgba(0,0,0,.78);
  background:rgba(255,255,255,.38);
}
.card:hover .card-label{opacity:1}
.card.show-label .card-label{opacity:1}

/* (이전 화살표 UI는 사용 안 함) */
.arrows{ display:none !important; }

/* ====== Detail (shoot) base ====== */
.detailWrap{
  width: 100%;
  padding: 16px;
}

/* 너가 원래 숨겨둔 상태 유지 */
.detailTitle{ display:none; }

/* BACK TO LIST (상단 고정) */
.backlink{
  display:inline-block;
  margin-bottom: 10px;
  font-size:13px;
  letter-spacing:0.12em;
  text-transform:uppercase;
  color:var(--muted);

  position: fixed;
  top: 60px;
  left: 22px;
  z-index: 100001;
}
.backlink:hover{ color:var(--fg); }

/* ====== Contact ====== */
.contactBlock{
  width: 100%;
  padding: 16px;
  font-size: 18px;
  letter-spacing: 0.08em;
  line-height: 1.6;
  opacity: 0.5;
  white-space: pre-line;
}
.contactBlock a:hover{
  border-bottom-color: rgba(17,17,17,.9);
}

/* ====== Mobile tweaks ====== */
@media (max-width:640px){
  .brand-main{font-size:12px;letter-spacing:0.26em}
  .brand-sub{font-size:12px}
  .main{padding-bottom:28vh}
}

/* ===== PC에서 모바일 프레임 기준 정렬 ===== */
@media (min-width: 641px){
  /* 브랜드: 프레임 왼쪽 안쪽 16px */
  .brand{
    left: calc(50% - (var(--frameW) / 2) + 16px) !important;
    right: auto !important;
  }

  /* 햄버거: 프레임 오른쪽 안쪽 16px */
  .menu-toggle{
    right: calc(50% - (var(--frameW) / 2) + 16px) !important;
    left: auto !important;
  }

  /* BACK LINK도 프레임 기준으로 */
  .backlink{
    left: calc(50% - (var(--frameW) / 2) + 16px) !important;
  }
}

/* =========================
   SHOOT: Page-turn Viewer (FINAL)
   ========================= */

.viewer{
  position: relative;
  width: 100%;
  height: calc(100vh - 180px); /* 필요하면 180px만 조절 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.pageTurn{
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1200px;
  overflow: hidden;

  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
}

/* 기본 이미지 */
#pageImg{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;

  border: 0 !important;
  outline: 0 !important;
}

/* 넘김 오버레이 이미지 */
#flipImg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;

  border: 0 !important;
  outline: 0 !important;

  backface-visibility: hidden;
  transform-style: preserve-3d;
}
/* ===== Page transition (premium) ===== */

.pageTurn{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

/* 두 이미지 레이어를 겹쳐두고 페이드로 전환 */
#pageImg, #flipImg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 0 !important;
  outline: 0 !important;
}

/* 기본은 pageImg가 보임 */
#pageImg{ opacity: 1; }

/* flipImg는 전환할 때만 잠깐 보임 */
#flipImg{
  opacity: 0;
  pointer-events: none;
}

/* 다음/이전 모두 동일하게 “부드러운 전환” */
#flipImg.is-fading{
  opacity: 1;
  transition: opacity 320ms ease;
}

/* 새 이미지가 살짝 들어오는 느낌(선택) */
#pageImg.is-enter{
  animation: enterSoft 320ms ease;
}
@keyframes enterSoft{
  from { opacity: .8; transform: translateX(10px) scale(0.995); }
  to   { opacity: 1;  transform: translateX(0)   scale(1); }
}

/* 이전 방향일 때는 반대로(선택) */
#pageImg.is-enter-prev{
  animation: enterSoftPrev 320ms ease;
}
@keyframes enterSoftPrev{
  from { opacity: .8; transform: translateX(-10px) scale(0.995); }
  to   { opacity: 1;  transform: translateX(0)    scale(1); }
}

/* 화살표: 원/배경 제거 + 크게 */
.nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;

  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;

  width: auto !important;
  height: auto !important;
  padding: 6px 12px;

  color: #111;        /* 흰 배경 기준 */
  font-size: 44px;
  line-height: 1;
  cursor: pointer;
}
.nav.prev{ left: 6px; }
.nav.next{ right: 6px; }

.nav:disabled{ opacity: .2; cursor: default; }

/* 페이지 표시 */
.pager{
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.12em;
  opacity: .7;
}

/* detailGrid는 더 이상 사용 안 함 */
.detailGrid{ display:none !important; }

/* ====== Tap/Selection clean ====== */
*{ -webkit-tap-highlight-color: transparent; }

a:active,
button:active,
.card:active,
.brand:active,
.menu-toggle:active{
  background: transparent !important;
}

img{ -webkit-touch-callout: none; }
::selection{ background: transparent; }

/* ===== FORCE: cross-fade transition for shoot viewer ===== */
.pageTurn{
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* 두 이미지를 "겹치기" */
#pageImg, #flipImg{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  display: block !important;

  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;

  /* 성능 + 깜빡임 방지 */
  will-change: opacity, transform;
  transform: translateZ(0);
}

/* 기본 상태 */
#pageImg{ opacity: 1 !important; }
#flipImg{ opacity: 0 !important; pointer-events:none !important; }

/* ✅ 이게 핵심: "기존 이미지가 사라지는" 트랜지션 */
#flipImg.is-fading{
  opacity: 0 !important;
  transition: opacity 380ms ease !important;
}

/* JS에서 flipImg opacity를 1로 만든 뒤 is-fading을 붙이면 1->0으로 사라짐 */

/* ✅ 새 이미지가 살짝 들어오는 느낌(선택) */
#pageImg.is-enter{
  animation: enterSoft 380ms ease both;
}
#pageImg.is-enter-prev{
  animation: enterSoftPrev 380ms ease both;
}
@keyframes enterSoft{
  from { opacity: .85; transform: translateX(10px) scale(0.995); }
  to   { opacity: 1;   transform: translateX(0)   scale(1); }
}
@keyframes enterSoftPrev{
  from { opacity: .85; transform: translateX(-10px) scale(0.995); }
  to   { opacity: 1;   transform: translateX(0)     scale(1); }
}

/* 혹시 시스템 설정에서 motion 줄이기를 켠 경우 대비(원하면 지워도 됨) */
@media (prefers-reduced-motion: reduce){
  #flipImg.is-fading{ transition: opacity 0ms !important; }
  #pageImg.is-enter, #pageImg.is-enter-prev{ animation: none !important; }
}

/* ===== Lightbox-like viewer base ===== */
.pageTurn{
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#pageImg, #flipImg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  will-change: transform, opacity;
  transform: translate3d(0,0,0);
}

#flipImg{
  opacity: 0;
  pointer-events: none;
}

/* ===== Viewer: 좌/중/우 3칸 레이아웃 ===== */
.viewer{
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 20px; /* 좌 20 / 사진 / 우 20 */
  align-items: center;
  column-gap: 10px; /* 화살표-사진 사이 여백 */
  width: 100%;
}

/* 사진 영역: 중앙 칸에만 */
.pageTurn{
  grid-column: 2;
  width: 100%;
}

/* 이미지가 아무리 커도 중앙 칸 안에서만 커지게 */
#pageImg, #flipImg{
  width: 100%;
  height: auto;
  display: block;
}

/* ===== 화살표 버튼: 좌우 칸에 고정 ===== */
.viewer .nav{
  position: static;          /* 기존에 absolute였다면 무조건 해제 */
  width: 10px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;

  /* 글자(‹ ›)를 작고 얇게 */
  font-size: 14px;           /* 더 작게 원하면 14~16 */
  font-weight: 300;
  line-height: 1;
  opacity: 0.35;             /* 얇고 은은하게 */
  -webkit-tap-highlight-color: transparent;
}

/* 왼쪽/오른쪽 위치 지정 */
.viewer .nav.prev{ grid-column: 1; justify-self: start; }
.viewer .nav.next{ grid-column: 3; justify-self: end; }

.viewer .nav:hover{ opacity: 0.7; }
.viewer .nav:active{ opacity: 0.9; }

/* 필요하면 모바일에서만 더 작게 */
@media (max-width:640px){
  .viewer{ grid-template-columns: 18px minmax(0,1fr) 18px; column-gap: 8px; }
  .viewer .nav{ font-size: 16px; }
}

.hero{
  width: 100%;
  padding: 0 30px;
  margin-top: 30px;
}

.hero-img{
  width: 100%;
  height: auto;   /* 이게 중요 */
  display: block;
  border-radius: 0;
}
