/* 全投稿一覧表示(M5b)。Figma 87:906(PC) / 87:1464(ホバー) / 87:2036(スマホ)。赤い背景に、傾けたカードを散らす。 */
:root { --g-red: #e6003c; --g-head: 128px; }
.gallery-page { margin: 0; background: var(--g-red); overflow-x: hidden; }
.gallery-list { background: #fff; }

/* ヘッダー: 戻る(白いピル)・タイトル・件数・絞り込み */
.g-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--g-head); background: var(--g-red); color: #fff; }
.g-back { position: absolute; left: clamp(12px, 2.2vw, 32px); top: 18px; display: inline-flex; align-items: center; gap: 4px; background: #fff; color: var(--g-red) !important; font-weight: 700; font-size: 14px; text-decoration: none; padding: 8px 18px; border-radius: 999px; white-space: nowrap; }
.g-back-short { display: none; }
.g-post { position: absolute; right: clamp(12px, 2.2vw, 32px); top: 18px; display: inline-flex; align-items: center; background: #fff; color: var(--g-red) !important; font-weight: 900; font-size: 14px; text-decoration: none; padding: 8px 22px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.g-post:hover { background: #ffe9ef; }
.g-head { text-align: center; padding-top: 12px; }
.g-title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: .02em; }
.g-sub { margin: 2px 0 0; font-size: 12px; opacity: .92; }
.g-filters { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; padding: 6px 8px; background: #fff; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.18); max-width: calc(100vw - 24px); overflow-x: auto; scrollbar-width: none; }
.g-filters::-webkit-scrollbar { display: none; }
.g-filters button { flex: none; border: 2px solid var(--g-red); background: #fff; color: var(--g-red); font: inherit; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 3px 16px; cursor: pointer; white-space: nowrap; }
.g-filters button[aria-pressed="true"] { background: var(--g-red); color: #fff; }
.g-filters button:focus-visible, .g-controls button:focus-visible, .g-back:focus-visible, .g-post:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }

/* ステージ(ヘッダーの下いっぱい) */
.g-stage-wrap { position: fixed; inset: var(--g-head) 0 0 0; overflow: hidden; }
.g-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; outline: none; }
.g-stage.dragging { cursor: grabbing; }
.g-stage canvas { display: block; width: 100%; height: 100%; }
.g-controls { position: absolute; right: 18px; bottom: 22px; z-index: 10; display: flex; flex-direction: column; gap: 10px; }
.g-controls button { width: 48px; height: 48px; border: 0; background: #fff; color: var(--g-red); font-size: 24px; font-weight: 700; border-radius: 50%; cursor: pointer; line-height: 1; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.g-hint { position: absolute; left: 18px; bottom: 18px; z-index: 10; margin: 0; max-width: calc(100% - 100px); background: rgba(255,255,255,.94); color: #444; font-size: 12px; padding: 7px 16px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.g-hint-sp { display: none; }
.g-empty { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; color: #fff; font-weight: 700; }
.g-empty[hidden] { display: none; }
.g-empty .btn-primary { background: #fff; color: var(--g-red); border-color: #fff; }
.g-noscript { padding: 80px 20px; text-align: center; color: #fff; }
.g-noscript .link { color: #fff; }

/* 拡大カードの表示中に、ほかを赤く沈める膜 */
.g-veil { position: absolute; inset: 0; z-index: 12; background: rgba(230, 0, 60, .58); opacity: 0; pointer-events: none; transition: opacity .15s; }
.g-veil.on { opacity: 1; pointer-events: auto; }

/* 拡大カード(ホバー/タップ): 画像・コメント・SNS共有・PNG保存 */
.g-card { position: absolute; z-index: 15; width: min(360px, 86vw); background: #fff; border: 3px solid var(--g-red); padding: 12px 12px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.4); display: none; }
.g-card.show { display: block; }
.g-card-close { position: absolute; right: -14px; top: -14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--g-red); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.g-card-close:focus-visible { outline: 3px solid #1a73e8; outline-offset: 2px; }
.g-card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; background: #f3f3f3; }
.g-card p { margin: 10px 0 12px; font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.g-card-actions { display: flex; gap: 8px; justify-content: flex-end; position: relative; flex-wrap: wrap; }

/* 静的な一覧(WebGLなし・動きを減らす設定): 白い背景 */
.gallery-list .g-bar { height: 76px; }
.gallery-list .g-list { max-width: 1120px; margin: 0 auto; padding: 100px 20px 48px; }
.g-count { color: var(--muted); text-align: center; margin: 0 0 16px; }
.g-pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 28px 0 8px; }
.g-note { text-align: center; font-size: 13px; }
.link { color: var(--red); font-weight: 700; }
.gallery-list .g-bar { background: var(--g-red); }

@media (max-width: 700px) {
  :root { --g-head: 118px; }
  .g-back { top: 12px; padding: 6px 14px; font-size: 13px; }
  .g-post { top: 12px; padding: 6px 14px; font-size: 13px; }
  .g-back-long { display: none; } .g-back-short { display: inline; }
  .g-title { font-size: 20px; }
  .g-filters { bottom: 10px; justify-content: flex-start; }
  .g-hint-pc { display: none; } .g-hint-sp { display: inline; }
  .g-hint { left: 12px; bottom: 14px; max-width: calc(100% - 84px); font-size: 11px; padding: 6px 12px; }
  .g-controls { right: 12px; bottom: 16px; } .g-controls button { width: 44px; height: 44px; }
  .gallery-list .cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding: 0; }
  .gallery-list .card { flex: none; }
}
