:root {
  --green-dark: #1b5e20;
  --green-mid: #2e7d32;
  --green-main: #4caf50;
  --green-light: #81c784;
  --text-color: #1b5e20;
  --white: #fff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100%;
  font-family: "Hiragino Kaku Gothic Pro", Meiryo, sans-serif;
  background-image: url("https://www.town.minamifurano.hokkaido.jp/wp-content/uploads/2024/03/bus_converted_01.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

/* ============================
   ヘッダー: 隙間なし全幅バナー
============================ */
#header-section {
  width: 100%;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

#header-section h1 {
  display: block;
  width: 100%;
  margin: 0;
  padding: clamp(10px, 2vh, 22px) 24px;
  background: linear-gradient(135deg, rgba(27, 94, 32, 0.75) 0%, rgba(46, 125, 50, 0.75) 60%, rgba(56, 142, 60, 0.75) 100%);
  color: var(--white);
  font-size: clamp(1.4rem, 4vw, 2.1rem);
  font-weight: bold;
  text-align: center;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  border-bottom: 4px solid var(--green-light);
}

/* ============================
   メイン
============================ */
#main-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(10px, 2vh, 28px) 16px clamp(10px, 2vh, 36px) 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#route-map,
#timetable {
  width: 100%;
  max-width: 600px;
  text-align: center;
}

#route-map {
  margin-bottom: clamp(4px, 1vh, 8px);
}

#timetable {
  margin-top: clamp(16px, 3vh, 40px);
}

/* ============================
   料金表ボタン（h2 > a）
============================ */
#route-map h2 {
  display: block;
  margin: 0;
}

#route-map h2 a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: clamp(12px, 2vh, 18px) 24px;
  background: rgba(76, 175, 80, 0.75);
  color: var(--white);
  font-size: clamp(1.15rem, 3.5vw, 1.55rem);
  font-weight: bold;
  letter-spacing: 0.06em;
  border: 3px solid var(--green-dark);
  border-radius: 12px;
  box-shadow: 0 5px 18px rgba(46, 125, 50, 0.45);
  text-decoration: none;
  transition: all 0.25s ease;
}

#route-map h2 a::after {
  content: "›";
  font-size: 1.7em;
  font-weight: bold;
  flex-shrink: 0;
  margin-left: 10px;
}

#route-map h2 a:hover,
#route-map h2 a:focus {
  background: var(--green-dark);
  border-color: var(--green-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(27, 94, 32, 0.5);
  color: var(--white);
}

#route-map h2 a:active {
  transform: translateY(0);
}

/* ============================
   時刻表セクション見出し
   ── 時刻表 ── デコレーションライン
============================ */
#timetable h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--white);
  font-size: clamp(1.4rem, 5vw, 2rem);
  font-weight: bold;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  background: none;
  border-bottom: none;
  text-shadow: 0 0 12px rgba(0,0,0,1), 0 2px 6px rgba(0,0,0,0.9), 0 0 30px rgba(0,0,0,0.7);
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: clamp(8px, 1.5vh, 16px);
  pointer-events: none;
  user-select: none;
}

#timetable h2::before,
#timetable h2::after {
  content: "";
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  max-width: 100px;
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9), 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* ============================
   路線ボタン（route > h3 > a）
============================ */
.route {
  margin: clamp(4px, 0.8vh, 10px) 0;
  text-align: center;
}

.route h3 {
  display: block;
  background: none;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.route h3 a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: clamp(10px, 1.5vh, 15px) 20px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-color);
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: bold;
  letter-spacing: 0.04em;
  border: 2px solid var(--green-main);
  border-left: 7px solid var(--green-main);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  min-height: clamp(44px, 6vh, 54px);
  transition: all 0.22s ease;
}

.route h3 a::after {
  content: "›";
  font-size: 1.6em;
  color: var(--green-main);
  font-weight: bold;
  flex-shrink: 0;
  margin-left: 12px;
  transition: color 0.22s ease;
}

.route h3 a:hover,
.route h3 a:focus {
  background: var(--green-main);
  color: var(--white);
  border-left-color: var(--green-dark);
  transform: translateX(5px);
  box-shadow: 0 5px 16px rgba(76, 175, 80, 0.4);
}

.route h3 a:hover::after,
.route h3 a:focus::after {
  color: var(--white);
}

.route h3 a:active {
  transform: translateX(0);
}

/* ============================
   フッター
============================ */
#footer-section {
  background-color: rgba(33, 33, 33, 0.92);
  color: var(--white);
  font-size: clamp(0.875rem, 2.5vw, 1.05rem);
  padding: clamp(10px, 1.5vh, 16px) 12px;
  width: 100%;
  text-align: center;
  flex-shrink: 0;
}

#footer-section p {
  margin: 5px 0;
  line-height: 1.7;
}

#footer-section p a.tel-link {
  color: var(--white) !important;
  text-decoration: none;
  border: none;
  padding: 4px 8px;
  background-color: transparent;
  box-shadow: none;
  transition: opacity 0.3s;
  font-weight: bold;
  font-size: 1.1em;
}

#footer-section p a.tel-link:hover,
#footer-section p a.tel-link:focus {
  background-color: transparent;
  color: var(--white) !important;
  text-decoration: underline;
  transform: none;
  opacity: 0.8;
}

/* ============================
   レスポンシブ
============================ */
@media screen and (min-width: 769px) {
  html,
  body {
    height: 100dvh;
    overflow: hidden;
  }

  #header-section h1 {
    padding: 2vh 24px;
    font-size: clamp(1.1rem, 3vh, 2rem);
  }

  #main-section {
    overflow: hidden;
    padding: 1.5vh 16px;
  }

  #route-map {
    margin-bottom: clamp(4px, 0.8vh, 8px);
  }

  #timetable {
    margin-top: clamp(12px, 2.5vh, 40px);
  }

  #timetable h2 {
    font-size: clamp(1.1rem, 3vh, 2rem);
    margin-bottom: clamp(6px, 1.2vh, 16px);
    padding: 0.8vh 20px;
  }

  #route-map h2 a {
    padding: clamp(10px, 1.8vh, 18px) 24px;
    font-size: clamp(1rem, 2.5vh, 1.5rem);
  }

  .route {
    margin: clamp(3px, 0.6vh, 10px) 0;
  }

  .route h3 a {
    padding: clamp(8px, 1.3vh, 15px) 20px;
    min-height: 0;
    font-size: clamp(0.9rem, 2vh, 1.25rem);
  }

  #footer-section {
    padding: clamp(8px, 1.5vh, 16px) 12px;
    font-size: clamp(0.75rem, 1.8vh, 1.05rem);
  }
}

@media screen and (max-width: 768px) {
  #main-section {
    padding: 20px 12px 28px 12px;
    justify-content: center;
    overflow-y: auto;
  }

  #route-map,
  #timetable {
    max-width: 100%;
  }
}

@media screen and (max-width: 480px) {
  #header-section h1 {
    padding: 16px 14px;
  }

  #main-section {
    padding: 16px 10px 20px 10px;
  }

  #timetable h2::before,
  #timetable h2::after {
    max-width: 60px;
  }

  #route-map h2 a {
    padding: 15px 16px;
  }

  .route h3 a {
    padding: 13px 14px;
    border-left-width: 6px;
  }

  #footer-section {
    padding: 14px 10px;
  }
}

@media screen and (max-width: 360px) {
  #header-section h1 {
    padding: 14px 10px;
  }

  #main-section {
    padding: 12px 8px 16px 8px;
  }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
  body {
    background-attachment: scroll;
  }

  #main-section {
    padding: 12px;
    justify-content: flex-start;
  }
}