
/* ========== カラーテーマ（ライト／ダーク） ========== */
:root {
  /* ベースカラー */
  --bg: #eceff0;
  --text: #1a202c;
  --muted: #555555;
  --border: #e5e7eb;
  --card-bg: #f9fafb;

  /* スクールカラー基調 */
  --brand: #0068b7;     /* 長崎大学スクールカラー */
  --accent: #0068b7;    /* 主要リンク色も統一 */
  --brand-700: #00589b; /* 濃いめ（ホバー/境界） */
  --brand-100: #e6f2fb; /* 薄いめ（背景） */

  /* フォーカス・シャドウ */
  --focus: #4fa4e0;     /* ブランドの明るめトーン */
  --shadow: rgba(0, 0, 0, .15);

  /* レイアウト */
  --container-max: 1000px;
  --radius: 10px;

  /* ヘッダーのロゴサイズ */
  --brand-height: 64px;
  --brand-gap: 12px;

  /* ピルボタン */
  --pill-bg: var(--brand-100);
  --pill-text: var(--accent);
  --pill-border: #cfe3f6;

  /* バッジ（学内専用） */
  --badge-bg: #ffe9a8;
  --badge-text: #7a5400;
  --badge-border: #ffd36a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --text: #f2f2f2;
    --muted: #c2c2c2;
    --border: #262626;
    --card-bg: #141414;

    --brand-700: #004a86;
    --brand-100: #07263a;

    --pill-bg: #0e2a3f;
    --pill-text: #b8dcff;
    --pill-border: #1f3f58;

    --badge-bg: #3a2f00;
    --badge-text: #ffd670;
    --badge-border: #534300;
  }
}

/* ========== ベース ========== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo",
               "Noto Sans JP", sans-serif;
  line-height: 1.7;
  font-size: 16px;
  font-family:
    "Noto Sans JP",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========== スキップリンク ========== */
.skip-link {
  position: absolute;
  left: -999px;
  top: -999px;
}
.skip-link:focus-visible {
  left: 16px;
  top: 16px;
  background: var(--accent);
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow);
}


/* ===== 上段（ブランド） ===== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 8px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}
.brand-title {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ===== 下段（リンクバー） ===== */
.header-bar {
  background: var(--brand-100);                  /* 薄い帯色 */
  border-top: 1px solid var(--border);
}
.header-bar .container {
  display: flex;
  justify-content: flex-start;                   /* 左寄せ（右寄せにしたいなら space-between と right を使う） */
}
.linkbar {
  display: flex;
  gap: .75rem;
  list-style: none;
  margin: 0;
  padding: .5rem 0;                              /* 帯の高さ調整 */
}
.linkbar a {
  display: inline-block;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  padding: .3rem .6rem;                          /* クリック領域を確保 */
  border-radius: 8px;
}
.linkbar a:hover,
.linkbar a:focus-visible {
  background: rgba(0, 104, 183, 0.12);          /* スクールカラーの薄い重ね */
  color: var(--brand-700);
  outline: none;
}


/* ===== レスポンシブ（任意） ===== */
@media (max-width: 640px) {
  .brand-title { font-size: 1.1rem; }
  .linkbar { overflow-x: auto; white-space: nowrap; }
  .linkbar a { font-size: .95rem; padding: .35rem .7rem; }
}

/* ====== 外部リンクアイコンを表示 ==== */
.linkbar a[target="_blank"]::after {
  content: "↗";
  font-size: .8em;
  margin-left: .25em;
}


/* ========== ナビゲーション ========== */
nav { padding: .5rem 0 .75rem; }
nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
nav a {
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
  padding: .375rem .6rem;
  border-radius: 8px;
}
nav a:hover,
nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  background: var(--card-bg);
}

/* ========== メイン & グリッド ========== */
main { padding: 1.25rem 0 3rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.card h2 {
  font-size: 1.05rem;
  margin: 0 0 .5rem;
}
.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.card li { margin: .35rem 0; }
.card a {
  color: var(--accent);
  text-decoration: none;
}
.card a:hover,
.card a:focus-visible {
  text-decoration: underline;
  outline: none;
}

/* ========== ピル型リンク（マニュアル／FAQ） ========== */
.pill-link {
  display: inline-block;
  margin-right: .5rem;
  padding: .15rem .45rem;
  border-radius: 9999px; /* 完全なピル形状 */
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid var(--pill-border);
  text-decoration: none;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.4;
}
.pill-link:hover,
.pill-link:focus-visible {
  background: var(--accent);
  color: #fff;
  border-color: var(--brand-700);
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ========== 学内専用バッジ ========== */
.badge-internal {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .4rem;
  border-radius: 9999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  border: 1px solid var(--badge-border);
  font-size: .75rem;
  font-weight: 700;
  vertical-align: middle;
}

/* ========== フッター & トップリンク ========== */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}
.top-link {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .6rem .9rem;
  text-decoration: none;
  box-shadow: 0 2px 6px var(--shadow);
}
.top-link:hover,
.top-link:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  background: var(--brand-700);
}

/* ========== スモール画面調整 ========== */
@media (max-width: 480px) {
  :root {
    --brand-height: 48px;
    --brand-gap: 8px;
  }
  .brand-title { font-size: 1.1rem; }
}
