/* =====================================================================
   closing-type.css
   1. 日本語の改行：文節のまとまり（.u-ph）と、ブラウザ任せの補助
   2. 相談セクション右の締めの図（.ct-fin）
   トップと制作実績の各ページで読み込む。JSなしでも成り立つ。
   ===================================================================== */

/* ---------- 1. 改行 ---------- */

/* 文節のまとまり。行に収まるあいだは途中で折らず、収まらない幅では中で折り返す
   （nowrap ではないので、はみ出さない）。 */
.u-ph{display:inline-block;max-width:100%}

/* 対応ブラウザでは文節単位で折る。非対応でも通常の折り返しのまま。
   :where で詳細度 0 にして、各ページの指定を上書きしない。 */
:where(main,.c-next) :where(h1,h2,h3,p,li,dt,dd,summary,figcaption){
  line-break:strict;
  overflow-wrap:break-word;
  word-break:auto-phrase;
}
:where(main,.c-next) :where(h2,h3,summary){text-wrap:balance}
:where(main,.c-next) :where(p,dd){text-wrap:pretty}

/* 下線つきの声：inline-block には親の下線が届かないので、同じ下線を持たせる */
.continuation .c-contact .entry-voice .u-ph{text-decoration:inherit}

/* 相談の見出し：狭い画面でも「まとまっていなくても、／いま考えていることから。」の二行に */
@media (max-width:520px){
  .continuation .c-contact h2{font-size:clamp(22px,6.9vw,28px)}
}


/* ---------- 2. 相談セクションの締めの図 ---------- */
/* ばらばらの言葉・写真・色が、黄色い下線のもとで一枚の画面にまとまる。
   動きは既存の --cp（0→1）と .is-set だけを使う。JSなし・動きを減らす設定では完成形で静止。 */
.ct-fin{position:relative;z-index:1;margin:30px 0 0 auto;width:min(74%,290px);pointer-events:none}
.ct-fin svg{display:block;width:100%;height:auto;overflow:visible}
.ct-fin text{font-family:inherit;font-weight:800;font-size:20px;letter-spacing:.04em;fill:#1f2340}

.cf-ink{fill:#1f2340}
.cf-cream{fill:#fffdf4}
.cf-white{fill:#fff}
.cf-sky{fill:#e6f3ff}
.cf-coral{fill:#ff6a48}
.cf-sun{fill:#ffc93c}
.cf-mint{fill:#2fc4a2}
.cf-night{fill:#293e50}
.cf-o{stroke:#1f2340;stroke-width:2.5;stroke-linejoin:round}
.cf-o--bold{stroke-width:3}
.cf-o--thin{stroke-width:1.5}
.cf-none{fill:none}

/* 集まってくる素材：--cp が 1 に近づくほど、決まった場所へ */
.cf-p{
  transform-box:fill-box;transform-origin:50% 50%;
  transform:
    translate(calc(var(--dx,0px) * (1 - var(--cp,1))),calc(var(--dy,0px) * (1 - var(--cp,1))))
    rotate(calc(var(--dr,0deg) * (1 - var(--cp,1))));
}

/* 収まったあと：選択枠が出て、黄色い下線が引かれ、つくる人のカーソルが着く */
.cf-line{transform-box:fill-box;transform-origin:0 50%;transition:transform .6s cubic-bezier(.3,.1,.2,1) .1s}
.cf-sel{transition:opacity .3s}
.cf-cursor{transition:opacity .3s .3s,transform .55s cubic-bezier(.3,1.4,.5,1) .3s}
.ct.is-live:not(.is-set) .cf-line{transform:scaleX(0);transition-duration:.2s;transition-delay:0s}
.ct.is-live:not(.is-set) .cf-sel{opacity:0}
.ct.is-live:not(.is-set) .cf-cursor{opacity:0;transform:translate(24px,18px);transition-duration:.2s;transition-delay:0s}

@media (prefers-reduced-motion:no-preference){
  .cf-logo-tile{transform-box:fill-box;transform-origin:center}
  .ct.is-live:not(.logo-seated) .cf-logo-tile{opacity:0}
  .ct.is-live.logo-seated .cf-logo-tile{animation:cf-seat-logo .46s cubic-bezier(.2,.75,.3,1) .65s both}
}
@keyframes cf-seat-logo{
  from{opacity:0;transform:translate(3px,10px) rotate(4deg)}
  75%{opacity:1;transform:translateY(-1px) rotate(-.5deg)}
  to{opacity:1;transform:none}
}

@media (min-width:600px){
  .ct-fin{width:300px;margin-top:36px}
}

/* 広い画面：カードの右の空きに置く。カードの幅が足りないときはカードが先に縮む */
@media (min-width:960px){
  .ct{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);column-gap:clamp(24px,2.5vw,36px);align-items:end}
  .ct > .ct-words{grid-column:1 / -1}
  .ct > .ct-card{grid-column:1;min-width:0}
  .ct > .ct-fin{grid-column:2;grid-row:2;align-self:center;justify-self:center;width:100%;margin:0;
    transform:translate(clamp(20px,3vw,44px),40px) rotate(8deg)}
}

@media (prefers-reduced-motion:reduce){
  .ct-fin *{transition:none!important;animation:none!important}
}
