@charset 'UTF-8';

/*
投稿・アーカイブ系ページ用CSS（functions.php で is_single() / is_archive() のときに読み込み）
主に成功事例（case-study）の一覧・詳細ページ用
*/

/* ===== 成功事例一覧（/case-study/）ページネーションを /category/column/ に合わせる ===== */
.p-case-grid + .c-pagination .page-numbers {
  box-shadow: var(--swl-box_shadow);
}

.p-case-grid + .c-pagination .page-numbers.prev,
.p-case-grid + .c-pagination .page-numbers.next {
  display: none;
}

.p-case-grid + .c-pagination .page-numbers.dots {
  min-width: 0;
  height: auto;
  margin: 0 6px;
  line-height: inherit;
  background: none;
  box-shadow: none;
  color: #aaa;
  font-size: 13px;
}

/* ===== 成功事例 個別ページ（single-case-study）の h3 ===== */
.post_content.case h3 {
  margin-top: 12px;
}

.post_content.case h3::before,
.post_content.case h3::after {
  content: none;
}

/* ===== 成功事例 詳細ページ：YouTubeサムネイル（クリックでその場で再生） ===== */
.case-yt {
  margin: 0 0 1em;
}

.case-yt__btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0;
}

.case-yt__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s;
}

.case-yt__btn:hover .case-yt__thumb,
.case-yt__btn:focus-visible .case-yt__thumb {
  opacity: 0.85;
}

.case-yt__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  border-radius: 12px;
  background: #ff0000;
  transform: translate(-50%, -50%);
}

.case-yt__play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-style: solid;
  border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent #fff;
  transform: translate(-40%, -50%);
}

.case-yt__player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.case-yt__player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== 成功事例 詳細ページ：本文エリアでは、ブロック先頭の見出しの上余白を0にしない ===== */
/* SWELL本体の .post_content div>:first-child { margin-top: 0 !important; } を、本文（.case-content）内の見出しだけ上書き */
.post_content.case .case-content > h2:first-child {
  margin-top: 4em !important;
}

.post_content.case .case-content > h3:first-child {
  margin-top: 12px !important;
}

/* ===== 成功事例 詳細ページ：YouTubeのカラムはスマホでも2カラム（TOPページと同じく2列） ===== */
/* SWELLの「スマホで2列」（.sp_column2）と同じ考え方で、列の幅を間隔（--wp-column-gap）込みで計算する */
@media screen and (max-width: 781px) {
  .post_content.case .wp-block-columns:has(.case-yt) {
    --wp-column-gap: 4%;
    flex-wrap: wrap !important;
    row-gap: 1.5em !important;
  }

  .post_content.case .wp-block-columns:has(.case-yt) > .wp-block-column {
    flex-basis: calc(50% - var(--wp-column-gap) / 2) !important;
    flex-grow: 0 !important;
    min-width: 0;
  }
}

/* ===== 成功事例 詳細ページ：見出し（h3）にTOPページと同じ丸矢印を付ける（追加CSSクラス「link-arrow」） ===== */
.post_content.case h3.link-arrow {
  position: relative;
  padding: 0 0 0 36px ;
}

.post_content.case h3.link-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: url(../../images/img/top-09-arrow.png) no-repeat center / contain;
  transform: translateY(-50%);
}