/* ========================================
   Popups — News / Event
   ======================================== */

/* ---------- Modal layer (actual pages) ---------- */
.popup-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
}

.popup-layer.is-open {
  display: flex;
}

.popup-layer__dim {
  position: absolute;
  inset: 0;
  background-color: #000;
  opacity: 0.2;
  border: none;
  padding: 0;
  cursor: pointer;
}

.popup-layer__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  /* layer padding 1.25rem × 2 — 화면 안에 팝업 전체가 들어오도록 */
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  min-height: 0;
  overflow: hidden;
}

html.is-popup-open,
body.is-popup-open {
  overflow: hidden;
}

/* ---------- Popup panels ---------- */
.popup-news,
.popup-event {
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  /* 오른쪽 padding은 inner로 옮겨 스크롤이 우측 여백에 오도록 함 */
  padding: 2.5rem 0 2.5rem 2.5rem; /* 40px */
  border-radius: 1.25rem; /* 20px */
  background-color: var(--color-white);
  overflow: hidden;
}

.popup-news__close,
.popup-event__close {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  background: transparent;
  font-family: var(--font-suit);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text-dark);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.popup-news__inner,
.popup-event__inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1.25rem; /* 20px */
  min-height: 0;
  padding-right: 2.5rem; /* 40px — 콘텐츠 여백, 스크롤은 그 바깥(우측) */
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.popup-news__header,
.popup-event__header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* 12px */
  padding-bottom: 0.625rem; /* 10px */
  border-bottom: 0.0625rem solid var(--color-grey-300); /* 1px grey-3 */
}

.popup-news__title,
.popup-event__title {
  margin: 0;
  font-family: var(--font-suit);
  font-weight: var(--fw-suit-bold);
  font-size: 1.75rem; /* 28px */
  color: var(--color-text-dark);
}

.popup-news__date,
.popup-event__date {
  margin: 0;
  font-family: var(--font-suit);
  font-weight: 500;
  font-size: 1rem; /* 16px */
  color: var(--color-grey-300);
}

.popup-news__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 59.0625rem; /* 945px */
  height: 24.5rem; /* 392px */
  flex-shrink: 0;
  overflow: hidden;
  background-color: var(--color-grey-100);
}

.popup-news__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-news__body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* 20px */
  width: 59.0625rem; /* 945px — 이미지와 동일 너비 */
}

.popup-news__text {
  margin: 0;
  font-family: var(--font-suit);
  font-weight: 400;
  font-size: 1.125rem; /* 18px */
  color: var(--color-text-dark);
  line-height: 1.5;
}

/* ---------- Event popup ---------- */
.popup-event__content {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem; /* 40px */
}

.popup-event__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 29.9375rem; /* 479px */
  height: 34.25rem; /* 548px */
  flex-shrink: 0;
  overflow: hidden;
  background-color: var(--color-grey-100);
}

.popup-event__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-event__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1.25rem; /* 20px — 문단 간 */
  min-width: 0;
}

.popup-event__section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem; /* 20px — title ↔ text */
}

.popup-event__section--divided {
  padding-bottom: 1.25rem; /* 20px */
  border-bottom: 0.0625rem solid var(--color-grey-200); /* 1px */
}

.popup-event__body-title {
  margin: 0;
  font-family: var(--font-suit);
  font-weight: var(--fw-suit-bold);
  font-size: 1.125rem; /* 18px */
  color: var(--color-text-dark);
}

.popup-event__body-text {
  margin: 0;
  font-family: var(--font-suit);
  font-weight: 400;
  font-size: 1.125rem; /* 18px */
  color: var(--color-text-dark);
  line-height: 1.5;
  white-space: pre-line;
}

.popup-event__section--notice .popup-event__body-title,
.popup-event__section--notice .popup-event__body-text {
  color: var(--color-grey-500);
}

.popup-news__media .popup__placeholder-icon,
.popup-event__media .popup__placeholder-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-grey-400);
}

/* ---------- Tablet: 768–1023px ---------- */
@media (min-width: 48rem) and (max-width: 63.9375rem) {

  .popup-layer__dialog {
    width: 100%;
    max-width: 100%;
  }

  .popup-event {
    width: 100%;
    max-width: 100%;
    padding: 2rem 0 2rem 1.5rem; /* 32px 0 32px 24px */
  }

  .popup-event__inner {
    gap: 1rem;
    padding-right: 1.5rem; /* 24px */
    overflow: hidden;
  }

  .popup-event__title {
    font-size: clamp(0.844rem, 1.76vw, 1.125rem); /* 18px, tab/body03 */
  }

  .popup-event__date {
    font-size: clamp(0.75rem, 1.368vw, 0.875rem); /* 14px, tab/body05 */
  }

  .popup-event__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  .popup-event__media {
    width: clamp(17.341rem, 36.168vw, 23.125rem); /* 370px */
    max-width: 45%;
    height: clamp(22.117rem, 46.139vw, 29.5rem); /* 472px */
  }

  .popup-event__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .popup-event__body-title {
    font-size: clamp(0.75rem, 1.564vw, 1rem); /* 16px */
  }

  .popup-event__body-text {
    font-size: clamp(0.75rem, 1.368vw, 0.875rem); /* 14px */
  }
}

/* ---------- Mobile: 320–767px ---------- */
@media (max-width: 47.9375rem) {
  .popup-layer {
    padding: 1.25rem; /* 20px */
  }

  .popup-layer__dialog {
    width: 100%;
  }

  .popup-news {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 0 1.5rem 1.25rem; /* 24px 0 24px 20px */
    border-radius: 0.75rem; /* 12px */
  }

  .popup-news__close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .popup-news__inner {
    gap: 1rem; /* 16px */
    padding-right: 1.25rem; /* 20px */
  }

  .popup-news__title {
    font-size: clamp(0.909rem, 4.545vw, 1.25rem); /* 20px, mo/subtitle03 */
  }

  .popup-news__date {
    font-size: clamp(0.75rem, 3.636vw, 1rem); /* 16px, mo/body03 */
  }

  .popup-news__media {
    width: 100%;
    max-width: none;
    height: clamp(12.727rem, 63.636vw, 17.5rem); /* 280px */
  }

  .popup-news__body {
    width: 100%;
    max-width: none;
  }

  .popup-news__text {
    width: 100%;
    font-size: clamp(0.75rem, 3.636vw, 1rem); /* 16px, mo/body03 */
  }

  .popup-event {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 0 1.5rem 1.25rem; /* 24px 0 24px 20px */
    border-radius: 0.75rem; /* 12px */
  }

  .popup-event__close {
    top: 0.75rem;
    right: 0.75rem;
  }

  .popup-event__inner {
    gap: 1rem; /* 16px */
    padding-right: 1.25rem; /* 20px */
  }

  .popup-event__title {
    font-size: clamp(0.909rem, 4.545vw, 1.25rem); /* 20px, mo/subtitle03 */
  }

  .popup-event__date {
    font-size: clamp(0.75rem, 3.636vw, 1rem); /* 16px, mo/body03 */
  }

  .popup-event__content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem; /* 16px */
  }

  .popup-event__media {
    width: 100%;
    max-width: none;
    height: clamp(9.045rem, 45.227vw, 12.4375rem); /* 199px */
  }

  .popup-event__body {
    width: 100%;
    flex: none;
  }

  .popup-event__body-title {
    font-size: clamp(0.75rem, 3.636vw, 1rem); /* 16px */
  }

  .popup-event__body-text {
    font-size: clamp(0.75rem, 3.182vw, 0.875rem); /* 14px */
  }
}

/* Mobile: 320–767px — News popup size/image responsive */
@media (max-width: 47.9375rem) {
  .popup-news {
    width: min(100%, 25rem); /* 400px */
    height: auto;
    max-height: 100%;
    padding: 1.25rem 0 1.25rem 1.875rem; /* 20px 30px — 오른쪽은 inner */
  }

  .popup-news__inner {
    gap: 0;
    padding-right: 1.875rem; /* 30px */
  }

  .popup-news__close {
    top: 0.5rem;
    right: 0.5rem; /* 8px */
  }

  .popup-news__header {
    gap: 0.5rem; /* 8px — title ↔ date */
    padding-bottom: 0.625rem; /* 10px — date ↔ line */
  }

  .popup-news__title {
    font-size: 1.25rem; /* 20px — Mobile/Subtitle03 */
    font-weight: 600;
  }

  .popup-news__date,
  .popup-news__text {
    font-size: 1rem; /* 16px — Mobile/Body03 */
    font-weight: 400;
  }

  .popup-news__media {
    width: min(100%, 21.25rem); /* 340px */
    height: auto;
    aspect-ratio: 340 / 214;
    margin-inline: auto;
    margin-top: 0.9375rem; /* 15px — line ↔ image */
    margin-bottom: 1.5625rem; /* 25px — image ↔ body */
  }

  .popup-news__body {
    width: 100%;
    max-width: 100%;
  }
}

