* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a237e;
  --secondary-color: #3949ab;
  --accent-color: #ff6f00;
  --text-color: #212121;
  --bg-color: #ffffff;
  --section-bg: #f5f5f5;
  --max-width: 1200px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* ヘッダー */
header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  padding: 4rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
  position: relative;
  z-index: 10;
}

header::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
  top: 0;
  left: 0;
}

header::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  right: -100px;
  top: -100px;
  pointer-events: none;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 1;
}

.subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
  font-weight: 300;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  font-size: 0.95rem;
  margin-top: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
  font-weight: 500;
  backdrop-filter: blur(10px);
}

/* ナビゲーション */
nav {
  background-color: var(--section-bg);
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ハンバーガーメニューボタン */
.nav-toggle {
  display: none;
  flex-direction: column;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 5px;
  z-index: 101;
  position: relative;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translateY(9px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translateY(-9px);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s;
  display: inline-block;
}

.nav-links a:hover {
  background-color: rgba(26, 35, 126, 0.1);
}

/* メインコンテンツ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}

section {
  margin-bottom: 5rem;
  scroll-margin-top: 80px;
  position: relative;
}

section:nth-child(even) .card {
  background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

section:nth-child(odd) .card {
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-color);
}

h3 {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h4 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  text-align: justify;
}

ul,
ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* テーブル */
.table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

th {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  color: white;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

tr:hover {
  background-color: #f5f5f5;
}

/* カード */
.card {
  background: white;
  padding: 2.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.12);
}

/* ヒーロー画像コンテナ */
.hero-image-container {
  width: 100%;
  margin: 2rem 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.image-placeholder {
  text-align: center;
  padding: 3rem;
  color: #666;
}

.image-placeholder p {
  margin: 0.5rem 0;
}

.image-note {
  font-size: 0.9rem;
  color: #999;
  font-style: italic;
}

/* 施設イメージ画像 */
.facility-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.card-grid > div {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 1.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card-grid > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.highlight {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 2rem;
  border-left: 6px solid var(--accent-color);
  border-radius: 10px;
  margin: 1.5rem 0;
  box-shadow: 0 2px 8px rgba(255, 111, 0, 0.15);
  position: relative;
}

.highlight::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    rgba(255, 111, 0, 0.1) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

/* タイムライン */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--secondary-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2.5rem;
  top: 0.3rem;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 3px solid var(--secondary-color);
}

.timeline-title {
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

/* 更新情報 */
.update-info {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  padding: 1.5rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  border-left: 5px solid #2196f3;
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

/* フッター */
footer {
  background-color: var(--text-color);
  color: white;
  padding: 2rem 1rem;
  margin-top: 4rem;
  text-align: center;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
}

footer a {
  color: #90caf9;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* レスポンシブ */
@media (max-width: 768px) {
  h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  /* ハンバーガーメニュー */
  .nav-toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 102;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: top 0.3s ease;
  }

  /* ページトップの時は言語切り替えボタンの下に表示 */
  .nav-toggle.at-top {
    top: 4.5rem;
  }

  .nav-links {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    height: 100dvh; /* 動的ビューポート高さ */
    background-color: white;
    flex-direction: column;
    padding: 0;
    margin: 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 99;
    touch-action: pan-y;
    display: block;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid #e0e0e0;
    display: block;
    margin: 0;
  }

  .nav-links li:first-child {
    padding-top: 4rem;
  }

  .nav-links li:last-child {
    padding-bottom: 2rem;
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 1.2rem 1.5rem;
    width: 100%;
    font-size: 1rem;
    line-height: 1.5;
    box-sizing: border-box;
    color: var(--text-color);
    text-decoration: none;
  }

  .nav-links a:active {
    background-color: rgba(26, 35, 126, 0.1);
  }

  /* モバイルメニューでの言語切り替え */
  .nav-links a[data-lang="ja"] {
    display: block;
  }

  .nav-links a[data-lang="en"] {
    display: none;
  }

  html[lang="en"] .nav-links a[data-lang="ja"] {
    display: none;
  }

  html[lang="en"] .nav-links a[data-lang="en"] {
    display: block;
  }

  /* メニューオーバーレイ */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 98;
  }

  .nav-overlay.active {
    display: block;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 0.5rem;
  }

  .hero-image-container {
    min-height: 250px;
  }

  .facility-image {
    height: 200px;
  }

  header {
    padding: 1.5rem 1rem;
  }

  .header-top {
    margin-bottom: 0.5rem;
  }

  .lang-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
  }
}

/* スマートフォン向け（より小さい画面） */
@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
  }

  .subtitle {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    margin-top: 0.3rem;
  }

  header {
    padding: 1rem 0.75rem;
  }

  .header-container {
    padding: 0;
  }

  .nav-links {
    width: 85%;
    max-width: 280px;
  }

  .lang-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeIn 0.6s ease-out;
}

/* トップに戻るボタン */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
}

.back-to-top:hover {
  background: var(--secondary-color);
}

/* 言語切り替え */
.language-switcher {
  display: flex;
  gap: 0.5rem;
}

.lang-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
}

.lang-btn.active {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
}

/* 言語別表示制御 */
[data-lang="ja"] {
  display: block;
}

[data-lang="en"] {
  display: none;
}

html[lang="en"] [data-lang="ja"] {
  display: none;
}

html[lang="en"] [data-lang="en"] {
  display: block;
}

/* ナビゲーションリンク専用の言語切り替え（より高い特異性で上書き） */
.nav-links a[data-lang="ja"] {
  display: inline-block !important;
}

.nav-links a[data-lang="en"] {
  display: none !important;
}

html[lang="en"] .nav-links a[data-lang="ja"] {
  display: none !important;
}

html[lang="en"] .nav-links a[data-lang="en"] {
  display: inline-block !important;
}

/* 免責事項 */
.disclaimer {
  background: #fff3cd;
  padding: 1.5rem;
  border-left: 5px solid #ffc107;
  border-radius: 5px;
  margin: 2rem 0;
  font-size: 0.9rem;
}

.disclaimer h4 {
  color: #856404;
  margin-bottom: 1rem;
}

.disclaimer ul {
  margin-left: 1.5rem;
}

.disclaimer li {
  margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
  .language-switcher {
    top: 0.5rem;
    right: 0.5rem;
  }
  .lang-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}

/* フォーム */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-color);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0e0e0;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.required {
  color: #c62828;
  margin-left: 0.3rem;
}

.form-note {
  font-size: 0.9rem;
  color: #666;
  margin-top: 0.5rem;
}

button[type="submit"] {
  background: var(--primary-color);
  color: white;
  padding: 1rem 2rem;
  border: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
}

button[type="submit"]:hover {
  background: var(--secondary-color);
}

button[type="submit"]:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* フォーム準備中スタイル */
.form-preparing {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
}

.form-preparing::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7);
  z-index: 10;
  border-radius: 5px;
}

.form-preparing-notice {
  position: relative;
  z-index: 20;
  background: #fff3cd;
  padding: 1.5rem;
  border-left: 5px solid #ffc107;
  border-radius: 5px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.form-preparing-notice h4 {
  color: #856404;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.form-preparing-notice p {
  color: #856404;
  margin: 0;
}

/* form.run フォーム埋め込みスタイル */
.formrun-embed {
  margin: 2rem 0;
  max-width: 100%;
}

/* form.run フォーム内の要素を既存デザインに合わせる */
.formrun-embed iframe {
  width: 100%;
  min-height: 600px;
  border: none;
  border-radius: 5px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .formrun-embed iframe {
    min-height: 500px;
  }
}
