/**
 * Home（フロントページ）専用 CSS
 * 条件: is_front_page()
 * body class: .home または .front-page
 *
 * ルール追加時は必ずページスコープを付けること。
 * 例: body.home .ms-slider-section { ... }
 *     .home .slick-slider { ... }
 *
 * 注意: slick の CSS/JS は別途 ms_enqueue_home_slick() で読み込み済み
 *
 * 以下は style.css から抽出したトップページ専用ルール
 * ※ style.css 側は変更なし（重複読み込みになるが、将来的に削除予定）
 */

/* ==========================================================
   style.css L810-817: スライダー/カバーの z-index 調整
   ========================================================== */
.home .slick-slider,
.home .swiper,
.home .vk_slider,
.home .wp-block-cover,
.home .wp-block-group {
  position: relative !important;
  z-index: 1 !important;
}

/* ==========================================================
   style.css L1046-1053: トップのスライダー/カバーはヘッダーより奥に
   ========================================================== */
.home .vk_slider,
.home .slick-slider,
.home .swiper,
.home .wp-block-cover,
.home .wp-block-group {
  position: relative;
  z-index: 1;
}

/* ==========================================================
   style.css L1168-1200: トップページ専用レイアウト
   ========================================================== */
.ms-home.l-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px;
}

/* PC：中身を80%に中央寄せ */
@media (min-width: 1025px) {
  .ms-home.l-container > * {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* タブレット：80%を維持 */
@media (min-width: 769px) and (max-width: 1024px) {
  .ms-home.l-container > * {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }
}

/* スマホ：100% */
@media (max-width: 768px) {
  .ms-home.l-container > * {
    width: 100%;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* トップページ「まったりスカッシュ松山」内側ボックス：左右に余白（他ページ・共通クラスに影響しない） */
  .home .ms-home .ms-hero .ms-lead {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* ==========================================================
   style.css L1205-1240: ヒーローセクション
   ========================================================== */
.ms-home .ms-hero {
  text-align: center;
  margin-bottom: 60px;
  background: linear-gradient(135deg, #fff7ee 0%, #ffe0bf 100%);
  border-radius: 16px;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.ms-home .ms-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(243, 152, 0, 0.05) 0%, rgba(243, 152, 0, 0.1) 100%);
  pointer-events: none;
}

.ms-home .ms-hero .entry-title {
  font-size: clamp(28px, 5vw, 42px);
  margin-bottom: 20px;
  color: #222;
  position: relative;
  z-index: 1;
}

.ms-home .ms-hero .ms-lead {
  font-size: clamp(16px, 2.5vw, 20px);
  line-height: 1.6;
  margin-bottom: 30px;
  position: relative;
  z-index: 1;
}

/* ==========================================================
   style.css L1249-1256: CTAボタン
   ========================================================== */
.ms-home .ms-cta {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

/* ==========================================================
   style.css L1341-1366: 活動内容（トップページ用）
   ========================================================== */
.ms-home .ms-activity-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
  justify-items: center;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 30px;
}

.ms-home .ms-activity-schedule {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .ms-home .ms-activity-content {
    gap: 20px;
    padding: 20px;
  }
}

/* ==========================================================
   style.css L1446-1502: 参加ステップ（トップページ用 - 横並びカード形式）
   ========================================================== */
.ms-home .ms-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 0 0 30px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ms-home .ms-step {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.ms-home .ms-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(243, 152, 0, 0.2);
  border-color: #f39800;
}

.ms-home .ms-step-number {
  background: linear-gradient(135deg, #f39800 0%, #e68900 100%);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  margin: 0 auto 15px auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ms-home .ms-step h3 {
  color: #2c3e50;
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
}

.ms-home .ms-step p {
  color: #666;
  margin: 0;
  line-height: 1.5;
  font-size: 14px;
}

/* レスポンシブ対応（スマホ） */
@media (max-width: 768px) {
  .ms-home .ms-steps {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }
  
  .ms-home .ms-step {
    padding: 15px;
  }
  
  .ms-home .ms-step-number {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* ==========================================================
   style.css L5159-5161: 「次回予定」セクションを非表示
   ========================================================== */
.ms-home .ms-next {
  display: none !important;
}

/* ==========================================================
   style.css L5200-5207: ヒーロータイトル間隔調整
   ========================================================== */
.ms-home .ms-hero .entry-title {
  margin-bottom: 28px;
}

@media (max-width: 767px) {
  .ms-home .ms-hero .entry-title {
    margin-bottom: 20px;
  }
}

/* ==========================================================
   style.css L5043-5133: スマホ時のスライダー余白調整
   ========================================================== */
@media (max-width: 767px) {
  .home .ms-slider-section {
    padding-bottom: 12px !important;
    margin-bottom: 0 !important;
  }
  
  .home .ms-home.l-container {
    padding-top: 16px !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 768px) {
  .home .ms-slider-section {
    min-height: auto !important;
  }
  
  .home .ms-slider-section .slick-list,
  .home .ms-slider-section .slick-track {
    min-height: auto !important;
    height: auto !important;
  }
}

@media (max-width: 375px) {
  .home .ms-slider-section {
    padding-bottom: 8px !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
  }
  
  .home .ms-home.l-container {
    padding-top: 12px !important;
    margin-top: 0 !important;
  }
  
  .home .ms-slider-section .slick-list,
  .home .ms-slider-section .slick-track {
    min-height: auto !important;
    height: auto !important;
  }
}

@media (max-width: 375px) and (min-height: 800px) {
  .home .ms-slider-section {
    padding-bottom: 8px !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
  }
  
  .home .ms-home.l-container {
    padding-top: 10px !important;
    margin-top: 0 !important;
  }
  
  .home .ms-slider-section .slick-list,
  .home .ms-slider-section .slick-track {
    min-height: auto !important;
    height: auto !important;
  }
}

/* ==========================================================
   style.css L5217-5257: スライダー 16:9 維持・余白対策
   ========================================================== */
@media (max-width: 768px) {
  .home .ms-slider-section {
    min-height: auto !important;
  }
  .home .ms-slider-section .slick-slide {
    min-height: 0 !important;
    height: auto !important;
  }
}

.home .ms-slider-section .season-slider .slider-img {
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

.home .ms-slider-section .season-slider .slider-img img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
}

.home .ms-slider-section .season-slider .slick-list,
.home .ms-slider-section .season-slider .slick-track {
  height: auto !important;
}

@media (max-width: 768px) {
  .home .season-slider .slick-slide {
    transform: scale(0.88);
  }
  .home .season-slider .slick-center {
    transform: scale(1.02);
  }
}

/* ==========================================================
   style.css L5260-5268: 説明枠同士の間隔
   ========================================================== */
.home .ms-home.l-container > * + * {
  margin-top: 18px;
}

@media (max-width: 768px) {
  .home .ms-home.l-container > * + * {
    margin-top: 14px;
  }
}

/* ==========================================================
   style.css L5275-5299: slick の余計な高さを無効化
   ========================================================== */
.home .ms-slider-section .season-slider .slick-slide {
  height: auto !important;
  min-height: 0 !important;
}

.home .ms-slider-section .season-slider .slick-list,
.home .ms-slider-section .season-slider .slick-track {
  height: auto !important;
  min-height: 0 !important;
}

@media (max-width: 768px) {
  .home .ms-slider-section .season-slider .slick-slide {
    height: auto !important;
    min-height: 0 !important;
  }
  
  .home .ms-slider-section .season-slider .slick-list,
  .home .ms-slider-section .season-slider .slick-track {
    height: auto !important;
    min-height: 0 !important;
  }
}

/* ==========================================================
   style.css L5307-5329: スライダーを大きく + 次ブロックとの間隔
   ========================================================== */
@media (max-width: 767px) {
  .home .ms-slider-section,
  .home .ms-slider-section .season-slider,
  .home .ms-slider-section .home-slider {
    height: auto !important;
    min-height: 240px !important;
  }

  .home .ms-slider-section img {
    width: 100%;
    height: auto;
  }
}

@media (max-width: 767px) {
  .home .ms-slider-section,
  .home .ms-slider-section .season-slider,
  .home .ms-slider-section .home-slider {
    min-height: auto !important;
  }
}

/* ==========================================================
   style.css L5333-5413: スライダー下余白設定
   ========================================================== */
.home .ms-slider-section {
  margin-bottom: 24px !important;
}

@media (max-width: 768px) {
  .home .ms-slider-section {
    margin-bottom: 24px !important;
  }
}

@media (max-width: 375px) {
  .home .ms-slider-section {
    margin-bottom: 20px !important;
  }
}

@media (max-width: 375px) {
  .home .ms-slider-section {
    margin-bottom: 8px !important;
    padding-bottom: 4px !important;
  }
  .home .ms-home.l-container {
    padding-top: 8px !important;
  }
}

@media (max-width: 375px) and (min-height: 800px) {
  .home .ms-home.l-container {
    padding-top: 8px !important;
  }
}

.home .ms-slider-section + .l-container,
.home .ms-slider-section + section,
.home .ms-slider-section + .wp-block-group {
  margin-top: 24px !important;
}

@media (max-width: 768px) {
  .home .ms-slider-section + .l-container,
  .home .ms-slider-section + section,
  .home .ms-slider-section + .wp-block-group {
    margin-top: 20px !important;
  }
}

@media (max-width: 375px) {
  .home .ms-slider-section + .l-container,
  .home .ms-slider-section + section,
  .home .ms-slider-section + .wp-block-group {
    margin-top: 8px !important;
  }
}

@media (max-width: 767px) {
  .home .ms-slider-section {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: auto !important;
    height: auto !important;
  }
  .home .ms-slider-section + .l-container,
  .home .ms-slider-section + section {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-height: auto !important;
    height: auto !important;
  }
  .home .ms-slider-section .slick-list,
  .home .ms-slider-section .slick-track {
    min-height: auto !important;
    height: auto !important;
  }
}

/* ==========================================================
   style.css L5484-5502: スライダー幅設定
   ========================================================== */
.home .ms-slider-section {
  max-width: 100%;
}

.home .ms-slider-section .l-container,
.home .ms-slider-section .container,
.home .ms-slider-section .vk_outer,
.home .ms-slider-section .l-section {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.home .ms-slider-section .season-slider,
.home .ms-slider-section .slick-list {
  width: 100%;
}

/* ==========================================================
   トップページ「一緒にスカッシュをやりましょう」＋ 公式LINE枠の大きさ調整
   ========================================================== */
/* スマホ：外枠の余白を抑え、内側のLINE枠・ボタンをバランスよく */
@media (max-width: 768px) {
  .home .ms-home .ms-final-cta {
    padding: 24px 16px !important;
    margin-bottom: 24px;
  }
  .home .ms-home .ms-final-cta h2 {
    margin-bottom: 14px !important;
    font-size: clamp(20px, 5vw, 24px);
  }
  .home .ms-home .ms-final-cta .ms-line-notice {
    margin-top: 12px !important;
    padding: 14px 12px !important;
  }
  .home .ms-home .ms-final-cta .ms-line-notice p {
    margin-bottom: 12px !important;
    font-size: 0.85rem;
  }
  /* 公式LINEボタン：やや大きく・横幅を活かす */
  .home .ms-home .ms-final-cta .ms-line-notice a {
    display: block;
    text-align: center;
  }
  .home .ms-home .ms-final-cta .ms-line-notice a img {
    height: 48px !important;
    width: auto;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
  }
}
