
/* ===== 基本デザイン定義 ===== */
:root{
  --outer-m:1.2rem;
  --max-w:1250px;
  --col-gap:2rem;
  --row-gap:0;
}
html{ font-size:115%; }
body{
  margin:0;
  padding:var(--outer-m);
  font:300 .85rem/1.6 "univers-next-pro","hiragino-kaku-gothic-pron",sans-serif;
  letter-spacing:.01em;color:#000;
}
h1,h2,h3,h4,h5,h6{font:inherit;margin:0}
a{color:#000;text-decoration:underline;text-decoration-thickness: 0.9px;text-underline-offset:.1em}
ul{list-style:none;margin:0;padding:0}
ul li {
  margin-bottom: .6em;
  padding-left: .85em;
  text-indent: -.85em;
}
ul li::before{content:"-";margin-right:.3em}
p{margin:0 0 .6em}

.container{max-width:var(--max-w);margin:0}
.section{margin-bottom:2rem}
.header{margin:0 0 .3em}

.content{display:flex;flex-direction:column;gap:var(--row-gap)}
@media(min-width:700px){
  .content{flex-direction:row;gap:var(--col-gap)}
  .content>div{width:50%}
}
:lang(en),.english{letter-spacing:.01em}

/* ======= 蔵書リスト用 ======= */
#library{margin-top:2rem}
#library .columns{display:flex;flex-direction:column;gap:1.5rem}
@media(min-width:700px){
  #library .columns{flex-direction:row}
  #library .columns>div{width:50%}
}
#library h3{
  font-weight:300;font-size:inherit;margin:0 0 .4em;
}

.book-table{
  width:100%;table-layout:fixed;border-collapse:collapse;font-size:.8rem;
  border-spacing: 1em 0;
}
.book-table th,
.book-table td {
  padding-left: 0.5em;
  padding-right: 0.5em;
  padding-top: .35em;
  padding-bottom: .35em;
  border-bottom: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.book-table th:first-child,
.book-table td:first-child { padding-left: 0; }
.book-table th:last-child,
.book-table td:last-child { padding-right: 0; }

.book-table th{
  cursor:pointer;
  border-bottom: 1.2px solid #000;
  text-align:left;
  font-weight:300;
}

.book-table th:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.9px;
  text-underline-offset: .1em;
}
.book-table tbody tr:hover td:first-child {
  text-decoration: underline;
  text-decoration-thickness: 0.9px;
  text-underline-offset: .1em;
}
.book-table th[data-dir="asc"],
.book-table th[data-dir="desc"] {
  text-decoration: underline;
  text-decoration-thickness: 0.9px;
  text-underline-offset: .1em;
}

.book-table th[data-dir="asc"]::after{ content:"▲"; margin-left:.25em; font-size:.65em; }
.book-table th[data-dir="desc"]::after{ content:"▼"; margin-left:.25em; font-size:.65em; }

.book-table th:nth-child(1), .book-table td:nth-child(1){width:40%}
.book-table th:nth-child(2), .book-table td:nth-child(2){width:15%}
.book-table th:nth-child(3), .book-table td:nth-child(3){width:10%}
.book-table th:nth-child(4), .book-table td:nth-child(4){width:15%}
.book-table th:nth-child(5), .book-table td:nth-child(5){width:20%}

.notice{font-size:.75rem;color:#666;margin:.3em 0}

@media(max-width:699px){
    .book-table th:nth-child(5), .book-table td:nth-child(5){display:none;}
    .book-table th:nth-child(4), .book-table td:nth-child(4){display:none;}
}

.book-table tr.expanded-row td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-break: strict;
  word-break: keep-all;
  overflow-wrap: break-word;
  vertical-align: top;
}

/* ====== Hover Preview Overlay (プレースホルダーなし版) ====== */
.hover-preview{
  position: fixed;
  z-index: 9999;
  inset: auto var(--outer-m) var(--outer-m) auto;
  max-height: 85vh;
  pointer-events: none;
  background: rgba(255,255,255,.92);
  opacity: 0;
  width: 35vw;
  transition: opacity 80ms ease;
}

.hover-preview.is-visible{
  opacity: 1;
}

.hover-preview img{
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 1;
}

/* 読み込み中：何も表示しない */
.hover-preview.is-loading img {
  opacity: 0;
}

@media(max-width:699px){
  .hover-preview{ display:none !important; }
}
@media(min-width:700px){
  .hover-preview.is-portrait{ width: 28vw; }
  .hover-preview.is-landscape{ width: 42vw; }
}

.hover-preview.top-right   { inset: var(--outer-m) var(--outer-m) auto auto; }
.hover-preview.bottom-right{ inset: auto var(--outer-m) var(--outer-m) auto; }
.hover-preview.top-left    { inset: var(--outer-m) auto auto var(--outer-m); }
.hover-preview.bottom-left { inset: auto auto var(--outer-m) var(--outer-m); }

[data-preview]{ outline-offset: 2px; }
[data-preview]:focus{ outline: 1px dashed #000; }

/* ====== No image fallback ====== */
.hover-preview.is-no-image {
  width: auto;
  background: transparent;
}
.hover-preview.is-no-image img {
  display: none;
}
.hover-preview.is-no-image::before {
  content: "No image available.";
  display: block;
  font: 300 .85rem/1.6 "univers-next-pro","hiragino-kaku-gothic-pron",sans-serif;
  letter-spacing: .01em;
  color: #000;
}
