/* ===== スタイルシート（CSS）：ページ全体のデザイン定義 ===== */

body {
  /* ページ全体の背景色、文字色、フォント設定 */
  background-color: #f5f5f5;  /* 目に優しいライトグレー */
  color: #333333;
  text-align: center;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  line-height: 1.6;
}

/* フランス語イタリック */
i, em {
  font-family: "Noto Serif", "Times New Roman", Times, serif;
  font-style: italic;
}

h1 {
  color: #0000ff;
  font-size: 2em;
  margin-bottom: 0;
}

h2 {
  color: #0000ff;
  margin-bottom: 1.8em;
}

h3 {
  color: #0066cc;
  margin-bottom: 2.2em;
  font-size: 1.3em;
}

h4 {
  color: #333333;
  margin-bottom: 1.5em;
}

hr {
  width: 600px;
  height: 3px;
  background-color: #66cc33;
  border: none;
  margin: 0.5em auto;
}

.entete {
  width: 520px;
  margin-top: 20px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.title {
  text-align: center;
  margin-bottom: 3em;
}

.title h1 {
  margin-bottom: 0;
}

.title p {
  margin-top: 0;
}

.main {
  width: 500px;
  margin-top: 0;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.subtitle {
  text-align: center;
  margin-top: -10px;
}

/* ヘッダー内容を横並びに（スマホでも維持） */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 1.5em;
}

.header-content p {
  margin: 0;
  flex-shrink: 1;
  min-width: 0;
  font-size: 1.15em;
  color: #0066cc;
  font-weight: 700;
}

.header-content p::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 16px;
  background: linear-gradient(to right, 
    #0055A4 0%, #0055A4 33.33%, 
    #FFFFFF 33.33%, #FFFFFF 66.66%, 
    #EF4135 66.66%, #EF4135 100%);
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid #ccc;
}

.header-content img {
  flex-shrink: 0;
}

/* ===== ヘッダーナビゲーション：ページ内リンクメニュー ===== */
.header-nav {
  text-align: center;
  margin: 1.5em 0;
  font-size: 1.1em;
  font-weight: 700;
}

.header-nav a {
  margin: 0 1em;
  padding: 0.5em 1em;
  display: inline-block;
  transition: background-color 0.2s;
}

.header-nav a:hover {
  background-color: rgba(0, 102, 204, 0.08);
  border-radius: 4px;
}

/* リスト要素のスタイル調整（見た目維持） */
ul {
  list-style-type: none;
  padding-left: 0;
  margin: 1em 0;
}

ul li {
  margin-bottom: 0.5em;
}

ul li:before {
  content: "- ";
}

/* 引用ブロックのスタイル調整 */
blockquote {
  margin: 2.5em 0;
  padding: 1.5em 1.5em 1.5em 2em;
  border-left: 6px solid #0066cc;
  background: linear-gradient(to right, #e8e8e8 0%, #f5f5f5 100%);
  border-radius: 0 5px 5px 0;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-style: normal;
}

blockquote::before {
  content: "引用";
  position: absolute;
  top: -0.8em;
  left: 1em;
  background-color: #0066cc;
  color: #ffffff;
  padding: 0.3em 0.8em;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: bold;
}

blockquote p {
  margin: 0.8em 0;
  line-height: 1.8;
}

blockquote p:first-child {
  margin-top: 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* addressのデフォルトスタイル解除 */
address {
  font-style: normal;
}

/* すべてのセクションの定義リストに統一スタイル */
section dl dt {
  color: #0066cc;
  font-size: 1.3em;
  font-weight: 700;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

section dl dt:first-of-type {
  margin-top: 0;
}

section dl dd {
  margin-left: 0;
  margin-bottom: 0.8em;
  white-space: normal;
}

/* セクション見出しの統一（すべてh2、赤色） */
section h2 {
  color: #ff0000;
  margin-bottom: 1em;
}

/* セクション間の余白 */
main section {
  margin-bottom: 3em;
}

main section:last-of-type {
  margin-bottom: 0;
}

/* フッターの上余白 */
footer {
  margin-top: 3em;
}

/* ===== トップへ戻るボタン：画面右下に固定表示 ===== */
#back-to-top {
  position: fixed;  /* スクロールしても位置固定 */
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: #0066cc;
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  font-weight: bold;
  line-height: 1;
  opacity: 0;  /* 初期状態は非表示 */
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.3s;  /* アニメーション効果 */
  z-index: 1000;  /* 他の要素より前面に表示 */
}

#back-to-top:hover {
  background-color: #0055aa;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

#back-to-top.show {
  /* JavaScriptで追加されるクラス：300pxスクロール後に表示 */
  opacity: 0.9;
  visibility: visible;
}

/* ===== レスポンシブデザイン：タブレット・スマホ対応 ===== */
@media screen and (max-width: 768px) {
  /* 画面幅768px以下（タブレット・スマホ）のスタイル */
  .entete {
    width: 95%;
    max-width: 520px;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  /* スマホでも横並びを維持 */
  .header-content {
    flex-wrap: nowrap;
  }
  
  .header-content p {
    font-size: 0.95em;
  }
  
  .main {
    width: 95%;
    max-width: 500px;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  hr {
    width: 95%;
    max-width: 480px;
  }
  
  h1 {font-size: 1.7em;}
  h2 {font-size: 1.35em;}
  
  .header-nav {
    font-size: 0.95em;
  }
  
  .header-nav a {
    margin: 0 0.4em;
    padding: 0.35em 0.6em;
  }
  
  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 1em;
  }
}

/* より小さい画面用の追加調整 */
@media screen and (max-width: 480px) {
  /* 画面幅480px以下（小型スマホ）のスタイル */
  .header-content {
    gap: 5px;
  }
  
  .header-content p {
    font-size: 0.85em;
  }
  
  .header-content img {
    max-width: 80px;
    height: auto;
  }
  
  .header-nav {
    font-size: 0.85em;
  }
  
  .header-nav a {
    margin: 0 0.25em;
    padding: 0.25em 0.45em;
  }
  
  a[href^="http"]:not([href*="muse.dti.ne.jp"])::after,
  a[href$=".pdf"]::after {
    font-size: 0.65em;
    padding: 0.1em 0.4em;
  }
}

/* アクセシビリティ向上 */
a:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* ===== リンクの視覚的区別：アイコン・バッジ表示 ===== */
/* 外部リンク：青色「外部 ↗」バッジ */
a[href^="http"]:not([href*="muse.dti.ne.jp"])::after {
  content: " 外部 ↗";
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.15em 0.5em;
  font-size: 0.75em;
  background-color: #0066cc;
  color: #ffffff;
  border-radius: 3px;
  font-weight: bold;
  vertical-align: baseline;
  line-height: 1;
  white-space: nowrap;
}

/* PDFリンク：赤色「PDF 📄」バッジ */
a[href$=".pdf"]::after {
  content: " PDF 📄";
  display: inline-block;
  margin-left: 0.3em;
  padding: 0.15em 0.5em;
  font-size: 0.75em;
  background-color: #cc0000;
  color: #ffffff;
  border-radius: 3px;
  font-weight: bold;
  vertical-align: baseline;
  line-height: 1;
  white-space: nowrap;
}

/* 内部HTMLリンク：バッジ表示なし（シンプル） */
a[href$=".html"]:not([href^="http"])::after {
  content: none;
}

/* ページ内リンク - アイコン表示なし */
a[href^="#"]::before {
  content: none;
}