/* ==========================================================
   池谷裕二 ホームページ — 共通スタイル (ikegaya.jp)
   Based on the 2026 design (style.css), extended for the whole site.
   ========================================================== */

:root {
  --color-primary: #016547;
  --color-primary-light: #1a8a6a;
  --color-primary-dark: #003d2b;
  --color-accent: #990033;
  --color-accent-soft: #b84060;
  --color-text: #2d2d2d;
  --color-text-light: #555;
  --color-text-muted: #6f6f6f;
  --color-bg: #f7fdfd;
  --color-bg-card: #ffffff;
  --color-bg-section: #f4f3ef;
  --color-border: #e0ddd5;
  --color-border-light: #eeedea;
  --color-link: #016547;
  --color-link-hover: #1a8a6a;
  --color-news-bg: #f0f7f4;

  --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  --font-serif: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.10);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --max-width: 880px;
  --page-width: 1040px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }

a { color: var(--color-link); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--color-primary-light); outline-offset: 2px; }

/* ---------- Site header (common to every page) ---------- */
.g-header {
  background: var(--color-bg-card);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.g-header-inner {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  gap: 16px;
}

.g-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-primary);
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}
.g-brand:hover { text-decoration: none; color: var(--color-primary-dark); }
.g-brand img { width: 28px; height: 28px; }
.g-brand .g-brand-en {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-text-muted);
  letter-spacing: 0.06em;
}

.g-nav { display: flex; flex-wrap: wrap; gap: 2px; }
.g-nav a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 14px;
  font-weight: 500;
}
.g-nav a:hover { background: var(--color-news-bg); color: var(--color-primary); text-decoration: none; }
.g-nav a[aria-current="page"] { color: var(--color-primary); background: var(--color-news-bg); }
.g-nav a.g-lang { color: var(--color-accent); }

.g-nav-toggle { display: none; }
.g-nav-button { display: none; }

/* ---------- Main area ---------- */
.g-main {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 8px;
}

.g-crumbs {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0 0 12px;
}
.g-crumbs a { color: var(--color-text-muted); }

/* Card that holds converted (legacy) page content */
.legacy {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  overflow-x: auto;
  overflow-wrap: break-word;
}
.legacy.legacy-plain { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: visible; }
.legacy.legacy-dark { color: #f2f2f2; }
.legacy.legacy-dark a { color: #7fd8c0; }

.legacy font[face] { font-family: inherit; }
.legacy table { max-width: 100%; }
.legacy img { max-width: 100%; height: auto; vertical-align: middle; }
.legacy hr { border: none; border-top: 1px solid var(--color-border); margin: 20px 0; }
.legacy pre { white-space: pre-wrap; }
.legacy input, .legacy select, .legacy textarea, .legacy button { font-family: inherit; font-size: 14px; }
.legacy h1, .legacy h2, .legacy h3 { color: var(--color-primary); line-height: 1.4; }
.legacy blockquote { margin: 1em 0; padding-left: 1em; border-left: 3px solid var(--color-border); }

/* Section title used by generated pages */
.g-page-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 8px 0 4px;
  line-height: 1.35;
}
.g-page-lead { color: var(--color-text-light); margin: 0 0 24px; font-size: 14px; }
.g-section-title {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 6px;
  margin: 36px 0 16px;
}

/* Redirect / moved notice pages */
.g-notice { text-align: center; padding: 48px 16px; }
.g-notice p { margin: 8px 0; }

/* ---------- Footer ---------- */
.g-footer {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 24px 16px 40px;
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--color-border);
}
.g-footer a { color: var(--color-primary); }
.g-footer p { margin: 0; }

/* ==========================================================
   Components from the 2026 design (home, profile, link pages)
   ========================================================== */
.site-container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.legacy .site-container { padding: 0; }

.site-header { text-align: center; padding: 12px 0 8px; }
.site-header h1 {
  color: var(--color-primary);
  font-family: 'BIZ UDPGothic', 'Noto Sans JP', sans-serif;
  font-size: 32px;
  margin: 0;
}

.news-bar {
  background: var(--color-news-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  margin: 16px 0 32px;
  font-size: 13px;
  color: var(--color-text-light);
}

.section-divider { border: none; border-top: 1px solid var(--color-border); margin: 32px 0; }

.content-grid { display: flex; gap: 40px; align-items: flex-start; }
.content-main { flex: 1; min-width: 0; }
.content-sidebar { flex-shrink: 0; width: 240px; }

.menu-list { list-style: none; margin: 0; padding: 0; }
.menu-item { padding: 12px 0; border-bottom: 1px solid var(--color-border-light); }
.menu-item:last-child { border-bottom: none; }
.menu-item a { font-weight: 500; color: var(--color-primary); }
.menu-item .description { display: block; font-size: 13px; color: var(--color-text-muted); margin-top: 2px; line-height: 1.5; }

.book-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.book-card + .book-card { margin-top: 16px; }
.book-card .book-badge {
  display: inline-block; background: #fff0f0; color: #c00; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; margin-bottom: 10px;
}
.book-card img {
  width: 120px; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.book-card img:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.book-card .book-title { display: block; font-weight: 700; color: var(--color-accent); margin-top: 12px; font-size: 14px; }
.book-card .book-publisher { display: block; font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }

.profile-section { display: flex; gap: 28px; align-items: flex-start; padding: 24px 0; }
.profile-image { flex-shrink: 0; text-align: center; }
.profile-image img { width: 150px; height: auto; border-radius: var(--radius-md); }
.profile-info { flex: 1; }
.profile-info .name-reading { font-size: 11px; color: var(--color-text-muted); letter-spacing: 0.1em; }
.profile-info .name { font-size: 20px; font-weight: 700; margin: 2px 0 8px; color: var(--color-text); }
.profile-info .title { font-size: 14px; color: var(--color-text-light); line-height: 1.8; }
.profile-info .contact { font-size: 13px; color: var(--color-text-light); margin-top: 12px; line-height: 1.8; }
.text-muted { color: var(--color-text-muted); }

.site-footer { text-align: right; padding: 24px 0 8px; font-size: 13px; color: var(--color-text-muted); }
.site-footer .footer-notes { font-size: 12px; line-height: 1.8; }
.site-footer .footer-notes .note-marker { color: var(--color-primary); margin-right: 4px; }
.site-footer .established { margin-top: 8px; font-size: 12px; }
.site-footer .established .date { color: var(--color-primary); }

.page-title {
  font-family: var(--font-serif); font-size: 28px; font-weight: 700; color: var(--color-primary);
  text-align: center; margin: 24px 0 8px;
}
.page-subtitle { text-align: center; font-size: 14px; color: var(--color-text-light); margin-bottom: 32px; }

.part-list { list-style: none; margin: 0; padding: 0; }
.part-list li { padding: 14px 0; border-bottom: 1px solid var(--color-border-light); }
.part-list li:last-child { border-bottom: none; }
.part-number {
  display: inline-block; background: var(--color-accent); color: #fff; font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; margin-right: 8px;
}
.part-list a { font-size: 16px; font-weight: 500; }
.part-list .part-desc { display: block; font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 24px 0; font-size: 14px; color: var(--color-primary); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px; text-align: center; }
.book-grid-item img { width: 80px; height: auto; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.book-grid-item .copies { font-size: 11px; color: var(--color-text-muted); margin-top: 4px; }

table.data-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
table.data-table th, table.data-table td { padding: 8px 12px; border-bottom: 1px solid var(--color-border-light); text-align: left; font-size: 14px; }
table.data-table th { font-weight: 700; color: var(--color-primary-dark); border-bottom: 2px solid var(--color-border); }

.prose { max-width: 680px; margin: 0 auto; font-family: var(--font-serif); font-size: 15px; line-height: 2; }
.prose p { margin: 1em 0; text-indent: 1em; }

.music-section h2, .music-section .section-title {
  font-family: var(--font-serif); font-size: 18px; color: var(--color-primary);
  margin: 32px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--color-border);
}
.music-entry { margin-bottom: 20px; padding-left: 12px; border-left: 3px solid var(--color-border-light); }
.music-personnel { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; line-height: 1.6; }

/* ==========================================================
   Home page (index.html)
   ========================================================== */
.home-hero {
  display: flex;
  gap: 28px;
  align-items: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
}
.home-hero-photo img { width: 150px; border-radius: var(--radius-md); box-shadow: var(--shadow-md); display: block; }
.home-hero-body { flex: 1; min-width: 0; }
.home-hero .name-reading { font-size: 12px; color: var(--color-text-muted); letter-spacing: 0.12em; }
.home-hero h1 { font-family: var(--font-serif); color: var(--color-primary); font-size: 32px; margin: 0 0 4px; line-height: 1.3; }
.home-hero h1 .en { font-family: var(--font-sans); font-size: 15px; color: var(--color-text-muted); font-weight: 400; margin-left: 10px; letter-spacing: 0.04em; }
.home-hero .title { color: var(--color-text-light); font-size: 14px; margin: 6px 0 12px; line-height: 1.8; }
.home-hero .contact { font-size: 13px; color: var(--color-text-light); line-height: 1.8; }
.home-hero .contact .text-muted { font-size: 12px; }
.home-hero .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn {
  display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--color-primary); color: var(--color-primary); background: #fff;
}
.btn:hover { background: var(--color-primary); color: #fff; text-decoration: none; }
.btn.btn-solid { background: var(--color-primary); color: #fff; }
.btn.btn-solid:hover { background: var(--color-primary-dark); }

.home-news {
  background: var(--color-news-bg);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin: 24px 0;
}
.home-news h2 { font-size: 14px; margin: 0 0 6px; color: var(--color-primary); }
.home-news ul { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--color-text-light); }

.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: start; }
.home-menu {
  list-style: none; margin: 0; padding: 0;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.home-menu li { padding: 14px 20px; border-bottom: 1px solid var(--color-border-light); }
.home-menu li:last-child { border-bottom: none; }
.home-menu a { font-size: 16px; font-weight: 500; }
.home-menu .description a { font-size: inherit; font-weight: 400; }
.home-menu .description { display: block; font-size: 13px; color: var(--color-text-muted); margin-top: 2px; line-height: 1.5; }
.home-side h2 { font-size: 14px; color: var(--color-text-light); margin: 0 0 10px; }
.home-links { margin-top: 32px; }
.home-links ul { columns: 2; column-gap: 32px; margin: 0; padding-left: 1.2em; font-size: 14px; }
.home-links li { break-inside: avoid; margin-bottom: 4px; }

.home-foot-notes { font-size: 12px; color: var(--color-text-muted); line-height: 1.8; margin-top: 32px; }
.home-foot-notes .note-marker { color: var(--color-primary); margin-right: 4px; }
.seo-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .g-nav-button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-sm); cursor: pointer;
    color: var(--color-primary); font-size: 22px; line-height: 1;
  }
  .g-nav-button:hover { background: var(--color-news-bg); }
  .g-header-inner { flex-wrap: wrap; }
  .g-nav { display: none; width: 100%; flex-direction: column; padding: 4px 0 12px; }
  .g-nav-toggle:checked ~ .g-nav { display: flex; }
  .g-nav a { padding: 10px 12px; }
}

@media (max-width: 768px) {
  :root { --max-width: 100%; }
  .content-grid { flex-direction: column; }
  .content-sidebar { width: 100%; display: flex; gap: 16px; overflow-x: auto; }
  .book-card { min-width: 200px; }
  .profile-section { flex-direction: column; align-items: center; text-align: center; }
  .site-footer { text-align: center; }
  .home-grid { grid-template-columns: 1fr; }
  .home-side { display: flex; gap: 16px; overflow-x: auto; }
  .home-side h2 { display: none; }
  .home-side .book-card + .book-card { margin-top: 0; }
  .home-links ul { columns: 1; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .g-main { padding: 16px 12px 8px; }
  .legacy { padding: 18px 14px; border-radius: var(--radius-md); }
  .home-hero { flex-direction: column; text-align: center; padding: 22px 16px; }
  .home-hero .actions { justify-content: center; }
  .home-hero h1 .en { display: block; margin: 4px 0 0; }
  .g-brand .g-brand-en { display: none; }
  .g-page-title { font-size: 24px; }
}

@media print {
  .g-header, .g-footer, .g-crumbs { display: none; }
  .legacy { border: 0; box-shadow: none; padding: 0; }
}
