/* =========================================================
   참조은SF 광고영상 페이지 BODY 전용
   - 공용 헤더 / 푸터 / 상단 헤더배너에는 영향 없음
========================================================= */

.movie-page,
.movie-page *,
.movie-page *::before,
.movie-page *::after {
  box-sizing: border-box;
}

.movie-page {
  width: 100%;
  padding: 72px 0 92px;
  color: #111;
  background: #fff;
}

.movie-inner {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.movie-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 78px;
}

.movie-head-copy h1 {
  margin: 0;
  color: #050505;
  font-size: clamp(38px, 3.1vw, 50px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
}

.movie-head-copy p {
  margin: 19px 0 0;
  color: #9a9a9a;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.025em;
}

.movie-upload-btn {
  min-width: 176px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 25px;
  color: #111;
  background: #fff;
  border: 1px solid #bdbdbd;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease;
}

.movie-upload-btn:hover {
  background: #f7f7f7;
  border-color: #888;
}

/* 대표 광고영상 */
.movie-featured {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(0, 1fr);
  align-items: center;
  gap: 54px;
  margin-bottom: 72px;
}

.movie-featured-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1538 / 1023;
  overflow: hidden;
  border-radius: 15px;
  background: #f3f3f3;
}

.movie-featured-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.movie-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.movie-play-button::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid currentColor;
}

.movie-featured-content {
  min-width: 0;
}

.movie-featured-title {
  margin: 0 0 18px;
  color: #090909;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.045em;
  word-break: keep-all;
}

.movie-featured-desc {
  max-width: 400px;
  margin: 0 0 28px;
  color: #777;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

/* 일반 광고영상 리스트 */
.movie-list {
  display: grid;
  gap: 27px;
}

.movie-card {
  display: grid;
  grid-template-columns: minmax(0, 470px) minmax(0, 1fr);
  align-items: center;
  gap: 42px;
  min-width: 0;
}

.movie-card[hidden] {
  display: none !important;
}

.movie-thumb {
  width: 100%;
  aspect-ratio: 1538 / 1023;
  overflow: hidden;
  border-radius: 10px;
  background: #f4f4f4;
}

.movie-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.movie-card-content {
  min-width: 0;
}

.movie-card-title {
  margin: 0 0 14px;
  color: #111;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -0.035em;
  word-break: keep-all;
}

.movie-card-desc {
  max-width: 475px;
  margin: 0 0 18px;
  color: #777;
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.movie-view-btn {
  min-width: 146px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  color: #222;
  background: #f0f0f0;
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition:
    background .2s ease,
    transform .2s ease;
}

.movie-view-btn:hover {
  background: #e7e7e7;
  transform: translateY(-1px);
}

.movie-view-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  font-size: 18px;
  line-height: 1;
}

/* 페이지네이션 */
.movie-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 29px;
  margin-top: 88px;
}

.movie-page-btn {
  min-width: 17px;
  padding: 0;
  color: #111;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}

.movie-page-btn.is-current {
  font-weight: 800;
}

.movie-page-btn:disabled {
  cursor: default;
  opacity: .45;
}

/* 태블릿 */
@media (max-width: 980px) {
  .movie-page {
    padding: 60px 0 78px;
  }

  .movie-head {
    margin-bottom: 58px;
  }

  .movie-featured {
    grid-template-columns: minmax(0, 56%) minmax(0, 1fr);
    gap: 34px;
    margin-bottom: 58px;
  }

  .movie-featured-title {
    font-size: 28px;
  }

  .movie-card {
    grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
    gap: 30px;
  }
}

/* 모바일 */
@media (max-width: 760px) {
  .movie-page {
    padding: 46px 0 64px;
  }

  .movie-inner {
    width: calc(100% - 32px);
  }

  .movie-head {
    flex-direction: column;
    align-items: stretch;
    gap: 26px;
    margin-bottom: 44px;
  }

  .movie-head-copy h1 {
    font-size: 36px;
  }

  .movie-upload-btn {
    width: 100%;
    min-width: 0;
    height: 50px;
  }

  .movie-featured {
    display: block;
    margin-bottom: 54px;
  }

  .movie-featured-media {
    margin-bottom: 25px;
    border-radius: 11px;
  }

  .movie-featured-media img {
    width: 100%;
    height: 100%;
  }

  .movie-featured-title {
    margin-bottom: 12px;
    font-size: 24px;
  }

  .movie-featured-desc {
    max-width: none;
    margin-bottom: 21px;
    font-size: 14px;
  }

  .movie-list {
    gap: 46px;
  }

  .movie-card {
    display: block;
  }

  .movie-thumb {
    margin-bottom: 22px;
  }

  .movie-thumb img {
    width: 100%;
    height: 100%;
  }

  .movie-card-title {
    margin-bottom: 10px;
    font-size: 20px;
  }

  .movie-card-desc {
    max-width: none;
    margin-bottom: 17px;
    font-size: 14px;
  }

  .movie-pagination {
    gap: 24px;
    margin-top: 66px;
  }
}

@media (max-width: 480px) {
  .movie-inner {
    width: calc(100% - 26px);
  }

  .movie-head-copy h1 {
    font-size: 32px;
  }

  .movie-head-copy p {
    margin-top: 14px;
    font-size: 13px;
  }

  .movie-featured-title {
    font-size: 22px;
  }

  .movie-card-title {
    font-size: 18px;
  }

  .movie-play-button {
    width: 54px;
    height: 54px;
  }
}


/* 업로드된 최신 대표 게시물의 입력 줄바꿈 보존 */
.movie-uploaded-featured .movie-featured-desc {
  white-space: pre-line;
}


/* =========================================================
   동영상 직접 업로드
========================================================= */
.movie-video-picker {
  position: relative;
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
  background: #f8f8f8;
  border: 1px dashed #c8c8c8;
  border-radius: 8px;
  cursor: pointer;
  transition:
    background .2s ease,
    border-color .2s ease;
}

.movie-video-picker:hover {
  background: #f4f4f4;
  border-color: #999;
}

.movie-video-picker input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.movie-video-picker-text {
  color: #777;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.65;
  text-align: center;
}

.movie-video-file-info {
  margin: 0;
  padding: 10px 12px;
  color: #333;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 영상보기 버튼이 button 태그로 바뀌어도 기존 디자인 유지 */
button.movie-view-btn {
  font-family: inherit;
  cursor: pointer;
}

button.movie-view-btn:disabled,
.movie-play-button:disabled {
  cursor: default;
  opacity: .45;
}

/* =========================================================
   동영상 재생 팝업
========================================================= */
.movie-player-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .72);
  box-sizing: border-box;
}

.movie-player-modal.is-open {
  display: flex;
}

.movie-player-dialog {
  width: min(1000px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 22px;
  background: #111;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
  box-sizing: border-box;
}

.movie-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.movie-player-title {
  margin: 0;
  color: #fff;
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.movie-player-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  padding: 0;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  font-family: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.movie-player-close:hover {
  background: rgba(255, 255, 255, .2);
}

.movie-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.movie-player-frame video,
.movie-player-frame iframe {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  border: 0;
}

.movie-player-frame [hidden] {
  display: none !important;
}

.movie-player-message {
  margin: 12px 2px 0;
  color: #bbb;
  font-size: 12px;
  line-height: 1.55;
}

.movie-player-message:empty {
  display: none;
}

@media (max-width: 600px) {
  .movie-player-modal {
    align-items: flex-start;
    padding: 10px;
  }

  .movie-player-dialog {
    max-height: calc(100dvh - 20px);
    padding: 14px;
    border-radius: 10px;
  }

  .movie-player-top {
    margin-bottom: 12px;
  }

  .movie-player-close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    font-size: 24px;
  }
}


/* =========================================================
   indexnews(5).html '바로가기' 버튼 스타일과 정확히 통일
   - 이 블록을 CSS 마지막에 두어 기존 movie 버튼 스타일보다 우선 적용
========================================================= */
.movie-page .movie-view-btn,
.movie-page button.movie-view-btn,
.movie-page a.movie-view-btn {
  width: 144px !important;
  min-width: 144px !important;
  height: 43px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  padding: 0 18px !important;
  box-sizing: border-box !important;

  color: #272727 !important;
  background: #f1f1f1 !important;
  border: 0 !important;
  border-radius: 999px !important;

  text-align: center !important;
  text-decoration: none !important;

  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1 !important;

  appearance: none !important;
  -webkit-appearance: none !important;
}

.movie-page .movie-view-btn:hover {
  color: #272727 !important;
  background: #e8e8e8 !important;
  transform: translateY(-1px);
}

.movie-page .movie-view-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  color: #272727 !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1 !important;
}

.movie-page .movie-view-icon {
  width: 18px !important;
  height: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 18px !important;
  margin: 0 !important;

  color: #272727 !important;
  font-family: inherit !important;
  font-size: 21px !important;
  font-weight: 300 !important;
  font-style: normal !important;
  line-height: 1 !important;
  transform: scaleX(-1) !important;
}

@media (max-width: 760px) {
  .movie-page .movie-view-btn,
  .movie-page button.movie-view-btn,
  .movie-page a.movie-view-btn {
    width: 132px !important;
    min-width: 132px !important;
    height: 41px !important;
    font-size: 14px !important;
  }

  .movie-page .movie-view-text {
    font-size: 14px !important;
  }
}


/* =========================================================
   indexnews(5)와 영상보기 텍스트/아이콘 컬러 완전 동일 적용
   - 비활성 버튼의 opacity 영향 제거
========================================================= */
.movie-page .movie-view-btn,
.movie-page .movie-view-btn:disabled,
.movie-page .movie-view-btn[aria-disabled="true"] {
  color: #272727 !important;
  -webkit-text-fill-color: #272727 !important;
  opacity: 1 !important;
  filter: none !important;
}

.movie-page .movie-view-btn .movie-view-text,
.movie-page .movie-view-btn .movie-view-icon,
.movie-page .movie-view-btn:disabled .movie-view-text,
.movie-page .movie-view-btn:disabled .movie-view-icon,
.movie-page .movie-view-btn[aria-disabled="true"] .movie-view-text,
.movie-page .movie-view-btn[aria-disabled="true"] .movie-view-icon {
  color: #272727 !important;
  -webkit-text-fill-color: #272727 !important;
  opacity: 1 !important;
  filter: none !important;
}


/* =========================================================
   광고영상 팝업 - 깔끔한 화이트 디자인
   기존 검은색 팝업 UI를 밝고 정돈된 스타일로 변경
========================================================= */
.movie-player-modal {
  background: rgba(15, 23, 42, .46) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.movie-player-dialog {
  width: min(960px, 100%) !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, .08) !important;
  border-radius: 20px !important;
  box-shadow:
    0 24px 70px rgba(15, 23, 42, .20),
    0 4px 18px rgba(15, 23, 42, .08) !important;
}

.movie-player-top {
  min-height: 72px;
  margin: 0 !important;
  padding: 18px 20px 18px 26px;
  background: #ffffff;
  border-bottom: 1px solid #eeeeee;
}

.movie-player-title {
  color: #111111 !important;
  font-size: clamp(18px, 2vw, 24px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.035em !important;
}

.movie-player-close {
  width: 40px !important;
  height: 40px !important;
  flex-basis: 40px !important;
  color: #555555 !important;
  background: #f4f4f4 !important;
  border: 1px solid #e7e7e7 !important;
  font-size: 25px !important;
  transition:
    background .2s ease,
    color .2s ease,
    transform .2s ease !important;
}

.movie-player-close:hover {
  color: #111111 !important;
  background: #eaeaea !important;
  transform: rotate(4deg);
}

.movie-player-frame {
  width: calc(100% - 40px) !important;
  margin: 20px auto 0 !important;
  aspect-ratio: 16 / 9;
  background: #111111 !important;
  border-radius: 12px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}

.movie-player-message {
  margin: 14px 24px 22px !important;
  color: #777777 !important;
  font-size: 12px !important;
}

.movie-player-dialog::after {
  content: "";
  display: block;
  height: 20px;
}

@media (max-width: 600px) {
  .movie-player-modal {
    padding: 12px !important;
  }

  .movie-player-dialog {
    border-radius: 14px !important;
  }

  .movie-player-top {
    min-height: 62px;
    padding: 14px 14px 14px 18px;
  }

  .movie-player-frame {
    width: calc(100% - 24px) !important;
    margin-top: 12px !important;
    border-radius: 9px !important;
  }

  .movie-player-message {
    margin: 12px 14px 16px !important;
  }

  .movie-player-dialog::after {
    height: 12px;
  }
}


/* =========================================================
   VIDEO POPUP OPEN/CLOSE ANIMATION
   참고 index.html의 popup-show / popup-hide 방식 적용
========================================================= */
.movie-player-modal {
  display: flex !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition:
    opacity .4s ease,
    visibility .4s !important;
}

.movie-player-modal.is-open {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.movie-player-modal.is-closing {
  visibility: visible !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.movie-player-modal .movie-player-dialog {
  opacity: 0;
  transform: scale(.8);
  transform-origin: center center;
}

.movie-player-modal.is-open .movie-player-dialog {
  animation: movie-popup-show .4s cubic-bezier(.175, .885, .32, 1.275) forwards;
}

.movie-player-modal.is-closing .movie-player-dialog {
  animation: movie-popup-hide .4s ease-in forwards;
}

@keyframes movie-popup-show {
  from {
    opacity: 0;
    transform: scale(.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes movie-popup-hide {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .movie-player-modal,
  .movie-player-modal .movie-player-dialog {
    transition: none !important;
    animation: none !important;
  }

  .movie-player-modal.is-open .movie-player-dialog {
    opacity: 1;
    transform: scale(1);
  }
}
