/* =========
   Base
========= */
:root{
  --bg:#fff;
  --ink:#111;
  --muted:#666;
  --line:rgba(0,0,0,.18);
  --link:#e24a78;
  --linkHover:#c83862;

  --max:980px;

  /* indent scale */
  --i1:24px;  /* section body */
  --i2:16px;  /* block inner */
  --i3:20px;  /* category */
  --i4:16px;  /* cp -> thumbs */
}

*{ box-sizing:border-box; }

/* スムーススクロール + sticky header のアンカー補正 */
html{
  scroll-behavior:smooth;
  scroll-padding-top:44px; /* 40〜48pxで微調整可 */
}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", Arial, sans-serif;
  line-height:1.65;
}

a{ color:var(--link); }
a:hover{ color:var(--linkHover); }
.muted{ color:var(--muted); }

.container{
  width:min(var(--max), 100%);
  margin:0 auto;
  padding:0 16px 60px;
}

/* =========
   Header / Nav
========= */
.header{
  position:sticky;
  top:0;
  z-index:20;
  background:#fff;
  border-bottom:1px solid var(--line);
}
.header__inner{
  width:min(var(--max), 100%);
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.siteTitle{
  text-decoration:none;
  font-weight:700;
  letter-spacing:.08em;
  color:var(--ink);
}
.nav{
  display:flex;
  gap:10px;
}
.nav__link{
  text-decoration:none;
  font-size:12px;
  letter-spacing:.12em;
  padding:6px;
  color:var(--ink);
}
.nav__link:hover{
  text-decoration:underline;
  text-underline-offset:3px;
}

/* =========
   Hero
========= */
.hero img{
  width:100%;
  height:auto;
  display:block;
}

/* =========
   Section
========= */
.section{
  margin-top:42px;
  margin-bottom:42px;
}

#about{
  border-top:1px solid #111;
  margin-top:0;
}

.section__title{
  display:block;
  width:100%;
  padding:6px 10px;
  margin:0;
  font-size:16px;
  font-weight:700;
  background-color:#111;
  color:#fff;
}

/* 左右均等 */
.section__body{
  margin-top:14px;
  padding:0 var(--i1);
}

/* =========
   About
========= */
.noticeBlock{
  margin-top:16px;
  padding-left:var(--i2);
}
.noticeTitle{
  margin:10px 0 8px;
  padding-left:10px;
  border-left:4px solid #000;
  font-weight:800;
}
.noticeBlock ul{
  margin:0;
  padding-left:22px;
}
.noticeBlock li{ margin:4px 0; }

.historyBlock{
  margin-top:18px;
  padding-left:var(--i2);
}
.subHead{
  font-size:15px;
  font-weight:700;
  margin:0 0 8px;
}

.historyBox{
  margin-top:8px;
  border:1px solid var(--line);
  padding:10px 12px;
  max-height:140px;
  overflow:auto;
}
.historyList{
  margin:0;
  padding:0;
  list-style:none;
}
.historyList li{
  padding:6px 0;
  border-bottom:1px dashed rgba(0,0,0,.18);
}
.historyList li:last-child{ border-bottom:none; }

/* =========
   Banner
========= */
.bannerBlock{
  margin-top:16px;
  padding-left:var(--i2);
  display:grid;
  grid-template-columns:180px 1fr;
  gap:12px;
}
.bannerBlock img{
  width:180px;
  border:1px solid var(--line);
}
.bannerMeta{ margin:0; }
.bannerMeta div{
  display:grid;
  grid-template-columns:72px 1fr;
  gap:8px;
  padding:4px 0;
}
.bannerMeta dt{ color:var(--muted); }
.bannerMeta dd{ margin:0; }

/* =========
   Gallery hierarchy
========= */

.category{
  margin-top:18px;
  margin-bottom:48px;
  padding-left:0;
}
.categoryTitle{
  margin:0 0 6px;
  padding-bottom:4px;
  font-size:16px;
  font-weight:900;
}
.categoryTitle::after{
  content:"";
  display:block;
  margin-top:5px;
  height:1px;
  width:100%;
  background:rgba(0,0,0,.28);
}

.cp{
  margin-top:8px;
  padding-left:0;
  margin-bottom:14px;
}
.cpTitle{
  margin:0 0 4px;
  font-size:13px;
  font-weight:700;
}
.cpTitle::before{
  content:"•";
  margin-right:6px;
}

.thumbGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill,50px);
  gap:5px;
}

.thumb{
  position:relative;
  width:50px;
  height:50px;
  border:1px solid var(--line);
  background:#fff;
  overflow:hidden;
  cursor:pointer;
}
.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}
.thumb.is-blur img{
  filter: blur(10px) brightness(.92);
  transform: scale(1.05);
}
.badge{
  position:absolute;
  top:1px;
  left:1px;
  padding:0 3px;
  font-size:9px;
  font-weight:800;
  background:#000;
  color:#fff;
  border-radius:2px;
}

/* =========
   Lightbox（初回：全体表示 / タップ：拡大）
   ※カード全面＝画像（下部情報なし）
========= */
.lightbox{
  position:fixed;
  inset:0;
  display:none;
  z-index:999;
}
.lightbox[aria-hidden="false"]{ display:block; }

.lightbox__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
}

/* カード */
.lightbox__panel{
  position:relative;
  width:min(1100px, calc(100% - 16px));
  height:calc(100svh - 16px);
  margin:8px auto;
  background:#000;
  border:1px solid var(--line);
  padding:0;
  overflow:hidden;
}

.lightbox__close{
  position:absolute;
  top:8px;
  right:8px;
  width:38px;
  height:38px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  z-index:2;
}

/* 画像エリア（スクロール） */
.lightbox__imgWrap{
  position:absolute;
  inset:0;
  overflow:auto;
  -webkit-overflow-scrolling: touch;
}

/* 初期(ズームOFF)は stage を “画面サイズ” に固定して、初回は必ずfitさせる */
.lightbox__stage{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ズーム中は stage を “中身サイズ” にしてスクロールできるようにする */
.lightbox.is-zoom .lightbox__stage{
  width:max-content;
  height:max-content;
  min-width:100%;
  min-height:100%;
  align-items:flex-start;   /* 上から見たい */
  justify-content:center;   /* 左寄せにしない */
}

/* 初回：必ず全体表示（縮小して収める） */
.lightbox__img{
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
  cursor:zoom-in;
}

/* ズーム中：JSがpx指定するので、上限を外す */
.lightbox.is-zoom .lightbox__img{
  max-width:none;
  max-height:none;
  cursor:zoom-out;
}

/* =========
   Footer
========= */
.footer{
  margin-top:40px;
  text-align:center;
  color:var(--muted);
}

/* =========
   Responsive
========= */
@media (max-width:600px){
  :root{
    --i1:14px;
    --i2:10px;
    --i3:12px;
    --i4:10px;
  }

  .bannerBlock{
    grid-template-columns:1fr;
  }
  .bannerBlock img{
    max-width:240px;
  }

  .thumbGrid{
    grid-template-columns:repeat(auto-fill,72px);
    gap:6px;
  }
  .thumb{
    width:72px;
    height:72px;
  }

  .lightbox__panel{
    width:calc(100% - 12px);
    height:calc(100svh - 12px);
    margin:6px auto;
  }

  /* スマホは左右paddingを弱める */
  .section__body{
    padding:0 14px;
  }
}

/* =========
   Gate page（崩れ対策・固定）
========= */
body.gatePage{
  background: var(--bg);
}

.gate{
  min-height: 100svh;
  display: grid;
  place-items: start center;
  padding: 72px 16px 40px;
}

.gate__wrap{
  width: min(760px, 100%);
}

.gate__banner{
  margin: 0 0 16px 0;
}
.gate__banner img{
  display: block;
  max-width: 100%;
  height: auto;
}

.gate__panel{
  text-align: left;
}
.gate__text{
  margin: 0 0 12px;
}
.gate__q{
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
}

.gate__row{
  display: flex;
  gap: 10px;
  align-items: center;
}

.gate__input{
  flex: 1;
  min-width: 0;
  padding: 12px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color:var(--ink);
}

.gate__btn{
  padding: 12px 16px;
  border: 1px solid var(--line);
  background:#111;
  color:#fff;
  cursor: pointer;
}
.gate__btn:hover{
  filter: brightness(1.05);
}

.gate__hint{
  margin: 10px 0 0;
  font-size: 12px;
}

.gate__error{
  margin: 10px 0 0;
  color: #b00020;
  font-weight: 800;
}

/* =========
   Profile（サイト主）
========= */
.profileImg{
  width:100px;
  height:100px;
  object-fit:contain;
  display:block;
  margin-bottom:12px;
  border-radius:50%;
}

@media (max-width: 600px){
  .gate{
    padding: 42px 16px 36px;
  }
  .gate__row{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .gate__btn{
    width: 100%;
  }
}