/**
 * CheckNow — 首页原生轮播 Banner CSS
 *
 * 独立命名空间 .cn-home-carousel，不依赖 Smart Slider。
 */
.cn-home-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* ponytail: 560-620px 桌面，520px min，不依赖 aspect-ratio */
  height: clamp(520px, 46vw, 620px);
  min-height: 520px;
  max-height: 620px;
}

.cn-home-carousel[style*="--cn-banner-desktop-height"] {
  height: var(--cn-banner-desktop-height);
  min-height: var(--cn-banner-desktop-height);
  max-height: none;
}

@media (max-width: 768px) {
  .cn-home-carousel {
    height: clamp(480px, 100vw, 560px);
    min-height: 480px;
    max-height: 560px;
  }

  .cn-home-carousel[style*="--cn-banner-mobile-height"] {
    height: var(--cn-banner-mobile-height);
    min-height: var(--cn-banner-mobile-height);
    max-height: none;
  }

  .cn-home-carousel[style*="--cn-banner-mobile-height"] .cn-home-carousel__slide {
    min-height: 0;
  }
}

.cn-home-carousel__viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.cn-home-carousel__track {
  display: flex;
  transition: transform var(--cn-carousel-duration, 500ms) ease;
  height: 100%;
}

.cn-home-carousel__slide {
	flex: 0 0 100%;
	width: 100%;
	min-width: 100%;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	height: 100%;
}

.cn-home-carousel__media {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.cn-home-carousel__img {
	position: absolute;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: none;
}

.cn-home-carousel__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(10,25,46,var(--cn-carousel-overlay, 1)) 0%,
    rgba(13,28,50,calc(var(--cn-carousel-overlay, 1) - 0.12)) 50%,
    rgba(14,32,55,calc(var(--cn-carousel-overlay, 1) - 0.33)) 100%
  );
}

@media (max-width: 640px) {
  .cn-home-carousel__overlay {
    background: linear-gradient(
      to right,
      rgba(10,25,46,calc(var(--cn-carousel-overlay, 1) + 0.04)) 0%,
      rgba(13,28,50,calc(var(--cn-carousel-overlay, 1) + 0.04)) 50%,
      rgba(14,32,55,calc(var(--cn-carousel-overlay, 1) - 0.04)) 100%
    );
  }
}

.cn-home-carousel__overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(10,25,46,calc(var(--cn-carousel-overlay, 1) - 0.05)) 0%, transparent 50%);
  pointer-events: none;
}

/* ponytail: 居中安全容器 — 1280px 对齐首页容器 */
.cn-home-carousel__content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  z-index: 3;
  display: flex;
  align-items: center;
  width: min(100% - 96px, 1280px);
  padding: 64px 0;
  box-sizing: border-box;
  pointer-events: none;
}

.cn-home-carousel__inner {
  width: min(100%, 580px);
  pointer-events: auto;
}

.cn-home-carousel--left .cn-home-carousel__inner {
  margin-right: auto;
  margin-left: 0;
  text-align: left;
}

.cn-home-carousel--center .cn-home-carousel__inner {
  margin-inline: auto;
  text-align: center;
}

.cn-home-carousel--right .cn-home-carousel__inner {
  margin-left: auto;
  text-align: left;
}

.cn-home-carousel__eyebrow {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #F0D495;
  margin: 0 0 12px;
  line-height: 1.4;
}

.cn-home-carousel__title {
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 16px;
  word-break: break-word;
}

.cn-home-carousel__description {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.7;
  color: rgba(255,255,255,0.72);
  margin: 0 0 28px;
  max-width: 540px;
  word-break: break-word;
}

.cn-home-carousel--center .cn-home-carousel__description { margin-left: auto; margin-right: auto; }
.cn-home-carousel--right .cn-home-carousel__description { margin-left: auto; }
.cn-home-carousel--left .cn-home-carousel__actions { justify-content: flex-start; }

.cn-home-carousel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.cn-home-carousel--center .cn-home-carousel__actions { justify-content: center; }
.cn-home-carousel--right .cn-home-carousel__actions { justify-content: flex-end; }

/* 箭头 */
.cn-home-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(10,25,46,0.55);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
}

.cn-home-carousel:hover .cn-home-carousel__arrow {
  opacity: 1;
}

.cn-home-carousel__arrow:hover,
.cn-home-carousel__arrow:focus {
  background: rgba(10,25,46,0.8);
}

.cn-home-carousel__arrow--prev { left: 16px; }
.cn-home-carousel__arrow--next { right: 16px; }

/* 圆点 */
.cn-home-carousel__dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.cn-home-carousel__dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.cn-home-carousel__dot.is-active,
.cn-home-carousel__dot[aria-current="true"] {
  background: var(--checknow-accent);
  transform: scale(1.2);
}

.cn-home-carousel__dot:hover {
  background: rgba(255,255,255,0.7);
}

/* 移动端 */
@media (max-width: 768px) {
  .cn-home-carousel__content {
    width: min(100% - 40px, 1280px);
    padding: 24px 0 48px;
    align-items: flex-end;
  }

  .cn-home-carousel__title {
    font-size: clamp(24px, 5vw, 32px);
  }

  .cn-home-carousel__description {
    font-size: 14px;
    margin-bottom: 20px;
  }

  .cn-home-carousel__actions {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .cn-home-carousel--center .cn-home-carousel__actions { align-items: center; }
  .cn-home-carousel--right .cn-home-carousel__actions { align-items: flex-end; }

  .cn-home-carousel__actions .cn-button {
    width: auto;
    min-width: 160px;
    padding: 12px 24px;
    font-size: 14px;
  }

  .cn-home-carousel__arrow {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .cn-home-carousel__title { font-size: clamp(20px, 6vw, 26px); }
  .cn-home-carousel__actions .cn-button { width: 100%; min-width: 0; }
  .cn-home-carousel__content {
    padding: 16px 0 40px;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .cn-home-carousel__track { transition: none; }
  .cn-home-carousel__arrow { opacity: 1; }
}
