/* =========================
  ①大久保－明石線 ページ専用CSS（整理版）
  brand: #dc3545
========================= */

:root{
  --brand:#dc3545;
  --brand2:#c41e3a;
  --bg:#f6f7f9;
  --text:#222;
  --muted:#666;
  --card:#fff;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --radius:18px;
}

/* ===== Base ===== */
body{
  background: var(--bg);
  color: var(--text);
}

/* ===== Hero（about.html風） ===== */
.hero{
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.hero__content{
  position: relative;
  z-index: 2;
}
.hero__content h1{
  font-size: clamp(26px, 5vw, 58px);
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.hero__content p{
  font-size: 16px;
  letter-spacing: .05em;
  opacity: .95;
}

/* 背景：赤オーバーレイ＋バス画像 */
.hero--bus{
  background:
    linear-gradient(rgba(220,53,69,.75), rgba(220,53,69,.75)),
    url("../images/ttl_bus.jpg") center / cover no-repeat;
}

/* ===== Breadcrumb ===== */
.breadcrumb{
  background: transparent;
}
.breadcrumb__inner{
  color: var(--muted);
}

/* ===== Sub menu（4ボタン） ===== */
.subnav{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  max-width: 1100px;
  margin: 18px auto 28px;
  padding: 0 20px;
}
.subnav__item{
  background: #fff;
  border-radius: 14px;
  padding: 18px 10px;
  text-align:center;
  font-weight: 800;
  color: #333;
  text-decoration:none;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  border: 1px solid #eee;
  transition: transform .15s ease;
}
.subnav__item:hover{
  transform: translateY(-1px);
}
.subnav__item.is-active{
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}

/* ===== Route tabs（3ボタン） ===== */
.tab-nav__list--bus{
  grid-template-columns: repeat(3, 1fr) !important;
}
.tab-nav__item{
  border-radius: 14px;
  font-weight: 800;
}

/* ===== Cards ===== */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

/* ===== Section heading ===== */
.section__title{
  position: relative;
  padding-bottom: 10px;
}
.section__title::after{
  content:"";
  display:block;
  width: 42px;
  height: 4px;
  background: var(--brand);
  border-radius: 99px;
  margin-top: 10px;
}
.section__subtitle{
  color: #999;
}
.section-head{ position: relative; }
.table-date{
  text-align: right;
  color: #999;
  font-weight: 700;
  margin: 6px 0 0;
}

/* ===== Map ===== */
.map-card iframe{
  width: 100%;
  height: 520px;
  border: none;
  border-radius: 14px;
  display:block;
}
.map-note{
  margin-top: 16px;
  background: #fff5f5;
  border-left: 5px solid var(--brand);
  border-radius: 14px;
  padding: 14px 16px;
  color: #444;
}
.map-note a{
  color: var(--brand);
  font-weight: 900;
  text-decoration: none;
}
.map-note a:hover{ text-decoration: underline; }
.map-note__link{ margin-top: 8px; }

/* ===== Reserve button（QRなし・緑） ===== */
.bus-actions{
  display:flex;
  justify-content:center;
  margin: 24px 0 32px;
}

.reserve-card{
  position: relative;
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: 1fr 120px 36px;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  text-decoration: none;
  background: #d9f0e3;
  box-shadow: 0 14px 30px rgba(0,0,0,.08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.reserve-card::before{
  content:"";
  position:absolute;
  inset: 10px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,.9);
  pointer-events:none;
}
.reserve-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(0,0,0,.12);
}

.reserve-card__body{
  color: #1f5f3a;
}
.reserve-card__title{
  display:block;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .04em;
}
.reserve-card__sub{
  display:block;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #2e8b57;
}

/* icons */
.reserve-card__icons{
  display:flex;
  justify-content:flex-end;
  gap:14px;
  opacity:.85;
}
.reserve-card__icon{
  position: relative;
  box-sizing: border-box;
}
.reserve-card__icon--pc{
  width: 46px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid rgba(46,139,87,.45);
}
.reserve-card__icon--pc::after{
  content:"";
  position:absolute;
  left:13px;
  bottom:-10px;
  width:20px;
  height:7px;
  border-radius:999px;
  border:2px solid rgba(46,139,87,.45);
  background: transparent;
}
.reserve-card__icon--sp{
  width:22px;
  height:36px;
  border-radius:6px;
  border: 2px solid rgba(46,139,87,.45);
}
.reserve-card__icon--sp::after{
  content:"";
  position:absolute;
  left:7px;
  bottom:4px;
  width:6px;
  height:6px;
  border-radius:999px;
  background: rgba(46,139,87,.45);
}
.reserve-card__arrow{
  width:22px;
  height:22px;
  border-right:5px solid rgba(46,139,87,.5);
  border-top:5px solid rgba(46,139,87,.5);
  transform: rotate(45deg);
  justify-self: end;
  margin-right: 6px;
}

/* ===== Table wrapper ===== */
.table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid #eee;
}

/* ===== Bus timetable ===== */
.bus-table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
  background:#fff;
}

/* cell base */
.bus-table th,
.bus-table td{
  padding: 14px 12px;
  border-bottom: 1px solid #eee;
  border-right: 1px solid #f2f2f2;
  text-align:center;
  white-space: nowrap;
  font-size: 14px;
}
.bus-table th:last-child,
.bus-table td:last-child{ border-right: none; }

/* top header row（赤グラデ） */
.bus-table thead tr:first-child th{
  color:#fff;
  font-weight:900;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  border-bottom: none;
}
.bus-table thead tr:first-child th:first-child{
  border-top-left-radius: 14px;
}
.bus-table thead tr:first-child th:last-child{
  border-top-right-radius: 14px;
}

/* hover */
.bus-table tbody tr:hover{
  background: rgba(220,53,69,.04);
}

/* 日曜運休セル（薄緑） */
.bus-table td.no-sun{
  background-color: #e6f4ea;
  color: #1b5e20;
  font-weight: 700;
}

/* 学校着／学校発：赤帯（PC/スマホ確実） */
.bus-table tbody tr.bus-table__accent td,
.bus-table tbody tr.bus-table__accent th,
.bus-table thead tr.bus-table__accent td,
.bus-table thead tr.bus-table__accent th{
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  border-color: rgba(255,255,255,0.35);
}

/* ===== Sticky：場所(2列目)だけ固定（番号は固定しない） ===== */
.bus-table th:nth-child(2),
.bus-table td:nth-child(2){
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  white-space: nowrap;
  box-shadow: 8px 0 8px -8px rgba(0,0,0,0.25);
}
/* header above */
.bus-table thead th{ z-index: 4; }

/* accent row の場所列も赤を維持（stickyの白上書きを防ぐ） */
.bus-table tbody tr.bus-table__accent td:nth-child(2),
.bus-table thead tr.bus-table__accent th:nth-child(2),
.bus-table thead tr.bus-table__accent td:nth-child(2){
  background: var(--brand);
  color: #fff;
}

/* ===== Notice box ===== */
.notice{
  margin-top: 18px;
  background: #fff6cf;
  border: 2px solid #f3d37b;
  border-radius: 14px;
  padding: 16px 16px;
  color:#6b5200;
  line-height: 1.9;
  position: relative;
}
.notice p{ margin: 6px 0; }
.notice::before{
  content:"";
  position:absolute;
  left: 14px;
  top: -10px;
  width: 52px;
  height: 6px;
  background: var(--brand);
  border-radius: 99px;
}

/* ===== Responsive（スマホ） ===== */
@media (max-width: 767px){
  .hero{ height: 260px; }
  .hero__content p{ font-size: 14px; }

  .subnav{ grid-template-columns: repeat(2,1fr); gap: 12px; }
  .tab-nav__list--bus{ grid-template-columns: repeat(2,1fr) !important; gap: 12px; }

  .map-card iframe{ height: 320px; }

  /* 時刻表横幅を少し縮める */
  .bus-table{ min-width: 880px; }

  /* バス停名（場所）列を細くして、時刻を2便以上見やすく */
  .bus-table th:nth-child(2),
  .bus-table td:nth-child(2){
    min-width: 110px;
    max-width: 110px;
    white-space: normal;
    line-height: 1.3;
    padding: 8px 6px;
    font-size: 13px;
  }

  .bus-table th,
  .bus-table td{
    padding: 8px 6px;
    font-size: 13px;
  }

  /* 予約カード */
  .reserve-card{
    grid-template-columns: 1fr 72px 28px;
    padding: 14px;
    border-radius: 16px;
  }
  .reserve-card__title{ font-size: 18px; }
  .reserve-card__sub{ font-size: 12px; }
}

/* =========================
  日曜日のみ表示スイッチ
========================= */
.sun-switch{
  max-width: 1100px;
  margin: 18px auto 0;
  padding: 0 20px;
}
.sun-switch__label{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  cursor: pointer;
  user-select: none;
}
.sun-switch__text{
  font-weight: 800;
}
.sun-switch__note{
  margin: 8px 0 0;
  color: #666;
  font-size: 13px;
}

/* 日曜モードON：日曜運行しない列を非表示 */
body.is-sun-mode .sun-col--ng{
  display: none !important;
}

/* =========================
  日曜切替スイッチ
========================= */
.sun-switch{
  max-width: 1100px;
  margin: 8px auto 18px;
  padding: 0 20px;
}
.sun-switch__label{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 900;
}
.sun-switch__note{
  margin: 6px 0 0;
  color:#666;
  font-size: 13px;
}

/* =========================
  日曜モードで「運行なし」にするセル
========================= */
.bus-table td.is-sunday-off{
  background: #e6f4ea;     /* 薄い緑 */
  color: #1b5e20;
  font-weight: 800;
}

/* =========================
  横スクロール時：場所列だけ固定
========================= */
.table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
}

/* stickyのため */
.bus-table{
  border-collapse: separate;
  border-spacing: 0;
}

/* 2列目：場所だけ固定 */
.bus-table th:nth-child(2),
.bus-table td:nth-child(2){
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
  white-space: nowrap;
  box-shadow: 8px 0 8px -8px rgba(0,0,0,0.25);
}

/* ヘッダーが上に来るように */
.bus-table thead th{
  z-index: 4;
}

/* =========================
  スマホ：場所列を細くして時間を2つ以上見えるように
========================= */
@media (max-width: 767px){
  .bus-table th:nth-child(2),
  .bus-table td:nth-child(2){
    min-width: 110px;
    max-width: 110px;
    white-space: normal;
    line-height: 1.3;
    padding: 8px 6px;
    font-size: 13px;
  }

  .bus-table th,
  .bus-table td{
    padding: 8px 6px;
    font-size: 13px;
  }
}

/* =========================
  日曜切替：見た目を大きく
========================= */
.sun-switch__label{
  font-size: 18px;
  line-height: 1.3;
}

.sun-switch__label input[type="checkbox"]{
  width: 22px;
  height: 22px;
  transform: translateY(1px);
}

.sun-switch__text{
  font-weight: 900;
}

.sun-switch__note{
  font-size: 14px;
}

/* スマホはさらに読みやすく */
@media (max-width: 767px){
  .sun-switch__label{ font-size: 20px; }
  .sun-switch__label input[type="checkbox"]{ width: 24px; height: 24px; }
  .sun-switch__note{ font-size: 14px; }
}
