/* 배경 슬라이드 — 역사 상세 화면 */
.background__slide--history {
  color: #fff;
}

.bg-history__backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(calc(32 * var(--ui-scale) * 1px)) saturate(1.25) brightness(1.08);
  transform: scale(1.15);
}

.bg-history__backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
}

.bg-history__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(28 * var(--ui-scale) * 1px) calc(48 * var(--ui-scale) * 1px) calc(32 * var(--ui-scale) * 1px);
  min-height: 0;
}

.bg-history__body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: calc(56 * var(--ui-scale) * 1px);
  min-height: 0;
  padding: calc(32 * var(--ui-scale) * 1px) calc(24 * var(--ui-scale) * 1px);
}

.bg-history__image {
  flex: 0 1 auto;
  align-self: center;
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: 50%;
  aspect-ratio: 3 / 2;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.bg-history__text {
  flex: 1;
  min-width: 0;
  max-height: 78%;
  overflow: hidden;
  padding: calc(8 * var(--ui-scale) * 1px) 0;
}

.bg-history__year-row {
  display: flex;
  align-items: flex-end;
  gap: calc(32 * var(--ui-scale) * 1px);
  padding-bottom: calc(12 * var(--ui-scale) * 1px);
  border-bottom: calc(1 * var(--ui-scale) * 1px) solid rgba(255, 255, 255, 0.28);
}

.bg-history__year {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: calc(72 * var(--ui-scale) * 1px);
  font-weight: 400;
  line-height: 1;
  color: #fff;
}

.bg-history__category {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: calc(16 * var(--ui-scale) * 1px);
  color: rgba(255, 255, 255, 0.9);
  padding-bottom: calc(4 * var(--ui-scale) * 1px);
  white-space: nowrap;
}

.bg-history__title {
  font-size: calc(22.4 * var(--ui-scale) * 1px);
  font-weight: 700;
  margin: calc(28 * var(--ui-scale) * 1px) 0 calc(18 * var(--ui-scale) * 1px);
  line-height: 1.4;
  color: #fff;
}

.bg-history__desc {
  font-size: calc(15.2 * var(--ui-scale) * 1px);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.92);
  max-width: calc(520 * var(--ui-scale) * 1px);
}

/* 화면비가 3:4보다 좁을 때만 세로 스택 (그 전까지는 좌우 배치 유지) */
@media (max-aspect-ratio: 3 / 4) {
  .bg-history__inner {
    padding: max(10px, calc(12 * var(--ui-scale) * 1px))
      max(14px, calc(16 * var(--ui-scale) * 1px));
    padding-top: calc(var(--top-height) + max(28px, 5.5dvh));
    padding-bottom: max(220px, 48dvh);
    justify-content: flex-start;
  }

  .bg-history__body {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: max(10px, calc(12 * var(--ui-scale) * 1px));
    padding: max(12px, calc(14 * var(--ui-scale) * 1px)) 0 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bg-history__text {
    display: contents;
  }

  .bg-history__year-row {
    order: 1;
    justify-content: center;
    align-items: baseline;
    gap: max(10px, calc(12 * var(--ui-scale) * 1px));
    width: 100%;
    margin: 0;
    padding-bottom: max(6px, calc(8 * var(--ui-scale) * 1px));
    border-bottom: none;
  }

  .bg-history__year {
    font-size: max(32px, calc(38 * var(--ui-scale) * 1px));
    text-align: center;
  }

  .bg-history__category {
    font-size: max(12px, calc(13 * var(--ui-scale) * 1px));
    padding-bottom: 0;
  }

  .bg-history__image {
    order: 2;
    flex: 0 0 auto;
    align-self: center;
    width: min(70%, 260px);
    max-width: 100%;
    height: auto;
    max-height: min(20dvh, 148px);
    aspect-ratio: 3 / 2;
    background-size: cover;
    background-position: center;
  }

  .bg-history__title {
    order: 3;
    width: 100%;
    margin: max(4px, calc(6 * var(--ui-scale) * 1px)) 0
      max(6px, calc(8 * var(--ui-scale) * 1px));
    font-size: max(15px, calc(17 * var(--ui-scale) * 1px));
    text-align: center;
  }

  .bg-history__desc {
    order: 4;
    width: 100%;
    font-size: max(12px, calc(13 * var(--ui-scale) * 1px));
    line-height: 1.55;
    max-width: none;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    line-clamp: 8;
    overflow: hidden;
  }
}

