/* =============================================================================
   KMDb home
   Figma: KShuKPV6DNqNS5rv28iRuT / 860:60900
   ============================================================================= */

.kmdb-home-main {
  overflow: hidden;
  background: var(--color-surface);
}

/* 진입 요소만 있는 얇은 화면. 본문이 짧아도 footer가 뜨지 않도록 최소 높이를 갖고 내용을 상하 중앙에 둔다. */
.kmdb-home-main--compact {
  display: grid;
  align-content: center;
  min-height: calc(100svh - var(--layout-header-desktop-height, 135px));
  padding-block: 40px;
}

@media (max-width: 599px) {
  .kmdb-home-main--compact {
    padding-block: 24px;
  }
}

/* 중앙 정렬은 상단 고정 여백과 공존할 수 없다. 이 화면에서만 hero의 상단 여백을 비운다. */
.kmdb-home-main--compact .kmdb-home-hero {
  padding-top: 0;
}

/* 페이지 최상단 공지 */
.kmdb-home-announcement {
  min-height: 56px;
  color: var(--color-text-white, #ffffff);
  background: var(--color-surface-black, #000000);
}

.kmdb-home-announcement[hidden] {
  display: none;
}

.kmdb-home-announcement__layout {
  display: grid;
  width: min(
    var(--layout-max),
    calc(100% - (var(--layout-safe-gutter) * 2))
  );
  min-height: 56px;
  margin: 0 auto;
  padding: 0;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
}

@media (max-width: 899px) {
  .kmdb-home-announcement__layout {
    display: flex;
    min-height: 100px;
    padding: 12px 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 16px;
  }
}

.kmdb-home-announcement__link {
  display: inline-flex;
  min-width: 0;
  grid-column: 2;
  align-items: center;
  gap: 8px;
  color: var(--color-text-white, #ffffff);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
}

@media (max-width: 899px) {
  .kmdb-home-announcement__link {
    align-self: flex-start;
    gap: 12px;
  }
}

.kmdb-home-announcement__link > img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  filter: brightness(0) invert(1);
}

.kmdb-home-announcement__link:lang(en) {
  max-width: 100%;
}

.kmdb-home-announcement__link > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kmdb-home-announcement__actions {
  display: flex;
  grid-column: 3;
  align-items: center;
  justify-self: end;
  gap: 32px;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
}

@media (max-width: 899px) {
  .kmdb-home-announcement__actions {
    width: 100%;
    justify-content: space-between;
    justify-self: auto;
  }
}

.kmdb-home-announcement__dismiss-today {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.kmdb-home-announcement__checkbox {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid var(--color-border-inactive3, #ced1d4);
  border-radius: 50%;
  background: var(--color-surface-white);
}

.kmdb-home-announcement__checkbox::after {
  position: absolute;
  inset: 0;
  background: var(--color-icon-ic-gray, #838689);
  content: "";
  mask: url("/icons/action/check.svg") center/20px 20px no-repeat;
  -webkit-mask: url("/icons/action/check.svg") center/20px 20px no-repeat;
}

.kmdb-home-announcement__dismiss-today input:checked + .kmdb-home-announcement__checkbox {
  border-color: var(--color-surface-white, #ffffff);
  background: var(--color-surface-black, #000000);
}

.kmdb-home-announcement__dismiss-today input:checked + .kmdb-home-announcement__checkbox::after {
  background: var(--color-surface-white, #ffffff);
}

.kmdb-home-announcement__dismiss-today input:focus-visible + .kmdb-home-announcement__checkbox {
  outline: 2px solid var(--color-surface-white, #ffffff);
  outline-offset: 2px;
}

.kmdb-home-announcement__close {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: var(--color-text-white, #ffffff);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.kmdb-home-announcement__close img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

/* Hero and integrated search */
.kmdb-home-hero {
  padding: 166px var(--layout-gutter) 0;
  color: var(--color-text);
}

.kmdb-home-hero__search-panel {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
}

.kmdb-home-hero__search-panel h1 {
  margin: 0 0 48px;
  font-size: 70px;
  font-weight: var(--font-weight-bold);
  line-height: 0.7;
  letter-spacing: 0;
}

.kmdb-home-hero--english h1 {
  line-height: 1.15;
}

.kmdb-home-hero__search-panel h1 span {
  display: inline;
}

.kmdb-home-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 149px;
  max-width: 750px;
  margin: 0 auto;
  border-radius: 20px;
  background: var(--color-surface);
}

@media (max-width: 1439px) {
  .kmdb-home-search {
    border-radius: 16px;
  }
}

.kmdb-home-search--single {
  grid-template-columns: minmax(0, 1fr);
}

.kmdb-home-search.kmdb-home-search--single > div {
  border-radius: 20px;
}

@media (max-width: 1439px) {
  .kmdb-home-search.kmdb-home-search--single > div {
    border-radius: 16px;
  }
}

.kmdb-home-search > div {
  position: relative;
  overflow: hidden;
  border: 1.5px solid var(--color-text);
  border-radius: 20px 0 0 20px;
  background: var(--color-surface);
}

.kmdb-home-search:has(input:focus)::after {
  position: absolute;
  inset: 0;
  border: 3px solid var(--color-focus);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.kmdb-home-search input {
  width: 100%;
  min-width: 0;
  min-height: 77px;
  padding: 0 72px 0 30px;
  border: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  outline: 0;
}

.kmdb-home-search input::placeholder {
  color: var(--color-muted);
  opacity: 1;
}

.kmdb-home-search > div > button {
  position: absolute;
  top: 50%;
  right: 26.5px;
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  transform: translateY(-50%);
}

.kmdb-home-search > div > button img,
.kmdb-home-search > a img {
  width: 28px;
  height: 28px;
}

.kmdb-home-search > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 80px;
  padding-left: 19px;
  border: 1.5px solid var(--color-text);
  border-left: 0;
  border-radius: 0 20px 20px 0;
  color: var(--color-text);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  background: var(--color-surface);
}

/* 영화글·리스트·컬렉션 신규 등록 소식 */
.kmdb-home-latest-news {
  position: relative;
  width: min(750px, calc(100% - (var(--layout-gutter) * 2)));
  margin: 36px auto 180px;
}

@media (max-width: 1439px) {
  .kmdb-home-latest-news {
    margin-bottom: 37px;
  }
}

@media (max-width: 599px) {
  .kmdb-home-latest-news {
    margin-bottom: 60px;
  }
}

.kmdb-home-latest-news__viewport {
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.kmdb-home-latest-news__viewport::-webkit-scrollbar {
  display: none;
}

.kmdb-home-latest-news__empty {
  display: grid;
  min-height: 120px;
  margin: 0;
  padding: 24px;
  place-items: center;
  border: 1px solid var(--color-border-disabled);
  border-radius: 16px;
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 599px) {
  .kmdb-home-latest-news__empty {
    min-height: 106px;
    padding: 16px;
    font-size: 14px;
  }
}

.kmdb-home-latest-news__track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kmdb-home-latest-news__track > li {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
}

.kmdb-home-latest-news__link {
  display: flex;
  min-height: 120px;
  align-items: center;
  gap: 20px;
  color: var(--color-text-01);
}

@media (max-width: 599px) {
  .kmdb-home-latest-news__link {
    min-height: 106px;
    gap: 16px;
  }
}

.kmdb-home-latest-news__image {
  display: grid;
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  overflow: hidden;
  place-items: center;
  border-radius: 50%;
  background: var(--color-background-secondary, #f4f4f4);
}

@media (max-width: 599px) {
  .kmdb-home-latest-news__image {
    flex-basis: 106px;
    width: 106px;
    height: 106px;
  }
}

.kmdb-home-latest-news__image--list {
  position: relative;
  --poster-count: 5;
}

.kmdb-home-latest-news__image--list:has(> .kmdb-home-latest-news__poster:only-child) {
  --poster-count: 1;
}

.kmdb-home-latest-news__image--list:has(> .kmdb-home-latest-news__poster:nth-child(2):last-child) {
  --poster-count: 2;
}

.kmdb-home-latest-news__image--list:has(> .kmdb-home-latest-news__poster:nth-child(3):last-child) {
  --poster-count: 3;
}

.kmdb-home-latest-news__image--list:has(> .kmdb-home-latest-news__poster:nth-child(4):last-child) {
  --poster-count: 4;
}

.kmdb-home-latest-news__poster {
  --poster-index: 0;
  position: absolute;
  top: 0;
  right: calc((var(--poster-count) - var(--poster-index) - 1) * 100% / var(--poster-count));
  z-index: calc(5 - var(--poster-index));
  width: 75%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 4px 0 6px rgba(0, 0, 0, 0.25);
}

.kmdb-home-latest-news__poster:only-child {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

.kmdb-home-latest-news__poster:nth-child(2) {
  --poster-index: 1;
}

.kmdb-home-latest-news__poster:nth-child(3) {
  --poster-index: 2;
}

.kmdb-home-latest-news__poster:nth-child(4) {
  --poster-index: 3;
}

.kmdb-home-latest-news__poster:nth-child(5) {
  --poster-index: 4;
}

.kmdb-home-latest-news__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kmdb-home-latest-news__details {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.kmdb-home-latest-news__type {
  pointer-events: none;
}

.kmdb-home-latest-news__details strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1439px) {
  .kmdb-home-latest-news__details strong {
    font-size: 16px;
  }
}

@media (max-width: 599px) {
  .kmdb-home-latest-news__details strong {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
  }
}

.kmdb-home-latest-news__details time {
  color: var(--color-muted);
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 1439px) {
  .kmdb-home-latest-news__details time {
    font-size: 14px;
  }
}

.kmdb-home-latest-news__controls {
  position: absolute;
  top: 8px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 599px) {
  .kmdb-home-latest-news__controls {
    display: none;
  }
}

.kmdb-home-latest-news__button {
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--color-border-disabled);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.kmdb-home-latest-news__button:disabled {
  opacity: .35;
  cursor: default;
}

.kmdb-home-latest-news__button img {
  width: 16px;
  height: 16px;
}

.kmdb-home-latest-news__status {
  min-width: 36px;
  color: var(--color-text-01);
  font-size: 14px;
  text-align: center;
}

/* Fan-picked movie posters */
.kmdb-home-fan-picks {
  width: min(
    var(--layout-max),
    calc(100% - (var(--layout-safe-gutter) * 2))
  );
  margin-inline: auto;
}

@media (max-width: 1439px) {
  .kmdb-home-fan-picks {
    padding: 30px 0;
  }
}

@media (max-width: 599px) {
  .kmdb-home-fan-picks {
    padding: 10px 0;
  }
}

.kmdb-home-updates h2 {
  margin: 0;
  font-size: 36px;
  font-weight: var(--font-weight-bold);
  line-height: 1.5;
  letter-spacing: 0;
}

.kmdb-home-fan-picks__grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 50px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kmdb-home-fan-picks__grid a {
  display: block;
  min-width: 0;
  color: inherit;
}

.kmdb-home-fan-picks__poster {
  display: grid;
  width: 100%;
  aspect-ratio: 7 / 10;
  overflow: hidden;
  background: var(--color-surface-alt);
  place-items: center;
}

.kmdb-home-fan-picks__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.kmdb-home-fan-picks__grid a:hover .kmdb-home-fan-picks__poster img {
  transform: scale(1.025);
}

/* Updates carousel */
.kmdb-home-updates {
  margin-top: 100px;
  padding-bottom: 185px;
}

.kmdb-home-updates__carousel-layout {
  --home-section-canvas-padding: max(
    var(--layout-safe-gutter),
    calc((100% - var(--layout-max)) / 2)
  );

  padding-right: 0;
  padding-left: var(--home-section-canvas-padding);
}

.kmdb-home-updates__heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: calc(100% - var(--layout-safe-gutter));
  max-width: var(--layout-max);
  margin: 0 0 30px;
}

.kmdb-home-updates__carousel-controls {
  display: flex;
  gap: 16px;
}

.kmdb-home-updates__carousel-button {
  display: inline-grid;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--color-text);
  border-radius: 50%;
  background: var(--color-surface);
}

.kmdb-home-updates__carousel-button img {
  width: 29px;
  height: 29px;
}

.kmdb-home-updates__carousel-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.kmdb-home-updates__carousel-viewport {
  position: relative;
  padding-bottom: 1px;
  overflow: hidden;
}

.kmdb-home-updates__carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 26px;
  width: max-content;
  padding-right: var(--layout-safe-gutter);
}

.kmdb-home-updates__carousel-track a,
.kmdb-home-updates__carousel-track img {
  user-select: none;
  -webkit-user-drag: none;
}

.kmdb-home-content-card {
  width: 208px;
}

.kmdb-home-content-card__link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: inherit;
}

.kmdb-home-content-card__link:focus-visible {
  outline: 0;
}

.kmdb-home-content-card__link:focus-visible::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 3px solid var(--color-focus);
  content: "";
  pointer-events: none;
}

.kmdb-home-content-card__media {
  position: relative;
  display: grid;
  width: 208px;
  height: auto;
  aspect-ratio: 3 / 4;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--color-surface-alt);
}

.kmdb-home-content-card__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kmdb-home-content-card__type {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--color-icon-default);
  border-radius: 999px;
  color: var(--color-text);
  background: var(--color-surface);
  font-size: 12px;
  line-height: 1.5;
}

.kmdb-home-content-card__article-summary,
.kmdb-home-content-card__heading {
  display: flex;
  flex-direction: column;
}

.kmdb-home-content-card__article-summary {
  gap: 12px;
}

.kmdb-home-content-card__heading {
  gap: 4px;
}

.kmdb-home-content-card__eyebrow {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
}

.kmdb-home-content-card strong {
  color: var(--color-text);
  font-size: 18px;
  font-weight: var(--font-weight-bold);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (min-width: 600px) {
  .kmdb-home-content-card strong {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

.kmdb-home-content-card__category-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.kmdb-home-content-card__category-badge {
  display: flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-height: 33px;
  height: 33px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-disabled);
  border-radius: 10px;
  color: var(--color-text-02);
  background: var(--color-surface-white);
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
}

.kmdb-home-content-card__category-badge:hover {
  border-color: var(--color-border-disabled);
}

.kmdb-home-fan-picks__empty,
.kmdb-home-updates__empty {
  display: grid;
  width: 100%;
  gap: 16px;
  place-content: center;
  place-items: center;
  border: 1px solid var(--color-border-disabled);
  border-radius: 16px;
  color: var(--color-text-02);
  text-align: center;
}

.kmdb-home-fan-picks__empty {
  min-height: calc((min(var(--layout-max), 100vw - (var(--layout-safe-gutter) * 2)) - 120px) / 6 * 10 / 7);
}

@media (max-width: 599px) {
  .kmdb-home-fan-picks__empty {
    min-height: calc((100vw - 48px) / 3 * 10 / 7);
  }
}

.kmdb-home-updates__empty {
  max-width: var(--layout-max);
  min-height: calc(208px * 4 / 3 + 86px);
}

@media (max-width: 599px) {
  .kmdb-home-updates__empty {
    min-height: calc(182px * 4 / 3 + 80px);
  }
}

.kmdb-home-fan-picks__empty img,
.kmdb-home-updates__empty img {
  width: 32px;
  height: 32px;
}

.kmdb-home-fan-picks__empty p,
.kmdb-home-updates__empty p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

@media (max-width: 599px) {
  .kmdb-home-fan-picks__empty p,
  .kmdb-home-updates__empty p {
    font-size: 14px;
  }
}

@media (max-width: 1439px) {
  .kmdb-home-hero {
    padding-top: 104px;
  }

  .kmdb-home-hero__search-panel h1 {
    margin-bottom: 40px;
    font-size: 44px;
    line-height: 1.5;
  }

  .kmdb-home-search > div {
    border-radius: 16px 0 0 16px;
  }

  .kmdb-home-search input {
    min-height: 67px;
    padding-right: 64px;
    font-size: 16px;
  }

  .kmdb-home-search > div > button img,
  .kmdb-home-search > a img {
    width: 24px;
    height: 24px;
  }

  .kmdb-home-search > a {
    min-height: 70px;
    border-radius: 0 16px 16px 0;
    font-size: 16px;
  }

  .kmdb-home-updates h2 {
    font-size: 20px;
  }

  .kmdb-home-fan-picks__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }

  .kmdb-home-content-card {
    width: 182px;
  }

  .kmdb-home-content-card__media {
    width: 182px;
  }

  .kmdb-home-updates {
    margin-top: 0;
    padding-top: 30px;
    padding-bottom: 92px;
  }

  .kmdb-home-updates__carousel-layout {
    --home-section-canvas-padding: var(--layout-gutter);

    max-width: none;
  }

  .kmdb-home-updates__heading-row {
    max-width: none;
    margin-bottom: 20px;
  }

  .kmdb-home-updates__carousel-controls {
    display: none;
  }

  .kmdb-home-content-card strong {
    font-size: 16px;
  }
}

@media (max-width: 599px) {
  .kmdb-home-hero {
    padding-top: 51px;
  }

  .kmdb-home-hero__search-panel {
    text-align: left;
  }

  .kmdb-home-hero__search-panel h1 {
    margin-bottom: 30px;
    font-size: 32px;
    line-height: 1.5;
    word-break: keep-all;
  }

  .kmdb-home-hero__search-panel h1 span {
    display: block;
  }

  .kmdb-home-search {
    grid-template-columns: 1fr;
  }

  .kmdb-home-search > div {
    height: 56px;
    border-radius: 16px 16px 0 0;
  }

  .kmdb-home-search input {
    height: 100%;
    min-height: 0;
    padding-right: 52px;
    padding-left: 20px;
    font-size: 16px;
  }

  .kmdb-home-search > div > button {
    right: 16px;
  }

  .kmdb-home-search > div > button img,
  .kmdb-home-search > a img {
    width: 24px;
    height: 24px;
  }

  .kmdb-home-search > a {
    justify-content: space-between;
    min-height: 56px;
    padding: 0 20px;
    border: 1.5px solid var(--color-text);
    border-top: 1px solid var(--color-line);
    border-radius: 0 0 16px 16px;
    font-size: 16px;
  }

  .kmdb-home-fan-picks__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .kmdb-home-updates {
    padding-bottom: 120px;
  }

  .kmdb-home-content-card {
    width: 182px;
  }

  .kmdb-home-content-card__media {
    width: 182px;
  }
}
