/* Shared page width and header geometry remain in styles.css. */
.materials-page { background:#302925; }
.materials-page .site-scene { background:#e9d5b4; }
.materials-page #site-nav a[aria-current='page'] { background:#c5a26b30; box-shadow:inset 0 -2px #783c36; }
.materials-page .site-footer { background:#302925; color:#ecddbf; }
.index-book { margin:42px 24px 0; padding-bottom:28px; }
.index-book [hidden] { display:none !important; }
.index-opening { position:relative; isolation:isolate; min-height:285px; display:grid; grid-template-columns:minmax(0,1fr) 235px; gap:28px; align-items:center; padding:25px 4% 24px 19%; border:1px solid #755333; overflow:hidden; }
.index-backdrop { position:absolute; inset:0; z-index:-1; width:100%; height:100%; object-fit:cover; object-position:center 68%; }
.index-title-paper { padding:22px 18px; text-align:center; background:#f4e3c5f5; color:#452923; border:4px double #9c7757; box-shadow:0 4px 16px #25190f55; }
.index-title-paper h1 { margin:0; font-size:clamp(2.1rem,4.2vw,3.55rem); font-weight:600; letter-spacing:.12em; line-height:1.4; }
.index-english { margin:6px 0 15px; font: .8125rem/1.5 Georgia,serif; letter-spacing:.18em; }
.index-title-paper > p:last-child { margin:0; font-size:1rem; line-height:1.85; }
.index-title-paper > p:last-child span { display:inline-block; margin-top:4px; }
.index-host { display:flex; flex-direction:column; align-items:center; justify-content:end; align-self:end; }
.index-host p { background:#efe0c5; margin:0 0 6px; padding:10px 12px; font-size:.875rem; line-height:1.8; border:1px solid #987853; transform:rotate(-2deg); white-space:nowrap; }
.index-host img { width:98px; height:130px; object-fit:contain; filter:drop-shadow(0 3px 3px #23190d55); }
.index-workspace { display:grid; grid-template-columns:242px minmax(0,1fr); grid-template-rows:auto 1fr; gap:0 18px; margin-top:15px; padding:16px; border:1px solid #a3835d; outline:1px solid #c6a981; outline-offset:-5px; background:repeating-linear-gradient(35deg,#67422405 0 1px,transparent 1px 4px),#efddbd; }
.index-toolbar { grid-column:2; display:flex; gap:16px; align-items:end; padding:0 0 17px; border-bottom:1px solid #b18a63; }
.keyword-field { flex:1; min-width:0; }
.keyword-field > label,.index-sort { font-size:.875rem; letter-spacing:.04em; }
.keyword-field > div { display:flex; margin-top:7px; }
.keyword-field input { width:100%; min-width:0; font:1rem/1.5 inherit; font-family:inherit; font-size:1rem; background:#faf0dc; border:1px solid #a5835f; border-radius:0; color:#382d22; min-height:46px; padding:10px 12px; }
.keyword-field input::placeholder { color:#71604b; }
.index-toolbar button { background:#753e39; border:3px double #d2ab87; color:#fff0d6; padding:8px 20px; min-height:46px; white-space:nowrap; cursor:pointer; }
.index-sort { display:flex; flex-direction:column; gap:7px; }
.index-sort select { padding:10px 28px 10px 10px; border:1px solid #a5835f; border-radius:0; background:#f7e7ce; color:#372921; font:inherit; min-height:46px; }
.index-sidebar { grid-column:1; grid-row:1 / span 2; border-right:1px solid #b99873; padding-right:17px; }
.index-filters > summary { display:none; }
.index-filters fieldset { min-width:0; border:0; padding:0; margin:0 0 22px; }
.index-filters legend { width:100%; margin:0 0 12px; padding:8px 6px; text-align:center; background:linear-gradient(100deg,#864d40,#602e2d); border:3px double #dbb998; outline:1px solid #905e45; color:#fff1d7; font-size:1rem; letter-spacing:.08em; }
.hall-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.index-choice { position:relative; display:block; cursor:pointer; min-width:0; }
.index-choice input { position:absolute; left:0; top:0; width:1px; height:1px; opacity:0; }
.index-choice > span { display:flex; align-items:center; justify-content:center; min-height:44px; padding:5px; border:1px solid #bda079; background:#f4e4ca; font-size:.9375rem; }
.index-choice input:checked + span { background:#223c38; color:#fff1d6; border-color:#213731; box-shadow:inset 0 0 0 2px #ba9a71; }
.index-choice input:focus-visible + span { outline:3px solid #a24b2d; outline-offset:3px; position:relative; z-index:1; }
.index-choice:hover > span { border-color:#733f2e; box-shadow:inset 0 0 0 1px #967250; }
.category-choices .index-choice > span { background:transparent; border:0; border-bottom:1px solid #b9956b66; padding:7px 10px; justify-content:space-between; min-height:36px; }
.category-choices .index-choice > span::after { content:'›'; font-family:Georgia,serif; font-size:1.15rem; }
.category-choices .index-choice input:checked + span { background:#dac09b; color:#3d2c20; box-shadow:inset 3px 0 #71392e; font-weight:600; }
.tag-choices { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.tag-choices .index-choice > span { min-height:37px; font-size:.875rem; padding:5px 2px; }
.tag-choices .index-choice input:checked + span { background:#743d38; border-color:#713830; }
.filter-help { margin:0 0 11px; font-size:.75rem; color:#67503a; line-height:1.7; }
.index-reset,.show-results { display:block; width:100%; padding:10px 8px; background:#e0c7a1; border:1px solid #9c7852; color:#463322; cursor:pointer; min-height:44px; font-size:.875rem; }
.show-results { display:none; margin-top:10px; background:#243e38; color:#fff1d6; }
.index-results { grid-column:2; min-width:0; }
.index-result-bar { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 0 5px; }
.index-result-bar h2 { margin:0; font-size:1rem; letter-spacing:.04em; font-weight:600; line-height:1.7; scroll-margin-top:20px; }
.index-result-bar strong { color:#703733; font-family:Georgia,serif; font-size:1.7rem; margin-left:3px; }
.index-result-bar p { margin:0; font-size:.75rem; color:#6e5139; white-space:nowrap; }
.active-filters { display:flex; flex-wrap:wrap; gap:6px; margin:7px 0 12px; }
.active-filters button { color:#61322c; background:#f7ead3; border:1px solid #af7b61; padding:6px 9px; font-size:.875rem; cursor:pointer; min-height:36px; }
.active-filters span { padding-left:7px; }
.index-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px 12px; }
.index-card { position:relative; min-width:0; padding:6px; border:1px solid #a7865e; background:#f5e5c9; box-shadow:2px 3px 0 #80604818; display:flex; flex-direction:column; }
.index-art { display:block; padding:3px; border:1px solid #c4a076; background:#e1c5a0; }
.index-art img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:contain; }
.hall-label { position:absolute; top:12px; left:12px; padding:4px 10px; font-size:.8125rem; border:3px double #d8c19c; box-shadow:1px 2px 3px #30201740; color:#fff2dc; line-height:1.4; }
.hall-main { background:#1f4947; }
.hall-west { background:#773a43; }
.index-caption { padding:7px 3px 3px; display:flex; flex-direction:column; flex:1; }
.index-category { margin:0 0 3px; font-size:.75rem; color:#76563a; }
.index-card h3 { margin:0; font-size:1rem; line-height:1.6; font-weight:600; }
.index-card h3 a { text-decoration:none; }
.index-card h3 a:hover { text-decoration:underline; }
.index-tags { list-style:none; padding:0; margin:8px 0 12px; display:flex; flex-wrap:wrap; gap:5px; }
.index-tags a { display:block; padding:3px 6px; border:1px solid #c3a782; background:#eddbbc; color:#58412d; font-size:.8125rem; line-height:1.55; text-decoration:none; }
.index-tags a:hover { background:#dbc096; }
.index-detail { display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:auto; min-height:39px; padding:7px 10px; background:#273b35; color:#fff1d5; border:3px double #cab289; text-decoration:none; font-size:.875rem; }
.index-detail:hover { background:#3a554b; }
.index-pagination { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:7px; margin:24px 0 14px; }
.index-pagination-top { justify-content:flex-end; margin:0 0 11px; }
.index-pagination a { display:grid; place-items:center; min-width:36px; min-height:38px; padding:5px 10px; border:1px solid #ab8560; background:#f7e9cf; text-decoration:none; font-size:.875rem; }
.index-pagination a[aria-current] { background:#773f3b; color:#fff2db; border-color:#703931; }
.index-pagination a:hover { outline:1px solid #743e31; }
.index-usage-note { font-size:.8125rem; line-height:1.9; color:#694d36; border-top:1px solid #bb9972; padding-top:14px; margin:20px 0 0; }
.index-empty { padding:65px 22px; text-align:center; border:3px double #b79873; margin:18px 0; background:#f5e7ce; }
.index-empty h3 { font-size:1.1rem; line-height:1.8; font-weight:500; }
.index-empty p { font-size:1rem; line-height:1.8; }
.index-empty button { min-height:44px; margin-top:15px; border:1px solid #7b583a; background:#e1c69f; padding:8px 16px; cursor:pointer; }
.index-book input:focus-visible,.index-book select:focus-visible,.index-book summary:focus-visible { outline:3px solid #a24b2d; outline-offset:3px; }
@media (max-width:1100px) {
  .index-opening { padding-left:8%; grid-template-columns:minmax(0,1fr) 160px; gap:22px; }
  .index-workspace { grid-template-columns:200px minmax(0,1fr); gap:0 14px; padding:14px; }
  .index-sidebar { padding-right:13px; }
  .index-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 9px; }
  .index-toolbar { gap:10px; }
  .index-toolbar button { padding-inline:14px; }
  .index-sort select { width:105px; }
}
@media (min-width:761px) and (max-width:900px) {
  .index-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .index-title-paper > p:last-child { font-size:.9375rem; }
}
@media (max-width:760px) {
  .materials-page .site-scene { padding-top:87px; }
  .index-book { margin:0 12px; padding-bottom:16px; }
  .index-opening { min-height:0; padding:14px 12px 10px; gap:0; display:block; }
  .index-title-paper { padding:13px 8px 12px; }
  .index-title-paper h1 { font-size:clamp(1.85rem,7.6vw,2.6rem); letter-spacing:.08em; }
  .index-english { font-size:.75rem; margin:4px 0 9px; }
  .index-title-paper > p:last-child { font-size:.875rem; line-height:1.8; }
  .index-title-paper > p:last-child span { margin-top:3px; }
  .index-host { flex-direction:row; justify-content:center; gap:12px; margin-top:9px; }
  .index-host p { font-size:.8125rem; padding:6px 10px; margin:0; }
  .index-host img { width:55px; height:73px; }
  .index-workspace { display:flex; flex-direction:column; padding:12px 9px; gap:12px; margin-top:10px; }
  .index-toolbar { order:0; flex-wrap:wrap; padding-bottom:12px; gap:11px; }
  .keyword-field { flex-basis:100%; }
  .keyword-field input { padding:10px 8px; }
  .keyword-field input::placeholder { font-size:.875rem; }
  .index-sort { flex-direction:row; align-items:center; margin-left:auto; }
  .index-sort select { min-height:40px; padding-block:7px; width:128px; }
  .index-sidebar { order:1; border-right:0; padding:0; }
  .index-filters { border:1px solid #ac8762; }
  .index-filters > summary { display:list-item; padding:12px 10px; font-size:.9375rem; cursor:pointer; color:#f8ecd6; background:#674432; line-height:1.6; }
  #filter-selection-count { display:block; padding-left:18px; color:#f3d6ab; font-size:.8125rem; }
  #filter-selection-count:empty { display:none; }
  .index-filter-body { padding:15px 10px; }
  .index-filters fieldset { margin-bottom:20px; }
  .category-choices { display:grid; grid-template-columns:1fr 1fr; gap:0 8px; }
  .category-choices .index-choice > span { min-height:44px; }
  .tag-choices { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .tag-choices .index-choice > span { min-height:44px; font-size:.8125rem; }
  .show-results { display:block; }
  .index-results { order:2; }
  .index-result-bar { padding:2px 0 5px; flex-wrap:wrap; }
  .index-result-bar h2 { font-size:.9375rem; }
  .index-result-bar strong { font-size:1.45rem; }
  .index-result-bar p { font-size:.75rem; }
  .index-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 8px; }
  .index-card { padding:4px; }
  .index-caption { padding:7px 2px 2px; }
  .index-card h3 { font-size:.9375rem; }
  .hall-label { top:9px; left:9px; font-size:.75rem; padding:3px 7px; }
  .index-detail { padding:7px 6px; font-size:.8125rem; min-height:44px; }
  .index-tags { gap:4px; }
  .index-tags a { font-size:.75rem; padding:4px; }
  .index-pagination a { min-height:44px; min-width:40px; }
  .index-pagination-top { margin:4px 0 12px; }
  .index-empty { padding:25px 12px; }
}
@media (max-width:359px) {
  .index-grid { grid-template-columns:1fr; }
  .index-card { padding:7px; }
  .index-card h3 { font-size:1rem; }
  .index-title-paper > p:last-child { font-size:.8125rem; }
  .tag-choices { grid-template-columns:1fr 1fr; }
}
/* The new collection uses transparent previews; originals load only on download. */
.downloadable .index-art { background:#e1d1b8; }
.downloadable .index-art img { object-fit:contain; padding:7px; }
.index-series { margin:0 0 9px; font-size:.8125rem; line-height:1.65; }
.index-series a { text-underline-offset:3px; }
.series-label { display:block; font-size:.875rem; margin-bottom:8px; }
#index-series { width:100%; min-height:44px; padding:8px 4px; font:inherit; font-size:.875rem; color:#382d22; border:1px solid #a5835f; background:#f7e7ce; }
