/* =========================================================
   体験の丸（ot-circles）
   ・「〜な方」を3つ、白い丸＋外側の細い輪で並べる部品（大人・子どもの「無料体験レッスンのご案内」）
   ・文字は HTML に書き、UX Builder の「HTML」要素で書き換えます
   ・改行したい所には、丸の文章の中に自分で <br> を書きます
     （<br class="spbr"> でスマホだけの改行も使えます。style.css の指定）
   ・丸の上の線のアイコンは circles.js が描きます（HTML の data-icon で絵を選ぶ）
   ・画面に入ると、丸が1つずつふわっと出ます（JS が動かない時も、文字は最初から見えます）
   ・置かれた場所の幅が 767px 以下で、上に2つ・下に1つの三角形に並びます（コンテナクエリ）
   ========================================================= */

/* ---------- 調整用の変数 ---------- */
.ot-circles {
  --ot-circles-size: 210px;          /* 丸の大きさ（PC） */
  --ot-circles-size-sp: 160px;       /* 丸の大きさ（スマホ）。上に2つ並ぶよう、これより大きくしない */
  --ot-circles-gap: 28px;            /* 丸の間（PC） */
  --ot-circles-gap-sp: 10px;         /* 丸の横の間（スマホ） */
  --ot-circles-up-sp: -12px;         /* スマホで下の丸を上に寄せる量（輪どうしが重ならない量） */
  --ot-circles-bg: #ffffff;          /* 丸の色 */
  --ot-circles-ring: rgba(180, 107, 100, 0.45); /* 外側の輪の色（コンタクトカラーを薄く） */
  --ot-circles-accent: #b46b64;      /* アイコンの線の色（コンタクトカラー） */
  --ot-circles-text: #292d33;        /* 文字の色 */
  --ot-circles-icon: 34px;           /* アイコンの大きさ（PC） */
  --ot-circles-icon-sp: 28px;        /* アイコンの大きさ（スマホ） */

  container-type: inline-size;       /* 置かれた場所の幅で、並び方を切り替える */
  margin: 8px 0 28px;
}

/* ---------- 並べる箱 ---------- */
/* :not(#ot-x) … Flatsome の ul・li の指定（左の余白・黒丸）に負けないための書き方
   （#ot-x という名前の部品は無いので、どの要素にも当てはまり、指定だけが強くなります） */
.ot-circles__list:not(#ot-x) {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ot-circles-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* WordPress が部品と部品の「すき間」に入れる <br> だけ消す
   （丸の文章の中に自分で書いた <br> は、改行として効く） */
.ot-circles > br,
.ot-circles__list > br {
  display: none;
}

/* ---------- 丸（1つ分） ---------- */
.ot-circles__item:not(#ot-x) {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: var(--ot-circles-size);
  height: var(--ot-circles-size);
  margin: 0;
  padding: 0 18px;
  border-radius: 50%;
  background: var(--ot-circles-bg);
  box-shadow: 0 6px 24px rgba(41, 45, 51, 0.08);  /* やわらかい影 */
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "YuGothic", sans-serif;
  font-size: 15px;                   /* 本文と同じ。これより小さくしない */
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--ot-circles-text);
  list-style: none;
}
/* 外側の細い輪（1px） */
.ot-circles__item::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid var(--ot-circles-ring);
  border-radius: 50%;
  pointer-events: none;
}
/* WordPress が文章を <p> で包んでも、すき間が増えないようにする */
.ot-circles__item p:not(#ot-x) {
  margin: 0;
}

/* ---------- 線のアイコン（JS が中に絵を入れる） ---------- */
.ot-circles__icon {
  display: block;
  width: var(--ot-circles-icon);
  height: var(--ot-circles-icon);
  margin-bottom: 8px;
  color: var(--ot-circles-accent);
}
.ot-circles__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ot-circles__icon svg * {
  vector-effect: non-scaling-stroke; /* 大きさを変えても、線はいつも1px */
}

/* ---------- ふわっと出す（JS が動く時だけ is-js が付く） ---------- */
.ot-circles.is-js .ot-circles__item {
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.ot-circles.is-js .ot-circles__item.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .ot-circles.is-js .ot-circles__item { opacity: 1; transform: none; transition: none; }
}

/* ---------- スマホ（置かれた場所の幅が767px以下）：上に2つ、下に1つ ---------- */
@container (max-width: 767px) {
  .ot-circles__list:not(#ot-x) {
    gap: 0 var(--ot-circles-gap-sp);
  }
  .ot-circles__item:not(#ot-x) {
    width: var(--ot-circles-size-sp);
    height: var(--ot-circles-size-sp);
    padding: 0 12px;
  }
  /* 下の丸を、上の2つの間に少し入り込ませる */
  .ot-circles__item:nth-child(3):not(#ot-x) {
    margin-top: var(--ot-circles-up-sp);
  }
  .ot-circles__item::after {
    inset: -5px;
  }
  .ot-circles__icon {
    width: var(--ot-circles-icon-sp);
    height: var(--ot-circles-icon-sp);
    margin-bottom: 4px;
  }
}
