/* ==========================================================================
   전단지(Weekly Flyer) 뷰어
   썸네일 바 + 가운데정렬 슬라이더 + 크게보기 팝업 + PDF 다운로드 버튼

   전단지 이미지는 비율이 제각각이라(가로형 포스터 ~ 세로로 아주 긴 띠)
   어디서도 자르지 않고 object-fit: contain 으로 전부 노출한다.
   사이트 공용 CSS 를 건드리지 않도록 선택자는 전부 뷰어 안으로 한정한다.
   ========================================================================== */

.flyer-page {
  --flyer-red: #e2231a;
  --flyer-text: #333;
  --flyer-border: #e5e5e5;
}

.flyer-page *,
.flyer-preview * { box-sizing: border-box; }

/* ---------- 상단 컨텐츠(에디터 본문) ---------- */
.flyer-intro {
  max-width: 1000px;
  margin: 0 auto 8px;
  padding: 0 16px;
  text-align: center;
}

.flyer-intro-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--flyer-text);
}

.flyer-intro-body { font-size: 14px; line-height: 1.7; color: #555; }
.flyer-intro-body img { max-width: 100%; height: auto; }

.flyer-empty {
  padding: 60px 20px;
  text-align: center;
  font-size: 15px;
  color: #999;
}

/* ---------- 컨테이너 ---------- */
.eflyer-flyerCont { display: none; }
.eflyer-flyerCont.eflyer-flyerContActive { display: block; }

.eflyer-flyerWrapper {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ---------- 헤더 (페이지 표시 / 썸네일) ---------- */
.eflyer-flyerHeader {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;   /* 썸네일 영역 가운데 정렬 */
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--flyer-border);
  margin-bottom: 16px;
}

/* 페이지 표시는 좌측에 띄워 두어 썸네일 가운데 정렬에 영향을 주지 않음 */
.eflyer-flyerTitleBox {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.flyer-pagination {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--flyer-red);
}

/* ---------- 썸네일 스와이퍼 ---------- */
.eflyer-flyerThumbsSwiper {
  flex: 0 1 auto;
  min-width: 0;
}

/* 썸네일 6장 + 간격 12px, 좌우 화살표 자리 34px씩 */
.eflyer-flyerThumbsWrapper {
  position: relative;
  width: 668px;
  max-width: 100%;
  padding: 0 34px;
}

.flyer-thumbs { overflow: hidden; }

.flyer-thumbs .swiper-slide { cursor: pointer; }

/* 비율이 제각각이라 고정 높이 박스 안에 넣고 자르지 않는다 */
.flyer-thumbs .swiper-slide > div {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 115px;
  border: 2px solid transparent;
  border-radius: 2px;
  overflow: hidden;
  background: #f4f4f4;
  transition: border-color .15s ease;
  line-height: 0;
}

.flyer-thumbs .swiper-slide img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.flyer-thumbs .swiper-slide:hover > div { border-color: #f7a9a4; }
.flyer-thumbs .swiper-slide-thumb-active > div { border-color: var(--flyer-red); }

/* 썸네일 좌우 화살표 (swiper 기본 스타일 덮어쓰기) */
.eflyer-flyerThumbsWrapper .swiper-button-prev,
.eflyer-flyerThumbsWrapper .swiper-button-next {
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border: 1px solid #000;
  border-radius: 50%;
  background: #000;
  color: #fff;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.eflyer-flyerThumbsWrapper .swiper-button-prev { left: 0; }
.eflyer-flyerThumbsWrapper .swiper-button-next { right: 0; }

.eflyer-flyerThumbsWrapper .swiper-button-prev::after,
.eflyer-flyerThumbsWrapper .swiper-button-next::after {
  font-size: 11px;
  font-weight: 700;
}

.eflyer-flyerThumbsWrapper .swiper-button-prev:hover,
.eflyer-flyerThumbsWrapper .swiper-button-next:hover {
  background: var(--flyer-red);
  border-color: var(--flyer-red);
  color: #fff;
}

.eflyer-flyerThumbsWrapper .swiper-button-disabled {
  opacity: .35;
  pointer-events: none;
}

.eflyer-flyerThumbsWrapper .swiper-button-lock { display: flex; }

/* ---------- 본 전단지 스와이퍼 ---------- */
.eflyer-flyerSwiper { position: relative; }

.flyer-main { overflow: hidden; }

.eflyer-flyerImgItem { line-height: 0; }

/* 현재 보고 있는 전단지만 밝게, 좌우는 어둡게 */
.flyer-main .swiper-slide {
  filter: brightness(.5);
  transition: filter .3s ease;
}

.flyer-main .swiper-slide-active { filter: none; }

/* 좌우 전단지는 클릭하면 가운데로 이동 (팝업 아님) */
.flyer-main .swiper-slide:not(.swiper-slide-active) { cursor: pointer; }
.flyer-main .swiper-slide:not(.swiper-slide-active) .flyer-img-mask { display: none; }

/* 카드 높이는 고정, 이미지는 자기 비율대로 맞춰 넣는다 */
.flyer-main .flyer-img-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  height: 72vh;
  min-height: 420px;
  background: #f4f4f4;
}

.flyer-main .flyer-img {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}

/* 마우스 오버 시 크게보기 마스크 */
.flyer-img-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
  cursor: pointer;
}

.flyer-img-box:hover .flyer-img-mask { opacity: 1; }

.flyer-img-mask-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1;
}

.flyer-img-mask-info svg { width: 1em; height: 1em; }

/* ---------- PDF 브로셔 다운로드 ---------- */
.flyer-download {
  display: flex;
  justify-content: center;
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid var(--flyer-border);
}

.flyer-download__btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 13px 30px 13px 15px;
  border-radius: 999px;
  background: var(--flyer-red);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(226, 35, 26, .26);
  transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.flyer-download__btn:hover,
.flyer-download__btn:focus { color: #fff; text-decoration: none; }

.flyer-download__btn:hover {
  background: #c41a12;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(226, 35, 26, .36);
}

.flyer-download__btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(226, 35, 26, .28);
}

.flyer-download__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}

.flyer-download__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

/* 마우스를 올리면 화살표가 살짝 내려간다 */
.flyer-download__btn:hover .flyer-download__icon svg { transform: translateY(2px); }

.flyer-download__text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  text-align: left;
}

.flyer-download__text strong { font-size: 15px; font-weight: 700; }

.flyer-download__text small {
  margin-top: 3px;
  font-size: 12px;
  opacity: .82;
}

/* ---------- 크게보기 오버레이 ---------- */
.flyer-preview {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, .78);
  overflow: hidden;
}

.flyer-preview[hidden] { display: none !important; }

/* 이미지 영역. 긴 전단지는 줄이지 않고 이 안에서 세로 스크롤로 본다 */
.flyer-preview__stage {
  position: absolute;
  inset: 64px 72px 56px;
  display: block;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.flyer-preview__img {
  display: inline-block;
  margin: 0 auto;              /* 위쪽부터 보이도록 세로 가운데 정렬은 하지 않는다 */
  width: auto;
  max-width: min(100%, 900px);
  max-height: none;
  transform-origin: top center;
  transition: transform .2s ease;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
  user-select: none;
  -webkit-user-drag: none;
}

/* 스크롤바는 감춘다. 확대된 전단지는 왼쪽 버튼 드래그로 옮겨 보고,
   휠은 확대/축소에만 쓴다. overflow 는 드래그 이동을 위해 그대로 둔다. */
.flyer-preview__stage {
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* 구 Edge/IE */
}
.flyer-preview__stage::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* 상단 컨트롤 바 */
.flyer-preview__toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
  height: 52px;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(2px);
}

.flyer-preview__toolbar button {
  display: inline-flex;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, .85);
  cursor: pointer;
  transition: color .15s ease, transform .15s ease;
}

.flyer-preview__toolbar button:hover {
  color: #fff;
  transform: scale(1.12);
}

.flyer-preview__toolbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 좌우 이동 버튼 */
.flyer-preview__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease;
}

.flyer-preview__nav:hover { background: rgba(255, 255, 255, .28); }
.flyer-preview__nav[hidden] { display: none; }
.flyer-preview__nav--prev { left: 16px; }
.flyer-preview__nav--next { right: 16px; }

.flyer-preview__nav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 하단 페이지 카운터 */
.flyer-preview__counter {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .8);
  pointer-events: none;
}

/* ---------- 반응형 ---------- */

/* PC 에서는 전단지 한 장이 한 화면에 통째로 들어오게 한다.
   기본 규칙은 max-height 가 없어서 1600x2100 전단지가 폭 900px 로 펴지고,
   그러면 높이가 1181px 이 되어 팝업 영역(화면높이 - 120px)을 넘는다.
   좁은 화면과 모바일(/m/)은 같은 CSS 를 공유하므로 지금처럼 세로 스크롤로 둔다. */
@media (min-width: 1025px) {
  .flyer-preview__img {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (max-width: 1024px) {
  .eflyer-flyerHeader {
    flex-direction: column;
    gap: 12px;
  }
  .eflyer-flyerTitleBox {
    position: static;
    transform: none;
  }
  .eflyer-flyerThumbsSwiper { width: 100%; }
  .eflyer-flyerThumbsWrapper { margin: 0 auto; }
}

@media (max-width: 640px) {
  .eflyer-flyerWrapper { padding: 16px 12px 32px; }
  .flyer-intro-title { font-size: 18px; }
  .flyer-thumbs .swiper-slide > div { height: 84px; }
  .flyer-main .flyer-img-box { height: 60vh; min-height: 320px; }
  .flyer-download { margin-top: 24px; padding-top: 22px; }
  .flyer-download__btn { gap: 11px; padding: 11px 22px 11px 12px; }
  .flyer-download__icon { width: 32px; height: 32px; }
  .flyer-download__icon svg { width: 17px; height: 17px; }
  .flyer-download__text strong { font-size: 14px; }
  .flyer-preview__toolbar { gap: 20px; }
  .flyer-preview__stage { inset: 60px 12px 48px; }
  .flyer-preview__nav { width: 36px; height: 36px; margin-top: -18px; }
  .flyer-preview__nav--prev { left: 6px; }
  .flyer-preview__nav--next { right: 6px; }
}
