/* =========================================================
   05. PHOTO / GALLERY
   写真で見る、楽しい七五三
   /assets/css/shichigosan/05-photo-gallery.css

   方針：
   - 横写真は横らしく、縦写真は縦らしく見せる
   - 重要な部分を極力切らない
   - masonry（組写真）型で自然に並べる
   - HTMLはそのまま使用
   - JSのランダム表示もそのまま使用
========================================================= */

#yp-shichigosan-photo-gallery {
  scroll-margin-top: 120px;
}

.yp-shichigosan-photo-gallery,
.yp-shichigosan-photo-gallery * {
  box-sizing: border-box;
}

.yp-shichigosan-photo-gallery {
  width: 100%;
  margin: 0;
  padding: 96px 0;
  background: #fbfaf8;
  color: #2f2a24;
  overflow: hidden;
}

/* =========================================================
   見出しエリア
========================================================= */

.yp-shichigosan-photo-gallery__inner {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
}

.yp-shichigosan-photo-gallery__head {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(320px, 1fr);
  gap: 54px;
  align-items: start;
  margin-bottom: 64px;
}

.yp-shichigosan-photo-gallery__title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.yp-shichigosan-photo-gallery h2,
.yp-shichigosan-photo-gallery h3 {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-top: 0 !important;
}

.yp-shichigosan-photo-gallery h2::before,
.yp-shichigosan-photo-gallery h2::after,
.yp-shichigosan-photo-gallery h3::before,
.yp-shichigosan-photo-gallery h3::after {
  display: none !important;
  content: none !important;
}

.yp-shichigosan-photo-gallery__label,
.yp-shichigosan-photo-gallery__sub-label,
.yp-shichigosan-photo-gallery__lead p,
.yp-shichigosan-photo-gallery__bottom-text {
  background: none !important;
  box-shadow: none !important;
}

.yp-shichigosan-photo-gallery__label::before,
.yp-shichigosan-photo-gallery__label::after,
.yp-shichigosan-photo-gallery__sub-label::before,
.yp-shichigosan-photo-gallery__sub-label::after,
.yp-shichigosan-photo-gallery__lead p::before,
.yp-shichigosan-photo-gallery__lead p::after,
.yp-shichigosan-photo-gallery__bottom-text::before,
.yp-shichigosan-photo-gallery__bottom-text::after {
  display: none !important;
  content: none !important;
}

.yp-shichigosan-photo-gallery__label {
  margin: 0 0 18px;
  color: #8a7458;
  font-family: "Times New Roman", "Yu Mincho", "YuMincho", serif;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.18em;
}

.yp-shichigosan-photo-gallery__title {
  margin: 0;
  color: #26343d;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.24;
  letter-spacing: 0.12em;
  font-weight: 400;
}

.yp-shichigosan-photo-gallery__sub-label {
  margin: 18px 0 0;
  color: #7a878f;
  font-family: "Times New Roman", "Yu Mincho", "YuMincho", serif;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.12em;
}

.yp-shichigosan-photo-gallery__lead p {
  margin: 0;
  color: #5d6971;
  font-size: 15px;
  line-height: 2.15;
  letter-spacing: 0.04em;
}

/* =========================================================
   ギャラリー本体
   横構図は横、縦構図は縦のまま見せる
========================================================= */

/* ▼▼▼ ギャラリー列数・間隔 調整エリア START ▼▼▼
   columns の数と gap を変えると印象が変わります。
   PC: 4列 / Tablet: 3列 / SP: 2列 を基本にしています。
   ▲▲▲ ギャラリー列数・間隔 調整エリア END ▲▲▲ */

.yp-shichigosan-photo-gallery__grid {
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
  padding: 0;
  column-count: 4;
  column-gap: 14px;
  background: transparent;
  line-height: 0;
}

/* HTMLにある --large / --wide / --tall は
   今回は使わず、すべて自然な縦横比で表示します */
.yp-shichigosan-photo-gallery__item,
.yp-shichigosan-photo-gallery__item--large,
.yp-shichigosan-photo-gallery__item--wide,
.yp-shichigosan-photo-gallery__item--tall {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
  line-height: 0;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

/* ▼▼▼ 画像の見せ方 調整エリア START ▼▼▼
   今回は「切らない」ことを優先しているため
   height:auto にしています。
   object-fit:cover は使いません。
   ▲▲▲ 画像の見せ方 調整エリア END ▲▲▲ */

.yp-shichigosan-photo-gallery__item img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  vertical-align: top;
  object-fit: contain;
  background: #ffffff;
  transform: scale(1);
  transition:
    transform 520ms ease,
    opacity 520ms ease,
    filter 520ms ease;
}

.yp-shichigosan-photo-gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background:
    linear-gradient(
      180deg,
      rgba(0, 0, 0, 0.00) 0%,
      rgba(0, 0, 0, 0.01) 52%,
      rgba(0, 0, 0, 0.08) 100%
    );
  pointer-events: none;
  opacity: 0.82;
}

/* =========================================================
   下部テキスト・ボタン
========================================================= */

.yp-shichigosan-photo-gallery__bottom {
  width: min(980px, calc(100% - 56px));
  margin: 52px auto 0;
  text-align: center;
}

.yp-shichigosan-photo-gallery__bottom-text {
  margin: 0 0 28px;
  color: #5d6971;
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: 0.04em;
}

.yp-shichigosan-photo-gallery__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 14px 48px 14px 24px;
  border: 1px solid rgba(38, 52, 61, 0.28);
  color: #26343d !important;
  background: transparent !important;
  text-decoration: none !important;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.08em;
  transition:
    background-color 260ms ease,
    color 260ms ease,
    border-color 260ms ease,
    transform 260ms ease;
}

.yp-shichigosan-photo-gallery__button::before {
  display: none !important;
  content: none !important;
}

.yp-shichigosan-photo-gallery__button::after {
  display: block !important;
  content: "";
  position: absolute;
  top: 50%;
  right: 22px;
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-50%) rotate(-45deg);
}

/* =========================================================
   HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {
  .yp-shichigosan-photo-gallery__item:hover img {
    transform: scale(1.02);
  }

  .yp-shichigosan-photo-gallery__button:hover {
    background: #26343d !important;
    border-color: #26343d;
    color: #ffffff !important;
    transform: translateY(-2px);
  }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media screen and (max-width: 1024px) {
  .yp-shichigosan-photo-gallery {
    padding: 78px 0;
  }

  .yp-shichigosan-photo-gallery__inner {
    width: min(100%, calc(100% - 36px));
  }

  .yp-shichigosan-photo-gallery__head {
    grid-template-columns: 230px 1fr;
    gap: 34px;
    margin-bottom: 48px;
  }

  .yp-shichigosan-photo-gallery__title {
    font-size: clamp(36px, 5vw, 58px);
  }

  .yp-shichigosan-photo-gallery__lead p {
    font-size: 14px;
    line-height: 2;
  }

  .yp-shichigosan-photo-gallery__grid {
    width: min(100%, calc(100% - 36px));
    column-count: 3;
    column-gap: 12px;
  }

  .yp-shichigosan-photo-gallery__item,
  .yp-shichigosan-photo-gallery__item--large,
  .yp-shichigosan-photo-gallery__item--wide,
  .yp-shichigosan-photo-gallery__item--tall {
    margin-bottom: 12px;
  }

  .yp-shichigosan-photo-gallery__bottom {
    width: min(100%, calc(100% - 36px));
  }
}

@media screen and (max-width: 767px) {
  #yp-shichigosan-photo-gallery {
    scroll-margin-top: 80px;
  }

  .yp-shichigosan-photo-gallery {
    padding: 58px 0;
  }

  .yp-shichigosan-photo-gallery__inner {
    width: calc(100% - 20px);
  }

  .yp-shichigosan-photo-gallery__head {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 34px;
  }

  .yp-shichigosan-photo-gallery__label {
    margin-bottom: 14px;
    font-size: 12px;
  }

  .yp-shichigosan-photo-gallery__title {
    font-size: clamp(32px, 10vw, 46px);
    line-height: 1.4;
    letter-spacing: 0.1em;
  }

  .yp-shichigosan-photo-gallery__sub-label {
    margin-top: 10px;
    font-size: 12px;
  }

  .yp-shichigosan-photo-gallery__lead p {
    font-size: 13px;
    line-height: 1.95;
  }

  .yp-shichigosan-photo-gallery__grid {
    width: calc(100% - 20px);
    column-count: 2;
    column-gap: 10px;
  }

  .yp-shichigosan-photo-gallery__item,
  .yp-shichigosan-photo-gallery__item--large,
  .yp-shichigosan-photo-gallery__item--wide,
  .yp-shichigosan-photo-gallery__item--tall {
    margin-bottom: 10px;
  }

  .yp-shichigosan-photo-gallery__bottom {
    width: calc(100% - 40px);
    margin-top: 38px;
  }

  .yp-shichigosan-photo-gallery__bottom-text {
    margin-bottom: 24px;
    font-size: 13px;
    line-height: 2;
    text-align: left;
  }

  .yp-shichigosan-photo-gallery__button {
    width: 100%;
    min-height: 50px;
    font-size: 12.5px;
  }
}

@media screen and (max-width: 374px) {
  .yp-shichigosan-photo-gallery__inner {
    width: calc(100% - 16px);
  }

  .yp-shichigosan-photo-gallery__grid {
    width: calc(100% - 16px);
    column-gap: 8px;
  }

  .yp-shichigosan-photo-gallery__item,
  .yp-shichigosan-photo-gallery__item--large,
  .yp-shichigosan-photo-gallery__item--wide,
  .yp-shichigosan-photo-gallery__item--tall {
    margin-bottom: 8px;
  }

  .yp-shichigosan-photo-gallery__bottom {
    width: calc(100% - 36px);
  }

  .yp-shichigosan-photo-gallery__lead p,
  .yp-shichigosan-photo-gallery__bottom-text {
    font-size: 12.5px;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
  .yp-shichigosan-photo-gallery__item img,
  .yp-shichigosan-photo-gallery__button {
    transition: none !important;
  }
}