/* case/detail/css/style.css — 事例紹介詳細 (Case study detail) — TEMPLATE
   Shared header/footer/CTA via ../../css/common.css.
   Page-specific: hero + framed body + More Contents.

   NOTE (WordPress): this is a per-post template. The banner image is set
   INLINE in the HTML (style="background-image:…") — NOT here — so each post
   can inject its own featured image. CSS keeps only layout / mask / animation. */

/* =============================================
   Hero (FV) — photo right, breadcrumb top, title + tag + client bottom-left.
   Reuses .page-banner__photo so the common.css float/breathing applies.
   ============================================= */
.page-banner {
  position: relative;
  width: 100%;
  height: 620px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url("../../../assets/img/banner-bg.webp") center / cover no-repeat,
    #ffffff;
  overflow: hidden;
}
.page-banner__media { position: absolute; inset: 0; z-index: 1; }
.page-banner__photo {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  /* background-image is provided INLINE in the HTML (per-post featured image) */
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 2%, #000 38%);
          mask-image: linear-gradient(90deg, transparent 2%, #000 38%);
  animation: none; /* Disable zoom-in/zoom-out breathing animation only for detail page */
}
.page-banner__scroll {
  position: absolute;
  left: max(35px, calc(50% - 685px));
  top: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  z-index: 3;
  animation: pb-scroll-bob 2.4s ease-in-out infinite;
}
@keyframes pb-scroll-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) { .page-banner__scroll { animation: none; } }
.page-banner__scroll-line { width: 1px; height: 153px; background: #000000; }
.page-banner__scroll-text {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--font-jp-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 6.3px;
  color: #000000;
}
.page-banner__inner {
  position: relative;
  height: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 100px;
  z-index: 2;
}

/* Breadcrumb — top-left */
.page-banner__breadcrumb {
  position: absolute;
  top: 24px;
  left: 0;
  width: 100%;
  padding-left: max(100px, calc(50% - 620px));
  z-index: 3;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-jp-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.04em;
  color: #323232;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 10px; }
.breadcrumb a { color: #323232; }
.breadcrumb__sep { display: inline-flex; width: 10px; height: 10px; color: #323232; }
.breadcrumb__current { color: #323232; }

/* Title + tag + client — bottom-left overlay */
.cd-hero__overlay {
  position: absolute;
  left: 100px;
  bottom: 96px;
  max-width: 620px;
  z-index: 3;
}
.cd-hero__title {
  margin: 0 0 26px;
  font-family: var(--font-jp-serif);
  font-weight: 500;
  font-size: 36px;
  line-height: 1.6;
  color: #1a1a1a;
}
.cd-hero__meta { display: flex; align-items: center; gap: 20px; }
.cd-hero__tag {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 97px; height: 28px; padding: 0 14px; border-radius: 14px;
  background: #498abf; color: #ffffff;
  font-family: var(--font-jp-serif); font-size: 14px;
}
.cd-hero__client { font-family: var(--font-jp-serif); font-size: 18px; color: #323232; }

/* ===== Hero — Tablet (≤ 1200px) ===== */
@media (max-width: 1200px) {
  .page-banner { height: 540px; }
  .page-banner__inner { padding: 0 48px; }
  .page-banner__breadcrumb { padding-left: 48px; }
  .page-banner__scroll { left: 28px; top: 150px; }
  .page-banner__scroll-line { height: 120px; }
  .cd-hero__overlay { left: 48px; bottom: 64px; max-width: 50%; }
  .cd-hero__title { font-size: 28px; }
}

/* ===== Hero — SP (< 768px) ===== */
@media (max-width: 767px) {
  .page-banner {
    height: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
    background-position: top center;
  }
  .page-banner__inner { display: contents; }
  .page-banner__breadcrumb {
    position: static;
    order: 1;
    width: 100%;
    padding: 12px 0 6px 20px;
  }
  .breadcrumb { font-size: 13px; }
  .page-banner__media {
    position: relative;
    order: 2;
    inset: auto;
    margin: 10px 0 0 9.5%;
    width: 90.4%;
    aspect-ratio: 352.64 / 271;
  }
  .page-banner__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .page-banner__scroll { left: -25px; top: 44px; gap: 12px; }
  .page-banner__scroll-line { height: 76px; }
  .page-banner__scroll-text { font-size: 14px; letter-spacing: 4.9px; }
  .cd-hero__overlay {
    position: static;
    order: 3;
    max-width: none;
    padding: 22px 20px 4px;
  }
  .cd-hero__title { font-size: 19px; margin-bottom: 18px; line-height: 1.55; }
  .cd-hero__meta { gap: 14px; }
  .cd-hero__client { font-size: 15px; }
}

/* =============================================
   Frame deco — shared by the body block and the More Contents cards.
   Top/bottom line + slash corners (tl, br) + sparkles (tr, bl), with a
   scroll-into-view draw-in (same motion as the homepage Company blog).
   ============================================= */
.cd-frame { position: absolute; pointer-events: none; z-index: 0; }
.cd-frame--tline { top: 0; left: 15px; right: 15px; height: 1px; background: #545353 }
.cd-frame--bline { bottom: 0; left: 15px; right: 15px; height: 1px; background: #545353 }
.cd-frame--tl, .cd-frame--br { width: 54px; height: 54px; }
.cd-frame--tl { top: -27px; left: -12px; }
.cd-frame--br { bottom: -27px; right: -12px; }
.cd-frame--tl::before, .cd-frame--br::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom right,
    transparent calc(50% - 0.5px),
    #545353 calc(50% - 0.5px),
    #545353 calc(50% + 0.5px),
    transparent calc(50% + 0.5px));
}
.cd-frame--star-tr, .cd-frame--star-bl { width: 16px; height: 16px; color: #545353; }
.cd-frame--star-tr svg, .cd-frame--star-bl svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.cd-frame--star-tr { top: -7px; right: 0; }
.cd-frame--star-bl { bottom: -8px; left: 0; }

/* Draw-in (keyed off the framed container's [data-reveal]) */
.cd-reveal[data-reveal] { opacity: 1; transform: none; transition: none; }
.cd-frame--tl, .cd-frame--br {
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.15s, opacity 0.5s ease 0.15s;
}
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--tl,
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--br {
  transform: rotate(-180deg) scale(0.3); opacity: 0;
}
.cd-frame--tline { transform-origin: left center; transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.35s; }
.cd-frame--bline { transform-origin: right center; transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1) 0.35s; }
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--tline,
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--bline { transform: scaleX(0); }
.cd-frame--star-tr, .cd-frame--star-bl {
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.6s, opacity 0.5s ease 0.6s;
}
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--star-tr,
.cd-reveal[data-reveal]:not(.is-visible) .cd-frame--star-bl {
  transform: rotate(-180deg) scale(0); opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .cd-reveal[data-reveal],
  .cd-frame--tl, .cd-frame--br,
  .cd-frame--tline, .cd-frame--bline,
  .cd-frame--star-tr, .cd-frame--star-bl { transition: none; }
}

/* =============================================
   Body block — framed long text + back-to-list button.
   ============================================= */
.cd-detail {
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url("../../../assets/img/banner-bg.webp") center / cover no-repeat,
    #ffffff;
  padding: 90px 100px 100px;
}
.cd-detail__inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 64px 80px 72px;
}
.cd-detail__text {
  position: relative;
  z-index: 1;
  font-family: var(--font-jp-serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 2;
  color: #323232;
}
.cd-detail__text p { margin: 0; }
.cd-detail__text p + p { margin-top: 1.8em; }
.cd-detail__back { display: flex; justify-content: center; margin-top: 56px; }
.cd-detail__back .detail-btn__accent { background: #2ca5a1; }

/* =============================================
   More Contents — centred heading + 3 related case cards (animated arrow).
   ============================================= */
.cd-more {
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    url("../../../assets/img/banner-bg.webp") center / cover no-repeat,
    #ffffff;
  padding: 0 100px 110px;
}
.cd-more__inner { max-width: 1240px; margin: 0 auto; }
.cd-more__heading {
  margin: 0 0 56px;
  text-align: center;
  font-family: "Cormorant Garamond", var(--font-jp-serif);
  font-weight: 500;
  font-size: 46px;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: #323232;
}
.cd-more__cards { display: flex; gap: 50px; }
.cd-more-card {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 30px 28px 34px;
  text-decoration: none;
  color: inherit;
  background-color: #fff;
}
.cd-more-card__photo {
  display: block;
  width: 100%;
  aspect-ratio: 360 / 220;
  /* background-image set inline (per-post) */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.cd-more-card:hover .cd-more-card__photo { transform: scale(1.03); }
.cd-more-card__tag {
  display: inline-block; min-width: 97px; height: 26px; line-height: 26px; text-align: center;
  padding: 0 12px; border-radius: 13px; background: #498abf; color: #ffffff;
  font-family: var(--font-jp-serif); font-size: 14px;
  margin: 22px 0 16px;
}
.cd-more-card__title {
  margin: 0 0 16px;
  font-family: var(--font-jp-serif); font-weight: 400; font-size: 18px; line-height: 1.6; color: #323232;
}
.cd-more-card__client {
  display: block; margin-bottom: 22px;
  font-family: var(--font-jp-serif); font-size: 16px; color: #323232;
}

/* Animated arrow foot (詳しく見る + sliding star) — same motion as the mc arrow */
.cd-more-card__more {
  flex-shrink: 0;
  font-family: var(--font-jp-serif); font-size: 16px; color: #323232; white-space: nowrap;
}
.cd-arrow { position: relative; flex: 1; min-width: 70px; height: 16px; color: #323232; }
.cd-arrow__line { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: currentColor; }
.cd-arrow__head {
  position: absolute; right: -1px; top: 1px; width: 14px; height: 1px;
  background: currentColor; transform-origin: left center;
  transform: translateY(-50%) rotate(30deg); transition: opacity 0.3s ease;
}
.cd-more-card:hover .cd-arrow__head { opacity: 0; }
.cd-arrow__star {
  position: absolute; left: -10px; top: calc(50% + 1px); width: 15px; height: 16px;
  color: #323232; transform: translate(0, -50%);
  transition: left 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.cd-arrow__star svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.cd-more-card:hover .cd-arrow__star { left: calc(100% + 10px); transform: translate(-100%, -50%); }
@media (prefers-reduced-motion: reduce) { .cd-arrow__star { transition: none; } }

/* ===== More Contents — Tablet (≤ 1024px) ===== */
@media (max-width: 1024px) {
  .cd-detail { padding: 64px 48px 90px; }
  .cd-detail__inner { padding: 48px 40px 56px; }
  .cd-more { padding: 0 48px 90px; }
  .cd-more__cards { gap: 28px; }
}

/* ===== SP (< 768px) ===== */
@media (max-width: 767px) {
  .cd-detail { padding: 40px 20px 56px; }
  .cd-detail__inner { padding: 36px 22px 44px; }
  .cd-detail__text { font-size: 15px; }
  .cd-detail__back { margin-top: 40px; }
  /* Smaller slash corners on SP */
  .cd-frame--tl, .cd-frame--br { width: 32px; height: 32px; }
  .cd-frame--tl { top: -16px; left: 0; }
  .cd-frame--br { bottom: -16px; right: 0; }

  .cd-more { padding: 0 20px 56px; }
  .cd-more__heading { font-size: 34px; margin-bottom: 36px; }
  /* extra vertical gap so each card's slash/star deco doesn't overlap the next */
  .cd-more__cards { flex-direction: column; gap: 56px; }
  .cd-more-card { padding: 26px 18px 30px; }
  .cd-more-card__photo { aspect-ratio: 352 / 200; }
  .cd-more-card__title { font-size: 16px; }
}
