/**
 * Slideshow Block Styles
 * Based on Figma design - Cover style layout
 * Figma node: 318-351
 */

.wp-block-anone-slideshow,
.wp-block-anone-slideshow * {
  box-sizing: border-box;
}

.wp-block-anone-slideshow {
  position: relative;
  width: 100%;
  overflow: hidden;
}

/* =============================================================
   Slides Container
   ============================================================= */

.slideshow {
  position: relative;
  width: 100%;
}

.slideshow__track {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.slideshow__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  position: relative;
  min-height: 500px;
}

/* =============================================================
   PC Layout - Cover Style (Image as background)
   ============================================================= */

@media (min-width: 1024px) {
  .slideshow__slide {
    min-height: 43.5rem; /* 696px from Figma */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
  }
}

/* =============================================================
   Image - Full width background
   ============================================================= */

.slideshow__image-wrapper {
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  z-index: 1;
}

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

/* Gradient overlay - from Figma */
.slideshow__image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 70.33%,
    rgba(0, 0, 0, 0.4) 90.16%
  ),
  linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.03) 0%,
    rgba(0, 0, 0, 0.03) 100%
  );
  pointer-events: none;
  border-radius: 0.5rem;
}

/* =============================================================
   Content - Overlaid on image
   ============================================================= */

.slideshow__content {
  position: relative;
  z-index: 2;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  justify-content: flex-start; /* 内容靠上 */
  text-align: center;
  flex: 1;
}

@media (min-width: 1024px) {
  .slideshow__content {
    padding: 2.5rem 2.5rem 0 2.5rem; /* 顶部和两侧 padding */
    gap: 1.25rem; /* 20px from Figma */
    justify-content: flex-start; /* 内容靠上 */
  }
}

/* Title */
.slideshow__title {
  color: #1d1d1f;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1.5rem;
  line-height: 160%;
  font-weight: 700;
  margin: 0;
}

@media (min-width: 1024px) {
  .slideshow__title {
    font-size: 2.25rem; /* 36px from Figma */
  }
}

.slideshow__title-main {
  display: block;
}

.slideshow__title-sub {
  display: block;
  text-transform: uppercase;
}

/* Description */
.slideshow__description {
  color: #1d1d1f;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.9375rem;
  line-height: 180%; /* 1.8 from Figma */
  font-weight: 400;
  margin: 0;
  white-space: pre-line;
  /* 日文不需要 uppercase */
}

@media (min-width: 1024px) {
  .slideshow__description {
    font-size: 1.0625rem; /* 17px from Figma */
  }
}

/* =============================================================
   CTA Buttons
   ============================================================= */

.slideshow__cta {
  display: flex;
  flex-direction: row;
  gap: 0.75rem; /* 12px from Figma */
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.slideshow__btn {
  border-radius: 6.25rem; /* 100px */
  padding: 0.5rem 1.5rem; /* 8px 24px from Figma */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9rem;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.9375rem; /* 15px */
  line-height: 160%;
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.slideshow__btn:hover {
  opacity: 0.8;
}

.slideshow__btn--primary,
.wp-block-anone-slideshow a.slideshow__btn--primary,
.wp-block-anone-slideshow a.slideshow__btn--primary:link,
.wp-block-anone-slideshow a.slideshow__btn--primary:visited,
.wp-block-anone-slideshow a.slideshow__btn--primary:hover,
.wp-block-anone-slideshow a.slideshow__btn--primary:focus {
  background: #1d1d1f;
  color: #ffffff;
  border: none;
}

.slideshow__btn--secondary,
.wp-block-anone-slideshow a.slideshow__btn--secondary,
.wp-block-anone-slideshow a.slideshow__btn--secondary:link,
.wp-block-anone-slideshow a.slideshow__btn--secondary:visited,
.wp-block-anone-slideshow a.slideshow__btn--secondary:hover,
.wp-block-anone-slideshow a.slideshow__btn--secondary:focus {
  background: #ffffff;
  color: #1d1d1f;
  border: 1px solid #1d1d1f;
}

@media (min-width: 1024px) {
  .slideshow__btn {
    min-width: 11.25rem; /* 180px from Figma */
  }
}

/* =============================================================
   Controls Container
   ============================================================= */

.slideshow__controls {
  position: absolute;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

@media (min-width: 1024px) {
  .slideshow__controls {
    bottom: 2rem;
    justify-content: space-between;
    padding: 0 2.5rem;
  }
  
  .slideshow__controls::before {
    content: "";
    flex: 1;
  }
}

/* =============================================================
   Pagination (Carousel Bar) - Figma node 464:14823
   ============================================================= */

.slideshow__pagination {
  display: flex;
  flex-direction: row;
  gap: 1.125rem; /* 18px from Figma */
  align-items: center;
  justify-content: center;
}

.slideshow__dot {
  width: 1.5rem; /* 24px */
  height: 0.25rem; /* 4px */
  background: #d9d9d9;
  border-radius: 1rem; /* 16px */
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: none;
  padding: 0;
}

.slideshow__dot:hover {
  background: #a0a0a0;
}

.slideshow__dot--active {
  background: #83ccd2;
}

/* =============================================================
   Navigation Arrows - Figma node 358:660
   ============================================================= */

.slideshow__nav {
  display: flex;
  flex-direction: row;
  gap: 0.75rem; /* 12px from Figma */
  align-items: center;
  justify-content: center;
}

@media (min-width: 1024px) {
  .slideshow__nav {
    justify-content: flex-end;
    flex: 1;
  }
}

.slideshow__nav-btn {
  width: 2.5rem; /* 40px from Figma */
  height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d9d9d9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.slideshow__nav-btn:hover {
  background: #ffffff;
  border-color: #1d1d1f;
}

.slideshow__nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slideshow__nav-btn svg {
  width: 0.75rem;
  height: 0.75rem;
  stroke: #1d1d1f;
  fill: none;
}

.slideshow__nav-btn--prev svg {
  transform: rotate(180deg);
}

/* =============================================================
   Tablet Layout (768px - 1023px)
   有空隙，有圆角，有导航箭头
   ============================================================= */

@media (min-width: 768px) and (max-width: 1023px) {
  .slideshow__slide {
    min-height: 32rem;
  }

  /* Tablet: 和PC一样的水平布局，分页居中，导航靠右 */
  .slideshow__controls {
    bottom: 1.5rem;
    padding: 0 1.5rem;
    flex-direction: row;
    justify-content: space-between;
    gap: 0;
  }

  /* 左侧占位，让分页居中 */
  .slideshow__controls::before {
    content: "";
    flex: 1;
  }

  /* 导航箭头靠右 */
  .slideshow__nav {
    justify-content: flex-end;
    flex: 1;
  }
}

/* =============================================================
   Mobile Layout (< 768px) - Based on SP.css
   全屏宽度，无圆角，无导航箭头
   ============================================================= */

@media (max-width: 767px) {
  /* 全屏无边距 */
  .wp-block-anone-slideshow {
    margin-left: calc(-1 * var(--wp--style--root--padding-left, 1.25rem));
    margin-right: calc(-1 * var(--wp--style--root--padding-right, 1.25rem));
    width: calc(100% + var(--wp--style--root--padding-left, 1.25rem) + var(--wp--style--root--padding-right, 1.25rem));
  }

  .slideshow__slide {
    min-height: 29.27rem; /* 468px from SP Figma */
  }

  /* 图片无圆角 */
  .slideshow__image-wrapper {
    border-radius: 0;
  }

  .slideshow__image-wrapper::after {
    border-radius: 0;
  }

  /* Controls - 只显示分页，居中 */
  .slideshow__controls {
    flex-direction: row;
    justify-content: center;
    gap: 0;
    bottom: 1rem;
    padding: 0;
  }

  /* 隐藏导航箭头 */
  .slideshow__nav {
    display: none;
  }

  .slideshow__pagination {
    gap: 1.125rem; /* 18px from SP Figma */
  }

  /* 内容区调整 */
  .slideshow__content {
    padding: 1.5rem 1rem;
  }
}

/* =============================================================
   Empty State
   ============================================================= */

.slideshow--empty {
  padding: 3rem;
  text-align: center;
  background: #f5f5f5;
  border: 2px dashed #ddd;
  border-radius: 0.5rem;
}

.slideshow--empty p {
  margin: 0;
  color: #666;
}

