/* =========================================================
   photo.css
   CPT photo_hub archive / single
   方針：
   - DigiPress / Gutenberg の本文表示を優先
   - Cover / Image / Gallery など本文ブロックはCSSで無理に触らない
   - 神社ページと同じカード・セクション部品だけを整える
   配置先：/wp-content/themes/yourpleasure/assets/css/photo.css
========================================================= */

/* ---------------------------------------------------------
   Common reset for PHOTO custom blocks
--------------------------------------------------------- */
.yp-photo-page,
.yp-photo-related,
.yp-photo-card,
.yp-shrine-guide-intro,
.yp-shrine-guide-feature,
.yp-shrine-guide-links,
.yp-shrine-guide-list-head,
.yp-shrine-page,
.yp-shrine-section,
.yp-shrine-card-grid,
.yp-shrine-card {
  box-sizing: border-box;
}

.yp-photo-page *,
.yp-photo-related *,
.yp-photo-card *,
.yp-shrine-guide-intro *,
.yp-shrine-guide-feature *,
.yp-shrine-guide-links *,
.yp-shrine-guide-list-head *,
.yp-shrine-page *,
.yp-shrine-section *,
.yp-shrine-card-grid *,
.yp-shrine-card * {
  box-sizing: border-box;
}

.yp-shrine-guide-intro p,
.yp-shrine-guide-intro h1,
.yp-shrine-guide-feature p,
.yp-shrine-guide-feature h2,
.yp-shrine-guide-links p,
.yp-shrine-guide-links h2,
.yp-shrine-guide-list-head p,
.yp-shrine-guide-list-head h2,
.yp-shrine-section p,
.yp-shrine-section h2,
.yp-shrine-card h3,
.yp-shrine-card p,
.yp-shrine-card span {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

.yp-shrine-guide-intro p::before,
.yp-shrine-guide-intro p::after,
.yp-shrine-guide-intro h1::before,
.yp-shrine-guide-intro h1::after,
.yp-shrine-guide-feature p::before,
.yp-shrine-guide-feature p::after,
.yp-shrine-guide-feature h2::before,
.yp-shrine-guide-feature h2::after,
.yp-shrine-guide-links p::before,
.yp-shrine-guide-links p::after,
.yp-shrine-guide-links h2::before,
.yp-shrine-guide-links h2::after,
.yp-shrine-guide-list-head p::before,
.yp-shrine-guide-list-head p::after,
.yp-shrine-guide-list-head h2::before,
.yp-shrine-guide-list-head h2::after,
.yp-shrine-section p::before,
.yp-shrine-section p::after,
.yp-shrine-section h2::before,
.yp-shrine-section h2::after,
.yp-shrine-card h3::before,
.yp-shrine-card h3::after,
.yp-shrine-card p::before,
.yp-shrine-card p::after,
.yp-shrine-card span::before,
.yp-shrine-card span::after {
  display: none !important;
  content: none !important;
}

/* ---------------------------------------------------------
   Archive: /photo/
   shrine archive と同じ型
--------------------------------------------------------- */
.yp-shrine-guide-intro {
  width: 100%;
  margin: 0;
  padding: 88px 0 62px;
  background: #ffffff;
  color: #2f2a24;
}

.yp-shrine-guide-intro__inner {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  text-align: center;
}

.yp-shrine-guide-intro__label,
.yp-shrine-guide-block-head__label,
.yp-shrine-guide-linkbox__label,
.yp-shrine-guide-list-head__label,
.yp-shrine-section__label {
  margin: 0 0 14px;
  color: #8a7458;
  font-family: "Times New Roman", "Yu Mincho", "YuMincho", serif;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.18em;
}

.yp-shrine-guide-intro__title {
  margin: 0 0 24px !important;
  padding: 0 !important;
  color: #26343d;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 1.28;
  letter-spacing: 0.12em;
  font-weight: 400;
}

.yp-shrine-guide-intro__lead {
  max-width: 760px;
  margin: 0 auto;
  color: #5d6971;
  font-size: 15px;
  line-height: 2.1;
  letter-spacing: 0.04em;
  text-align: left;
}

.yp-shrine-guide-list-head {
  width: min(1120px, calc(100% - 56px));
  margin: 0 auto;
  padding: 0 0 36px;
  color: #2f2a24;
  text-align: center;
}

.yp-shrine-guide-list-head__title,
.yp-shrine-section__title {
  margin: 0 !important;
  padding: 0 !important;
  color: #26343d;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.5;
}

.yp-shrine-guide-list-head__text {
  max-width: 760px;
  margin: 18px auto 0;
  color: #5d6971;
  font-size: 14px;
  line-height: 2;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------
   Single: /photo/{slug}/
   single-shrine.php と同じ型。
   本文ブロックはGutenberg/DigiPressに任せる。
--------------------------------------------------------- */
.yp-photo-page,
.yp-shrine-page {
  width: 100%;
}

.yp-photo-entry,
.yp-shrine-entry {
  color: #2f2a24;
}

.yp-shrine-section {
  width: min(1120px, calc(100% - 56px));
  margin: 72px auto;
  padding: 0;
}

.yp-shrine-section__head {
  margin: 0 0 30px;
  text-align: center;
}

.yp-shrine-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.yp-shrine-card {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(38, 52, 61, 0.1);
}

.yp-shrine-card__link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit !important;
  text-decoration: none !important;
  background: none !important;
  box-shadow: none !important;
}

.yp-shrine-card__link::before,
.yp-shrine-card__link::after {
  display: none !important;
  content: none !important;
}

.yp-shrine-card__image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: #f7f4ee;
}

.yp-shrine-card__image img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center center;
  transition: transform 420ms ease;
}

.yp-shrine-card__body {
  padding: 22px 22px 24px;
  background: #ffffff;
}

.yp-shrine-card__title {
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: #26343d;
  font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  font-size: 20px;
  line-height: 1.55;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.yp-shrine-card__text {
  margin: 0;
  color: #5d6971;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.04em;
}

.yp-shrine-card__more {
  display: inline-block;
  margin-top: 18px;
  color: #8a7458;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------
   Hover
--------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .yp-shrine-card {
    transition:
      transform 280ms ease,
      border-color 280ms ease,
      box-shadow 280ms ease,
      opacity 280ms ease;
  }

  .yp-shrine-card:hover {
    transform: translateY(-3px);
    border-color: rgba(138, 116, 88, 0.24);
    box-shadow: 0 12px 30px rgba(38, 52, 61, 0.08);
  }

  .yp-shrine-card:hover .yp-shrine-card__image img {
    transform: scale(1.035);
  }
}

/* ---------------------------------------------------------
   Responsive
--------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .yp-shrine-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .yp-shrine-guide-intro {
    padding: 58px 0 42px;
  }

  .yp-shrine-guide-intro__inner,
  .yp-shrine-guide-list-head,
  .yp-shrine-section {
    width: calc(100% - 20px);
  }

  .yp-shrine-guide-intro__inner,
  .yp-shrine-guide-list-head,
  .yp-shrine-section__head {
    text-align: left;
  }

  .yp-shrine-guide-intro__label,
  .yp-shrine-guide-list-head__label,
  .yp-shrine-section__label {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .yp-shrine-guide-intro__title {
    margin-bottom: 18px !important;
    font-size: clamp(32px, 10vw, 46px);
    line-height: 1.38;
  }

  .yp-shrine-guide-intro__lead,
  .yp-shrine-guide-list-head__text {
    font-size: 13px;
    line-height: 1.95;
  }

  .yp-shrine-guide-list-head {
    padding-bottom: 28px;
  }

  .yp-shrine-guide-list-head__title,
  .yp-shrine-section__title {
    font-size: clamp(24px, 7.5vw, 34px);
    line-height: 1.5;
  }

  .yp-shrine-section {
    margin: 54px auto;
  }

  .yp-shrine-card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .yp-shrine-card__body {
    padding: 18px 16px 20px;
  }

  .yp-shrine-card__title {
    font-size: 18px;
  }

  .yp-shrine-card__text {
    font-size: 13px;
    line-height: 1.85;
  }
}

@media screen and (max-width: 374px) {
  .yp-shrine-guide-intro__inner,
  .yp-shrine-guide-list-head,
  .yp-shrine-section {
    width: calc(100% - 16px);
  }
}

/* =========================================================
   PHOTO RELATED CARD FIX
   目的：
   - 関連カード上部の余白を消す
   - PCでは神社ページと同じカード型を維持
   - スマホでは写真全面＋テキストオーバーレイ表示にする
========================================================= */

/* PC / 共通：DigiPress や article 由来の余白を確実に打ち消す */
.yp-photo-related article.yp-shrine-card,
.single-photo_hub article.yp-shrine-card.yp-photo-card,
.post-type-archive-photo_hub article.yp-shrine-card.yp-photo-card {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 1px solid rgba(38, 52, 61, 0.1) !important;
  box-shadow: none !important;
}

.yp-photo-related .yp-shrine-card__link,
.single-photo_hub .yp-photo-related .yp-shrine-card__link,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__link {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit !important;
  text-decoration: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.yp-photo-related .yp-shrine-card__image,
.single-photo_hub .yp-photo-related .yp-shrine-card__image,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__image {
  position: relative !important;
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  line-height: 0 !important;
  background: #f7f4ee !important;
  border: 0 !important;
}

.yp-photo-related .yp-shrine-card__image img,
.single-photo_hub .yp-photo-related .yp-shrine-card__image img,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  object-fit: cover !important;
  object-position: center center !important;
  vertical-align: bottom !important;
}

.yp-photo-related .yp-shrine-card__body,
.single-photo_hub .yp-photo-related .yp-shrine-card__body,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__body {
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 30px 32px 34px !important;
  background: #ffffff !important;
}

.yp-photo-related .yp-shrine-card__title,
.single-photo_hub .yp-photo-related .yp-shrine-card__title,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__title {
  margin: 0 0 12px !important;
}

.yp-photo-related .yp-shrine-card__text:empty,
.single-photo_hub .yp-photo-related .yp-shrine-card__text:empty,
.post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__text:empty {
  display: none !important;
}

/* スマホ：写真全面カード。白い本文エリアは作らず、写真内にタイトルを乗せる */
@media screen and (max-width: 767px) {
  .yp-photo-related .yp-shrine-card-grid,
  .single-photo_hub .yp-photo-related .yp-shrine-card-grid,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .yp-photo-related article.yp-shrine-card,
  .single-photo_hub article.yp-shrine-card.yp-photo-card,
  .post-type-archive-photo_hub article.yp-shrine-card.yp-photo-card {
    min-height: 0 !important;
    border: 0 !important;
    background: #26343d !important;
  }

  .yp-photo-related .yp-shrine-card__link,
  .single-photo_hub .yp-photo-related .yp-shrine-card__link,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__link {
    position: relative !important;
    display: block !important;
    min-height: 250px !important;
    overflow: hidden !important;
    background: #26343d !important;
  }

  .yp-photo-related .yp-shrine-card__link::after,
  .single-photo_hub .yp-photo-related .yp-shrine-card__link::after,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__link::after {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 1 !important;
    display: block !important;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.18) 42%, rgba(0, 0, 0, 0.68) 100%) !important;
    pointer-events: none !important;
  }

  .yp-photo-related .yp-shrine-card__image,
  .single-photo_hub .yp-photo-related .yp-shrine-card__image,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__image {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    margin: 0 !important;
  }

  .yp-photo-related .yp-shrine-card__image img,
  .single-photo_hub .yp-photo-related .yp-shrine-card__image img,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
  }

  .yp-photo-related .yp-shrine-card__body,
  .single-photo_hub .yp-photo-related .yp-shrine-card__body,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__body {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2 !important;
    display: block !important;
    margin: 0 !important;
    padding: 76px 18px 18px !important;
    color: #ffffff !important;
    background: transparent !important;
  }

  .yp-photo-related .yp-shrine-card__title,
  .single-photo_hub .yp-photo-related .yp-shrine-card__title,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__title {
    margin: 0 0 12px !important;
    color: #ffffff !important;
    font-size: clamp(18px, 5.3vw, 24px) !important;
    line-height: 1.45 !important;
    letter-spacing: 0.06em !important;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45) !important;
  }

  .yp-photo-related .yp-shrine-card__text,
  .single-photo_hub .yp-photo-related .yp-shrine-card__text,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__text {
    display: none !important;
  }

  .yp-photo-related .yp-shrine-card__more,
  .single-photo_hub .yp-photo-related .yp-shrine-card__more,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__more {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    margin-top: 0 !important;
    padding: 8px 11px !important;
    color: #ffffff !important;
    font-size: 11px !important;
    line-height: 1 !important;
    letter-spacing: 0.08em !important;
    border: 1px solid rgba(255, 255, 255, 0.58) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(3px) !important;
  }
}

@media screen and (max-width: 374px) {
  .yp-photo-related .yp-shrine-card__link,
  .single-photo_hub .yp-photo-related .yp-shrine-card__link,
  .post-type-archive-photo_hub .yp-photo-related .yp-shrine-card__link {
    min-height: 225px !important;
  }
}

