/* view="filter" 専用。従来の著者・シリーズ一覧へは適用しない。 */
.book-filter {
  --book-filter-accent: #333;
  --book-filter-border: #ddd;
  --book-filter-muted: #f5f5f5;
  margin: 2rem 0;
  color: #222;
  line-height: 1.6;
}

.book-filter [hidden] { display: none !important; }
.book-filter *, .book-filter *::before, .book-filter *::after { box-sizing: border-box; }
.book-filter .book-filter__title { margin-top: 0; }

.book-filter__controls {
  padding: 20px;
  border: 1px solid var(--book-filter-border);
  border-radius: 6px;
  background: var(--book-filter-muted);
}

.book-filter__control-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.book-filter__label { flex: 0 0 4em; font-weight: 700; }
.book-filter__views { display: flex; min-width: 0; }

.book-filter button, .book-filter select {
  min-height: 44px;
  margin: 0;
  border: 1px solid #b3b3b3;
  border-radius: 4px;
  background: #fff;
  color: #222;
  font: inherit;
  line-height: 1.5;
  box-shadow: none;
  text-transform: none;
}

.book-filter button { padding: 8px 18px; cursor: pointer; }
.book-filter button::before, .book-filter button::after { content: none; }
.book-filter select { display: block; width: 100%; min-width: 0; padding: 8px 28px 8px 10px; }
.book-filter__keyword-row { min-width: 0; margin-bottom: 16px; }
.book-filter__keyword-field { display: block; min-width: 0; }
.book-filter__keyword-field > span { display: block; margin-bottom: 4px; font-size: .9em; font-weight: 700; }
.book-filter input[type="search"] { display: block; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 8px 10px; border: 1px solid #b3b3b3; border-radius: 4px; background: #fff; color: #222; font: inherit; line-height: 1.5; box-shadow: none; }
.book-filter__views button { border-radius: 0; }
.book-filter__views button:first-child { border-radius: 4px 0 0 4px; }
.book-filter__views button:last-child { margin-left: -1px; border-radius: 0 4px 4px 0; }
.book-filter__views button[aria-pressed="true"] { z-index: 1; border-color: var(--book-filter-accent); background: var(--book-filter-accent); color: #fff; }

.book-filter__facets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.book-filter__facets label { min-width: 0; }
.book-filter__facets label > span { display: block; margin-bottom: 4px; font-size: .9em; font-weight: 700; }
.book-filter .book-filter__hint { margin: 12px 0 0; color: #666; font-size: .85em; }
.book-filter__status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.book-filter .book-filter__status { min-width: 0; margin: 0; font-size: .9em; overflow-wrap: anywhere; }
.book-filter .book-filter__reset { flex-shrink: 0; color: var(--book-filter-accent); font-size: .85em; }
.book-filter .book-filter__empty { padding: 24px; background: var(--book-filter-muted); }
.book-filter__list, .book-filter__groups { margin-top: 16px; }

.book-filter__work { margin: 0; padding: 0; border-bottom: 1px solid var(--book-filter-border); }
.book-filter__work:first-child { border-top: 1px solid var(--book-filter-border); }
.book-filter__details { margin: 0; padding: 0; border: 0; background: transparent; }
.book-filter__header {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 240px;
  align-items: center;
  gap: 16px;
  padding: 16px 8px;
  background: transparent;
  color: inherit;
  list-style: none;
}
.book-filter__fallback-toggle::-webkit-details-marker { display: none; }
.book-filter__fallback-toggle::marker { content: ""; }
.book-filter__header::before, .book-filter__header::after, .book-filter__fallback-toggle::before, .book-filter__fallback-toggle::after { content: none; }
.book-filter__covers { display: flex; flex-direction: column; align-self: start; gap: 10px; }
.book-filter__cover-frame { display: block; width: 80px; aspect-ratio: 2 / 3; }
.book-filter .book-filter__cover { display: block; width: 100%; height: 100%; max-width: 100%; margin: 0; object-fit: contain; box-shadow: 0 1px 3px #0002; }
.book-filter__overview { min-width: 0; }
.book-filter__titles { min-width: 0; }
.book-filter__volume, .book-filter__book-title, .book-filter__date { display: block; }
.book-filter__volume + .book-filter__volume { margin-top: 10px; }
.book-filter__header--volumes .book-filter__overview { align-self: start; }
.book-filter__header--volumes .book-filter__volume { display: flex; min-height: 120px; flex-direction: column; justify-content: center; }
.book-filter__book-title { font-weight: 700; font-size: 1.05em; overflow-wrap: anywhere; }
.book-filter__date { margin-top: 2px; color: #666; font-size: .82em; }
.book-filter__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.book-filter__tag { padding: 3px 8px; border-radius: 3px; background: #efefef; color: #444; font-size: .75em; overflow-wrap: anywhere; }
.book-filter__tag--series, .book-filter__tag--single { background: #e8eff8; color: #3f5875; }
.book-filter__tag--genre { background: #eaf1ea; color: #49614b; }
.book-filter__tag--type { background: #f5eedf; color: #725d35; }
.book-filter__actions { display: flex; width: 100%; flex-direction: column; align-self: center; gap: 8px; }
.book-filter__amazon-item { position: relative; display: block; width: 100%; }
.book-filter__amazon-pixel { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; }
.book-filter__amazon-title { display: block; margin: 0 0 3px; color: #666; font-size: .78em; line-height: 1.4; overflow-wrap: anywhere; }
.book-filter a.book-filter__amazon-link { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border: 1px solid #d3a91f; border-radius: 4px; background: #FFD45A; color: #28220f; font-size: .9em; font-weight: 700; line-height: 1.4; text-align: center; text-decoration: none; }
.book-filter__amazon-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
.book-filter button.book-filter__toggle { display: inline-flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 8px 12px; border: 1px solid #999; border-radius: 4px; background: #fff; color: #333; white-space: nowrap; font: inherit; font-size: .8em; font-weight: 700; line-height: 1.4; box-shadow: none; text-transform: none; transition: none; opacity: 1; cursor: pointer; }
.book-filter .book-filter__fallback-toggle { display: flex; width: 240px; max-width: calc(100% - 16px); min-height: 44px; align-items: center; justify-content: center; gap: 10px; margin: 0 8px 16px auto; padding: 8px 12px; border: 1px solid #999; border-radius: 4px; background: #fff; color: #333; white-space: nowrap; font-size: .8em; font-weight: 700; line-height: 1.4; list-style: none; cursor: pointer; }
.book-filter .book-filter__toggle .book-filter__close-label, .book-filter__fallback-toggle .book-filter__close-label { display: none; }
.book-filter__chevron { width: 0; height: 0; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.book-filter .book-filter__toggle[aria-expanded="true"], .book-filter__details[open] > .book-filter__fallback-toggle { border-color: #333; background: #333; color: #fff; }
.book-filter .book-filter__toggle[aria-expanded="true"] .book-filter__open-label, .book-filter__details[open] > .book-filter__fallback-toggle .book-filter__open-label { display: none; }
.book-filter .book-filter__toggle[aria-expanded="true"] .book-filter__close-label, .book-filter__details[open] > .book-filter__fallback-toggle .book-filter__close-label { display: inline; }
.book-filter .book-filter__toggle[aria-expanded="true"] .book-filter__chevron, .book-filter__details[open] > .book-filter__fallback-toggle .book-filter__chevron { transform: rotate(180deg) translateY(2px); }
.book-filter__detail-content { display: grid; gap: 16px; margin: 0 8px 16px; padding: 16px; border: 1px solid #ddd; border-radius: 8px; background: #f5f5f5; }
.book-filter__reader-card, .book-filter__purchase-card { min-width: 0; padding: 18px; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.book-filter .book-filter__reader-heading, .book-filter .book-filter__purchase-heading { margin: 0 0 14px !important; padding: 0 0 0 12px !important; border: 0 !important; border-left: 4px solid #555 !important; border-radius: 0; background: none !important; box-shadow: none; color: #333; font-size: 1.05em; font-weight: 700; line-height: 1.4; letter-spacing: .02em; }
.book-filter .book-filter__reader-heading::before, .book-filter .book-filter__reader-heading::after, .book-filter .book-filter__purchase-heading::before, .book-filter .book-filter__purchase-heading::after { content: none !important; display: none !important; }
.book-filter__reader-entry + .book-filter__reader-entry { margin-top: 14px; padding-top: 14px; border-top: 1px solid #ddd; }
.book-filter .book-filter__reader-volume-title { margin: 0 0 6px; color: #333; font-size: .95em; font-weight: 700; line-height: 1.5; }
.book-filter .book-filter__reader-card .book-detail__summary { margin: 0; }
.book-filter .book-filter__reader-card .book-detail__summary p { margin: 0; line-height: 1.8; }

.book-filter__purchase-card .book-detail { margin: 0; }
.book-filter__purchase-card .book-detail__body { margin: 0; }
.book-filter__purchase-card .book-detail__type2-list { display: none; }
.book-filter__purchase-card .book-detail__content { min-width: 0; width: 100%; }
.book-filter__purchase-card .book-detail__meta { margin: 6px 0 14px; padding-bottom: 12px; border-bottom: 1px solid #ddd; }
.book-filter__purchase-card .book-purchase__label { margin: 0 0 10px; font-size: .9em; font-weight: 700; }
.book-filter__purchase-card .book-purchase { margin: 0; }
.book-filter__purchase-card .book-purchase__links { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 0; }
.book-filter__purchase-card .book-detail + .book-detail { margin-top: 18px; padding-top: 18px; border-top: 1px solid #ddd; }
.book-filter .book-filter__series-links { margin-top: 16px; }
.book-filter .book-filter__series-link { margin: 8px 0 0; font-size: .9em; }
.book-filter .book-filter__series-link a { color: #06c; font-weight: 700; }
.book-filter__group { margin-bottom: 28px; }
.book-filter__group-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 16px; border-left: 5px solid var(--book-filter-accent); background: var(--book-filter-muted); }
.book-filter h3.book-filter__group-title { flex: 0 1 auto; margin: 0; padding: 0 !important; border: 0 !important; background: none; box-shadow: none; color: inherit; font-size: 1.12em; line-height: 1.6; overflow-wrap: anywhere; }
.book-filter h3.book-filter__group-title::before, .book-filter h3.book-filter__group-title::after { content: none !important; display: none !important; }
.book-filter__group-count { white-space: nowrap; font-size: .85em; }
.book-filter__group-link { margin-left: auto; color: var(--book-filter-accent); font-size: .82em; text-decoration: underline; }
.book-filter .book-filter__group-link { color: #06c; font-weight: 700; }

.book-filter button:focus-visible, .book-filter input:focus-visible, .book-filter select:focus-visible, .book-filter a:focus-visible { outline: 3px solid var(--book-filter-accent); outline-offset: 3px; }
.book-filter .book-filter__fallback-toggle:focus-visible { outline: 3px solid var(--book-filter-accent); outline-offset: 3px; }
@media (hover: hover) {
  .book-filter button.book-filter__toggle:hover, .book-filter__fallback-toggle:hover { border-color: #333; }
  .book-filter button:hover { border-color: var(--book-filter-accent); }
}

@media (max-width: 600px) {
  .book-filter__controls { padding: 14px; }
  .book-filter__control-row { gap: 10px; }
  .book-filter__control-row:has(select) { display: block; }
  .book-filter__control-row:has(select) .book-filter__label { display: block; margin-bottom: 4px; }
  .book-filter__facets { grid-template-columns: 1fr; gap: 12px; }
  .book-filter button { padding: 8px 12px; }
  .book-filter__status-row { align-items: flex-start; }
  .book-filter__header { grid-template-columns: 80px minmax(0, 1fr); align-items: start; gap: 12px; padding: 16px 4px; }
  .book-filter__actions { grid-column: 1 / -1; width: 100%; }
  .book-filter .book-filter__fallback-toggle { width: calc(100% - 8px); max-width: none; margin-right: 4px; margin-left: 4px; }
  .book-filter__detail-content { margin-right: 0; margin-left: 0; padding: 12px; }
  .book-filter__reader-card, .book-filter__purchase-card { padding: 14px; }
  .book-filter__purchase-card .book-purchase__links { grid-template-columns: minmax(0, 1fr); }
  .book-filter__group-header { gap: 6px 12px; padding: 10px 12px; }
  .book-filter__group-link { flex-basis: 100%; margin-left: 0; }
}
