/* =========================================
   1) リセットCSS (全ページ共通)
========================================= */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}
.zen-maru-gothic-regular {
  font-family: "Zen Maru Gothic", serif !important;
  font-weight: 400;
  font-style: normal;
}
.shippori-mincho-regular {
  font-family: "Shippori Mincho", serif !important;
  font-weight: 400;
  font-style: normal;
}
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24
}
a {
  text-decoration: none;
}
body {
  line-height: 1;
}
ol, ul {
  list-style: none;
}
blockquote, q {
  quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* =========================================
   2) 共通フォント設定
========================================= */
* {
  box-sizing: border-box;
  font-family: "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, "メイリオ", sans-serif;
}
body {
  background-color: #f5f5f5;
}

/* =========================================
   3) ヘッダー & ナビゲーション (共通)
========================================= */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  height: 45px;
}
.nav-menu {
  display: flex;
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  justify-content: space-around;
}
.nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 10px 15px;
  position: relative;
  text-decoration: none;
  color: #333;
  flex: 1;
  text-align: center;
  justify-content: center;
}
.nav-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  border-right: 1px dashed #e0e0e0;
}
.nav-item:hover {
  background-color: #f9f9f9;
}
.nav-item {
  position: relative; /* 擬似要素を絶対配置するために必要 */
  /* 既存の .nav-item のスタイルはそのままでOK */
}

/* 下に伸びるバーのアニメーション */
.nav-item::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;                /* 初期状態は幅 0 */
  height: 2px;             /* バーの太さ */
  background-color: #333;   /* バーの色 */
  transition: width 0.4s ease; /* ゆっくり伸びる時間と動き */
}

.nav-item:hover::before {
  width: 100%; /* ホバー時に幅を100%にして横いっぱいに伸ばす */
}
.nav-icon {
  font-size: 20px;
  margin-right: 8px;
  color: #acacac;
}
.nav-title {
  font-size: 16px;
  margin-bottom: 3px;
}
.nav-subtitle {
  font-size: 8px;
  color: #666;
}

/* ハンバーガーメニュー */
.hamburger-menu {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  margin-right: 20px;
  z-index: 2000;
  position: relative;
}
.hamburger-menu span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #333;
  border-radius: 3px;
  transition: all 0.3s ease;
}
.hamburger-menu.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.hamburger-menu.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* =========================================
   4) 検索バー (共通)
========================================= */
.search-container {
  display: flex;
  align-items: center;
  padding: 20px;
  background-color: #dee5f0;
  position: fixed;
  top: 45px;
  width: 100%;
  z-index: 999;
  height: 85px;
}
.search-content {
  display: flex;
  align-items: center;
  max-width: 700px;
  width: 100%;
  margin: 0 auto;
}
.logo {
  font-size: 28px;
  margin-right: 20px;
  color: #333;
  font-weight: bold;
}
.search-box {
  flex: 1;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 8px 50px 8px 20px;
  border-radius: 50px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
}
.search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
}
.search-icon {
  width: 24px;
  height: 24px;
}
/* サジェストリストのアニメーション用 */
#suggestionList {
  /* 最初は非表示にするため、JSで display:none を使用するが、
     アニメーションのために以下のトランジションと初期値を設定 */
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 表示状態 */
#suggestionList.show {
  opacity: 1;             /* フェードイン */
  transform: translateY(0); /* 上から下へスライドダウン */
}

/* =========================================
   5) メインコンテンツ全般
========================================= */
/* （例：cardiology.html、level_1.html 等で使われるレイアウト） */
.section-title {
  font-size: 24px;
  font-weight: bold;
  margin: 30px auto;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 10px 20px;
  background-color: #999;
  border-radius: 20px;
}
.section-title .material-icons {
  margin-right: 8px;
  font-size: 26px;
  color: #555;
}

.main-container {
  display: flex;
  max-width: 900px;
  margin: 160px auto 0;
  background-color: #fff;
  border-radius: 20px;
  overflow: hidden;
  width: 95%;
}
.sidebar {
  width: 220px;
  background-color: #e6e6e6;
  padding: 20px 0;
  border-radius: 20px 0 0 20px;
}
.sidebar-section-title {
  background-color: #a0a0a0;
  color: #fff;
  padding: 4px 15px;
  font-size: 14px;
  margin-bottom: 15px;
  border-radius: 15px;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.sidebar-list {
  margin-bottom: 30px;
  padding: 0 15px;
}
.sidebar-item {
  font-size: 14px;
  margin-bottom: 8px;
  color: #333;
  display: block;
  text-decoration: none;
  padding-left: 1em;
}
.sidebar-item {
  font-size: 0.85em;
  line-height: 1.2;
  word-break: break-all;
}
.sidebar-item:hover {
  text-decoration: underline;
}
.sidebar-item::before {
  content: "・";
  margin-right: 3px;
}

/* カテゴリー見出し */
.category-heading {
  font-weight: bold;
  margin-top: 15px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}
.category-heading .material-icons {
  font-size: 18px;
  margin-right: 5px;
  margin-bottom: 2px;
  color: #b3b3b3;
}

.content {
  flex: 1;
  padding: 20px;
  text-align: center;
  margin-bottom: 10%;
}
.word-title {
  background-color: #efefef;
  width: 100%;
  border-radius: 8px;
  padding: 10px 20px;
  margin: 10px auto;
  display: inline-block;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
}

/* ----- 用語一覧テーブル (例: cardiology.html, level_1.html など) ----- */
.terms-table {
  width: 100%;
  margin-top: 20px;
  border-collapse: separate;
  border-spacing: 0;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  font-size: 14px;
}
.terms-table thead {
  background-color: #a0a0a0;
  border-bottom: 2px solid #ddd;
  color: #FFFFFF;
}
.terms-table thead th:first-child {
  border-top-left-radius: 8px;
}
.terms-table thead th:last-child {
  border-top-right-radius: 8px;
}
.terms-table th {
  font-weight: bold;
  text-align: center;
  padding: 12px 15px;
}
.terms-table tbody tr {
  border-bottom: 1px solid #ddd;
}
.terms-table tbody tr:hover {
  background-color: #f5f5f5;
}
.terms-table td {
  padding: 12px 15px;
  text-overflow: ellipsis;
  overflow: visible; /* ツールチップが表示されるように変更 */
  white-space: normal; /* ツールチップが表示されるように変更 */
}
.terms-table td:nth-child(1),
.terms-table td:nth-child(2) {
  text-align: center;
}
.terms-table td.definition {
  max-width: 400px;
}

/* =========================================
   6) フッター (共通)
========================================= */
.footer-container {
  background-color: #dee5f0;
  padding: 30px 20px 20px;
  margin-top: 40px;
  border-top: 1px solid #ccc;
}
.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.footer-logo {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}
.footer-credit {
  text-align: center;
  font-size: 12px;
  color: #888;
  margin: 0 auto;
  max-width: 1000px;
  padding-top: 15px;
  border-top: 1px dashed #ccc;
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-link {
  color: #555;
  text-decoration: none;
  font-size: 14px;
  position: relative;
}
.footer-link:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  height: 12px;
  border-right: 1px solid #ccc;
}
.footer-link:hover {
  text-decoration: underline;
}

/* =========================================
   7) レスポンシブ（768px 以下）
========================================= */
@media (max-width: 768px) {
  .hamburger-menu {
    display: flex;
    position: fixed;
    top: 12px;
    right: 20px;
    margin: 0;
    background-color: transparent;
  }
  .nav-menu {
    position: fixed;
    top: -100%;
    left: 0;
    flex-direction: column;
    width: 100%;
    height: auto;
    background-color: white;
    padding: 60px 0 20px;
    transition: 0.3s;
    box-shadow: 0 5px 5px rgba(0,0,0,0.1);
    z-index: 1900;
  }
  .nav-container {
    background-color: #e0e0e000;
    border-bottom: 1px solid #e0e0e000;
  }
  .nav-menu.active {
    top: 0;
  }
  .nav-item {
    padding: 15px;
    width: 100%;
  }
  .nav-item:not(:last-child)::after {
    display: none;
  }
  .search-container {
    flex-direction: column;
    align-items: center;
    padding: 15px;
    position: static;
    height: auto;
  }
  .search-content {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .logo {
    margin: 0 0 15px;
    text-align: center;
  }
  .search-box {
    width: 90%;
    margin: 0 auto;
  }
  .main-container {
    flex-direction: column;
    margin-top: 20px;
  }
  .sidebar {
    display: none;
  }
  .content {
    width: 100%;
    text-align: center;
  }
  .footer-container {
    padding: 20px 15px 15px;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    margin-bottom: 15px;
  }
}

/* =========================================
   8) ホーム (index.html) 用 (問い合わせフォームなど)
========================================= */
.main-container.home {
  margin-top: 160px;
  max-width: 1100px;
  border-radius: 20px;
  padding: 30px;
}
.page-title {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #ccc;
}
/* ホーム用セクション */
.home-section {
  margin-bottom: 40px;
}
.home-section-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-left: 10px;
  border-left: 5px solid #a0a0a0;
  display: flex;
  align-items: center;
}
.home-section-title .material-icons {
  margin-right: 10px;
  color: #a0a0a0;
}
.home-section-content {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}
/* お問い合わせフォーム */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 14px;
  outline: none;
}
.form-textarea {
  resize: vertical;
  height: 100px;
}
.form-buttons {
  display: flex;
  gap: 10px;
}
.form-button {
  display: inline-block;
  background-color: #333;
  color: #fff;
  font-size: 14px;
  padding: 10px 30px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}
.form-button:hover {
  background-color: #555;
}
.confirm-area {
  max-width: 600px;
  margin: 20px auto;
  padding: 15px;
  border: 1px dashed #ccc;
  border-radius: 10px;
  background-color: #f9f9f9;
}
.confirm-item {
  margin-bottom: 10px;
  line-height: 1.6;
}
.confirm-label {
  font-weight: bold;
}
.recaptcha-container {
  margin: 20px 0;
}

/* =========================================
   9) メニュー (menu.html) 用 (タブ切り替え)
========================================= */
.tab-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  border-bottom: 2px solid #ccc;
  padding-bottom: 10px;
  margin-bottom: 30px;
}
.tab-button {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 16px;
  font-weight: 600;
  padding: 5px 15px 8px;
  cursor: pointer;
  transition: background-color 0.3s, border-bottom-color 0.3s;
  color: #555;
}
.tab-button:hover {
  background-color: #f4f4f4;
}
.tab-button.active {
  color: #333;
  border-bottom-color: #333;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
.fields-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.field-category {
  width: 100%;
  margin-bottom: 40px;
}
.category-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-left: 10px;
  border-left: 5px solid #a0a0a0;
  display: flex;
  align-items: center;
}
.category-title .material-icons {
  margin-right: 10px;
  color: #a0a0a0;
}
.fields-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.field-item {
  width: calc(33.333% - 10px);
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 15px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}
.field-item:hover {
  background-color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.field-icon {
  margin-right: 10px;
  color: #808080;
}
.field-text {
  flex: 1;
}
.field-name {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 5px;
}
.field-english {
  font-size: 12px;
  color: #666;
}
/* レベルリスト (menu.html, wordbooks.html) */
.level-list, .level-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.level-item {
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 15px;
  text-decoration: none;
  color: #333;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}
.level-item:hover {
  background-color: #e0e0e0;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.level-title, .level-name {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 5px;
}
.level-description {
  font-size: 14px;
  color: #666;
}
/* レベル番号のみ大きく表示するケース */
.level-number {
  font-size: 28px;
  font-weight: bold;
  color: #007bff;
  min-width: 40px;
  margin-right: 20px;
  text-align: center;
}
.level-text {
  flex: 1;
}

/* =========================================
   10) words/galactose.html 用 (詳細ページレイアウト)
========================================= */
.word-header {
  text-align: center;
  margin-bottom: 60px;
  position: relative;
  padding-top: 60px;
}
.level-label {
  font-size: 14px;
  color: #666;
  margin: 15px;
  position: absolute;
  top: 0;
  left: 0;
  border: 1px solid #666;
  padding: 2px 12px;
  border-radius: 10px;
}
.word-title {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 15px;
  background: none; /* 既存の .word-title と重複しないように */
  border-radius: 0; /* 既存の .word-title と重複しないように */
  padding: 0;
}
.word-japanese {
  font-size: 16px;
  color: #333;
  margin-bottom: 25px;
}
.pronunciation {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}
.katakana {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
}
.section-box {
  background-color: #f5f5f5;
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: left; /* 全体が center なので、本文は左寄せ */
}
.section-box-title {
  background-color: #a0a0a0;
  color: #fff;
  padding: 5px 15px;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 15px;
  border-radius: 15px;
  width: 100px;
  text-align: center;
}
.section-box-content {
  font-size: 14px;
  line-height: 1.6;
  padding-left: 1em;
}
.example-container {
  margin-bottom: 15px;
  padding-left: 10px;
}
.example-english {
  margin-bottom: 5px;
}
.example-japanese {
  color: #555;
}
.highlight {
  font-weight: bold;
  color: #e64c4c;
}
.subject-tags {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.subject-tag {
  font-size: 12px;
  color: #666;
  border: 1px solid #666;
  padding: 2px 12px;
  border-radius: 10px;
}

/* =========================================
   11) レスポンシブ (menu や field-item の列数など)
========================================= */
@media (max-width: 768px) {
  .field-item {
    width: calc(50% - 7.5px);
  }
  .level-item {
    width: 100%;
  }
  .nav-container {
  width: 0%;
}
.quiz-container{
  width: 100%;
}
}
@media (max-width: 480px) {
  .field-item {
    width: 100%;
  }
}
