/* ============================================================
   作品の詳細（小窓）。GALLERY と TOP の PICK UP で共用。ui.css の直後に読む
   ============================================================ */

/* ---------- 作品の詳細 ---------- */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-bg { position: absolute; inset: 0; background: rgba(74, 68, 61, .5); }
.modal-sheet {
  position: relative; width: 100%; max-width: 940px; max-height: calc(100vh - 56px); overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); gap: 30px; padding: 44px 36px 36px;
  background: var(--white); border-radius: 40px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.modal-bg { animation: fadeIn .3s ease; }
.modal-sheet { animation: popIn .45s var(--ease-pop); }
.modal-bar { position: absolute; left: 38px; top: 14px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--ink-soft); }
.modal-bar .mo-i { --s: 12px; --c: var(--sky-deep); }
.modal-img img { display: block; width: 100%; height: auto; max-height: calc(100vh - 150px); object-fit: contain; border-radius: 24px; background: var(--sky-pale); }
.m-title { margin: 0; font-weight: 700; font-size: 23px; line-height: 1.5; letter-spacing: .03em; color: var(--brown); word-break: keep-all; overflow-wrap: anywhere; }
.m-date { font-family: var(--f-en); font-weight: 600; font-size: 16px; letter-spacing: .1em; color: var(--ink-soft); margin: 4px 0 12px; }
.modal .chip { cursor: default; background: var(--sky-pale); box-shadow: none; color: var(--ink); min-height: 30px; padding: 0 14px; font-size: 13px; }
.modal button.chip { cursor: pointer; }
.modal button.chip:hover { background: var(--sky); }
.m-rows { margin: 18px 0; display: grid; gap: 14px; }
.m-row dt { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; letter-spacing: .04em; line-height: 1.4; }
.m-row dd { margin: 0; }
.m-link { color: var(--brown); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.m-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.m-btns .btn-ghost { background: var(--sky-pale); box-shadow: none; }
.m-desc { font-size: 14px; line-height: 1.9; margin-bottom: 20px; }
.m-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 10px; }
.m-extra { display: grid; gap: 12px; }
.m-extra img, .m-extra video { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--sky-pale); }
.m-extra .yt-box { border-radius: 16px; }
.m-extra .zoom-btn { border-radius: 16px; }
.modal-prev, .modal-next, .modal-close {
  position: fixed; z-index: 2; width: 54px; height: 54px; border-radius: 50%; background: var(--white); color: var(--brown);
  box-shadow: 0 14px 30px -18px rgba(74, 68, 61, .6), inset 0 0 0 2px var(--sky-soft);
  font-family: var(--f-en); font-weight: 600; font-size: 28px; line-height: 1; display: grid; place-items: center; padding-bottom: 4px;
  transition: transform .25s var(--ease-pop);
}
.modal-prev:hover, .modal-next:hover { transform: scale(1.08); }
.modal-close:hover { transform: rotate(90deg); }
.modal-prev:disabled, .modal-next:disabled { opacity: .35; cursor: default; transform: none; }
.modal-prev .tx, .modal-next .tx { display: none; }
.modal-prev { left: 24px; top: 50%; margin-top: -27px; }
.modal-next { right: 24px; top: 50%; margin-top: -27px; }
.modal-close { right: 24px; top: 20px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
@keyframes riseIn { from { transform: translateY(100%); } }

@media (max-width: 920px) {
  .modal-sheet { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-bg { background: rgba(74, 68, 61, .55); }
  .modal-sheet { max-height: 92vh; border-radius: 32px 32px 0 0; padding: 40px 20px 28px; gap: 18px; animation: riseIn .4s ease; }
  .modal-img img { max-height: 62vh; }
  .modal-bar { left: 20px; }
  .m-title { font-size: 20px; }
  .modal-prev, .modal-next, .modal-close { width: 46px; height: 46px; font-size: 24px; top: 8px; margin-top: 0; }
  /* 左上はヘッダーのロゴに重なるので、閉じるの左に並べる。閉じるはメニューのボタンと同じ位置にして、後ろのボタンを隠す */
  .modal-prev { left: auto; right: 120px; }
  .modal-next { right: 68px; }
  .modal-close { right: 16px; }
  body.modal-open .hd .btn-contact { visibility: hidden; }
}
