/* ==========================================================================
   event.css (기획전 허브 페이지)
   - 반응형: PC 퍼스트
     PC     : 1100px 이상 (기본값, Figma node 1709:32841)
     Tablet : @media (max-width: 1099px) (PC 시안과 동일 레이아웃, 토큰 값으로 자동 스케일)
     Mobile : @media (max-width: 767px) (Figma node 1746:34370)
   - 색상·폰트크기·여백은 base.css 토큰 사용. 시안과 토큰이 달라 직접 쓴 값은 그 자리에 주석.
   ========================================================================== */

/* D-day 배지 보라색 : base.css 에 토큰이 없는 시안 전용 색상 (확인 필요: 디자인 토큰 승격 여부) */
.event {
  --event-dday-bg: #A975EE;
}

/* ==========================================================================
   타이틀
   ========================================================================== */
.event-title__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
  padding-top: var(--space-64);
  padding-bottom: var(--space-48);
}

.event-title__tit {
  font-size: var(--fz-heading-xxl);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.event-title__desc {
  font-size: var(--fz-body-m);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}

/* ==========================================================================
   메인 배너 (슬라이드 2장 + 01 | 02 컨트롤)
   ========================================================================== */
.event-hero__stage {
  position: relative;
  aspect-ratio: 1200 / 500;
  overflow: hidden;
}

.event-hero__slide {
  position: absolute;
  inset: 0;
}

.event-hero__bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-hero__txt {
  position: absolute;
  top: 50%;
  left: 10%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  color: var(--text-primary);
}

.event-hero__tit {
  display: flex;
  flex-direction: column;
  font-size: var(--fz-heading-xxl);
  font-weight: 300;
  line-height: 1.4;
}

.event-hero__tit strong {
  font-weight: 600;
}

.event-hero__desc {
  font-size: var(--fz-body-l);
  line-height: var(--lh-body);
}

/* 컨트롤 : 반투명 검정 알약. 시안 값(rgba 0.4)이라 토큰이 없어 직접 지정 */
.event-hero__ctrl {
  position: absolute;
  right: 3%;
  bottom: 33px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--base-white);
}

.event-hero__arrow {
  width: 16px;
  height: 16px;
  background: url('../../images/events/icon-banner-arrow.svg') center / contain no-repeat;
}

.event-hero__arrow--next {
  transform: rotate(180deg);
}

.event-hero__count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fz-caption);
  line-height: var(--lh-body);
}

.event-hero__count span:first-child {
  font-weight: 500;
}

.event-hero__count span:last-child {
  color: var(--border-default);
}

.event-hero__count i {
  width: 1px;
  height: 10px;
  background: var(--border-default);
}

/* ==========================================================================
   공통 섹션 (진행 중 / 상황별 / 지난 기획전)
   ========================================================================== */
.event-section__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-32);
  padding-top: var(--space-96);
  padding-bottom: var(--space-96);
}

.event-section__head {
  display: flex;
  align-items: flex-end;
  gap: var(--space-12);
}

.event-section__desc {
  font-size: var(--fz-body-s);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: -0.02em;
  color: var(--text-secondary);
}

.event-section__more {
  align-self: center;
}

/* 헤더 우측 "더보기" 링크 (situation.css 의 .situation-section__more 참고) : margin-left:auto 로 오른쪽 끝에 붙임 */
.event-section__more-link {
  flex-shrink: 0;
  margin-left: auto;
  font-size: var(--fz-body-xs);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}


/* ==========================================================================
   이벤트 카드
   ========================================================================== */
.event-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-24);
}

.event-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.event-card__img {
  width: 100%;
  height: auto; /* HTML height 속성(CLS 방지용 원본값)이 aspect-ratio 를 덮어쓰지 않게 */
  aspect-ratio: 197.67 / 125;
  border-radius: 8px;
  object-fit: cover;
}

.event-card__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-14);
  padding-bottom: var(--space-12);
  text-align: center;
}

.event-card__badges {
  display: flex;
  gap: var(--space-8);
}

/* 배지 글자 10px : 시안 값. 토큰(--fz-caption 13px)보다 작아 직접 지정 */
.event-badge {
  padding: 2px 7px;
  border-radius: 24px;
  background: var(--brand-primary);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--base-white);
  white-space: nowrap;
}

.event-badge--sale {
  background: var(--brand-primary-light);
  font-weight: 700;
  color: var(--brand-primary);
}

.event-badge--dday {
  background: var(--event-dday-bg);
  font-weight: 700;
}

.event-card__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.event-card__name {
  font-size: var(--fz-body-l);
  font-weight: 500;
  line-height: var(--lh-body);
  color: var(--text-primary);
}

.event-card__date {
  font-size: var(--fz-body-xs);
  line-height: var(--lh-tight);
  color: var(--text-secondary);
}

/* "더보기" 추가 카드 목록 : 클릭 전에는 숨김, 클릭 후 PC·Tablet 은 3열로 추가 노출 */
.event-list-more {
  display: none;
}

.event-list-more.is-open {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-24);
}

/* 4번째 카드는 Mobile 2x2 배열용이라 PC·Tablet(3열)에서는 숨김 */
.event-list-more > li:nth-child(4) {
  display: none;
}

/* ==========================================================================
   상황별 추천상품 : 공통 .occa-card 를 3열 그리드에 배치
   ========================================================================== */
.event-occa-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-24);
}

/* ==========================================================================
   지난 기획전/이벤트 (게시판형 목록)
   ========================================================================== */
.event-board__list {
  border-top: 1px solid var(--border-default);
}

.event-board__row {
  display: flex;
  align-items: center;
  gap: var(--space-36);
  padding: var(--space-8) var(--space-24);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--fz-body-xs);
  line-height: var(--lh-tight);
}

.event-board__tit {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}

.event-board__state {
  flex-shrink: 0;
  color: var(--text-muted);
}

.event-board__notice {
  padding: var(--space-12) var(--space-24);
  font-size: var(--fz-caption);
  font-weight: 300;
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.event-page {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-16) 0;
  font-size: var(--fz-price-s);
  line-height: var(--lh-body);
  color: var(--text-secondary);
}

.event-page__num.is-active {
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   CS Center 배너 2개 (기업제휴 · 원데이특가) : index.css 와 동일하게 220px 고정 정사각형
   ========================================================================== */
.partners-list {
  display: flex;
  align-items: center;
  gap: 12px;
}

.partners-list .partners,
.partners-list .event-banner {
  flex: none;
  width: 220px;
  height: 220px;
  min-width: 0;
  max-width: none;
  padding: 16px;
}

/* ==========================================================================
   Tablet (768px ~ 1099px)
   ========================================================================== */
@media (max-width: 1099px) {
  .event-hero__ctrl {
    bottom: 5%;
  }
}

/* ==========================================================================
   Mobile (~767px)
   ========================================================================== */
@media (max-width: 767px) {
  .event-title__inner {
    padding-top: var(--space-48);
  }

  /* 모바일 제목 24px : 모바일 토큰(--fz-heading-xxl 30px)에 24px 값이 없어 직접 지정 */
  .event-title__tit {
    font-size: 24px;
  }

  /* 배너 : 좌우 여백 없이 가득 채움. 높이를 px 고정하지 않고 폭에 비례하게 맞춘다.
     모바일 이미지는 3:4 이지만 이 페이지는 더 짧은 5:6 으로 두고, 이미지는 object-fit: cover 로 중앙 기준 크롭 */
  .event-hero__inner {
    padding-left: 0;
    padding-right: 0;
  }

  .event-hero__stage {
    aspect-ratio: 5 / 6;
    height: auto;
  }

  /* 이미지는 위쪽 기준으로 맞추고 넘치는 아래쪽만 잘리게 한다 (기본은 중앙 기준) */
  .event-hero__bg {
    object-position: top;
  }

  .event-hero__txt {
    top: auto;
    left: var(--space-48);
    bottom: var(--space-64);
    transform: none;
  }

  /* 배너 제목 : 모바일 토큰(--fz-heading-xxl 30px)보다 조금 작게 26px. 맞는 토큰이 없어 직접 지정 */
  .event-hero__tit {
    font-size: 26px;
  }

  /* 컨트롤 : 알약·숫자 대신 배너 양옆 중앙에 < > 화살표만 (문구 가림 방지).
     화살표는 32px 원 안에 16px 아이콘. ctrl 은 전체 폭을 덮되 클릭은 통과시키고 화살표 버튼만 클릭되게 한다.
     숫자(01/02)는 스크린리더용 aria-live 가 있어 화면에서만 숨김 */
  .event-hero__ctrl {
    left: 0;
    right: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    justify-content: space-between;
    padding: 0 var(--space-12);
    background: none;
    pointer-events: none;
  }

  .event-hero__arrow {
    width: 32px;
    height: 32px;
    position: relative;
    border-radius: 50%;
    /* 반투명 흰 원(시안 값이라 토큰 없음) + 검정 화살표.
       기존 화살표 이미지는 흰색이라 배경 이미지로는 못 쓰고, 같은 파일을 mask 로 써서 색만 검정으로 칠한다 */
    background: rgba(255, 255, 255, 0.7);
    pointer-events: auto;
  }

  .event-hero__arrow::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--text-primary);
    -webkit-mask: url('../../images/events/icon-banner-arrow.svg') center / 16px 16px no-repeat;
    mask: url('../../images/events/icon-banner-arrow.svg') center / 16px 16px no-repeat;
  }

  .event-hero__count {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  /* 섹션 : 제목·설명 세로 스택, 아래 여백은 마지막 섹션에서만 */
  .event-section__inner {
    padding-bottom: 0;
  }


  .event-section__head {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-8);
    position: relative;
  }

  /* 모바일은 head 가 세로 배치라 더보기를 맨 아래(서브타이틀 줄) 오른쪽 끝에 고정 */
  .event-section__more-link {
    position: absolute;
    bottom: 0;
    right: 0;
  }

  /* 이벤트 카드 : 1장씩 가로 스와이프. 스크롤바는 숨기고 스와이프로만 이동 */
  .event-list {
    display: flex;
    gap: var(--space-12);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .event-list::-webkit-scrollbar {
    display: none;
  }

  .event-list > li {
    flex: 0 0 100%;
    scroll-snap-align: start;
  }

  /* "더보기" 클릭 후 : 슬라이더는 그대로 두고 그 아래에 2열 그리드로 추가 (Figma 1752:35851) */
  .event-list-more.is-open {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-24) var(--space-8);
    padding: var(--space-48) 0;
  }

  .event-list-more > li:nth-child(4) {
    display: block;
  }

  /* 상황별 : 2열 */
  .event-occa-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-24) var(--space-12);
  }

  .event-board__row {
    gap: var(--space-16);
    padding-top: var(--space-14);
    padding-bottom: var(--space-14);
  }

  /* CS Center 배너 : 220px 고정폭이 둘이면 모바일 화면을 넘치므로 반반 */
  .partners-list {
    width: 100%;
  }

  .partners-list .partners,
  .partners-list .event-banner {
    width: calc(50% - 6px);
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 12px;
  }
}
