/* =========================================================
   江野国立博物館 収蔵品データベース 共通テーマ
   YACHO の「CSS テーマ」にサイト共通で登録する
   (YACHO が書き出すページの構造に合わせて作り直した版)
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500&family=Noto+Serif+JP:wght@400;500&display=swap");

:root {
  --ink: #1b1b1b;
  --sub: #666666;
  --line: #d6d6d6;
  --band: #ebebea;
  --frame: #d9d9d7;
  --black: #0e0e0e;
  --accent: #1f5a6b;
  --gold: #c9a227;
  --indigo: #1f3a4a;
  --sans: "Noto Sans JP", sans-serif;
  --serif: "Noto Serif JP", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.8;
}

a { color: var(--ink); text-decoration: underline; }
a:hover { color: var(--accent); }

/* ---------- ヘッダー(YACHO の検索欄 .top-nav にロゴを足す) ---------- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--black);
  border-bottom: 1px solid #2a2a2a;
  min-height: 72px;
  padding: 8px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.top-nav::before {
  grid-column: 1;
  grid-row: 1;
  content: "収蔵品データベース";
  justify-self: start;
  align-self: start;
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0.2em;
  font-weight: 400;
  border-top: 3px solid var(--gold);
  padding-top: 6px;
}
.top-nav::after {
  content: "江野国立博物館";
  grid-column: 2;
  grid-row: 1;
  text-align: center;
  color: #ffffff;
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  padding-bottom: 14px;
}
/* 英字ロゴ(ロゴの下に重ねる) */
.top-nav__search::before {
  content: "ENO NATIONAL MUSEUM";
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  color: #bdbdbd;
  white-space: nowrap;
  pointer-events: none;
}
.top-nav__search {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin-left: 0;
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid #5a5a5a;
}
.top-nav__search input {
  min-width: 0;
  width: 180px;
  max-width: 40vw;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 13px;
  padding: 0 4px;
}
.top-nav__search input::placeholder { color: #9a9a9a; }
.top-nav__search input:focus { outline: 1px solid var(--gold); }
.top-nav__search button {
  height: 44px;
  min-width: 44px;
  background: none;
  border: none;
  border-radius: 0;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}

/* ヘッダーのロゴ・「収蔵品データベース」をリンクにする(site.js が透明なリンクを重ねる) */
.site-logo-link, .site-db-link { display: block; z-index: 1; }
.site-logo-link { grid-column: 2; grid-row: 1; align-self: stretch; justify-self: stretch; min-width: 220px; }
.site-db-link { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; width: 140px; height: 36px; }
.site-logo-link:focus-visible, .site-db-link:focus-visible { outline: 1px solid var(--gold); }

/* ---------- 本文の枠 ---------- */
.site-container { min-height: 100vh; display: flex; flex-direction: column; }
.site-container > .content { flex: 1 0 auto; }
.content { max-width: none; margin: 0; padding: 0; }

/* 資料ページ(.item-hero がある)では YACHO の自動タイトルを隠し、本文側の見出しを使う */
.article:has(.item-hero) > .article-header { display: none; }

/* 資料ページ以外(トップなど)は通常の読み物レイアウト */
.article:not(:has(.item-hero)):not(:has(.home)):not(:has(.db)) {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.article-title {
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 16px;
}

/* ---------- 画像と概要(グレー帯) ---------- */
.item-hero { background: var(--band); }
.item-hero__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
}
.viewer {
  flex: 1 1 420px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.viewer__stage {
  background: var(--frame);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 520px;
}
.viewer__stage img {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
}
.viewer__placeholder {
  color: var(--sub);
  font-size: 12px;
  letter-spacing: 0.2em;
}
.viewer__count { text-align: center; font-size: 12px; color: #4a4a4a; }
.viewer__credit { font-size: 11px; line-height: 1.6; color: #555555; }
.viewer__thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.viewer__thumb {
  padding: 0;
  width: 52px;
  height: 60px;
  background: var(--frame);
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
}
.viewer__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer__thumb.is-current { border-color: var(--ink); }

.summary {
  flex: 1 1 260px;
  min-width: 0;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-size: 13px;
}
.item-title {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
}

/* ---------- 項目 ---------- */
.item-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
.fields {
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fields--first { padding-top: 0; }
.fields h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.field { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.field__name { flex: 0 0 150px; color: var(--sub); font-size: 13px; }
.field__value { flex: 1 1 300px; min-width: 0; }
.field__value b { font-weight: 500; }

/* 翻刻・現代語訳など長文 */
.text-block { margin: 0; white-space: pre-wrap; }
.text-block .initial { font-weight: 500; color: var(--accent); }

.fold { padding: 16px 0; border-bottom: 1px solid var(--line); }
.fold summary {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "⌄"; font-size: 18px; }
.fold[open] summary::after { content: "⌃"; }
.fold p { margin: 8px 0 0; font-size: 13px; }

.record-meta { margin-top: 40px; font-size: 11px; color: var(--sub); line-height: 1.8; }

/* ---------- ページ番号(YACHO の #page-counter を右下の小さな表示に) ---------- */
.page-counter,
#page-counter {
  font-size: 11px !important;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #555555;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 4px 10px;
  right: 20px !important;
  bottom: 16px !important;
}
#page-counter:hover { background: #ffffff; }

/* ---------- フッター(YACHO 既定の固定表示を解除) ---------- */
footer,
.site-footer {
  position: static;
  background: var(--black);
  color: #ffffff;
  border-top: 28px solid var(--indigo);
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font-size: 10px;
}
.site-footer p { margin: 0; color: #9a9a9a; }
.site-footer p:first-child { display: none; } /* 空の © 行 */
.site-footer::before {
  content: "江野国立博物館";
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  color: #ffffff;
}

/* ---------- 博物館トップ(.home) ---------- */
.article:has(.home) > .article-header { display: none; }
.home-visual { background: var(--black); line-height: 0; }
.home-visual img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center 60%;
}
.home-hero { background: var(--black); color: #ffffff; border-top: 1px solid #2a2a2a; }
.home-hero__inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 72px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home-hero__tag {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  border-top: 3px solid var(--gold);
  padding-top: 6px;
}
.home-hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.1em;
  line-height: 1.5;
}
.home-hero__lead { margin: 0; font-size: 14px; color: #d6d6d6; max-width: 640px; }
.home-hero__date { margin: 0; font-size: 12px; color: #9a9a9a; }
.home-hero__link { margin: 8px 0 0; font-size: 13px; }
.home-hero__link a { color: #ffffff; }
.home-hero__link a:hover { color: var(--gold); }
.home-section p a { color: var(--ink); }
.ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.ex-item { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-photo { background: var(--frame); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ex-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-item figcaption { display: flex; flex-direction: column; font-size: 13px; line-height: 1.6; }
.ex-item__meta { font-size: 11px; color: var(--sub); }
.dir-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dir-table th, .dir-table td { border: none; border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; background: none; font-weight: 300; }
.dir-table th { color: var(--sub); font-size: 12px; }
.home-body { max-width: 760px; margin: 0 auto; padding: 24px 24px 48px; }
.home-section { padding: 28px 0; border-bottom: 1px solid var(--line); }
.home-section:last-child { border-bottom: none; }
.home-section .fields { border-bottom: none; padding-bottom: 0; }
.home-section h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
}
.home-section p { margin: 0 0 8px; }
.home-note { font-size: 12px; color: var(--sub); }
.news { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.news li { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.news__date { flex: 0 0 150px; color: var(--sub); font-size: 13px; }
.news li > span:last-child { flex: 1 1 300px; min-width: 0; }
@media (max-width: 640px) {
  .home-hero__inner { padding: 48px 16px 56px; }
  .home-hero__title { font-size: 22px; }
  .home-visual img { height: 200px; object-position: 40% 60%; }
  .news__date { flex-basis: 100%; }
}

/* =========================================================
   収蔵品データベース(一覧・ジャンル・経路表示・検索結果)
   ========================================================= */

/* ヘッダーの検索欄は隠す(検索はデータベースのページから行う)。英字ロゴは残す */
.top-nav__search { border-bottom: none; }
.top-nav__search > * { visibility: hidden; pointer-events: none; }

.article:has(.db) > .article-header { display: none; }
.article:has(.db) { max-width: none; margin: 0; padding: 0; }

/* 画像と検索欄 */
.db-hero {
  position: relative;
  height: 360px;
  background: #2b2b29;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.db-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.db-hero .viewer__placeholder { color: #8a8a86; }
.db-search {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(14, 14, 14, 0.72);
}
.db-search__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
}
.db-search__field {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #9a9a9a;
}
.db-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--sans);
  font-size: 14px;
  padding: 0 4px;
}
.db-search input::placeholder { color: #bdbdbd; }
.db-search input:focus { outline: 1px solid var(--gold); }
.db-search button {
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 説明文 */
.db-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
  font-size: 13px;
  line-height: 2;
}
.db-intro p { margin: 0 0 12px; }
.db-intro__note { font-size: 11px; color: var(--sub); }

/* 見出し(左右に線) */
.db-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 760px;
  margin: 0 auto 32px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.db-heading::before, .db-heading::after { content: ""; flex: 1 1 0; border-top: 1px solid currentColor; }
.db-heading--dark { color: var(--accent); }

/* ジャンル */
.db-genres { background: var(--accent); padding: 56px 24px 72px; }
.db-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.db-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.db-card:hover { color: #ffffff; border-color: rgba(255, 255, 255, 0.6); }
.db-card__img {
  aspect-ratio: 1 / 1;
  background: #3c3c3a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.db-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.db-card__img .viewer__placeholder { color: #8a8a86; }
.db-card__label {
  min-height: 64px;
  padding: 14px 14px 16px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
}

/* 特集 */
.db-albums { padding: 56px 24px 72px; }
.db-album-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.db-album { background: #f2f2f0; display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.db-album__img { aspect-ratio: 16 / 10; background: var(--frame); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.db-album__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.db-album__body { padding: 18px 20px 22px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.db-album__title { font-family: var(--serif); font-size: 18px; letter-spacing: 0.08em; }
.db-album__sub { font-size: 12px; color: var(--sub); }
.db-album__count { font-size: 11px; color: var(--sub); }
.db-album--closed .db-album__img { filter: grayscale(1); opacity: 0.6; }
.db-album__status { align-self: center; font-size: 11px; letter-spacing: 0.12em; border: 1px solid var(--line); padding: 2px 10px; color: var(--sub); }

/* 館内マップ */
.db-map { background: var(--accent); padding: 40px 24px; }
.db-map__inner {
  max-width: 1000px;
  margin: 0 auto;
  min-height: 200px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  text-align: center;
}
.db-map__title { font-family: var(--serif); font-size: 22px; letter-spacing: 0.2em; }
.db-map__note { font-size: 12px; color: #c9d6da; }

/* ジャンル一覧ページ */
.db-page-head { background: var(--band); }
.db-page-head__inner { max-width: 1000px; margin: 0 auto; padding: 20px 24px 40px; }
.db-page-head h1 { margin: 16px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: 0.12em; }
.db-page-head__count { font-size: 12px; color: var(--sub); }
.db-list { max-width: 1000px; margin: 0 auto; padding: 40px 24px 64px; }
.db-list .db-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px 20px; }
.db-item { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.db-item:hover { color: var(--accent); }
.db-item__img { aspect-ratio: 1 / 1; background: var(--frame); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.db-item__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.db-item__title { font-size: 13px; line-height: 1.6; }
.db-item__meta { font-size: 11px; color: var(--sub); }
.db-empty {
  border: 1px solid var(--line);
  padding: 40px 24px;
  text-align: center;
  font-size: 13px;
  color: var(--sub);
}
.db-empty p { margin: 0 0 6px; }

/* 経路表示 */
.breadcrumb {
  font-size: 11px;
  color: var(--sub);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.breadcrumb a { color: var(--sub); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb__sep { color: #9a9a9a; }
.item-hero .breadcrumb { max-width: 1000px; margin: 0 auto; padding: 20px 24px 0; }
.item-hero:has(.breadcrumb) .item-hero__inner { padding-top: 24px; }

/* 検索結果(YACHO の検索モーダルを館の見た目に) */
.search-modal__overlay { background: rgba(14, 14, 14, 0.6); }
.search-modal__content {
  max-width: 520px;
  background: #ffffff;
  color: var(--ink);
  border-radius: 0;
  box-shadow: none;
  border-top: 3px solid var(--gold);
  padding: 28px 28px 20px;
  font-family: var(--sans);
}
.search-modal__content h2 {
  color: var(--accent);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.search-result-list li { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; background: none; border-radius: 0; }
.search-result-list li a { color: var(--ink); text-decoration: underline; background: none; padding: 0; }
.search-result-list li a:hover { color: var(--accent); }
.search-note { margin: 12px 0 0; font-size: 11px; color: var(--sub); }
.search-hint { font-size: 12px; color: var(--sub); }
.search-modal__actions { margin-top: 16px; text-align: right; }
.search-modal__actions button {
  min-height: 40px;
  padding: 0 20px;
  background: var(--black);
  color: #ffffff;
  border: none;
  border-radius: 0;
  font-family: var(--sans);
  cursor: pointer;
}

/* ---------- スマホ ---------- */
@media (max-width: 640px) {
  .top-nav { grid-template-columns: 1fr; justify-items: center; padding: 12px 16px; }
  .top-nav::before { justify-self: center; grid-column: 1; grid-row: 1; }
  .top-nav::after { grid-column: 1; grid-row: 2; font-size: 20px; padding-bottom: 0; }
  .top-nav__search::before { display: none; }
  .site-logo-link { grid-column: 1; grid-row: 2; justify-self: center; width: 240px; min-width: 0; }
  .site-db-link { grid-column: 1; grid-row: 1; justify-self: center; }
  .top-nav .top-nav__search { display: none; }
  .top-nav__search { grid-column: 1; grid-row: 3; justify-self: center; }
  .viewer__stage { height: 360px; }
  .viewer__stage img { max-height: 360px; }
  .summary { padding-top: 0; }
  .item-hero__inner { padding-top: 24px; }
  .field__name { flex-basis: 100%; }
  .db-hero { height: 240px; }
  .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .db-list .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .db-album-grid { grid-template-columns: 1fr; }
  .db-heading { margin-bottom: 24px; }
}
