/* ===================================
   Service Slider Styles
   =================================== */

/* Container & Wrapper */
.slider-container {
  position: relative;
  overflow: visible;
  padding: 0 20px;
}

.slider-wrapper {
  overflow: hidden;
  width: 100%;
}

/* Slider Core */
.service-slider {
  display: flex;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  gap: 15px;
}

.service-slider .item {
  flex: 0 0 calc(25% - 11.25px);
  min-width: 0;
  box-sizing: border-box;
  height: auto; /* 高さを自動調整に変更 */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Desktop / Large Tablet (992px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 992px) {
  .service-slider .item {
    flex: 0 0 calc(33.333% - 10px);
  }
}

/* Tablet (768px - 991px) */
@media screen and (max-width: 991px) and (min-width: 768px) {
  .service-slider .item {
    flex: 0 0 calc(50% - 7.5px);
  }
}

/* Mobile (0px - 767px) */
@media screen and (max-width: 767px) {
  .service-slider .item {
    flex: 0 0 calc(100% - 7.5px);
  }
}

/* Navigation */
.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% + 40px);
  left: -20px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.slider-prev,
.slider-next {
  background: transparent;
  color: #333;
  border: none;
  width: 48px;
  height: 72px;
  cursor: pointer;
  font-size: 48px;
  font-weight: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  pointer-events: auto;
  position: relative;
  font-family: Arial, sans-serif;
  user-select: none;
}

.slider-prev {
  margin-right: 5px;
}

.slider-next {
  margin-left: 5px;
}

.slider-prev:hover,
.slider-next:hover {
  color: #666;
  transform: scale(1.1);
}

.slider-prev:disabled,
.slider-next:disabled {
  color: #ccc;
  cursor: not-allowed;
  transform: none;
  opacity: 0.5;
}

/* Card Styles */
.service-slider .item .banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #d0d0d0; /* #f0f0f0 から #d0d0d0 に変更 */
}

/* Card Image - 正方形に近い比率に調整 */
.service-slider .item .banner .card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1; /* 正方形の比率 */
  overflow: hidden;
  background: #f8f8f8;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 4px; /* タイトルとの間に4pxのマージン */
}

.service-slider .item .banner .card-image img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #fff;
  transition: none;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  flex-shrink: 0;
}

/* 画像の縦横比を統一したい場合のオプション */
.service-slider .item .banner .card-image.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
  margin-bottom: 4px;
}

.service-slider .item .banner .card-image.aspect-ratio-4-3 {
  aspect-ratio: 4 / 3;
  margin-bottom: 4px;
}

.service-slider .item .banner .card-image.aspect-ratio-1-1 {
  aspect-ratio: 1 / 1;
  margin-bottom: 4px;
}

/* Card Content - パディング調整 */
.service-slider .item .banner .card-content {
  padding: 0 1em 1em 1em; /* 上のパディングを削除 */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.service-slider .item .banner .card-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0; /* 上マージンを0に */
  line-height: 1.5;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
}

.service-slider .item .banner .card-content small {
  font-size: 12px;
  color: #999;
  font-weight: 400;
  margin: 0 0 8px 0;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.service-slider .item .banner .card-content p {
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 16px 0;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* 詳細へのリンク */
.service-slider .item .banner .card-content span {
  margin-top: auto;
  display: block;
  text-align: center;
  padding: 10px 16px;
  color: #B6002A;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

/* ===================================
   Responsive Breakpoints
   =================================== */

/* Large Desktop (1200px - 1399px) */
@media screen and (max-width: 1399px) and (min-width: 1200px) {
  .service-slider .item {
    flex: 0 0 calc(25% - 11.25px);
  }
}

/* Desktop / Large Tablet (992px - 1199px) */
@media screen and (max-width: 1199px) and (min-width: 992px) {
  .service-slider .item {
    flex: 0 0 calc(33.333% - 10px);
  }
  
  .service-slider .item .banner .card-image {
    margin-bottom: 3px; /* タブレット用マージン調整 */
  }
  
  .service-slider .item .banner .card-content {
    padding: 0 0.9em 0.9em 0.9em;
  }
  
  .service-slider .item .banner .card-content h3 {
    font-size: 15px;
    min-height: 45px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
  }
  
  .service-slider .item .banner .card-content span {
    font-size: 12px;
    padding: 9px 14px;
  }
}

/* Tablet (768px - 991px) */
@media screen and (max-width: 991px) and (min-width: 768px) {
  .slider-container {
    padding: 0 17px;
  }
  
  .slider-nav {
    width: calc(100% + 34px);
    left: -17px;
  }
  
  .slider-prev,
  .slider-next {
    width: 40px;
    height: 60px;
    font-size: 40px;
  }
  
  .slider-prev {
    margin-right: 4px;
  }
  
  .slider-next {
    margin-left: 4px;
  }
  
  .service-slider .item {
    flex: 0 0 calc(50% - 7.5px);
  }
  
  .service-slider .item .banner .card-image {
    margin-bottom: 3px; /* タブレット用マージン調整 */
  }
  
  .service-slider .item .banner .card-content {
    padding: 0 0.8em 0.8em 0.8em;
  }
  
  .service-slider .item .banner .card-content h3 {
    font-size: 15px;
    min-height: 45px;
  }
  
  .service-slider .item .banner .card-content small {
    font-size: 11px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
    margin: 0 0 14px 0;
  }
  
  .service-slider .item .banner .card-content span {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Mobile (0px - 767px) */
@media screen and (max-width: 767px) {
  .slider-container {
    padding: 0 15px;
  }
  
  .slider-nav {
    width: calc(100% + 30px);
    left: -15px;
  }
  
  .slider-prev,
  .slider-next {
    width: 36px;
    height: 54px;
    font-size: 36px;
  }
  
  .slider-prev {
    margin-right: 3px;
  }
  
  .slider-next {
    margin-left: 3px;
  }
  
  .service-slider .item {
    flex: 0 0 calc(100% - 7.5px);
  }
  
  .service-slider .item .banner .card-image {
    margin-bottom: 2px; /* モバイル用マージン調整 */
  }
  
  .service-slider .item .banner .card-content {
    padding: 0 0.7em 0.7em 0.7em;
  }
  
  .service-slider .item .banner .card-content h3 {
    font-size: 14px;
    min-height: 42px;
  }
  
  .service-slider .item .banner .card-content small {
    font-size: 11px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
    margin: 0 0 12px 0;
  }
  
  .service-slider .item .banner .card-content  {
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* ===================================
   Performance & Accessibility
   =================================== */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .service-slider,
  .service-slider .item .banner,
  .service-slider .item .banner .card-image img,
  .service-slider .item .banner .card-content a,
  .slider-prev,
  .slider-next {
    transition: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .service-slider .item .banner {
    border: 2px solid #000;
  }
  
  .service-slider .item .banner .card-content span {
    border: 2px solid #B6002A;
  }
}

/* Print Styles */
@media print {
  .slider-nav {
    display: none;
  }
  
  .service-slider {
    display: block;
  }
  
  .service-slider .item {
    display: block;
    width: 100%;
    height: auto;
    page-break-inside: avoid;
    margin-bottom: 1em;
  }
}

/* Service Banner Items Hover Animation - サイズ変更なし */
.service-slider .item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}

/* 軽い白いオーバーレイ */
.service-slider .item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  border-radius: 12px;
}

/* Card Styles - サイズ変更エフェクトを削除 */
.service-slider .item .banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #d0d0d0; /* #f0f0f0 から #d0d0d0 に変更 */
  transition: none;
}

/* ブラウザ対応の強化 */
@supports not (backdrop-filter: blur()) {
  .service-slider .item::before {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Campaign Status Tag */
.campaign-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  z-index: 5;
  line-height: 1;
  letter-spacing: 0.02em;
}

/* 期間終了スタイル */
.campaign-status.expired {
  background-color: #fff;
  color: #B6002A;
  border: 1px solid #B6002A;
}

/* 実施中スタイル（オプション） */
.campaign-status.active {
  background-color: rgba(182, 0, 42, 0.9);
  color: #fff;
  border: 1px solid #B6002A;
}

/* 間もなく終了スタイル（オプション） */
.campaign-status.ending-soon {
  background-color: rgba(255, 140, 0, 0.9);
  color: #fff;
  border: 1px solid #ff8c00;
}

/* レスポンシブ調整 */
@media screen and (max-width: 767px) {
  .campaign-status {
    font-size: 10px;
    padding: 3px 6px;
    top: 6px;
    right: 6px;
  }
}

/* ホバー時も表示維持 */
.service-slider .item:hover .campaign-status {
  z-index: 15;
}

/* Card Content */
.service-slider .item .banner .card-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #333;
  margin: 0 0 8px 0;
  line-height: 1.5;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 48px;
  word-break: break-all;
  max-width: 100%;
}

.service-slider .item .banner .card-content p {
  font-size: 13px;
  line-height: 1.6;
  color: #666;
  margin: 0 0 16px 0;
  letter-spacing: 0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  word-break: break-all;
  max-width: 100%;
}

/* レスポンシブでの文字制限調整 */
@media screen and (max-width: 1199px) and (min-width: 992px) {
  .service-slider .item .banner .card-content h3 {
    font-size: 15px;
    min-height: 45px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
  }
}

@media screen and (max-width: 991px) and (min-width: 768px) {
  .service-slider .item .banner .card-content h3 {
    font-size: 15px;
    min-height: 45px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
    margin: 0 0 14px 0;
  }
}

@media screen and (max-width: 767px) {
  .service-slider .item .banner .card-content h3 {
    font-size: 14px;
    min-height: 42px;
  }
  
  .service-slider .item .banner .card-content p {
    font-size: 12px;
    margin: 0 0 12px 0;
  }
}