/* =========================================================
   長崎大学 眼科・視覚科学教室 目の健康情報ポータル
   デザインは WetFieldEye に準拠
   （紺のヘッダー帯＋金の差し色／医療系ブルー／システム日本語フォント）
   ========================================================= */

:root {
  --navy:      #0a3a8c;   /* ブランド紺（ヘッダー帯・タイトル・見出し） */
  --navy-deep: #062a6b;
  --blue:      #005fb6;   /* 医療系ブルー（リンク・アクセント） */
  --blue-bg:   #e9f1fb;   /* 淡い青背景（見出しバー等） */
  --blue-bg2:  #f4f8fd;
  --gold:      #d98a00;   /* 差し色 */
  --gold-bg:   #fff6e6;

  --ink:       #231815;   /* 本文 */
  --gray:      #5b6470;
  --line:      #d8e0ea;

  --neutral-bg:   #f4f4f4;
  --neutral-line: #e3e3e3;

  --bg:        #eef3f8;
  --surface:   #ffffff;
  --shadow:    0 2px 12px rgba(10, 58, 140, .08);

  --radius:    10px;
  --maxw:      880px;

  --font: "Meiryo", "メイリオ", "Hiragino Kaku Gothic ProN",
          "Hiragino Sans", "Yu Gothic", "YuGothic",
          "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

p { margin: 0 0 .9em; }
a { color: var(--blue); }
strong { color: var(--navy); font-weight: 700; }
img, svg { display: block; max-width: 100%; }

.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

/* 改行を文節・固有名詞の途中で起こさないためのユーティリティ */
.nw { white-space: nowrap; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: #fff; padding: .6em 1em; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; border-radius: 6px; }

/* ---------- ヘッダー ---------- */
.site-header {
  background-color: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-bottom: 3px solid var(--gold);
  color: #fff;
}
.site-header__inner {
  width: min(100% - 2rem, 1100px);
  margin-inline: auto;
  display: flex; align-items: center; gap: .6rem .85rem; flex-wrap: wrap;
  padding: .7rem 0;
}
.site-header__brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; color: #fff; margin-right: auto;
}
.site-header__logo {
  flex: none; height: 46px; width: 46px;
  border-radius: 50%; background: #fff;
}
.site-header__text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.site-header__ja { font-size: clamp(1.05rem, 3.4vw, 1.4rem); font-weight: 800; letter-spacing: .03em; word-break: keep-all; }
.site-header__en { font-size: clamp(.58rem, 2vw, .72rem); letter-spacing: .03em; color: #c9d7f0; margin-top: .15em; }

.header-link {
  flex: none; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .55); color: #fff;
  font-size: .82rem; font-weight: 700; line-height: 1;
  padding: .5em 1.05em; border-radius: 999px;
  display: inline-flex; align-items: center; gap: .35em;
  transition: background .12s ease, color .12s ease;
}
@media (hover: hover) { .header-link:hover { background: #fff; color: var(--navy); } }

/* ---------- ページタイトル（404 等で使用） ---------- */
.page-title { padding: 2rem 0 .6rem; }
.page-title__main {
  margin: 0; color: var(--navy);
  font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: .02em;
}
.page-title__sub { margin: .35rem 0 0; color: var(--gray); font-weight: 700; font-size: .95rem; }

/* ---------- ページヒーロー（バナー） ---------- */
.page-hero { padding: 2rem 0 .4rem; text-align: center; }
.page-hero__heading { margin: 0; line-height: 0; }
.page-hero__img {
  width: 100%; height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.page-hero__tagline {
  margin: .9rem 0 0;
  color: var(--gray); font-weight: 700; font-size: .95rem; line-height: 1.85;
}

/* ---------- セクション ---------- */
.section { padding: 1.4rem 0 .6rem; }
.section:last-of-type { padding-bottom: 2.4rem; }

.headline {
  margin: 1.6rem 0 1rem;
  padding: .55em .9em;
  font-size: clamp(1.15rem, 3.6vw, 1.38rem);
  font-weight: 800;
  color: var(--navy);
  background: var(--blue-bg);
  border-left: 6px solid var(--blue);
  border-radius: 0 6px 6px 0;
  line-height: 1.45;
}
.intro { color: var(--ink); margin-bottom: .4rem; }

/* ---------- 資料カード ---------- */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 380px));
  justify-content: center;
  gap: 1.4rem;
}
.resource-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .resource-card:hover { border-color: var(--blue); box-shadow: 0 6px 20px rgba(10, 58, 140, .16); transform: translateY(-2px); }
}
.resource-card__banner { margin: 0; background: var(--blue-bg); border-bottom: 1px solid var(--line); }
.resource-card__banner img { width: 100%; height: auto; display: block; }
.resource-card__body {
  display: flex; flex-direction: column; gap: .7rem; flex: 1;
  padding: 1.1rem 1.2rem 1.2rem;
}
.resource-card__title { margin: 0; color: var(--navy); font-size: 1.12rem; font-weight: 800; line-height: 1.4; }
.resource-card__desc { margin: 0; color: var(--ink); font-size: .95rem; }

/* ボタン（404 ページの「トップへ戻る」等で使用） */
.btn {
  display: inline-flex; align-items: center; gap: .4em;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--blue); background: var(--blue-bg); color: var(--blue);
  font-size: .9rem; font-weight: 700; line-height: 1;
  padding: .6em 1.2em; border-radius: 999px;
  transition: background .12s ease, color .12s ease;
}
@media (hover: hover) { .btn:hover { background: var(--blue); color: #fff; } }
.btn__ext { font-size: 1.05em; font-weight: 900; }

/* ---------- 注記（アンバー塗りのコールアウト。枠線・左帯なしでリンクカードと区別） ---------- */
.note {
  background: var(--gold-bg);
  border-radius: 8px;
  padding: .9em 1.1em;
  color: #7a5200;
  font-size: .92rem;
  line-height: 1.75;
  margin: 1.1rem 0 0;
}
.note__label { font-weight: 700; color: #7a5200; }

/* 説明文・注記は文節境界（HTML 内の <wbr>）でのみ改行。
   keep-all で漢字途中の改行を抑止し、全ブラウザで切りの良い位置に揃える。 */
#about p { word-break: keep-all; }

/* ---------- 関連リンク ---------- */
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.linklist a {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  padding: .85em 1.1em;
  transition: box-shadow .12s ease;
}
@media (hover: hover) { .linklist a:hover { box-shadow: var(--shadow); } }
.linklist .ll-title { color: var(--navy); font-weight: 800; display: inline-flex; align-items: center; gap: .35em; }
.linklist .ll-title .ext { color: var(--blue); font-weight: 900; }
.linklist .ll-desc { color: var(--gray); font-size: .88rem; margin: .2em 0 0; }

/* ---------- フッター ---------- */
.site-footer {
  margin-top: 2rem;
  padding: 1.6rem 1.2rem 2rem;
  background: var(--navy);
  border-top: 3px solid var(--gold);
  color: #d7e2f6;
  text-align: center;
}
.site-footer__issuer { margin: 0; font-weight: 700; color: #fff; font-size: 1rem; word-break: keep-all; }
.site-footer__en { margin: .3rem 0 0; font-size: .8rem; color: #aebfdf; }

/* ---------- モバイル ---------- */
@media (max-width: 600px) {
  /* 「長崎大学 眼科・視覚科学教室」は同じ行・同じサイズで表示（収まらない場合のみ折り返し）。
     英語の正式名称はその下に小さく折り返して表示。 */
  .site-header__inner { gap: .5rem; padding: .5rem 0; flex-wrap: nowrap; }
  .site-header__brand { gap: .5rem; margin-right: auto; min-width: 0; }
  .site-header__ja { font-size: .98rem; line-height: 1.3; }
  .site-header__en { font-size: .58rem; line-height: 1.3; }
  .header-link { font-size: .74rem; padding: .45em .85em; }
}

/* ---------- アクセシビリティ ---------- */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
