/* ============================================
   池谷裕二 ホームページ — 共通スタイル
   ============================================ */

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

/* --- CSS Custom Properties --- */
: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: #888;
  --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;
  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*,
*::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;
}

/* --- Layout Container --- */
.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header / Welcome --- */
.site-header {
  text-align: center;
  padding: 12px 0 8px;
}

.site-header h1 {
  color: var(--color-primary);
  font-family: 'BIZ UDPGothic', 'UD デジタル 教科書体 NK-R', 'Noto Sans JP', sans-serif;
  font-size: 32px;
  margin: 0;
}

.site-header img {
  max-width: 600px;
  width: 100%;
  height: auto;
}

/* --- News Ticker (replaces MARQUEE) --- */
.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);
  overflow: hidden;
  white-space: nowrap;
}

.news-bar-inner {
  display: inline-block;
  animation: scroll-news 30s linear infinite;
}

@keyframes scroll-news {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

.news-bar:hover .news-bar-inner {
  animation-play-state: paused;
}

/* --- Section Divider --- */
.section-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 32px 0;
}

/* --- Main Content Layout --- */
.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 Items --- */
.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--transition);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:hover {
  border-radius: var(--radius-sm);
  padding-left: 8px;
}

.menu-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-primary);
}

.menu-item a img {
  vertical-align: middle;
}

.menu-item .description {
  display: block;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.5;
}

/* --- Book Card (Sidebar) --- */
.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 --- */
.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);
  transition: opacity var(--transition);
}

.profile-image img:hover {
  opacity: 0.85;
}

.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;
}

/* --- Footer --- */
.site-footer {
  text-align: right;
  padding: 24px 0 40px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.site-footer a {
  color: var(--color-primary);
}

.site-footer .footer-notes {
  font-size: 12px;
  line-height: 1.8;
  color: var(--color-text-muted);
}

.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);
}

/* --- Index (Splash) Page --- */
.splash-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 40px 20px;
}

.splash-content {
  max-width: 480px;
}

.splash-content .welcome-img {
  width: 100%;
  max-width: 380px;
  margin-bottom: 16px;
}

.splash-content .cover-img {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  margin-bottom: 24px;
}

.lang-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 8px;
}

.lang-buttons a img {
  transition: transform var(--transition), opacity var(--transition);
}

.lang-buttons a img:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

/* --- Page-specific: Research, Publication, etc. --- */
.page-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin: 40px 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-to-top / Navigation --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 24px 0;
  font-size: 14px;
  color: var(--color-primary);
}

.back-link:hover {
  text-decoration: none;
  color: var(--color-link-hover);
}

/* --- Book Grid (media/index.html) --- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 16px;
  text-align: center;
}

.book-grid-item {
  text-align: center;
}

.book-grid-item img {
  width: 80px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.book-grid-item img:hover {
  transform: translateY(-2px);
}

.book-grid-item .copies {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- Table Styling (for data tables, not layout) --- */
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);
}

/* --- Long-form Text (preface, essays) --- */
.prose {
  max-width: 680px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 2;
  color: var(--color-text);
}

.prose p {
  margin: 1em 0;
  text-indent: 1em;
}

.prose hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2em 0;
}

/* --- Music Recommendation Pages --- */
.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-entry strong {
  color: var(--color-text);
}

.music-entry a {
  color: var(--color-primary);
}

.music-personnel {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.6;
}

/* --- Responsive --- */
@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;
  }

  .splash-content .cover-img {
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .site-header {
    padding: 24px 0 16px;
  }

  .page-title {
    font-size: 22px;
  }
}

/* --- Utility Classes --- */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-small {
  font-size: 13px;
}

.text-muted {
  color: var(--color-text-muted);
}

.text-primary {
  color: var(--color-primary);
}

.text-accent {
  color: var(--color-accent);
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.hidden {
  display: none;
}