*{box-sizing:border-box}body{margin:0;color:#202020;font-family:-apple-system,BlinkMacSystemFont,'Noto Sans JP',sans-serif;font-size:14px}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}.site-header{display:flex;align-items:center;justify-content:space-between;gap:28px;padding:20px 5%;border-bottom:1px solid #eee;background:white}.logo{width:205px;max-width:40vw}.head-right{display:flex;align-items:center;gap:20px}.head-search{display:flex;width:410px;max-width:42vw;box-shadow:0 1px 12px #ddd;border-radius:6px;overflow:hidden}.head-search input,.hero-search input{flex:1;min-width:0;border:0;padding:15px;outline:none}.head-search button,.hero-search button{background:white;border:0;padding:0 19px}.hero{text-align:center;padding:92px 16px 68px}.hero-logo{width:310px;max-width:75vw}.hero h1{font-size:21px;margin:20px}.hero-search{display:flex;max-width:510px;margin:35px auto 18px;box-shadow:0 2px 15px #ddd;border-radius:6px;overflow:hidden}.hero-nav{display:flex;gap:25px;justify-content:center;flex-wrap:wrap;font-weight:600}.hero-nav button{background:none;border:0;padding:8px}.hero-nav button:hover{border-bottom:2px solid #222}.subnote{font-size:11px;margin:50px 0 0}.home-wrap{max-width:1150px;margin:0 auto 130px;padding:0 20px}.section-title{text-align:center;font-size:22px;margin:0 0 35px}.home-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.home-card{border:1px solid #e4e4e4;padding:25px 20px 32px;text-align:center}.home-card h3{font-size:17px;margin:15px 0 30px}.home-preview{display:flex;gap:16px;min-height:195px;align-items:flex-start;justify-content:center}.home-preview img{width:44%;height:185px;object-fit:contain;background:#f6f6f6}.red-btn{display:block;background:#962424;color:white;border:0;padding:14px;text-align:center;width:100%;margin-top:25px}.layout{display:flex;gap:44px;max-width:1240px;padding:45px 25px 100px;margin:auto;min-height:850px}.layout.right{flex-direction:row-reverse}.sidebar{width:315px;flex-shrink:0}.results{min-width:0;flex:1}.sidebar-title{display:flex;justify-content:space-between;border-bottom:1px solid #ddd;padding-bottom:13px;font-weight:700}.filter-section{border-bottom:1px solid #ddd;padding:26px 0}.filter-section h3{font-size:14px;margin:0 0 15px}.check{display:block;margin:12px 0}.check input{accent-color:#962424;margin-right:8px}.period-label{display:block;margin:12px 0}.period-label input{accent-color:#962424}.dates{display:flex;gap:8px;flex-wrap:wrap}.dates input{width:135px;max-width:100%;border:1px solid #ddd;padding:8px}.keywords{display:flex;flex-wrap:wrap;gap:8px}.chip{border:1px solid #962424;border-radius:20px;color:#962424;background:white;padding:6px 12px;font-size:12px}.result-bar{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:30px}.result-bar select{border:1px solid #ddd;background:white;padding:10px;min-width:150px}.book-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:35px 18px}.book{border:0;background:none;text-align:left;padding:0;min-width:0}.cover{height:175px;background:#f6f6f6;display:flex;justify-content:center;align-items:center}.cover img{max-width:100%;max-height:100%;object-fit:contain}.book-title{font-size:12px;font-weight:600;margin-top:10px;line-height:1.5;overflow-wrap:anywhere}.pagination{display:flex;justify-content:center;gap:7px;margin-top:65px}.pagination button{border:0;background:#ddd;padding:10px 15px}.pagination button.active{background:#962424;color:white}.filter-toggle{border:1px solid #ccc;background:white;padding:10px 15px;border-radius:4px}.mobile-filter{display:none}.empty{padding:60px 15px;text-align:center;color:#777}.error{padding:20px;background:#fff4f4;color:#962424;overflow-wrap:anywhere}.footer{border-top:1px solid #eee;text-align:center;padding:22px;color:#999;font-size:11px}.sidebar.closed{display:none}.layout:has(.sidebar.closed) .results{width:100%}@media(max-width:767px){.site-header{padding:15px;gap:10px;flex-wrap:wrap}.logo{width:155px}.head-right{gap:8px;font-size:11px}.head-search{order:3;max-width:none;width:100%}.hero{padding:65px 15px}.hero h1{font-size:18px}.home-grid{grid-template-columns:1fr}.home-preview img{height:160px}.home-wrap{margin-bottom:70px}.layout,.layout.right{display:block;padding:20px 15px 70px;min-height:600px}.sidebar{width:100%;margin-bottom:20px;padding:16px;border:1px solid #ddd}.mobile-filter{display:block;margin-bottom:16px}.book-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 12px}.cover{height:170px}.result-bar{flex-wrap:wrap}.result-bar select{min-width:120px}.sidebar.closed{display:none}}
/* トップ4列、モバイル2列 */
.home-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.home-card{padding:20px 12px 25px}.home-preview{gap:6px}.home-preview img{height:160px}.sidebar-title button{border:0;background:transparent;cursor:pointer}@media(max-width:767px){.home-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.home-card{padding:12px 8px}.home-card h3{font-size:14px;margin:10px 0 16px}.home-preview{min-height:110px}.home-preview img{height:105px}.home-card .red-btn{font-size:12px;padding:10px 4px}}

/* トップページ：ヘッダーと最新2件のカード */
.home-header{min-height:90px;padding:22px 3%;}
.home-header-link{display:inline-flex;align-items:center;gap:10px;font-weight:700;font-size:13px;}
.home-header-link i{font-size:18px;}
.home-card h3::after{content:"";display:block;width:42px;height:3px;background:#222;margin:10px auto 0;}
.home-preview{align-items:flex-start;min-height:225px;gap:10px;}
.preview-book{display:block;flex:1;min-width:0;text-align:left;}
.home-preview .preview-book img{display:block;width:100%;height:155px;object-fit:contain;background:#f7f7f7;}
.preview-book span{display:block;margin-top:12px;font-size:11px;line-height:1.5;overflow-wrap:anywhere;}
.preview-status{font-size:12px;color:#777;margin:auto;}
@media(max-width:767px){.home-header{min-height:65px;padding:16px 14px}.home-header-link{font-size:10px;gap:6px}.home-header-link i{font-size:15px}.home-preview{min-height:160px;gap:6px}.home-preview .preview-book img{height:105px}.preview-book span{font-size:10px;margin-top:7px}.home-card h3::after{margin-top:7px}}

/* 2026-10-17: 表紙の上下にできる過剰な余白を解消 */
.home-preview{align-items:flex-start;min-height:0;}
.home-preview .preview-book img{width:100%;height:auto;max-height:185px;aspect-ratio:auto;object-fit:contain;background:transparent;}
.preview-book span{margin-top:9px;}
.hero-search button i{font-size:17px;color:#222;}
@media(max-width:767px){.home-preview{min-height:0;}.home-preview .preview-book img{height:auto;max-height:170px;}.home-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}.home-card{padding:14px 9px 18px;}.home-preview{gap:7px;}.preview-book span{font-size:10px;}}

/* トップ：カードとボタン位置を揃え、表紙の余白は増やさない */
.home-grid{align-items:stretch;}
.home-card{display:flex;flex-direction:column;min-width:0;}
.home-card .home-preview{flex:1;align-content:start;align-items:flex-start;}
.home-card .red-btn{margin-top:auto;flex-shrink:0;}
.home-preview .preview-book img{height:auto;max-height:185px;object-fit:contain;}
@media(max-width:767px){.home-preview .preview-book img{max-height:170px;}}

/* 一覧ページヘッダー：ロゴ横に検索欄、右に3リンク */
.results-header{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:13px 2.5%;min-height:86px;}
.results-header .header-main{display:flex;align-items:center;gap:30px;min-width:0;flex:1;}
.results-header .logo{width:220px;max-width:none;display:block;}
.results-header .head-search{width:440px;max-width:100%;flex:0 1 440px;}
.results-header .head-search button{display:flex;align-items:center;justify-content:center;min-width:55px;border-left:1px solid #f4f4f4;}
.results-header .head-right{display:flex;align-items:center;justify-content:flex-end;gap:22px;white-space:nowrap;font-size:13px;}
.results-header .head-right a{display:inline-flex;align-items:center;gap:9px;}
.results-header .head-right i{font-size:20px;}
@media(max-width:1050px){.results-header{flex-wrap:wrap;}.results-header .header-main{flex:1 1 100%;}.results-header .head-right{width:100%;justify-content:flex-end;}}
@media(max-width:767px){.results-header{padding:13px 15px;gap:12px;}.results-header .header-main{flex-wrap:wrap;gap:12px;}.results-header .logo{width:175px;}.results-header .head-search{order:2;width:100%;flex:1 1 100%;}.results-header .head-right{justify-content:space-between;gap:10px;font-size:11px;white-space:normal;}.results-header .head-right i{font-size:16px;}}

/* 表紙は共通の画像枠で中央寄せ。縦横比は維持し、カードとボタンも整列 */
.home-preview{align-items:stretch!important;min-height:0!important;flex:1;}
.home-preview .preview-book{display:flex;flex-direction:column;min-width:0;}
.home-preview .preview-book img{display:block;width:100%;height:205px!important;max-height:none!important;object-fit:contain!important;object-position:center;background:#fff;}
.home-preview .preview-book span{display:block;margin-top:10px;line-height:1.5;}
.home-card .red-btn{margin-top:26px;}
@media(max-width:767px){.home-preview .preview-book img{height:125px!important;} .home-card .red-btn{margin-top:18px;}}

/* 2026-10-17: sort values are API OrderBy expressions; compact select chevron */
.result-bar select{min-width:0;width:154px;padding:10px 32px 10px 12px;appearance:none;-webkit-appearance:none;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' stroke='%23222' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:12px 8px;}
/* Preserve a shared thumbnail stage for portraits and landscape covers */
.home-preview .preview-book img{height:205px!important;object-fit:contain!important;background:#f7f7f7!important;}
@media(max-width:767px){.home-preview .preview-book img{height:125px!important;}.result-bar select{width:140px;}}

/* Thumbnail stage: center every cover vertically, including landscape photos. */
.home-preview .preview-book img{object-position:center center!important;background:#f7f7f7!important;}

/* 画像枠の上下にグレーの帯を表示しない（正しい1枚目の状態） */
.home-preview .preview-book img{background:transparent!important;}

/* 2026-10-17: keep gray background, remove forced thumbnail height and excess vertical bands */
.home-preview .preview-book img{height:auto!important;max-height:205px!important;aspect-ratio:auto!important;object-fit:contain!important;background:#f7f7f7!important;}
@media(max-width:767px){.home-preview .preview-book img{height:auto!important;max-height:170px!important;}}

/* Final: gray thumbnail stage, reduced vertical bands, vertically centered */
.home-preview .preview-book img{display:block!important;width:100%!important;height:175px!important;max-height:none!important;object-fit:contain!important;object-position:center center!important;background:#f7f7f7!important;}
@media(max-width:767px){.home-preview .preview-book img{height:115px!important;}}

/* Restore exact thumbnail spacing from user-provided new_archive_search_latest(1).zip */
.home-preview{align-items:flex-start!important;min-height:225px!important;gap:10px!important;}
.home-preview .preview-book img{height:155px!important;max-height:none!important;object-fit:contain!important;object-position:center center!important;background:#f7f7f7!important;}
@media(max-width:767px){.home-preview{min-height:160px!important;gap:6px!important;}.home-preview .preview-book img{height:105px!important;}}

/* Sidebar title: only heading and reset link */
.sidebar-title{justify-content:flex-start;gap:32px}

/* 2026-10-17: reduce space above category list buttons; reset on sidebar right */
.sidebar-title{justify-content:space-between;gap:0;}
.home-card .home-preview{flex:0 0 auto!important;min-height:0!important;}
.home-card .red-btn{margin-top:8px!important;}
@media(max-width:767px){.home-card .red-btn{margin-top:8px!important;}}

/* Align all four category buttons at the same vertical position */
.home-card .home-preview{flex:1 1 auto!important;}
.home-card .red-btn{margin-top:auto!important;}

/* Keep all four buttons aligned, with a subtle gap above them */
.home-card .home-preview{margin-bottom:12px!important;}
@media(max-width:767px){.home-card .home-preview{margin-bottom:8px!important;}}

/* Tag filter: scroll only the list, not the entire sidebar */
.tag-scroll{max-height:320px;overflow-y:auto;overscroll-behavior:contain;padding:2px 8px 2px 0;border:1px solid #e5e5e5;border-radius:4px;}
.tag-option{display:flex;align-items:flex-start;gap:5px;margin:0;padding:8px 10px;overflow-wrap:anywhere;}
.tag-option:hover{background:#f7f7f7}.tag-option input{flex:none;margin-top:3px}.tag-status{color:#777;font-size:12px;}

/* Search tags: original red outlined chips; scroll within tag list */
.tag-scroll{display:flex;flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:8px;max-height:320px;overflow-y:auto;padding:10px;border:1px solid #e5e5e5;border-radius:4px;}
.tag-chip{appearance:none;background:#fff;border:1px solid #962424;border-radius:999px;color:#962424;padding:5px 13px;font:inherit;font-size:12px;line-height:1.4;cursor:pointer;white-space:normal;text-align:center;}
.tag-chip:hover,.tag-chip.selected{background:#962424;color:#fff;border-color:#962424;}
.tag-chip:focus-visible{outline:2px solid #962424;outline-offset:2px;}

/* Align the clip link to the right on the homepage. */
.home-header .home-clip-link{margin-left:auto;}

/* 共通ヘッダーメニュー：間隔・ホバー色を統一 */
.results-header .head-right{gap:22px;}
.results-header .head-right a:hover,.results-header .head-right a:focus-visible{color:#962424;text-decoration:none;}

/* Page search: match the legacy page-search header at narrow widths. */
.page-mobile-header{display:none}
@media(max-width:860px){
  .results-header{display:none!important}
  .page-mobile-header{display:block;background:#fff;border-bottom:1px solid #eee;padding:16px 20px 20px}
  .page-mobile-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:60px}
  .page-mobile-logo{display:block;min-width:0;text-align:center}
  .page-mobile-logo img{display:block;width:min(260px,55vw);height:auto;max-height:48px;object-fit:contain}
  .page-mobile-icon{width:65px;flex:0 0 65px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-weight:600;font-size:11px;white-space:nowrap}
  .page-mobile-icon i{font-size:23px}
  .page-mobile-nav{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px 22px;padding:12px 0 16px;font-size:13px}
  .page-mobile-nav a:hover,.page-mobile-icon:hover{color:#962424}
  .page-mobile-search{display:flex;width:min(100%,600px);height:54px;margin:12px auto 0;box-shadow:0 2px 15px #ddd;border-radius:12px;overflow:hidden}
  .page-mobile-search input{flex:1;min-width:0;border:0;padding:0 18px;outline:none;background:white}
  .page-mobile-search button{flex:0 0 62px;border:0;background:#fff;font-size:19px}
}
@media(max-width:480px){
  .page-mobile-header{padding:12px 14px 18px}
  .page-mobile-logo img{width:min(210px,52vw)}
  .page-mobile-icon{width:52px;flex-basis:52px;font-size:10px}
  .page-mobile-icon i{font-size:20px}
  .page-mobile-nav{gap:8px 15px;font-size:12px}
}

/* Compact mobile header logo and top/premium links */
@media(max-width:860px){.page-mobile-logo img{width:min(205px,47vw);max-height:38px}.page-mobile-icon{width:54px;flex-basis:54px;font-size:10px;gap:2px}.page-mobile-icon i{font-size:18px}.page-mobile-top{min-height:48px}}
@media(max-width:480px){.page-mobile-logo img{width:min(175px,45vw);max-height:34px}.page-mobile-icon{width:46px;flex-basis:46px;font-size:9px}.page-mobile-icon i{font-size:17px}}

/* Match the page-based search mobile header dimensions. */
@media (max-width:860px){
  .page-mobile-logo img{width:auto;max-width:min(205px,55vw);height:30px;max-height:30px;object-fit:contain}
  .page-mobile-icon{font-size:11px;gap:2px}
  .page-mobile-icon i{font-size:19px}
}
@media (max-width:480px){
  .page-mobile-logo img{max-width:55vw;height:30px;max-height:30px}
  .page-mobile-icon{font-size:10px}
  .page-mobile-icon i{font-size:19px}
}

/* 2026-10-20: match legacy page search header precisely at mobile widths */
@media (max-width:860px){
  .page-mobile-header{padding:0 0 0;border-bottom:0}
  .page-mobile-top{padding:22px 12px 13px;min-height:0;gap:0}
  .page-mobile-icon{width:auto;flex:0 0 50px;font-size:8px;line-height:1.4;font-weight:650;gap:0}
  .page-mobile-icon i{font-size:19px;line-height:1.2}
  .page-mobile-logo img{height:30px;max-height:30px;width:auto;max-width:55vw}
  .page-mobile-nav{gap:16px;padding:9px 12px;font-size:11px;line-height:1.5;border-bottom:1px solid #eee;flex-wrap:wrap}
  .page-mobile-search{box-sizing:border-box;width:min(510px,calc(100% - 24px));height:54px;margin:24px auto 0;box-shadow:0 5px 10px rgba(0,0,0,.06);border:1px solid #ececec;border-radius:12px}
  .page-mobile-search input{height:100%;font-size:16px;padding:0 18px}
  .page-mobile-search button{flex:0 0 54px;font-size:19px;color:#333}
}
@media(max-width:480px){
  .page-mobile-top{padding:22px 12px 13px}
  .page-mobile-icon{width:auto;flex-basis:50px;font-size:8px}
  .page-mobile-icon i{font-size:19px}
  .page-mobile-nav{gap:16px;font-size:11px}
  .page-mobile-search{width:calc(100% - 24px)}
}

/* Keyword input: legacy page-search shape and clear action. */
.results-header .head-search, .page-mobile-search {position:relative;}
.results-header .head-search .keyword-clear, .page-mobile-search .keyword-clear {
  flex:0 0 42px;display:flex;align-items:center;justify-content:center;
  border:0;border-right:1px solid #e8e8e8;background:#fff;color:#666;
  padding:0;font-size:14px;box-shadow:none;
}
.results-header .head-search .keyword-clear:hover, .page-mobile-search .keyword-clear:hover {background:#f3f3f3;}
.results-header .head-search input::placeholder, .page-mobile-search input::placeholder {color:#888;opacity:1;font-size:14px;font-weight:400;}
@media(max-width:860px){
  .page-mobile-search{overflow:hidden;}
  .page-mobile-search input{font-size:16px;}
  .page-mobile-search .keyword-clear{flex-basis:54px;font-size:15px;}
  .page-mobile-search button:not(.keyword-clear){flex:0 0 54px;}
}

/* Sort dropdown followed by compact hamburger filter control */
.result-bar>div:last-child{display:flex;align-items:center;gap:8px;flex-shrink:0}
.result-bar .filter-menu-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border:1px solid #ddd;border-radius:4px;background:#fff;color:#333;cursor:pointer;font-size:18px;line-height:1}
.result-bar .filter-menu-icon:hover,.result-bar .filter-menu-icon:focus-visible{color:#962424;border-color:#962424}

/* Responsive filter toggle: one control per layout; icon reflects sidebar state. */
.mobile-filter .filter-toggle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;font-size:19px;line-height:1;border:1px solid #ddd;border-radius:4px;background:#fff;color:#333}
.mobile-filter .filter-toggle:hover,.mobile-filter .filter-toggle:focus-visible{color:#962424;border-color:#962424}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:767px){
 .result-bar .filter-menu-icon{display:none!important}
 .mobile-filter{display:flex;justify-content:flex-end;margin-bottom:12px}
}
@media(min-width:768px){.mobile-filter{display:none!important}}

/* Keep all nine pagination controls visible on narrow phones. */
@media (max-width: 480px) {
  .pagination {
    box-sizing: border-box; width: 100%; max-width: 100%;
    gap: 3px; margin-top: 36px; padding: 0 4px;
    justify-content: center; flex-wrap: nowrap;
  }
  .pagination button {
    box-sizing: border-box; flex: 0 1 32px; min-width: 0;
    width: 32px; height: 36px; padding: 0;
    font-size: 14px; text-align: center;
  }
}

/* Match archive_page_results pagination appearance. */
.pagination { gap: 7px; margin-top: 50px; margin-bottom: 10px; }
.pagination button { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 45px; height: 42px; padding: 0; background: #d8d8d8; color: #333; border: 0; border-radius: 0; font-size: 14px; font-weight: 700; line-height: 1; }
.pagination button.active { background: #962424; color: #fff; }
.pagination button:disabled { opacity: .35; cursor: default; }
@media (max-width: 480px) {
  .pagination { box-sizing: border-box; width: 100%; max-width: 100%; gap: 3px; margin-top: 36px; padding: 0 4px; justify-content: center; flex-wrap: nowrap; }
  .pagination button { box-sizing: border-box; flex: 0 1 32px; min-width: 0; width: 32px; height: 36px; padding: 0; font-size: 14px; font-weight: 700; }
}

/* Shared pagination markup and appearance with archive_page_results. */
.paging-wrap{display:flex;justify-content:center;margin:50px 0 10px;max-width:100%;}
.paging{display:flex;gap:7px;list-style:none;padding:0;margin:0;max-width:100%;}
.paging li{list-style:none;}
.paging a{box-sizing:border-box;width:45px;height:42px;display:flex;align-items:center;justify-content:center;background:#ddd;color:#333;font-weight:700;border-radius:0;text-decoration:none;}
.paging a.active{background:#962424;color:#fff;}
.paging a.disabled{pointer-events:none;opacity:.35;}
@media(max-width:480px){.paging-wrap{box-sizing:border-box;width:100%;margin-top:36px;padding:0 4px}.paging{box-sizing:border-box;width:100%;justify-content:center;gap:3px;flex-wrap:nowrap}.paging li{flex:0 1 32px;min-width:0}.paging a{box-sizing:border-box;width:100%;height:36px;font-size:14px}}
