/* Slider module styles extracted from template-parts/slider.php */

/* Hero Slider — visual spec to match reference */
.slider-wrapper {
  position: relative;
  width: 100%;
  height: 640px;
  overflow: hidden;
}

/* Visibility Utilities for Independent Sliders */
.slider-pc-only {
  display: block;
}

.slider-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .slider-pc-only {
    display: none;
  }

  .slider-mobile-only {
    display: block;
  }
}

/* 当导航栏吸顶时,为轮播图添加上边距 */
body.has-sticky-header .slider-wrapper {
  margin-top: 80px;
}

.main-slider {
  width: 100%;
  height: 100%;
}

.swiper-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

.slide-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Keep the coordinate system consistent with the admin preview (0-100% across full slide). */
  padding: 0;
}

.slide-canvas {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Mobile: keep a 390px design canvas centered on wider devices (e.g. 430px). */
.slider-mobile-only .slide-canvas {
  max-width: 390px;
  margin: 0 auto;
}

.slide-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.slide-image::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Support custom overlay via CSS variable, fallback to default gradient */
  background: var(--overlay-bg, linear-gradient(180deg,
        rgba(13, 39, 84, 0.88) 0%,
        rgba(13, 39, 84, 0.78) 40%,
        rgba(13, 39, 84, 0.65) 100%));
  z-index: 1;
}


.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-text {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  color: #fff;
  text-align: center;
  padding: 20px 40px;
  /* Default position - can be overridden by inline styles */
  top: 50%;
  transform: translateY(-50%);
}

/* 独立定位元素的通用样式 - 使用百分比定位，元素左上角对齐到指定位置 */
.slide-element {
  position: absolute;
  z-index: 3;
  color: #fff;
  white-space: nowrap;
  /* left和top直接表示元素左上角的位置，不再使用transform居中 */
  /* 移除padding以确保定位准确，避免内容被推开 */
}

.slide-line {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
}

/* Text elements are positioned inside a full-width line to avoid shrink-to-fit width limiting. */
.slide-line .slide-element {
  position: relative;
  top: 0;
}

.slide-text-left {
  text-align: left;
  /* 左对齐时不限制宽度，内容真正靠左 */
  max-width: none;
  right: auto;
  left: 40px;
  padding-right: 20%;
}

.slide-text-center {
  text-align: center;
  max-width: 1060px;
  margin: 0 auto;
}

.slide-text-right {
  text-align: right;
  /* 右对齐时内容真正靠右 */
  max-width: none;
  left: auto;
  right: 40px;
  padding-left: 20%;
}

.slide-title {
  font-weight: 800;
  margin: 0;
  line-height: 1.15;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.35);
  font-size: 52px;
}

.slide-title.slide-element,
.slide-subtitle.slide-element,
.slide-desc.slide-element {
  display: inline-block;
}

.slide-subtitle {
  font-size: 18px;
  margin: 0;
  line-height: 1.6;
  font-style: italic;
  opacity: 0.9;
}

.slide-list-wrapper {
  text-align: left;
  width: fit-content;
}

.slide-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.slide-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 6px;
  line-height: 1.5;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slide-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  font-weight: bold;
}

.slide-desc {
  font-size: 20px;
  margin: 0 0 0 0;
  line-height: 1.6;
  opacity: 0.95;
  max-width: 980px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: normal;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

/* Mobile description width is controlled via inline styles (max-width) for per-slide flexibility. */

.slide-buttons {
  display: inline-flex;
  gap: 16px;
}

.slide-text-left .slide-buttons {
  justify-content: flex-start;
}

.slide-text-center .slide-buttons {
  justify-content: center;
}

.slide-text-right .slide-buttons {
  justify-content: flex-end;
}

/* Scope .btn styles to slider to avoid global side-effects */
.slider-wrapper .btn {
  display: inline-block;
  padding: 10px 24px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.slider-wrapper .btn-primary {
  background-color: var(--primary-blue, var(--primary-color, #1d5fbf));
  color: #fff;
}

.slider-wrapper .btn-primary:hover {
  background-color: var(--accent-yellow, #fdb913);
  color: var(--btn-hover-color, #000);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.slider-wrapper .btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.slider-wrapper .btn-outline:hover {
  background: var(--accent-yellow, #fdb913);
  color: var(--btn-hover-color, #000);
}

/* Navigation arrows (no circular background) */
.swiper-button-next,
.swiper-button-prev {
  color: #fff;
  background: transparent;
}

.swiper-button-next:after,
.swiper-button-prev:after {
  font-size: 16px;
}

/* Pagination */
.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.5);
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
  .slider-wrapper {
    height: 420px;
  }

  .slide-text {
    padding: 15px;
  }

  .slide-title {
    font-size: 32px;
  }

  .slide-desc {
    font-size: 16px;
    width: 70%;
    max-width: 70%;
    white-space: normal;
  }

  .slide-content {
    padding: 0;
  }

  .slider-wrapper .btn {
    padding: 8px 20px;
    font-size: 0.9rem;
  }

  .swiper-button-next,
  .swiper-button-prev {
    display: none !important;
  }

  body.has-sticky-header .slider-wrapper {
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .slider-wrapper {
    height: 340px;
  }

  .slide-text {
    padding: 10px;
  }

  .slide-title {
    font-size: 26px;
  }

  .slide-desc {
    font-size: 14px;
    
  }

  .slider-wrapper .btn {
    padding: 6px 16px;
    font-size: 0.84rem;
    border-radius: 4px;
  }
}
