/* 비동기 배너 결정 중에는 본문 배치를 노출하지 않는다. JS가 없으면 정적 본문을 그대로 표시한다. */
@media (scripting: enabled) {
  .site-content:has(> .banner-carousel[aria-busy="true"]) {
    visibility: hidden;
    animation: banner-loading-expired var(--banner-loading-timeout) step-end forwards;
  }
}

@keyframes banner-loading-expired {
  to { visibility: visible; }
}

/* 배너는 본문 폭을 유지한다. 선택 목록만 넓은 화면의 왼쪽 여백에 놓는다. */
.banner-carousel {
  position: relative;
  isolation: isolate;
  display: grid;
  flex: none;
  grid-template-columns: minmax(0, 1fr);
  min-height: var(--banner-block-size);
}

.banner-track {
  grid-area: 1 / 1;
  display: flex;
  min-height: 0;
  overflow-x: auto;
  border-radius: var(--radius-squircle-md);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.banner-track::-webkit-scrollbar {
  display: none;
}

/* 짧은 문구와 제목은 래퍼 없이 세로 중앙에 놓는다. 그림은 자체 쌓임 맥락 안에서 글 뒤에 깔린다. */
.banner-slide {
  position: relative;
  isolation: isolate;
  display: grid;
  flex: 0 0 100%;
  min-width: 0;
  align-content: center;
  padding: var(--space-2xl) var(--space-2xl);
  /* 그림 없는 슬라이드: 밝은 회색 단색. 색을 얹을 때 여기서 시작한다. */
  background: rgb(var(--color-gray-100));
  scroll-snap-align: start;
}

.banner-slide--image {
  background-color: rgb(var(--color-gray-100));
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.banner-carousel[data-fallback="true"] .banner-slide--image {
  background-image: url("/assets/images/banner-test.webp");
}

.banner-picture {
  position: absolute;
  z-index: var(--z-index-background);
  inset: 0;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-eyebrow {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
  line-height: var(--font-line-height-md);
}

.banner-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--banner-title-line-count);
  line-clamp: var(--banner-title-line-count);
  font-size: var(--banner-title-font-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--banner-title-line-height);
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.banner-eyebrow:not([hidden]) {
  margin-block-end: var(--banner-label-gap);
}

.banner-arrow {
  position: absolute;
  inset-block-end: var(--space-xs);
  inset-inline-start: var(--space-2xl);
  z-index: var(--z-index-content);
  display: flex;
  width: var(--size-icon-md);
  height: var(--size-icon-md);
  padding: 0;
  align-items: center;
  justify-content: center;
  color: rgb(var(--color-white));
}

.banner-arrow--next {
  inset-inline-start: auto;
  inset-inline-end: var(--space-2xl);
}

.banner-carousel[data-count="1"] .banner-arrow {
  visibility: hidden;
}

.banner-arrow::before {
  width: var(--size-icon-md);
  height: var(--size-icon-md);
  background: currentColor;
  mask: url("/assets/icons/chevron-left.svg?v=70ca6ce8") center / contain no-repeat;
  content: "";
}

.banner-arrow--next::before {
  mask-image: url("/assets/icons/chevron-right.svg?v=d1400e82");
}

.banner-list {
  position: absolute;
  grid-area: 1 / 1;
  inset-inline-end: calc(100% + var(--space-2xl));
  display: none;
  width: var(--banner-list-inline-size);
  align-self: center;
  flex-direction: column;
  gap: var(--banner-list-gap);
}

/* 긴 제목은 줄을 바꾸고 선택한 항목만 강조한다. */
.banner-list-item {
  padding: 0 var(--space-xs);
  color: rgb(var(--color-gray-500));
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--font-line-height-xs);
  overflow-wrap: anywhere;
  text-align: right;
  word-break: keep-all;
}

.banner-list-item[aria-selected="true"] {
  color: rgb(var(--color-gray-900));
}

/* 1728px부터 목록 폭·간격·화면 바깥 여백을 본문 왼쪽에 확보할 수 있다. */
@media (min-width: 108rem) {
  .banner-list {
    display: flex;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .banner-track {
    scroll-behavior: smooth;
  }

  .banner-slide[data-reveal="playing"] > :is(.banner-eyebrow, .banner-title) {
    animation: banner-text-reveal var(--banner-reveal-duration) var(--easing-standard) both;
  }
}

@keyframes banner-text-reveal {
  from {
    transform: translateY(var(--space-md));
  }
  to {
    transform: translateY(0);
  }
}

/* 영상 선반: 목록은 한 줄이다. 열 수(--video-grid-columns)만큼 균등 분배하고 넘치는 카드는 가로 스크롤로 넘긴다(YouTube·넥슨 선반 방식). */
.video-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - var(--space-2xl) * (var(--video-grid-columns) - 1)) / var(--video-grid-columns));
  gap: var(--space-2xl);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.video-grid::-webkit-scrollbar {
  display: none;
}

/* 넥슨 게임 카드 방식: 흰 카드 면 위에 썸네일, 아래에 여백 있는 글. 테두리·그림자 없음.
   카드(링크)가 목록의 직접 자식이며 썸네일(img)·제목·정보 줄을 래퍼 없이 세로로 놓는다(2026-09-16 사용자 요청: 컨테이너 최소화). 카드의 잘라내기가 둥근 모서리와 썸네일 확대를 함께 맡는다. */
.video-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgb(var(--color-gray-100));
  scroll-snap-align: start;
}

.video-thumb {
  flex: none;
  width: 100%;
  aspect-ratio: var(--media-video-aspect-ratio);
  background: rgb(var(--color-gray-500));
  transform-origin: center;
  object-fit: cover;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .video-thumb {
    transform: scale(1);
    transition: transform var(--duration-ui-default) var(--easing-out);
  }

  .video-card:hover .video-thumb {
    transform: scale(var(--video-thumbnail-emphasis-scale));
  }
}

/* 제목은 2줄까지만 보이고 넘치면 말줄임(…)으로 자른다. 호버 시 한 줄로 펴서 흘려도 높이가 변하지 않도록 2줄 높이를 예약한다. */
.video-title {
  display: -webkit-box;
  min-height: calc(var(--font-line-height-md) * 2);
  padding: var(--space-md) var(--space-md) 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: var(--font-line-height-md);
}

.video-card[data-title-overflow]:hover .video-title {
  display: block;
  white-space: nowrap;
}

/* 두 줄 영역에서 실제로 잘린 제목만 한 번 흐르고, 마지막 글자가 보이는 위치에서 멈춘다. */
.video-card[data-title-overflow]:hover .video-title-text {
  display: inline-block;
}

@keyframes video-title-flow {
  to {
    transform: translateX(var(--runtime-video-title-translation));
  }
}

@media (prefers-reduced-motion: no-preference) {
  .video-card[data-title-overflow]:hover .video-title-text {
    animation: video-title-flow var(--runtime-video-title-duration) linear 1 forwards;
  }
}

/* 제목이 한 줄이든 두 줄이든 정보 줄은 항상 카드 바닥에 붙는다. */
.video-info {
  display: flex;
  justify-content: space-between;
  margin-block-start: auto;
  padding: var(--space-xs) var(--space-md) var(--space-md);
  gap: var(--space-sm);
  color: rgb(var(--color-gray-500));
  font-size: var(--font-size-xs);
  line-height: var(--font-line-height-xs);
}

.site-content:has(> .banner-carousel:first-child) {
  gap: 0;
}

.site-content:has(> .banner-carousel:first-child) > * + * {
  margin-block-start: var(--layout-section-gap);
}

.site-content:has(> .banner-carousel:first-child) > .banner-carousel + * {
  margin-block-start: var(--space-2xl);
}

