/* トップ物件カードのギャラリーモーダル（画面設計書 2026-10-05 第3版 2章）。js: javascript/top-gallery.js。
   色は暫定値（フッター #1a3a4a 系の深い青）。最終値は web-designer 確認事項 */
.gm-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* 背面のスクロールロック（property.css の同名ルールと同じ。トップでは property.css を読まないためここに置く） */
html.modal-open{overflow:hidden}
html.modal-open .fixed-cta{right:var(--sbw,0px)}
body.gallery-open .fixed-cta{display:none}

dialog.gm{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;background:rgba(15,32,42,.96);color:#fff;overflow:hidden;font-family:inherit}
dialog.gm[open]{display:flex;flex-direction:column}
dialog.gm::backdrop{background:rgba(15,32,42,.96)}
.gm-bar{flex:none;height:56px;display:flex;align-items:center;justify-content:space-between;padding:0 16px}
.gm-count{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;letter-spacing:.04em;color:#fff}
.gm-btn{display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:rgba(255,255,255,.14);color:#fff;cursor:pointer;font-family:inherit;padding:0;-webkit-tap-highlight-color:transparent}
.gm-btn:focus-visible{outline:3px solid #fff;outline-offset:2px}
.gm-close{width:44px;height:44px}
.gm-close svg{width:20px;height:20px}
.gm-main{position:relative;flex:1;min-height:0;display:flex}
.gm-stage{flex:1;min-width:0;display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x pinch-zoom;-webkit-overflow-scrolling:touch;list-style:none;margin:0;padding:0}
.gm-stage::-webkit-scrollbar{display:none}
.gm-slide{flex:0 0 100%;min-width:0;scroll-snap-align:center;scroll-snap-stop:always;display:flex;align-items:center;justify-content:center;position:relative;list-style:none}
.gm-slide img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;opacity:0;transition:opacity .15s}
.gm-slide.gm-ready img{opacity:1}
.gm-slide.gm-loading::after{content:"";position:absolute;left:50%;top:50%;width:32px;height:32px;margin:-16px 0 0 -16px;border:3px solid rgba(255,255,255,.25);border-top-color:#fff;border-radius:50%;opacity:0;animation:gm-spin .8s linear infinite,gm-show 0s linear .2s forwards}
@keyframes gm-spin{to{transform:rotate(360deg)}}
@keyframes gm-show{to{opacity:1}}
.gm-error{display:flex;flex-direction:column;align-items:center;gap:12px;font-size:14px;padding:0 24px;text-align:center}
.gm-retry{min-height:44px;padding:0 20px;border:1px solid rgba(255,255,255,.6);border-radius:8px;background:transparent;color:#fff;font-size:14px;font-family:inherit;cursor:pointer}
.gm-retry:focus-visible{outline:3px solid #fff;outline-offset:2px}
.gm-nav{position:absolute;top:50%;margin-top:-22px;width:44px;height:44px;font-size:26px;line-height:1;background:rgba(0,0,0,.5);box-shadow:0 0 0 1px rgba(255,255,255,.25);z-index:2}
.gm-prev{left:8px}
.gm-next{right:8px}
.gm-nav[aria-disabled="true"]{opacity:.3;cursor:not-allowed}
.gm-foot{flex:none;display:flex;flex-direction:column;align-items:center;gap:12px;padding:8px 16px max(16px,env(safe-area-inset-bottom))}
.gm-caption{max-width:100%;margin:0;font-size:13px;line-height:1.4;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gm-detail{display:flex;align-items:center;justify-content:center;gap:8px;width:calc(100% - 0px);max-width:400px;height:52px;border-radius:8px;background:#fff;color:#222;font-size:16px;font-weight:600;text-decoration:none;box-sizing:border-box}
.gm-detail span{color:#E61E4D;font-size:20px;line-height:1}
.gm-detail:focus-visible{outline:3px solid #E61E4D;outline-offset:2px}
@media (min-width:768px){
.gm-bar{padding:0 24px}
.gm-count{font-size:16px}
.gm-slide{padding:0 64px}
.gm-nav{width:48px;height:48px;margin-top:-24px;background:rgba(255,255,255,.14);font-size:28px}
.gm-prev{left:24px}
.gm-next{right:24px}
.gm-caption{font-size:14px;margin-top:4px}
.gm-foot{gap:16px;padding-top:12px}
.gm-nav{box-shadow:none}
.gm-detail{width:320px}
}
@media (hover:hover) and (pointer:fine){
.gm-btn:hover{background:rgba(255,255,255,.28)}
}
@media (max-height:480px) and (orientation:landscape){
.gm-bar{height:52px}
.gm-foot{flex-direction:row;justify-content:space-between;gap:16px;padding:6px 16px max(8px,env(safe-area-inset-bottom))}
.gm-caption{text-align:left;flex:1;min-width:0}
.gm-detail{width:220px;height:44px;flex:none}
}
@media (prefers-reduced-motion:reduce){
.gm-slide img{transition:none}
.gm-slide.gm-loading::after{animation:none;opacity:1}
}
.gm [hidden]{display:none!important}

/* 指で操作する端末では前後の矢印を視覚的に隠す（スワイプで送る）。display:none にはせず、フォーカス・スクリーンリーダーからは操作可能のまま */
@media (hover:none) and (pointer:coarse) and (any-hover:none){
.gm-main .gm-nav{width:1px;height:1px;min-width:0;margin:-1px;box-shadow:none;padding:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0;font-size:0;opacity:0}
/* フォーカス時だけ元の大きさで見せる */
.gm-main .gm-nav:focus-visible{width:44px;height:44px;margin:-22px 0 0;overflow:visible;clip:auto;clip-path:none;font-size:26px;opacity:1;box-shadow:0 0 0 1px rgba(255,255,255,.25)}
.gm-main .gm-nav[aria-disabled="true"]:focus-visible{opacity:.3}
@media (min-width:768px){.gm-main .gm-nav:focus-visible{width:48px;height:48px;margin:-24px 0 0;font-size:28px;box-shadow:none}}
}
