/* =========================================================
   フランスの歴史を一気に解説するぜ！ 共通スタイルシート
   - 全ページ（TOP・各時代ページ）で読み込んで使います
   - 色はフランス国旗（青・白・赤＝トリコロール）をベースに上品に
   ========================================================= */

/* ----- 1. 基本の色やフォントをまとめて定義（変数） ----- */
:root {
  --bleu: #0d2c6c;        /* 国旗の青（メインカラー） */
  --bleu-clair: #1f4fa8;  /* 明るい青（リンクなど） */
  --rouge: #c8102e;       /* 国旗の赤（アクセント） */
  --or: #c8a14b;          /* 金（見出しの装飾） */
  --ivoire: #fbf9f4;      /* 背景のアイボリー */
  --gris: #5a5a5a;        /* 本文の補助テキスト */
  --texte: #222;          /* 本文の文字色 */
  --carte: #ffffff;       /* カードの背景 */
  --ombre: 0 4px 18px rgba(13, 44, 108, 0.10); /* 影 */
}

/* ----- 2. 全体のリセットと土台 ----- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "游明朝", serif;
  color: var(--texte);
  background: var(--ivoire);
  line-height: 1.9;
  font-size: 17px;
}

img { max-width: 100%; height: auto; }
a { color: var(--bleu-clair); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- 3. ヘッダー（全ページ共通の上部メニュー） ----- */
.site-header {
  background: var(--bleu);
  color: #fff;
  border-bottom: 4px solid var(--rouge);
}
.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.site-header .logo {
  color: #fff;
  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}
.site-header .logo:hover { text-decoration: none; opacity: 0.9; }
.site-header nav a {
  color: #fff;
  margin-left: 18px;
  font-size: 0.92rem;
}

/* ----- 4. ヒーロー（TOPページの一番上の大きな見出し） ----- */
.hero {
  background:
    linear-gradient(rgba(13,44,108,0.78), rgba(13,44,108,0.88)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><rect width='40' height='40' fill='%230d2c6c'/><path d='M0 39 L40 39' stroke='%231f4fa8' stroke-width='0.5'/></svg>");
  color: #fff;
  text-align: center;
  padding: 70px 20px 0;
  overflow: hidden;
}
/* ヒーロー下部のフランス史パノラマ（建造物スカイライン） */
.hero-skyline {
  display: block;
  width: calc(100% + 40px);
  margin: 40px -20px 0;
}
.hero h1 {
  font-size: 2.3rem;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
  line-height: 1.5;
}
.hero p { max-width: 720px; margin: 0 auto; font-size: 1.05rem; opacity: 0.95; }
.hero .tricolore {
  width: 90px; height: 6px; margin: 22px auto 0;
  background: linear-gradient(to right, #fff 0 33.3%, #fff 33.3% 66.6%, var(--rouge) 66.6%);
  /* 青・白・赤の3色ライン */
  background: linear-gradient(to right,
    #ffffff 0 33.3%, var(--rouge) 33.3%);
  border-radius: 3px;
}

/* ----- 5. メインの中身を中央寄せにする箱 ----- */
.container { max-width: 1080px; margin: 0 auto; padding: 50px 20px; }
.narrow { max-width: 820px; }

/* ----- 6. セクション見出し ----- */
.section-title {
  font-size: 1.6rem;
  color: var(--bleu);
  text-align: center;
  margin-bottom: 8px;
}
.section-lead {
  text-align: center;
  color: var(--gris);
  margin-bottom: 36px;
  font-size: 0.98rem;
}

/* ----- 7. 時代カード（TOPページの一覧） ----- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}
.card {
  background: var(--carte);
  border-radius: 12px;
  box-shadow: var(--ombre);
  overflow: hidden;
  border-top: 5px solid var(--bleu);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px rgba(13,44,108,0.18); text-decoration: none; }
.card .num {
  font-size: 0.8rem; color: var(--rouge); font-weight: bold; letter-spacing: 0.1em;
}
.card .card-body { padding: 22px 22px 24px; }
.card h3 { font-size: 1.2rem; color: var(--bleu); margin: 6px 0 6px; }
.card .years { font-size: 0.85rem; color: var(--gris); margin-bottom: 10px; }
.card p { font-size: 0.93rem; color: #444; }
.card .more { display: inline-block; margin-top: 14px; color: var(--bleu-clair); font-size: 0.9rem; font-weight: bold; }

/* ----- 8. 年表（TOPページの縦タイムライン） ----- */
.timeline { position: relative; max-width: 820px; margin: 0 auto; padding-left: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px;
  width: 3px; background: linear-gradient(var(--bleu), var(--rouge));
}
.tl-item { position: relative; padding: 0 0 26px 18px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 7px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid var(--bleu);
}
/* 全体年表の大区分ラベル */
.tl-group { margin: 22px 0 8px -28px; }
.tl-group:first-child { margin-top: 0; }
.tl-era-label { display: inline-block; background: var(--rouge); color: #fff; font-size: 0.82rem; padding: 5px 16px; border-radius: 16px; font-weight: bold; letter-spacing: 0.03em; }
.tl-item .era { font-size: 0.78rem; color: var(--rouge); font-weight: bold; letter-spacing: 0.08em; }
.tl-item h3 { font-size: 1.1rem; color: var(--bleu); margin: 2px 0 4px; }
.tl-item h3 a { color: var(--bleu); }
.tl-item p { font-size: 0.92rem; color: #444; }

/* ----- 9. パンくずリスト ----- */
.breadcrumb { font-size: 0.83rem; color: var(--gris); padding: 14px 20px; max-width: 1080px; margin: 0 auto; }
.breadcrumb a { color: var(--gris); }
.breadcrumb span { color: var(--rouge); }

/* ----- 10. 各時代ページの本文 ----- */
.article-header {
  background: var(--bleu);
  color: #fff;
  padding: 46px 20px 40px;
  text-align: center;
}
.article-header .era-num { color: var(--or); font-size: 0.85rem; letter-spacing: 0.18em; }
.article-header h1 { font-size: 2rem; margin: 8px 0 10px; line-height: 1.5; }
.article-header .years { font-size: 1rem; opacity: 0.92; }

.article-body h2 {
  font-size: 1.45rem; color: var(--bleu);
  border-left: 6px solid var(--rouge);
  padding-left: 14px; margin: 44px 0 16px;
}
.article-body h3 { font-size: 1.15rem; color: var(--bleu-clair); margin: 28px 0 10px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 18px 1.4em; }
.article-body li { margin-bottom: 7px; }
.article-body .lead {
  font-size: 1.08rem; background: #fff; border-radius: 10px;
  padding: 22px 24px; box-shadow: var(--ombre); margin-bottom: 30px;
}

/* 強調ボックス（豆知識など） */
.note {
  background: #fff7e9; border-left: 5px solid var(--or);
  padding: 16px 20px; border-radius: 6px; margin: 22px 0;
  font-size: 0.96rem;
}
.note strong { color: var(--rouge); }

/* ----- 10b. 写真ギャラリー（各時代ページの追加写真） ----- */
.gallery-title {
  font-size: 1.45rem; color: var(--bleu);
  border-left: 6px solid var(--rouge);
  padding-left: 14px; margin: 44px 0 16px;
}
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 16px 0 10px;
}
.gallery figure {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: var(--ombre); margin: 0;
  display: flex; flex-direction: column;
}
.gallery .ph {
  width: 100%; height: 210px; overflow: hidden; background: #f1ece1;
}
.gallery .ph img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.gallery figcaption {
  font-size: 0.84rem; color: #444; padding: 12px 14px; line-height: 1.6;
}
.gallery figcaption .src { color: var(--gris); font-size: 0.76rem; }
.gallery figcaption .src a { color: var(--gris); }

@media (max-width: 600px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery .ph { height: 230px; }
}

/* ----- 11. 年表テーブル（各時代ページの出来事一覧） ----- */
.events-table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; background: #fff; box-shadow: var(--ombre); border-radius: 8px; overflow: hidden; }
.events-table th, .events-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid #eee; font-size: 0.95rem; }
.events-table thead th { background: var(--bleu); color: #fff; font-weight: bold; }
.events-table td.year { white-space: nowrap; color: var(--rouge); font-weight: bold; width: 110px; }
.events-table tbody tr:hover { background: #f5f8ff; }

/* ----- 12. 登場人物カード ----- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 16px 0 28px; }
.person { background: #fff; border-radius: 10px; padding: 18px 20px; box-shadow: var(--ombre); border-top: 4px solid var(--rouge); }
.person h4 { color: var(--bleu); font-size: 1.05rem; margin-bottom: 4px; }
.person .role { font-size: 0.8rem; color: var(--rouge); margin-bottom: 8px; }
.person p { font-size: 0.9rem; color: #444; margin: 0; }

/* ----- 13. 前後の時代へのナビ ----- */
.prev-next { display: flex; justify-content: space-between; gap: 14px; margin: 40px 0 10px; flex-wrap: wrap; }
.prev-next a {
  flex: 1 1 45%; background: #fff; border-radius: 10px; padding: 16px 20px;
  box-shadow: var(--ombre); min-width: 240px;
}
.prev-next a:hover { text-decoration: none; background: #f5f8ff; }
.prev-next .dir { font-size: 0.78rem; color: var(--rouge); }
.prev-next .ttl { color: var(--bleu); font-weight: bold; }
.prev-next .next { text-align: right; }

/* 一覧に戻るボタン */
.back-top { text-align: center; margin: 30px 0; }
.back-top a {
  display: inline-block; background: var(--bleu); color: #fff;
  padding: 12px 30px; border-radius: 30px; font-size: 0.95rem;
}
.back-top a:hover { background: var(--bleu-clair); text-decoration: none; }

/* ----- 13b. 用語集ページ ----- */
.glossary-search { max-width: 820px; margin: 0 auto 10px; }
.glossary-search input {
  width: 100%; padding: 14px 18px; font-size: 1rem;
  border: 2px solid #d8d2c4; border-radius: 30px;
  font-family: inherit; background: #fff;
}
.glossary-search input:focus { outline: none; border-color: var(--bleu-clair); }
.glossary-count { text-align: center; color: var(--gris); font-size: 0.85rem; margin: 6px 0 24px; }

.glossary-cat {
  font-size: 1.3rem; color: var(--bleu);
  border-left: 6px solid var(--rouge); padding-left: 12px;
  margin: 34px 0 14px;
}
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.term {
  background: #fff; border-radius: 10px; padding: 16px 18px;
  box-shadow: var(--ombre); border-top: 3px solid var(--bleu);
}
.term-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.term h3 { font-size: 1.05rem; color: var(--bleu); margin: 0; }
.term-cat { font-size: 0.7rem; color: #fff; background: var(--rouge); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.term p { font-size: 0.9rem; color: #444; margin: 8px 0 10px; }
.term-link { font-size: 0.82rem; font-weight: bold; }
.glossary-empty { text-align: center; color: var(--gris); padding: 30px; display: none; }

/* ----- 14. フッター ----- */
.site-footer {
  background: var(--bleu); color: #fff; text-align: center;
  padding: 30px 20px; margin-top: 40px; font-size: 0.85rem;
}
.site-footer .tricolore-bar {
  height: 5px; max-width: 1080px; margin: 0 auto 20px;
  background: linear-gradient(to right, #1f4fa8 0 33.3%, #fff 33.3% 66.6%, var(--rouge) 66.6%);
  border-radius: 3px;
}
.site-footer a { color: #cfe0ff; }

/* ----- 14b. 画像・イラスト（地図やイラストの表示枠） ----- */
.illust { margin: 28px 0; text-align: center; }
.illust img {
  width: 100%; max-width: 580px;
  border-radius: 12px;
  box-shadow: var(--ombre);
  background: #fff;
}
.illust figcaption {
  font-size: 0.82rem; color: var(--gris);
  margin-top: 8px;
}

/* TOPページ・各時代ページ見出し下のアイキャッチ画像（額縁風） */
.eyecatch { text-align: center; margin: -10px 0 30px; }
.eyecatch img {
  width: 100%; max-width: 720px;
  max-height: 500px;
  object-fit: contain;          /* 縦長の肖像画も切れずに全体を表示 */
  border-radius: 14px;
  box-shadow: var(--ombre);
  background: #f1ece1;           /* 美術館の台紙のような色 */
  border: 1px solid #e3dccd;
}
.eyecatch figcaption {
  font-size: 0.8rem; color: var(--gris);
  margin-top: 8px;
}
.eyecatch figcaption a { color: var(--gris); text-decoration: underline; }

/* 時代カードのサムネイル写真（高さをそろえて見た目を統一） */
.card .thumb { width: 100%; height: 190px; overflow: hidden; background: var(--bleu); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* TOPのヒーロー内に置く地図 */
.hero-map { max-width: 340px; margin: 26px auto 0; }
.hero-map img { width: 100%; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.35)); }

/* ----- 15. スマホ対応 ----- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero h1 { font-size: 1.6rem; }
  .article-header h1 { font-size: 1.5rem; }
  .site-header .inner { flex-direction: column; align-items: flex-start; }
  .site-header nav a { margin: 0 14px 0 0; }
  .events-table th, .events-table td { font-size: 0.88rem; padding: 9px 8px; }
  .events-table td.year { width: 80px; }
}
