/* ===================================================================
   GW TOPデザイン — TOP共通パーツ
   -------------------------------------------------------------------
   ⚠️ 段階的な移設中のため、現時点では既存の見た目を変えない。
      priority 5 で早めに読み込んでいるので、各プラグインのインラインstyleや
      固定ページ本文のOtterカスタムCSSが後から上書きする状態を保っている。
   =================================================================== */

/* -------------------------------------------------------------------
   セクション見出し（モック仕様・2026-09-08）
   もずくさんの Figma Make モックの実測値に合わせた。
   英語ラベル 12px/700/#de4592/字間2px、見出し clamp(18px,3vw,22px)/700/#1e1e1e。
   SPは中央寄せ、768px以上で左寄せ。モックには下線が無いので ::after は消す。
   ⚠️ これ1か所でTOPの見出し8セクションすべてに効く。
   ------------------------------------------------------------------- */
.gw-section-header {
    position: relative;
    padding: 0;
    margin: 48px 0 16px;
    border: none;
    text-align: center;
}
@media (min-width: 768px) {
    .gw-section-header { text-align: left; }
}

/* 旧デザインの下線アクセントを消す */
.gw-section-header::after { content: none; }

.gw-section-header .gw-subtitle {
    font-size: 12px !important;
    font-weight: 700;
    color: var(--gwt-primary) !important;
    letter-spacing: 2px;
    /* 本文側の英語ラベルは ARTICLE / diary / protocol と大小が混在しているが、
       ここで大文字に揃うので本文の書き換えは不要 */
    text-transform: uppercase;
    margin: 0 0 5px !important;
    line-height: 1;
}

/* 🚨 Blocksy の constrained レイアウトは
   `.is-layout-constrained > *` に `width: var(--theme-block-width)`（SPで330px）と
   `margin-left/right:auto !important` を当てている。
   下の h2 / .gw-subtitle の `margin:0 ... !important` が auto を打ち消すため、
   330px の箱が左端に貼りついて見出しが左にズレていた（SPで7.5px、
   親のpaddingが無いブロックでは22.5px）。幅を100%に戻して text-align に任せる。 */
.gw-section-header > * {
    width: 100% !important;
}

.gw-section-header h2 {
    font-size: clamp(18px, 3vw, 22px) !important;
    font-weight: 700 !important;
    color: #1e1e1e !important;
    line-height: 1.35 !important;
    margin: 0 0 8px !important;
    border: none !important;
    padding: 0 !important;
}

/* -------------------------------------------------------------------
   コンテナの左右マージン打ち消し
   「最新の相談container」「最新の日記container」の Otter カスタムCSS。
   上の見出しCSSと違って重複ではなく固有のルールなので、そのまま移設する。
   ------------------------------------------------------------------- */
.ticss-9ab4df09,
.ticss-a5afb000 {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* -------------------------------------------------------------------
   ボタン（新デザイン）
   モックの6種を .gwt- 名前空間で用意しておく。
   既存のクラスとは衝突しないので、使うまでは描画に影響しない。
   hover は必ず @media (hover: hover) の中に置く
   ＝スマホでタップ後にhover状態が残る誤爆を防ぐ（モックもこの作り）。
   ------------------------------------------------------------------- */
.gwt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gwt-space-2);
  /* モック実測値: padding 13px 0 / font-size 13.5px / font-weight 700 */
  padding: 13px 20px;
  border-radius: var(--gwt-radius-pill);
  font-size: 13.5px;
  font-weight: var(--gwt-font-weight-bold);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--gwt-transition), color var(--gwt-transition), opacity var(--gwt-transition);
}
.gwt-btn:active { opacity: .75; }

.gwt-btn--primary { background: var(--gwt-primary); color: #fff; border: 2px solid var(--gwt-primary); }
.gwt-btn--dark    { background: var(--gwt-primary-dark); color: #fff; border: 2px solid var(--gwt-primary-dark); }
.gwt-btn--outline { background: #fff; color: var(--gwt-primary); border: 2px solid var(--gwt-primary); }
.gwt-btn--ghost   { background: #fff; color: var(--gwt-primary); border: 1.5px solid var(--gwt-primary); }
.gwt-btn--white   { background: #fff; color: var(--gwt-primary); border: 2px solid #fff; }
.gwt-btn--light   { background: var(--gwt-primary-light); color: var(--gwt-primary); border: 1.5px solid var(--gwt-primary); }

@media (hover: hover) {
  .gwt-btn--primary:hover,
  .gwt-btn--dark:hover    { background: #fff; color: var(--gwt-primary); }
  .gwt-btn--outline:hover,
  .gwt-btn--ghost:hover   { background: var(--gwt-primary); color: #fff; }
  .gwt-btn--white:hover   { background: transparent; color: #fff; }
  .gwt-btn--light:hover   { background: var(--gwt-primary-light-hover); border-color: var(--gwt-primary); }
}

/* -------------------------------------------------------------------
   カードのhover（モック .hover-card 相当）
   ------------------------------------------------------------------- */
.gwt-card { transition: box-shadow var(--gwt-transition); }
.gwt-card .gwt-card__title { transition: color var(--gwt-transition); }

@media (hover: hover) {
  .gwt-card:hover { box-shadow: var(--gwt-shadow-card-hover); }
  .gwt-card:hover .gwt-card__title { color: var(--gwt-primary); }
}

/* -------------------------------------------------------------------
   モーションを減らす設定への配慮
   ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .gwt-btn,
  .gwt-card,
  .gwt-card .gwt-card__title {
    transition: none;
  }
}

/* -------------------------------------------------------------------
   セクション（新デザイン）
   モックの値: 英語ラベル 12px/700/ls2px、見出し clamp(18px,3vw,22px)/700、
   サブ文 12px/#555/lh1.75。SPは中央寄せ・768px以上で左寄せ。
   ------------------------------------------------------------------- */
.gwt-section { padding: 48px 0 0; }

.gwt-section__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gwt-primary);
  letter-spacing: 2px;
  margin: 0 0 5px;
  text-align: center;
}
.gwt-section__title {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  color: #1e1e1e;
  line-height: 1.35;
  margin: 0 0 8px;
  border: none;
  padding: 0;
  text-align: center;
}
.gwt-section__lead {
  font-size: 12px;
  color: var(--gwt-text-muted);
  line-height: 1.75;
  margin: 0 0 16px;
  text-align: center;
}
@media (min-width: 768px) {
  .gwt-section__label,
  .gwt-section__title,
  .gwt-section__lead { text-align: left; }
}

.gwt-section__cta {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.gwt-btn--half { width: 100%; }
@media (min-width: 640px) {
  .gwt-btn--half { flex: 0 0 calc(50% - 6px); width: auto; }
}

/* -------------------------------------------------------------------
   記事カード
   .gwt-cards--stack … 1件ずつ横長で縦に積む
   .gwt-acard--media … 画像を左に置く横長カード
   ------------------------------------------------------------------- */
.gwt-cards { display: grid; gap: 12px; }
.gwt-cards--stack { display: flex; flex-direction: column; gap: 8px; }

.gwt-acard {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid #e0e0e0;
  border-radius: var(--gwt-radius-lg);
  background: var(--gwt-surface);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--gwt-transition);
}

.gwt-acard__thumb {
  flex: 0 0 auto;
  display: block;
  width: 112px;
  /* アイキャッチの実寸は 300x157（≒1.9:1）。4:3 で切ると左右が大きく削れて
     文字入りのアイキャッチが読めなくなるため 16:9 に合わせる */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: var(--gwt-surface-alt);
}
.gwt-acard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.gwt-acard__thumb--empty { background: var(--gwt-primary-light); }

@media (min-width: 640px) {
  .gwt-acard__thumb { width: 168px; }
}

.gwt-acard__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gwt-acard__tag {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gwt-primary);
  margin-bottom: 2px;
}

.gwt-acard__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  color: #1e1e1e;
  line-height: 1.35;
  margin: 0 0 4px;
  transition: color var(--gwt-transition);
}

.gwt-acard__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
  color: var(--gwt-text-muted);
  line-height: 1.7;
  margin: 0 0 4px;
  word-break: break-all;
  overflow-wrap: break-word;
}

.gwt-acard__meta {
  display: block;
  font-size: 12px;
  color: #777;
}

@media (hover: hover) {
  .gwt-acard:hover { box-shadow: var(--gwt-shadow-card-hover); }
  .gwt-acard:hover .gwt-acard__title { color: var(--gwt-primary); }
}

@media (prefers-reduced-motion: reduce) {
  .gwt-acard,
  .gwt-acard__title { transition: none; }
}

/* 見出しをページ側のブロックで出している場合は、セクション上部の余白を詰める */
.gwt-section--nohead { padding-top: 0; }

/* -------------------------------------------------------------------
   テキストカード（画像なし）とグリッド
   モックの「博士の恋愛プロトコル」の記事カード。
   SP1列 / 640px以上2列、gap 12px（モックは grid sm:grid-cols-2 gap-3）
   ------------------------------------------------------------------- */
.gwt-cards--grid2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) {
  .gwt-cards--grid2 { grid-template-columns: repeat(2, 1fr); }
}

.gwt-acard--text .gwt-acard__body { width: 100%; }
.gwt-acard--text .gwt-acard__title { -webkit-line-clamp: 2; }
.gwt-acard--text .gwt-acard__excerpt { -webkit-line-clamp: 2; }

/* -------------------------------------------------------------------
   カテゴリのピル（アーカイブへのリンク）
   モックの .btn-hashtag 相当。押すとそのカテゴリの一覧へ遷移する。
   ------------------------------------------------------------------- */
.gwt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.gwt-pill {
  display: inline-block;
  background: #fff;
  border: 1.5px solid var(--gwt-primary);
  color: var(--gwt-primary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--gwt-radius-pill);
  text-decoration: none;
  transition: background var(--gwt-transition), color var(--gwt-transition);
}
.gwt-pill--active {
  background: var(--gwt-primary);
  color: #fff;
}
@media (hover: hover) {
  .gwt-pill:hover {
    background: var(--gwt-primary);
    color: #fff;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gwt-pill { transition: none; }
}

/* -------------------------------------------------------------------
   テキスト相談2種の入口（[gwt_consult_methods]・TOP改修 08/09）
   「専門家一覧を見る」ボタンの下。カード2枚を縦に並べ、スペック行の
   ラベルを揃えることで、隣り合わせで比較できるようにしている。
   ⚠️ 名前だけでは区別できないので、対比（書いて送る／その場で話す）が
      必ず見えるようにすること。
   ------------------------------------------------------------------- */
.gwt-cm-list {
  display: flex;
  flex-direction: column;
  gap: var(--gwt-space-5);
}

.gwt-cm {
  display: block;
  padding: var(--gwt-space-5) var(--gwt-space-4) var(--gwt-space-4);
  background: var(--gwt-surface);
  border: 0;
  border-radius: var(--gwt-radius-lg);
  color: var(--gwt-text);
  text-decoration: none;
}

.gwt-cm__head { margin-bottom: var(--gwt-space-2); }

.gwt-cm__kicker {
  display: block;
  font-size: 11px;
  font-weight: var(--gwt-font-weight-bold);
  color: var(--gwt-primary);
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.gwt-cm__title {
  margin: 0;
  font-size: 17px;
  font-weight: var(--gwt-font-weight-bold);
  line-height: 1.4;
  color: #1e1e1e;
}

.gwt-cm__desc {
  margin: 0 0 var(--gwt-space-3);
  font-size: 13px;
  line-height: 1.7;
  color: var(--gwt-text-muted);
}

/* 初回無料の訴求（チャット相談のみ）。
   箱を重ねると「枠の中の枠の中の枠」になるので、塗りは使わず文字で見せる。 */
.gwt-cm__offer {
  margin: 0 0 var(--gwt-space-3);
  font-size: 15px;
  font-weight: var(--gwt-font-weight-bold);
  line-height: 1.5;
  color: var(--gwt-primary-dark);
}
.gwt-cm__offer-sub {
  display: block;
  font-size: 12px;
  font-weight: var(--gwt-font-weight-base);
  color: var(--gwt-text-muted);
}

/* スペック行 */
.gwt-cm__specs {
  margin: 0 0 var(--gwt-space-4);
  border-top: 1px solid var(--gwt-line);
}
.gwt-cm__spec {
  display: flex;
  gap: var(--gwt-space-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--gwt-line);
  font-size: 13px;
  line-height: 1.6;
}
.gwt-cm__spec-label {
  /* 「回答のタイミング」が1行に収まる幅。2枚のカードで同じ幅にして横並びで揃える */
  flex: 0 0 88px;
  color: var(--gwt-text-weak);
  font-size: 11px;
  line-height: 1.5;
  padding-top: 2px;
}
.gwt-cm__spec-value { flex: 1 1 auto; }
.gwt-cm__spec-value strong {
  font-weight: var(--gwt-font-weight-bold);
  color: #1e1e1e;
}

.gwt-cm__cta { width: 100%; }

.gwt-cm__note {
  margin: var(--gwt-space-2) 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--gwt-text-weak);
}

@media (min-width: 768px) {
  .gwt-cm-list { flex-direction: row; align-items: stretch; }
  .gwt-cm {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
  }
  /* CTAをカード下端に揃える */
  .gwt-cm__specs { margin-top: auto; }
}

/* -------------------------------------------------------------------
   「文章で相談する」を面で区切る（バンド）
   角丸の箱で囲うと「枠の中の枠の中の枠」になるので、角丸なしの帯にする。
   ⚠️ 余白はすべてここで持つ。ページ42側のブロックからは padding を外した
      （GenerateBlocks は uploads/generateblocks/style-42.css にCSSを
       キャッシュしていて、wp post update では再生成されないため）。
   ------------------------------------------------------------------- */
#text-consult {
  /* 「箱」に見せない。角丸のないバンドにして、前後のコンテンツから面で切り離す。
     （モックが「専門家を探す」を灰色の面で区切っているのと同じ考え方） */
  margin: 48px 0 0;
  padding: 2px 15px 24px;
  background: var(--gwt-primary-light);
  background: color-mix(in srgb, var(--gwt-primary) 7%, #fff);
}

#text-consult .gw-section-header {
  margin-top: 24px;
}

/* 特徴タグ（[gwt_consult_methods]）。リンクではなくラベル。
   本文に「完全匿名」と書き込むと文が不自然になるので、タグで見せる（kim 2026-09-08） */
#text-consult .gwt-cm__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 var(--gwt-space-3);
}
#text-consult .gwt-cm__tag {
  padding: 3px 9px;
  background: var(--gwt-primary-light);
  background: color-mix(in srgb, var(--gwt-primary) 10%, #fff);
  color: var(--gwt-primary-dark);
  font-size: 11px;
  font-weight: var(--gwt-font-weight-bold);
  line-height: 1.6;
  border-radius: var(--gwt-radius-pill);
  white-space: nowrap;
}

/* -------------------------------------------------------------------
   専門家エリアを灰色の面で区切る（モック: background #f5f5f5 / padding 56px 0）
   出典: Figma Make src/App.tsx L675。#text-consult と同じく角丸なしのバンド。
   ------------------------------------------------------------------- */
#adviser-list {
  margin: 48px 0 0;
  /* タイルを少しでも広く取るため左右は12px（他セクションは15px） */
  padding: 2px 12px 32px;
  background: var(--gwt-surface-alt, #f5f5f5);
}
#adviser-list .gw-section-header { margin-top: 24px; }

/* セクションのリード文（モック: 12px / #555 / line-height 1.75） */
.gw-section-header .gw-section-lead {
  font-size: 12px;
  color: #555;
  line-height: 1.75;
  margin: 0;
}
