/* =====================================
   写真ページ専用スコープ
   カテゴリ大タイル + 写真小タイル
===================================== */

/* ★ ブラウザ初期余白の完全除去 */
html, body {
  margin: 0;
  padding: 0;
}

/* 外枠 */
.photos-page {
  font-family: "Yu Gothic", sans-serif;
  background: #f7f7f7;
  padding-top: 0.1px; /* margin-collapse 防止 */
}

/* 中身 */
.photos-page-inner {
  max-width: 1040px;          /* ★ 少しだけ広げる */
  margin: 0 auto;
  padding: 32px 20px 0;
  box-sizing: border-box;
}

/* ページ見出し */
.photos-page h1 {
  margin-top: 0 !important;
  font-size: 30px;
  border-bottom: 3px solid #ddd;
  padding-bottom: 10px;
  margin-bottom: 40px;
}

/* =========================
   カテゴリカード（大タイル）
========================= */
.photos-page .category-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 44px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* カテゴリ見出し */
.photos-page .category-card h3 {
  margin: 0 0 22px;
  border-left: 5px solid #999;
  padding-left: 14px;
  font-size: 24px;
}

/* =========================
   写真タイル群（横並び）
========================= */
.photos-page .category-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* ★ 主役感 */
  gap: 16px;
}

/* 写真タイル（小） */
.photos-page .photo-tile {
  background: #fdfdfd;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* 写真 */
.photos-page .photo-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;   /* 正方形 */
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
}

/* hover */
.photos-page .photo-tile:hover img {
  filter: brightness(0.95);
  transform: scale(1.02);
}

/* =========================
   スマホ
========================= */
@media (max-width: 600px) {

  .photos-page-inner {
    padding: 20px 12px 0;
  }

  .photos-page h1 {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .photos-page .category-card {
    padding: 16px;
    margin-bottom: 32px;
  }

  .photos-page .category-card h3 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .photos-page .category-photos {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }
}

/* =========================
   写真拡大モーダル
========================= */

/* デフォルトは非表示 */
.photo-modal {
  display: none;
}

/* hidden が外れたときだけ表示 */
.photo-modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
}

.photo-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #111;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  z-index: 1;
}

/* 上部バー */
.photo-modal-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.photo-save {
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  opacity: .85;
}

.photo-save:hover {
  opacity: 1;
  text-decoration: underline;
}

.photo-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

/* 画像 */
#photoModalImg {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}

/* キャプション */
#photoModalCaption {
  margin-top: 10px;
  font-size: 14px;
  opacity: .85;
}

