/* =========================================================
   09. GALLERY — 専用CSS。既存の漫画・NEWSには干渉しません。
   ========================================================= */
#gallery.rg-gallery{background:#e9e9e6;color:#171717;padding:90px 0 110px}
.rg-gallery-inner{width:min(90%,1500px);margin:0 auto}
.rg-gallery-heading{display:flex;justify-content:space-between;align-items:end;gap:20px;margin-bottom:32px}
.rg-gallery-kicker{font-size:11px;font-weight:800;letter-spacing:.22em;color:#7544b8;margin-bottom:12px}
.rg-gallery-heading h2{margin:0;font-size:clamp(52px,6vw,90px);line-height:.94;font-weight:900;letter-spacing:-.05em}
.rg-gallery-description{color:#777;font-size:14px;margin-top:16px}
.rg-gallery-all-link{color:#111;text-decoration:none;border-bottom:2px solid #7544b8;padding-bottom:6px;font-size:12px;font-weight:800;letter-spacing:.1em;white-space:nowrap}
.rg-gallery-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.rg-gallery-card{display:block;position:relative;border:0;padding:0;background:#d7d7d5;cursor:pointer;overflow:hidden;aspect-ratio:4/5;min-width:0;text-align:left}
.rg-gallery-card img{display:block;width:100%;height:100%;object-fit:cover;object-position:center;transition:transform .4s ease}
.rg-gallery-card:hover img{transform:scale(1.035)}
.rg-gallery-card:focus-visible{outline:3px solid #7544b8;outline-offset:3px}
.rg-gallery-tag{position:absolute;bottom:0;left:0;right:0;padding:24px 12px 10px;color:#fff;font-size:10px;font-weight:800;letter-spacing:.15em;background:linear-gradient(transparent,rgba(0,0,0,.72))}
.rg-gallery-empty{grid-column:1/-1;color:#777;padding:35px 0}
.rg-gallery-filters{display:flex;flex-wrap:wrap;gap:9px;margin:20px 0 28px}
.rg-gallery-filters button{border:1px solid #c4c4c4;background:transparent;color:#444;padding:9px 14px;font-size:11px;font-weight:800;letter-spacing:.08em;cursor:pointer}
.rg-gallery-filters button.active,.rg-gallery-filters button:hover{background:#19191d;border-color:#19191d;color:#fff}
.rg-gallery-page{min-height:100vh;background:#e9e9e6}
.rg-gallery-page-header{padding:20px 5%;background:#19191d;color:#fff}
.rg-gallery-page-header a{color:#fff;text-decoration:none;font-size:12px;font-weight:800;letter-spacing:.12em}
.rg-gallery-page #gallery.rg-gallery{padding-top:65px}
.rg-gallery-lock{overflow:hidden}
.rg-gallery-modal[hidden]{display:none}
.rg-gallery-modal{position:fixed;inset:0;z-index:9999;background:rgba(10,10,13,.95);display:flex;align-items:center;justify-content:center;padding:50px}
.rg-gallery-modal img{display:block;max-width:100%;max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px);object-fit:contain}
.rg-gallery-close{position:absolute;right:18px;top:10px;border:0;background:transparent;color:white;font-size:40px;cursor:pointer;line-height:1.2}
@media(max-width:900px){.rg-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){main section#gallery.rg-gallery{padding:70px 7% 85px}.rg-gallery-inner{width:100%}.rg-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.rg-gallery-heading{align-items:start}.rg-gallery-all-link{font-size:10px}.rg-gallery-modal{padding:42px 12px}}

/* =========================================================
   GALLERY VIEWER v2 — 前後移動・スワイプ・カウンター
   ========================================================= */
.rg-gallery-modal{touch-action:pan-y;overscroll-behavior:contain}
.rg-gallery-modal img{user-select:none;-webkit-user-select:none}
.rg-gallery-prev,.rg-gallery-next{
  position:absolute;top:50%;transform:translateY(-50%);z-index:2;
  width:48px;height:64px;border:0;border-radius:6px;
  background:rgba(255,255,255,.12);color:#fff;font-size:46px;
  line-height:1;cursor:pointer;
}
.rg-gallery-prev{left:12px}
.rg-gallery-next{right:12px}
.rg-gallery-prev:hover,.rg-gallery-next:hover{background:rgba(255,255,255,.25)}
.rg-gallery-prev:disabled,.rg-gallery-next:disabled{opacity:.2;cursor:default}
.rg-gallery-prev:focus-visible,.rg-gallery-next:focus-visible,.rg-gallery-close:focus-visible{outline:2px solid #c3a1ff;outline-offset:3px}
.rg-gallery-counter{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);color:#fff;background:rgba(0,0,0,.35);padding:4px 12px;border-radius:20px;font-size:12px;letter-spacing:.08em;pointer-events:none}
@media(max-width:600px){
  .rg-gallery-prev,.rg-gallery-next{width:28px;height:56px;font-size:32px;background:rgba(0,0,0,.25)}
  .rg-gallery-prev{left:0}.rg-gallery-next{right:0}
  .rg-gallery-modal img{max-width:calc(100% - 30px)}
}
