@charset "UTF-8";

/*!
 * 子テーマブロック用CSS（サイト表示側・ブロックエディタ共通）
 *
 * 目次
 *  0. 色などの設定（ここを変えればサイト全体の配色が変わります）
 *  1. 画面幅いっぱいに広げる共通処理（chb-bleed）
 *  2. 画像スライダー
 *  3. ３個見出し
 *  4. 特殊見出し（H2）
 *  5. 画像３点セット
 *  6. カスタム投稿一覧（お知らせ／イベント）
 *  7. フルサイズ背景色
 *
 * レスポンシブの区切りは Cocoon に合わせています。
 *   タブレット：834px以下 ／ スマホ：480px以下
 */

/************************************
** 0. 色などの設定
************************************/
:root {
  --chb-orange: #f39801;   /* ボタン・枠線・ホバー */
  --chb-yellow: #febe5c;   /* 見出しバー・丸 */
  --chb-beige: #fee5bd;    /* セクション背景 */
  --chb-cream: #fff7ea;    /* 丸の中の背景 */
  --chb-red: #922a31;      /* 見出し文字・丸の枠線 */
  --chb-text: #333333;     /* 本文 */
  --chb-muted: #6e6e6e;    /* 抜粋などの薄い文字 */
  --chb-line: #dddddd;     /* 区切り線 */
}

/************************************
** 1. 画面幅いっぱいに広げる共通処理
**
** 親要素（本文の幅）からはみ出して、画面の左右端まで広げる。
** 本来は assets/js/front.js が親要素の位置から正確な値を計算して入れる。
** JSが動かない場合でも、親が画面中央にある限り下の calc で同じ見た目になる。
************************************/
.chb-bleed {
  --chb-bleed-left: calc(50vw - 50%);
  --chb-bleed-right: calc(50vw - 50%);
  box-sizing: border-box;
  max-width: none;
  margin-left: calc(var(--chb-bleed-left) * -1);
  margin-right: calc(var(--chb-bleed-right) * -1);
}

/* 横スクロールバーが出ないようにする（スクロールバー幅ぶんのはみ出し対策） */
html:has(.chb-bleed),
body:has(.chb-bleed) {
  overflow-x: clip;
}

/************************************
** 2. 画像スライダー
************************************/
.chb-slider {
  --chb-slider-h: var(--chb-slider-h-pc, 220px);
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.chb-slider__track {
  display: flex;
  width: max-content;
  /* 1周の秒数は block の設定値（--chb-slider-duration）で指定される */
  animation: chb-slider-scroll var(--chb-slider-duration, 40s) linear infinite;
  will-change: transform;
}

.chb-slider__set {
  display: flex;
  flex: 0 0 auto;
}

.chb-slider__item {
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.chb-slider .chb-slider__img {
  display: block;
  height: var(--chb-slider-h);
  width: auto;
  max-width: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/*
 * 1周分（--chb-slider-shift）だけ左へ動かして、先頭に戻す。
 * JSが動いている間は front.js が「画像1セット分の幅(px)」を入れる。
 * JSが無い場合は、同じ並びを2セット置いてあるので -50% で切れ目なく繋がる。
 */
@keyframes chb-slider-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(var(--chb-slider-shift, 50%) * -1));
  }
}

/* 「視差効果を減らす」設定の人には動きを止めたい場合は、次の3行のコメントを外してください
@media (prefers-reduced-motion: reduce) {
  .chb-slider__track { animation-play-state: paused; }
}
*/

@media screen and (max-width: 834px) {
  .chb-slider {
    --chb-slider-h: var(--chb-slider-h-tablet, 180px);
  }
}

@media screen and (max-width: 480px) {
  .chb-slider {
    --chb-slider-h: var(--chb-slider-h-sp, 120px);
  }
}

/************************************
** 3. ３個見出し
************************************/
.chb-triple {
  --chb-triple-circle: 250px;   /* 丸の大きさ */
  --chb-triple-icon: 80px;      /* アイコンの大きさ */
  --chb-triple-step: min(100px, 7vw); /* 段落ちの幅（PCのみ） */
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 2em 0;
  padding-left: 3vw;
}

.chb-triple__item {
  display: flex;
  align-items: center;
  gap: 56px;
}

/* 2段目・3段目は段落ち（PCのみ） */
.chb-triple__item:nth-child(2) {
  margin-left: var(--chb-triple-step);
}
.chb-triple__item:nth-child(3) {
  margin-left: calc(var(--chb-triple-step) * 2);
}

/* 丸（アイコン＋見出し） */
.chb-triple .chb-triple__circle {
  flex: 0 0 var(--chb-triple-circle);
  box-sizing: border-box;
  width: var(--chb-triple-circle);
  height: var(--chb-triple-circle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  border: 2px solid var(--chb-red);
  border-radius: 50%;
  background-color: var(--chb-cream);
  text-align: center;
}

.chb-triple .chb-triple__icon {
  display: block;
  width: auto;
  max-width: var(--chb-triple-icon);
  height: var(--chb-triple-icon);
  object-fit: contain;
  margin: 0;
}

.chb-triple .chb-triple__icon-empty {
  display: block;
  font-size: 12px;
  color: var(--chb-red);
  opacity: 0.5;
}

/* 見出し：Cocoonの見出しデザインを打ち消してから指定する */
.chb-triple .chb-triple__circle .chb-triple__heading {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--chb-red);
  font-size: 1.45em;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.04em;
}
.chb-triple .chb-triple__circle .chb-triple__heading::before,
.chb-triple .chb-triple__circle .chb-triple__heading::after {
  content: none;
  display: none;
}

.chb-triple .chb-triple__text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 560px;
  margin: 0;
  color: var(--chb-text);
  line-height: 2;
  font-size: 1.2rem;
}

/* 入力前の仮表示（エディタのみ） */
.chb-triple .is-placeholder {
  opacity: 0.45;
}

/* タブレット：段落ちをなくす */
@media screen and (max-width: 834px) {
  .chb-triple {
    --chb-triple-circle: 220px;
    gap: 40px;
	padding-left: 0;
  }
  .chb-triple__item {
    gap: 32px;
  }
  .chb-triple .chb-triple__circle {
    padding: 10px;
  }
  .chb-triple .chb-triple__circle .chb-triple__heading {
    font-size: 1.2em;
    letter-spacing: 0.02em;
  }
  .chb-triple__item:nth-child(2),
  .chb-triple__item:nth-child(3) {
    margin-left: 0;
  }
}

/* スマホ：段落ちなし・丸の見出しが上、本文がその下 */
@media screen and (max-width: 480px) {
  .chb-triple {
    --chb-triple-circle: 220px;
    gap: 40px;
  }
  .chb-triple__item {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .chb-triple .chb-triple__text {
    flex: 0 0 auto;
    width: 100%;
  }
}

/************************************
** 4. 特殊見出し（H2）
**    「タイトル用丸」画像を、文字の左後ろに敷く
************************************/
h2.chb-heading.chb-heading {
  position: relative;
  isolation: isolate;
  display: inline-block;
  box-sizing: border-box;
  margin: 1.8em 0 0.9em;
  padding: 0.4em 0 0.4em 1.7em;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--chb-red);
  font-size: 1.6em;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

h2.chb-heading.chb-heading::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  top: 50%;
  width: 2.7em;   /* 画像の縦横比 335:310 に合わせている */
  height: 2.5em;
  transform: translateY(-50%);
  background: url("../images/title-circle.png") center / contain no-repeat;
}

h2.chb-heading.chb-heading::after {
  content: none;
  display: none;
}

@media screen and (max-width: 480px) {
  h2.chb-heading.chb-heading {
    font-size: 1.35em;
  }
}

/************************************
** 5. 画像３点セット
************************************/
.chb-trio {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  margin: 2em 0;
}

.chb-trio__images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chb-trio .chb-trio__img {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #f3f3f3;
}
.chb-trio .chb-trio__img img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  margin: 0;
}

.chb-trio .chb-trio__img--top {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
}
.chb-trio .chb-trio__img--left,
.chb-trio .chb-trio__img--right {
  aspect-ratio: 4 / 3;
}

.chb-trio__content {
  min-width: 0;
}

/* 右側の先頭ブロックの上の余白は不要 */
.chb-trio__content > :first-child {
  margin-top: 0;
}

/* スマホ：画像が上、右側の内容が下 */
@media screen and (max-width: 834px) {
  .chb-trio {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

/************************************
** 6. カスタム投稿一覧（お知らせ／イベント）
************************************/
.chb-posts {
  margin: 1.5em 0;
}

.chb-posts .chb-posts__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px dotted var(--chb-line);
}

.chb-posts .chb-posts__item {
  margin: 0;
  padding: 0;
  border-bottom: 1px dotted var(--chb-line);
  list-style: none;
}

.chb-posts .chb-posts__link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 10px 14px 6px;
  color: var(--chb-text);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.chb-posts .chb-posts__link:hover {
  background-color: #fffaf1;
  color: var(--chb-text);
  text-decoration: none;
}

/* サムネイル（16:9） */
.chb-posts .chb-posts__thumb {
  flex: 0 0 120px;
  width: 120px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f3f3;
}
.chb-posts .chb-posts__thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  margin: 0;
}

.chb-posts .chb-posts__body {
  flex: 1 1 0;
  min-width: 0;
  display: block;
}

.chb-posts .chb-posts__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 28px;
}

.chb-posts .chb-posts__date {
  flex: 0 0 auto;
  min-width: 7.2em;
  font-size: 1.15em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--chb-text);
}

.chb-posts .chb-posts__title {
  flex: 1 1 12em;
  min-width: 0;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.5;
  color: var(--chb-text);
}

.chb-posts .chb-posts__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  font-size: 0.875em;
  line-height: 1.7;
  color: var(--chb-muted);
}
/* 日付やタイトルが無いとき、抜粋の上の余白は不要 */
.chb-posts .chb-posts__body > .chb-posts__excerpt:first-child {
  margin-top: 0;
}

/* 右端の矢印 */
.chb-posts .chb-posts__arrow {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin: 0 8px 0 4px;
  border-top: 2px solid var(--chb-text);
  border-right: 2px solid var(--chb-text);
  transform: rotate(45deg);
}

.chb-posts .chb-posts__empty {
  margin: 0;
  padding: 1em 0;
  color: var(--chb-muted);
}

@media screen and (max-width: 480px) {
  .chb-posts .chb-posts__link {
    gap: 12px;
    padding: 12px 4px;
  }
  .chb-posts .chb-posts__thumb {
    flex-basis: 96px;
    width: 96px;
  }
  /* 日付の下にタイトルを縦に並べる（縦並びでは flex-basis が高さになるので auto に戻す） */
  .chb-posts .chb-posts__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .chb-posts .chb-posts__date,
  .chb-posts .chb-posts__title {
    flex: 0 0 auto;
    font-size: 1em;
  }
  .chb-posts .chb-posts__date {
    min-width: 0;
  }
}

/************************************
** 7. フルサイズ背景色
**    背景色は画面幅いっぱい、中身は本文の幅
**
** 左右に「はみ出した分」と同じ長さのpaddingを付けることで、
** 中に入れたブロックが、元の本文の幅にぴったり収まる。
************************************/
.chb-fullbg {
  box-sizing: border-box;
  padding-top: 56px;
  padding-bottom: 56px;
}

.chb-fullbg.chb-bleed {
  padding-left: var(--chb-bleed-left);
  padding-right: var(--chb-bleed-right);
}

.chb-fullbg__inner {
  box-sizing: border-box;
  width: 100%;
}

/* 中身の先頭・末尾ブロックの外側の余白を消して、上下の余白を揃える */
.chb-fullbg__inner > :first-child {
  margin-top: 0;
}
.chb-fullbg__inner > :last-child {
  margin-bottom: 0;
}

@media screen and (max-width: 480px) {
  .chb-fullbg {
    padding-top: 40px;
    padding-bottom: 40px;
  }
}
