/* Iris — 海外文化研究所 */
:root {
  --bg: #FAFAF7;
  --bg-alt: #F3F1EA;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --border: #E0DED6;
  --accent: #6B4423;
  --accent-hover: #8B5A2B;
  --amazon: #FF9900;
  --amazon-hover: #E88900;
  --card: #FFFFFF;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-hover: 0 4px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.08);
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

/* Header */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: rgba(250, 250, 247, 0.95);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text);
}
.site-title a { color: inherit; }
.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}
.site-nav a { color: var(--text-muted); }
.site-nav a:hover { color: var(--text); }

/* Search widget */
.search-widget { position: relative; display: flex; align-items: center; }
.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.search-toggle:hover { color: var(--text); background: var(--bg-alt); }
.search-widget.search-open .search-toggle { color: var(--text); background: var(--bg-alt); }
.search-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(360px, 88vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  padding: 0.75rem;
  z-index: 200;
}
.search-widget.search-open .search-panel { display: block; }
.search-input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.search-input:focus { outline: none; border-color: var(--accent); }
.search-results { margin-top: 0.5rem; max-height: 60vh; overflow-y: auto; }
.search-results:not(:empty) { border-top: 1px solid var(--border); padding-top: 0.5rem; }
.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text);
}
.search-result:hover { background: var(--bg-alt); color: var(--text); }
.search-result-title { flex: 1; }
.search-result-type {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}
.search-empty { padding: 0.75rem 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
@media (max-width: 640px) {
  .search-panel { position: fixed; top: 4.25rem; left: 1rem; right: 1rem; width: auto; }
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}
.hero p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
}

/* Hero (large / landing page) */
.hero-large { padding: 5.5rem 0 4.5rem; }
.hero-large h1 { font-size: 2.75rem; margin-bottom: 1.25rem; }
.hero-large .hero-sub {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  max-width: 720px;
}
.hero-large .hero-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 720px;
  margin-bottom: 2rem;
}
.hero-stats {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  max-width: 720px;
}
.hero-stat {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.hero-stat strong {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--accent);
  font-weight: 500;
}

/* Section heading */
.section-heading {
  margin-bottom: 2rem;
}
.section-heading h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.section-heading p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Featured section */
.section-featured {
  padding: 4rem 0 3rem;
}
.section-featured .books-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 1.5rem;
}

/* Category cards */
.section-categories {
  padding: 3rem 0 5rem;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.cat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.35rem 1.5rem;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: block;
}
.cat-card:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.cat-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.cat-card-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 500;
}
.cat-card-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.cat-card:hover .cat-card-count { color: var(--accent); }
.cat-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .section-featured .books-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero-large { padding: 3rem 0 2.5rem; }
  .hero-large h1 { font-size: 1.85rem; }
  .hero-large .hero-sub { font-size: 1.05rem; }
  .hero-stats { gap: 1.5rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .section-featured .books-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem 1rem; }
}

/* Filters */
.filters {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filter-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Book grid */
.books-section { padding: 2.5rem 0 5rem; }
.book-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.books-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 1.5rem;
}
.book-card {
  background: transparent;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}
.book-card:hover { transform: translateY(-2px); }
.book-cover {
  aspect-ratio: 2 / 3;
  background: var(--bg-alt);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
  margin-bottom: 0.9rem;
}
.book-card:hover .book-cover { box-shadow: var(--shadow-hover); }
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.book-title {
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.book-card a.book-title-link { color: inherit; display: block; }
.book-card a.book-title-link:hover { color: var(--accent); }
.book-short {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.85rem;
  flex: 1;
}
.book-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  align-items: stretch;
}
.btn-amazon {
  background: var(--amazon);
  color: #111;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  font-weight: 600;
  transition: background 0.15s, box-shadow 0.15s;
  display: block;
}
.btn-amazon:hover {
  background: var(--amazon-hover);
  color: #111;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}
.link-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.2rem;
  text-decoration: none;
  transition: color 0.15s;
}
.link-detail:hover {
  color: var(--accent);
  text-decoration: underline;
}
.link-detail::after {
  content: " →";
  opacity: 0.6;
}

/* Category navigation (jump links) */
.cat-nav {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 4.25rem;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(243, 241, 234, 0.95);
}
.cat-nav .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
}
.cat-nav-item {
  font-size: 0.88rem;
  color: var(--text);
  padding: 0.3rem 1rem;
  border-bottom: 2px solid transparent;
  border-right: 1px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
.cat-nav-item:last-child { border-right: none; }
.cat-nav-item:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.cat-nav-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
}
.cat-nav-item:hover span { color: var(--accent); background: white; }
@media (max-width: 640px) {
  .cat-nav-item { border-right: none; padding: 0.3rem 0.7rem; }
}

/* Books container & category sections */
.books-container {
  padding: 2.5rem 0 5rem;
}
.cat-section {
  padding-top: 3rem;
  scroll-margin-top: 8rem;  /* デスクトップ：ヘッダー4rem + cat-nav 3rem 分を確保 */
}
.cat-section:first-child { padding-top: 2rem; }
@media (max-width: 768px) {
  /* モバイル：cat-navは折り返しで高さが可変・stickyだと折り重なるため通常フローに戻す */
  .cat-nav {
    position: static;
    padding: 0.75rem 0;
  }
  .cat-section { scroll-margin-top: 5rem; }
  .cat-section:first-child { padding-top: 1.5rem; }
}
.cat-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.cat-header h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.cat-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}
.cat-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}
.cat-subheading {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 2.5rem 0 1rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent);
}

/* Series page */
.series-page .hero-large { padding: 4rem 0 3rem; }
.series-crumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.series-crumb a { color: var(--text-muted); }
.series-crumb a:hover { color: var(--accent); }

.books-grid.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 2.5rem 1.5rem; }
@media (max-width: 1024px) {
  .books-grid.grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .books-grid.grid-4 { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
}

.cat-card.static {
  cursor: default;
}
.cat-card.static:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: var(--shadow);
}
.cat-card.static:hover .cat-card-count { color: var(--text-muted); }
.cat-card.static .cat-card-desc a {
  color: var(--accent);
  border-bottom: 1px dotted var(--accent);
}
.cat-card.static .cat-card-desc a:hover {
  border-bottom-style: solid;
}

/* View all link */
.view-all-wrap {
  text-align: center;
  margin-top: 3rem;
}
.view-all-link {
  display: inline-block;
  padding: 0.85rem 2rem;
  border: 1px solid var(--text);
  color: var(--text);
  border-radius: 3px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.view-all-link:hover {
  background: var(--text);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.pag-link, .pag-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 3px;
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.pag-link:hover, .pag-page:hover {
  background: var(--bg-alt);
  color: var(--accent);
}
.pag-page.current {
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.pag-link.disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}
.pag-link.disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

/* Book detail page */
.book-detail {
  padding: 3rem 0 5rem;
}
.book-detail-inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}
.book-detail-cover {
  position: sticky;
  top: 6rem;
}
.book-detail-cover-link {
  display: block;
}
.book-detail-cover img {
  width: 100%;
  border-radius: 4px;
  box-shadow: var(--shadow-hover);
}
.book-detail-cover .btn-amazon {
  display: block;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  text-align: center;
  width: 100%;
}
.btn-amazon-large {
  display: inline-block;
  background: var(--amazon);
  color: #111;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn-amazon-large:hover {
  background: var(--amazon-hover);
  color: #111;
  box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

/* Mobile sticky Amazon button on detail page */
.sticky-buy {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: white;
  border-top: 1px solid var(--border);
  z-index: 50;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.sticky-buy .btn-amazon {
  display: block;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
}
.book-detail-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.book-detail h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 0.75rem;
}
.book-detail .book-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.book-detail h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.book-detail h2:first-of-type { margin-top: 0; }
.book-detail p { margin-bottom: 1rem; font-size: 0.98rem; }
.book-detail ul { margin: 0 0 1.5rem 1.5rem; }
.book-detail ul li { margin-bottom: 0.4rem; font-size: 0.95rem; }

/* Kindle Unlimited CTA */
.ku-hint {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--amazon);
  border-radius: 3px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.ku-hint a {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}
.ku-cta {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 3rem 0 3.5rem;
  margin-top: 3rem;
  text-align: center;
}
.ku-cta h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.ku-cta p {
  color: var(--text-muted);
  margin: 0 auto 1.5rem;
  max-width: 560px;
  font-size: 0.95rem;
}

.related-books {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.related-books h2 { margin-top: 0 !important; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* About page */
.page-content {
  padding: 4rem 0 5rem;
  max-width: 720px;
  margin: 0 auto;
}
.page-content h1 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
  line-height: 1.4;
}
.page-content h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}
.page-content p { margin-bottom: 1.25rem; font-size: 1rem; }
.page-content ul { margin: 0 0 1.5rem 1.5rem; }
.page-content ul li { margin-bottom: 0.5rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 3rem;
  background: var(--bg-alt);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--serif);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* HTML sitemap */
.sitemap-section { margin-top: 2.5rem; }
.sitemap-section ul {
  columns: 2 18rem;
  column-gap: 3rem;
  margin-left: 0;
  list-style: none;
}
.sitemap-section li { break-inside: avoid; }

/* ==========================================
   Iris Libraries
   ========================================== */

/* Library index page */
.lib-index-content { padding: 3rem 0 4rem; }
.lib-index-section { margin-bottom: 3rem; }
.lib-cat-heading {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.lib-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.lib-index-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.lib-index-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  color: var(--text);
}
.lib-index-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}
.lib-index-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.lib-index-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Library page breadcrumb & intro */
.lib-crumb {
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.lib-crumb a { color: var(--text-muted); }
.lib-crumb a:hover { color: var(--accent); }

.lib-intro {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-top: 1rem;
  max-width: 720px;
}
.lib-series-cta {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.lib-series-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s;
}
.lib-series-link:hover { background: var(--accent-hover); color: #fff; }

/* Books section */
.lib-books-section { padding: 2.5rem 0 4rem; }
.lib-notice {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.65rem 1rem;
  margin-bottom: 2rem;
}
.lib-books-list { display: flex; flex-direction: column; gap: 1.5rem; }

/* Individual book card */
.lib-book-card {
  display: flex;
  gap: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  position: relative;
}
.lib-book-rank {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  align-self: flex-start;
  margin-top: 0.15rem;
}
.lib-book-cover {
  flex-shrink: 0;
  width: 100px;
}
.lib-book-cover img {
  width: 100%;
  border-radius: 3px;
  box-shadow: var(--shadow);
}
.lib-cover-placeholder {
  width: 100px;
  height: 140px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lib-cover-icon { font-size: 2rem; }
.lib-book-body { flex: 1; min-width: 0; }
.lib-book-header {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}
.iris-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.lib-book-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
}
.lib-book-title a { color: var(--text); }
.lib-book-title a:hover { color: var(--accent); }
.lib-book-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.lib-book-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.lib-book-desc {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 0.85rem;
}
.lib-book-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.btn-amazon-intl {
  background: #232F3E;
  color: #fff;
  font-size: 0.85rem;
  padding: 0.55rem 0.9rem;
  border-radius: 3px;
  font-family: inherit;
  text-align: center;
  font-weight: 600;
  transition: background 0.15s;
  display: block;
}
.btn-amazon-intl:hover { background: #374151; color: #fff; }

/* "or" separator between two Amazon store buttons — centered on its own line */
.btn-or {
  display: block;
  text-align: center;
  color: #999;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0.4rem 0;
  line-height: 1;
  position: relative;
}
.btn-or::before,
.btn-or::after {
  content: '';
  display: inline-block;
  width: 1.5rem;
  height: 1px;
  background: #ddd;
  vertical-align: middle;
  margin: 0 0.5rem;
}

/* Library card: keep buttons in a flex row, hide or-separator inline */
.lib-book-actions .btn-or { display: none; }

/* Detail page sidebar: buttons stack vertically full-width with "or" between */
.book-detail-cover .btn-amazon-intl {
  display: block;
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  text-align: center;
}

/* Detail page main-body "Buy on Kindle" section: stacked full-width both */
.buy-btns {
  max-width: 380px;
  margin: 1rem 0 1.5rem;
}
.buy-btns .btn-amazon-large {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  text-align: center;
  box-sizing: border-box;
}
.buy-btns .btn-amazon-intl {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Sticky mobile buy bar: single primary button only (hide secondary + or) */
.sticky-buy .btn-or,
.sticky-buy .btn-amazon-intl { display: none; }
.btn-amazon-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.9rem;
}

/* Affiliate note */
/* Library pagination */
.lib-index-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  min-height: 1.2em;
}
.lib-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.lib-page-btn, .lib-page-num {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.lib-page-btn:hover:not([disabled]), .lib-page-num:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lib-page-btn[disabled] { opacity: 0.35; cursor: default; }
.lib-page-current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.lib-affiliate-note {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  line-height: 1.7;
}

/* Category tabs on library index */
.lib-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 2rem 0 1.5rem;
}
.lib-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  background: #f5f3ef;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.lib-tab:hover {
  background: #fdf3e7;
  border-color: var(--accent);
  color: var(--accent);
}
.lib-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.lib-tab.active .lib-tab-count {
  opacity: 0.8;
}
.lib-tab-count {
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Policy link on library index */
.lib-index-links {
  margin-top: 1.5rem;
}
.lib-policy-link {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.lib-policy-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Policy page */
.lib-policy-section {
  padding: 2.5rem 0 4rem;
}
.lib-policy-section .container {
  max-width: 780px;
}
.lib-policy-section h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-top: 2.5rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.lib-policy-section h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
  color: var(--accent);
}
.lib-policy-section p {
  font-size: 0.98rem;
  line-height: 1.85;
  margin-bottom: 1rem;
}
.lib-policy-list {
  margin: 0.5rem 0 1.25rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.85;
}
.lib-policy-list li {
  margin-bottom: 0.5rem;
}
.lib-policy-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

/* Language switcher */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
}
.lang-switcher details {
  position: relative;
}
.lang-switcher summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 3px 6px;
  border-radius: 4px;
  transition: color 0.2s;
  user-select: none;
  letter-spacing: 0.03em;
}
.lang-switcher summary:hover { color: var(--text); }
.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-switcher summary::marker { display: none; }
.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  min-width: 130px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 200;
}
.lang-dropdown a {
  display: block;
  padding: 7px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.lang-dropdown a:hover { background: var(--bg-alt); color: var(--text); }
.lang-dropdown a.lang-active { font-weight: 600; color: var(--accent); }

/* Coming-soon state for new language sites */
.lang-coming-soon {
  text-align: center;
  padding: 4rem 1.5rem 5rem;
}
.lang-coming-soon h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}
.lang-coming-soon p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.75;
}

/* Responsive */
@media (max-width: 1024px) {
  .books-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .lib-index-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero { padding: 2.5rem 0 2rem; }
  .hero h1 { font-size: 1.65rem; }
  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .book-detail-inner { grid-template-columns: 1fr; gap: 2rem; }
  .book-detail-cover { position: static; max-width: 240px; margin: 0 auto; }
  .site-nav { gap: 1rem; font-size: 0.85rem; }
  .site-title { font-size: 1rem; }
  .lib-index-grid { grid-template-columns: 1fr; }
  .lib-book-card { flex-wrap: wrap; }
  .lib-book-cover { width: 80px; }
  .lib-cover-placeholder { width: 80px; height: 112px; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .books-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem 0.75rem; }
  .book-title { font-size: 0.9rem; }
  .book-short { font-size: 0.78rem; }
  /* 375px幅でナビが折り返しても崩れないよう調整 */
  .site-header .container { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .site-nav { gap: 0.85rem; font-size: 0.8rem; flex-wrap: wrap; }
  .site-title { font-size: 0.95rem; }
  .lib-book-card { padding: 1rem; gap: 0.85rem; }
}
@media (max-width: 768px) {
  .book-detail { padding-bottom: 6rem; }
  .sticky-buy { display: block; }
  .buy-btns { max-width: none; }
}
