/* 図鑑サイト本体。色・余白・文字サイズは common.css の変数のみ（仕様書 6章） */
.z-body { background: var(--bg-page); color: var(--text-main); font-family: var(--font); margin: 0; line-height: 1.6; }
.z-body.is-open { overflow: hidden; }
.z-wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--s2); }

/* ヘッダー */
.z-head { padding: var(--s6) 0 var(--s4); }
.z-eyebrow { margin: 0 0 var(--s1); }
.z-count { display: inline-block; background: var(--accent-dark); color: #fff; font-size: var(--fs-label); font-weight: 700; line-height: 16px; padding: 4px var(--s2); border-radius: var(--r-pill); }
.z-head .t-head { margin: 0 0 var(--s2); }
.z-lead { margin: 0; max-width: 560px; }

/* 一覧（行ごとに番号順。スマホ2列／タブレット3列／PC4列） */
.z-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
@media (min-width: 640px) { .z-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .z-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); } }

.z-grid > li { display: flex; }
.z-card { flex: 1; display: flex; flex-direction: column; gap: var(--s1); width: 100%; min-height: 44px; margin: 0; padding: var(--s1); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-md); text-align: left; font: inherit; color: inherit; cursor: pointer; }
.z-card:focus-visible, .z-iconbtn:focus-visible, .z-btn:focus-visible { outline: 3px solid var(--main-dark); outline-offset: 2px; }
.z-thumb { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-sm); overflow: hidden; background: var(--bg-sunk); }
.z-thumb video, .z-detail__video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--bg-sunk); }
.z-cardmeta { display: flex; align-items: center; gap: var(--s1); padding: 0 var(--s1); }
.z-pill { display: inline-block; flex: none; background: var(--accent-light); color: var(--accent-deep); font-size: var(--fs-label); font-weight: 700; line-height: 16px; padding: 4px var(--s1); border-radius: var(--r-pill); }
.z-cardmeta .z-en { font-size: var(--fs-label); color: var(--text-sub); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.z-cardname { margin: 0; padding: 0 var(--s1); font-size: var(--fs-body); font-weight: 700; line-height: 1.4; }
@media (max-width: 1023px) { .z-cardmeta .z-en { display: none; } }
.z-cardone { margin: 0; padding: 0 var(--s1) var(--s1); font-size: var(--fs-label); color: var(--text-sub); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.z-foot { margin-top: var(--s8); padding: var(--s4) 0 var(--s6); border-top: 1px solid var(--border); font-size: var(--fs-label); }

/* 詳細：スマホ=ボトムシート／PC=右パネル */
.z-overlay { position: fixed; inset: 0; background: rgba(43, 43, 43, .48); z-index: 20; }
.z-overlay[hidden] { display: none; }
.z-detail { position: fixed; z-index: 30; background: var(--bg-card); display: flex; flex-direction: column; visibility: hidden; transition: transform .24s ease, visibility 0s .24s;
  left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; transform: translateY(100%); }
.z-detail.is-open { visibility: visible; transform: none; transition: transform .24s ease; }
@media (min-width: 1024px) {
  .z-detail { left: auto; top: 0; right: 0; bottom: 0; width: 440px; max-height: none; border-radius: var(--r-lg) 0 0 var(--r-lg); transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) { .z-detail, .z-detail.is-open { transition: none; } }
.z-detail__bar { display: flex; align-items: center; gap: var(--s1); padding: var(--s1) var(--s2); border-bottom: 1px solid var(--border); }
.z-iconbtn { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg-card); color: var(--text-main); font: inherit; font-size: var(--fs-title); line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.z-iconbtn--close { margin-left: auto; }
.z-iconbtn:disabled { opacity: .4; cursor: default; }
.z-detail__scroll { overflow-y: auto; overscroll-behavior: contain; padding: var(--s2); }
.z-detail__video { position: relative; aspect-ratio: 9 / 16; max-height: 56vh; max-height: 56dvh; margin: 0 auto; border-radius: var(--r-md); overflow: hidden; background: var(--bg-sunk); }
.z-detail__body { padding-top: var(--s2); display: flex; flex-direction: column; gap: var(--s1); }
.z-meta { display: flex; align-items: center; gap: var(--s1); margin: 0; }
.z-badge { display: inline-block; background: var(--main-dark); color: #fff; font-size: var(--fs-label); font-weight: 700; line-height: 16px; padding: 4px var(--s1); border-radius: var(--r-pill); }
.z-badge.is-heavy { background: var(--accent-dark); }
.z-detail__body .t-title { margin: 0; }
.z-detail__body .z-en { margin: 0; font-size: var(--fs-label); }
.z-one { margin: var(--s1) 0 0; font-size: var(--fs-body); }
.z-scene { margin: var(--s1) 0 var(--s2); padding: var(--s2); background: var(--bg-sunk); border-radius: var(--r-md); }
.z-scene dt { font-size: var(--fs-label); color: var(--text-sub); margin: 0 0 var(--s1); }
.z-scene dd { margin: 0; font-size: var(--fs-body); font-weight: 700; }
.z-btn { position: sticky; bottom: 0; box-shadow: 0 0 0 var(--s1) var(--bg-card); display: flex; align-items: center; justify-content: center; min-height: 48px; background: var(--accent-dark); color: #fff; border-radius: var(--r-pill); font-size: var(--fs-body); font-weight: 700; text-decoration: none; padding: 0 var(--s4); }
