/* ゲストでもトップナビを必ず表示（以前の不具合対策は維持） */
body:not(.ccm-toolbar-visible) .ccm-block-top-navigation-bar {
  display: block !important;
  visibility: visible !important;
}

/* ナビは fixed の代わりに sticky で運用（ツールバー有無に強い） */
.theme-atomik .navbar.fixed-top,
.theme-nghr-atomik .navbar.fixed-top {
  position: sticky !important;
  top: 0;
  left: auto;
  right: auto;
  width: auto;
  min-height: 64px;
  background: #fff;
  z-index: 999;
  box-shadow: 0 .25rem .5rem rgba(0,0,0,.05);
}

/* ナビ内の文字色（背景白でも読めるように） */
.theme-atomik .navbar .navbar-brand,
.theme-nghr-atomik .navbar .navbar-brand,
.theme-atomik .navbar .nav-link,
.theme-nghr-atomik .navbar .nav-link {
  color: #212529;
}

/* 以前の“押し下げ系”ルールはリセットして無効化（念のため） */
body.ccm-toolbar-visible .ccm-block-top-navigation-bar .navbar.fixed-top,
body.ccm-toolbar-visible .navbar.fixed-top {
  top: auto !important;
  margin-top: 0 !important;
}

body:not(.ccm-toolbar-visible) {
  padding-top: 0 !important;
}

/* 本文全体を Noto Sans JP に統一 */
body {
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-weight: 400;
  line-height: 1.6;
}

/* 見出しは太めで */
h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

/* 重要度を上げてナビ左側のブランド部分全体を上書き */
div.ccm-page div.ccm-block-top-navigation-bar .navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  text-transform: none;
}

/* トップナビゲーションバーの背景色を白に */
.theme-nghr-atomik .ccm-block-top-navigation-bar.navbar,
.theme-nghr-atomik .navbar {
  background-color: #fff !important;
}

/* ナビゲーションのリンク文字色をSCIENCE TOKYOブルーに */
.theme-nghr-atomik .navbar .nav-link,
.theme-nghr-atomik .navbar .navbar-brand {
  color: #1F3C88 !important;
}

/* ホバー時に少し明るく */
.theme-nghr-atomik .navbar .nav-link:hover,
.theme-nghr-atomik .navbar .nav-link:focus {
  color: #3050aa !important;
}

/* 見える化：クリップ/潜り込み防止 */
.theme-atomik .navbar,
.theme-nghr-atomik .navbar,
.c-page-header, .c-page-header .container, .c-page-header .row {
  overflow: visible !important;
}

.theme-atomik .dropdown-menu,
.theme-nghr-atomik .dropdown-menu {
  z-index: 1051 !important;
}

.c-page-header {
  position: relative;
}

/* PCマウス環境だけホバーで開く（モバイルはタップ） */
@media (hover:hover) and (pointer:fine) {
  .navbar .dropdown:hover > .dropdown-menu {
    display: block;
  }
}

/* 見出し（h1〜h6）と display系のクラスにブランドカラーを適用 */
.theme-nghr-atomik h1,
.theme-nghr-atomik h2,
.theme-nghr-atomik h3,
.theme-nghr-atomik h4,
.theme-nghr-atomik h5,
.theme-nghr-atomik h6,
.theme-nghr-atomik .display-1,
.theme-nghr-atomik .display-2,
.theme-nghr-atomik .display-3,
.theme-nghr-atomik .display-4,
.theme-nghr-atomik .display-5,
.theme-nghr-atomik .display-6 {
  color: #1F3C88 !important;
}

/* フッター全体の背景をScience Tokyoブルーに */
.theme-nghr-atomik footer {
  background-color: #1F3C88 !important;
  color: #fff !important;
}

/* フッター内のリンク文字色も白に */
.theme-nghr-atomik footer a {
  color: #fff !important;
  text-decoration: none;
}

/* リンクにホバーしたときは少し明るい青に */
.theme-nghr-atomik footer a:hover,
.theme-nghr-atomik footer a:focus {
  color: #cfd8f7 !important;
}

/* =========================
   Timetable Table Custom
========================= */

/* 共通設定 */
.theme-nghr-atomik table.timetable {
  table-layout: fixed;
  width: 100%;
}

.theme-nghr-atomik .timetable thead.timetable-head th {
  background-color: #7A93C8;
  color: #fff;
  text-align: center;
  vertical-align: middle;
}

.theme-nghr-atomik table.timetable th,
.theme-nghr-atomik table.timetable td {
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* =========================================
   timetable-regular
   時間 / 推奨学年 / 科目名 / 担当教員 / 講義室 / 備考
   合計100%
========================================= */
.theme-nghr-atomik table.timetable-regular th.jikan,
.theme-nghr-atomik table.timetable-regular td.jikan { width: 10%; }

.theme-nghr-atomik table.timetable-regular th.gakki,
.theme-nghr-atomik table.timetable-regular td.gakki { width: 8%; }

.theme-nghr-atomik table.timetable-regular th.kamoku,
.theme-nghr-atomik table.timetable-regular td.kamoku { width: 25%; }

.theme-nghr-atomik table.timetable-regular th.kyoin,
.theme-nghr-atomik table.timetable-regular td.kyoin { width: 15%; }

.theme-nghr-atomik table.timetable-regular th.heya,
.theme-nghr-atomik table.timetable-regular td.heya { width: 15%; }

.theme-nghr-atomik table.timetable-regular th.bikou,
.theme-nghr-atomik table.timetable-regular td.bikou { width: 27%; }

/* =========================================
   timetable-intensive
   推奨学年 / 科目名 / 担当教員 / 日程 / 時間 / 講義室等 / 備考
   合計100%
========================================= */
.theme-nghr-atomik table.timetable-intensive th.gakki,
.theme-nghr-atomik table.timetable-intensive td.gakki { width: 8%; }

.theme-nghr-atomik table.timetable-intensive th.kamoku,
.theme-nghr-atomik table.timetable-intensive td.kamoku { width: 20%; }

.theme-nghr-atomik table.timetable-intensive th.kyoin,
.theme-nghr-atomik table.timetable-intensive td.kyoin { width: 12%; }

.theme-nghr-atomik table.timetable-intensive th.nittei,
.theme-nghr-atomik table.timetable-intensive td.nittei { width: 10%; }

.theme-nghr-atomik table.timetable-intensive th.jikan,
.theme-nghr-atomik table.timetable-intensive td.jikan { width: 10%; }

.theme-nghr-atomik table.timetable-intensive th.heya,
.theme-nghr-atomik table.timetable-intensive td.heya { width: 15%; }

.theme-nghr-atomik table.timetable-intensive th.bikou,
.theme-nghr-atomik table.timetable-intensive td.bikou { width: 25%; }

/* =========================================
   timetable-graduate
   時間 / 科目コード / 科目名 / 担当教員 / 講義室等 / 備考
   合計100%
========================================= */
.theme-nghr-atomik table.timetable-graduate th.jikan,
.theme-nghr-atomik table.timetable-graduate td.jikan { width: 10%; }

.theme-nghr-atomik table.timetable-graduate th.code,
.theme-nghr-atomik table.timetable-graduate td.code { width: 14%; }

.theme-nghr-atomik table.timetable-graduate th.kamoku,
.theme-nghr-atomik table.timetable-graduate td.kamoku { width: 26%; }

.theme-nghr-atomik table.timetable-graduate th.kyoin,
.theme-nghr-atomik table.timetable-graduate td.kyoin { width: 15%; }

.theme-nghr-atomik table.timetable-graduate th.heya,
.theme-nghr-atomik table.timetable-graduate td.heya { width: 15%; }

.theme-nghr-atomik table.timetable-graduate th.bikou,
.theme-nghr-atomik table.timetable-graduate td.bikou { width: 20%; }

/* =========================================
   timetable-practice
   推奨学年 / 科目名 / 担当教員 / 日程 / 時間 / 講義室等 / 備考
   合計100%
========================================= */
.theme-nghr-atomik table.timetable-practice th.gakki,
.theme-nghr-atomik table.timetable-practice td.gakki { width: 8%; }

.theme-nghr-atomik table.timetable-practice th.kamoku,
.theme-nghr-atomik table.timetable-practice td.kamoku { width: 20%; }

.theme-nghr-atomik table.timetable-practice th.kyoin,
.theme-nghr-atomik table.timetable-practice td.kyoin { width: 12%; }

.theme-nghr-atomik table.timetable-practice th.nittei,
.theme-nghr-atomik table.timetable-practice td.nittei { width: 10%; }

.theme-nghr-atomik table.timetable-practice th.jikan,
.theme-nghr-atomik table.timetable-practice td.jikan { width: 10%; }

.theme-nghr-atomik table.timetable-practice th.heya,
.theme-nghr-atomik table.timetable-practice td.heya { width: 15%; }

.theme-nghr-atomik table.timetable-practice th.bikou,
.theme-nghr-atomik table.timetable-practice td.bikou { width: 25%; }

/* =========================================
   timetable-nursingcare
   推奨学年 / 科目名 / 担当教員 / 日程 / 時間 / 講義室等 / 備考
   合計100%
========================================= */
.theme-nghr-atomik table.timetable-nursingcare th.gakki,
.theme-nghr-atomik table.timetable-nursingcare td.gakki { width: 8%; }

.theme-nghr-atomik table.timetable-nursingcare th.kamoku,
.theme-nghr-atomik table.timetable-nursingcare td.kamoku { width: 20%; }

.theme-nghr-atomik table.timetable-nursingcare th.kyoin,
.theme-nghr-atomik table.timetable-nursingcare td.kyoin { width: 12%; }

.theme-nghr-atomik table.timetable-nursingcare th.nittei,
.theme-nghr-atomik table.timetable-nursingcare td.nittei { width: 10%; }

.theme-nghr-atomik table.timetable-nursingcare th.jikan,
.theme-nghr-atomik table.timetable-nursingcare td.jikan { width: 10%; }

.theme-nghr-atomik table.timetable-nursingcare th.heya,
.theme-nghr-atomik table.timetable-nursingcare td.heya { width: 15%; }

.theme-nghr-atomik table.timetable-nursingcare th.bikou,
.theme-nghr-atomik table.timetable-nursingcare td.bikou { width: 25%; }

/* closable用：アコーディオンのボタンにも見出し色を適用 */
.theme-nghr-atomik .accordion-button {
  color: #1F3C88 !important;
}

/* hover/focus時に暗くなりすぎないよう上書き */
.theme-nghr-atomik .accordion-button:not(.collapsed) {
  color: #1F3C88 !important;
  background-color: #f8f9fa;
  box-shadow: none;
}

/* ---- Stucco風・ゆとりリスト ---- */
.nghr-news-spacious {
  border-top: 1px solid #e6e9ef;
}

.nghr-news-spacious .nghr-item {
  padding: 14px 0;
  border-bottom: 1px solid #e6e9ef;
}

.nghr-news-spacious .nghr-row {
  display: block;
  text-decoration: none;
}

.nghr-news-spacious .nghr-row:hover .nghr-title {
  text-decoration: underline;
}

/* 日付＋NEWを横並びで控えめに */
.nghr-news-spacious .nghr-meta {
  display: inline-flex;
  gap: .4rem;
  align-items: baseline;
  margin-right: .5rem;
  font-size: 1rem;
  color: #6c7a89;
}

.nghr-news-spacious .nghr-badge {
  display: inline-block;
  font-size: .75rem;
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: .25rem;
  background: #ffefef;
  border: 1px solid #ffc9c9;
  color: #c92a2a;
}

/* タイトルはブランド色 */
.nghr-news-spacious .nghr-title {
  display: inline;
  margin: 0 .25rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
}

/* 抜粋は控えめの小さめ文字 */
.nghr-news-spacious .nghr-excerpt {
  margin: .25rem 0 0;
  color: #536270;
  font-size: .95rem;
}

/* 余白をさらにStucco風にしたい場合は調整 */
@media (min-width: 768px) {
  .nghr-news-spacious .nghr-item {
    padding: 16px 0;
  }
}

/* ▶︎（chevron） */
.nghr-news-spacious .nghr-chevron {
  display: inline-block;
  margin-right: .35rem;
  transform: translateY(.05em);
}

.nghr-news-spacious .nghr-chevron::before {
  content: "\25B6";
  font-size: .9em;
  line-height: 1;
  color: currentColor;
}

/* ホバー時はタイトルだけ下線 */
.nghr-news-spacious .nghr-row:hover .nghr-title {
  text-decoration: underline;
}

/* 備考内の旧年度注意文用。
   現在は view.php 側の inline style で色付けしているため未使用。
.old-year-note {
  color: #c62828;
  font-weight: 600;
}
*/
