/* タスキリレー 共通スタイル（index / service / results / contact）
   先頭は design-system/baseline/baseline.css v1.0 そのまま（7. ページ遷移のみ有効化） */

/* ==========================================================================
   モダン・ベースライン v1.0（字詰め・改行・アクセシビリティの共通設定）
   - 単一HTML方針に合わせ、この内容を <style> の先頭にそのまま貼る
   - 色・フォントは持たない（業種別トークンは各サイトで定義）。--bl-* だけを使う
   - 詳細: design-system/baseline/README.md / DESIGN_GUIDELINES.md §9
   ========================================================================== */

/* ---- 1. トークン（流体タイプスケール・余白・イージング） ---- */
:root {
  --bl-fs-display: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);  /* ヒーロー見出し */
  --bl-fs-h2: clamp(1.625rem, 1.25rem + 1.6vw, 2.5rem);
  --bl-fs-h3: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem);
  --bl-fs-lead: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --bl-fs-body: 1rem;
  --bl-fs-small: 0.875rem;
  --bl-space-section: clamp(4rem, 3rem + 5vw, 8rem);      /* セクション上下余白 */
  --bl-gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);        /* 左右余白 */
  --bl-content: 1120px;
  --bl-header-h: 72px;                                      /* 固定ヘッダーの高さに合わせて上書き */
  --bl-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --bl-reveal-distance: 24px;                               /* 業種別に上書き（葬儀は 0 推奨） */
  --bl-focus: #1a73e8;                                      /* 各サイトのメイン色で上書き可 */
}

/* ---- 2. ベース ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--bl-header-h) + 16px);      /* アンカー移動で見出しがヘッダーに隠れない */
}
body {
  margin: 0;
  line-break: strict;                                       /* 行頭の小書き仮名・約物を禁則 */
  overflow-wrap: anywhere;                                  /* 長いURL・メールで横スクロールさせない */
  -webkit-font-smoothing: antialiased;
}
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
img { object-fit: cover; }
iframe { max-width: 100%; border: 0; }
button, input, select, textarea { font: inherit; }

/* ---- 3. 和文タイポグラフィ ---- */
/* 見出し: プロポーショナル詰め＋文節改行＋行数バランス */
h1, h2, h3, h4, .bl-heading {
  font-feature-settings: "palt";
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-wrap: balance;
  word-break: auto-phrase;                                  /* Chrome/Edge: 文節で改行（lang="ja" 必須） */
}
/* 本文: 最終行の1文字残り（泣き別れ）を防ぐ */
p, li, dd, figcaption { text-wrap: pretty; }
/* 料金・実績・電話番号: 桁を揃える */
.bl-num, table, .price { font-variant-numeric: tabular-nums; }
/* 改行させたくない語句（会社名・電話番号）: <span class="bl-nowrap"> */
.bl-nowrap { white-space: nowrap; }

/* ---- 4. アクセシビリティ ---- */
.bl-skip {
  position: absolute; left: 12px; top: -100px; z-index: 10000;
  padding: 12px 20px; background: #000; color: #fff; text-decoration: none; border-radius: 6px;
}
.bl-skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--bl-focus); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.bl-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- 5. レイアウト・ユーティリティ ---- */
.bl-container { width: min(100% - var(--bl-gutter) * 2, var(--bl-content)); margin-inline: auto; }
.bl-section { padding-block: var(--bl-space-section); }
/* スマホのアドレスバーで切れないファーストビュー */
.bl-fullh { min-height: 100vh; min-height: 100svh; }
/* container query の起点: 置き場所の幅でカードを組み替える */
.bl-cq { container-type: inline-size; }
/* 縦書き見出し（老舗・葬儀・石材・仏具） */
.bl-vertical { writing-mode: vertical-rl; text-orientation: mixed; letter-spacing: 0.2em; }
.bl-vertical .bl-tcy { text-combine-upright: all; }       /* 縦中横: 「創業<span class="bl-tcy">32</span>年」 */

/* ---- 6. スクロール出現（scroll-driven animations） ---- */
/* 使い方: 要素に class="bl-reveal"。対応ブラウザはCSSのみで動作、非対応は baseline.js が補完 */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  @supports (animation-timeline: view()) {
    .bl-reveal {
      animation: bl-reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
  /* 非対応ブラウザ用（baseline.js が html.bl-js-reveal を付与） */
  .bl-js-reveal .bl-reveal {
    opacity: 0; transform: translateY(var(--bl-reveal-distance));
    transition: opacity 0.8s var(--bl-ease-out), transform 0.8s var(--bl-ease-out);
  }
  .bl-js-reveal .bl-reveal.is-visible { opacity: 1; transform: none; }
}
@keyframes bl-reveal {
  from { opacity: 0; transform: translateY(var(--bl-reveal-distance)); }
  to   { opacity: 1; transform: none; }
}

/* ---- 7. ページ遷移（マルチページ構成のサイトのみ有効化） ---- */
/* このサイトは4ページ構成なので有効化（4ページとも shared.css を読むので記述は1か所） */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

/* ---- 8. 動きを減らす設定の利用者には演出を止める ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   タスキリレー サイト固有
   生成りの紙 × 墨 × 襷の赤（ロゴと同じ赤）。赤は襷の帯と、ごく一部の強調にだけ使う
   組み方: 見出し・リード・CTA は中央。長い本文は「中央に置いたカラムの中で左揃え」
   ========================================================================== */
:root {
  --paper: #f4f1ea;
  --paper-2: #ebe6db;
  --white: #fbfaf6;
  --ink: #1c1b19;
  --ink-2: #3d3a35;
  --ink-muted: #6b665d;
  --rule: #d3ccbd;
  --red: #d2281e;          /* 襷の赤 */
  --red-dark: #9e1a13;     /* 襷の折り返し（影の側） */
  --font-head: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --bl-header-h: 64px;
  --bl-focus: #d2281e;
  --bl-reveal-distance: 18px;
  --bl-content: 1140px;
  --col: 38em;             /* 中央に置く本文カラムの幅 */
}
html, body { overflow-x: clip; }
body {
  font-family: var(--font-body);
  font-size: var(--bl-fs-body);
  line-height: 1.95;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 900; margin: 0; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
blockquote, figure { margin: 0; }
.num { font-family: var(--font-head); font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 0; }

/* ---------- 襷の帯（ブランドの記号。これ1つを反復する） ---------- */
.sash {
  display: inline-block; width: 30px; height: 9px; background: var(--red);
  transform: skewX(-38deg) rotate(-28deg); flex: none;
  box-shadow: inset 0 -3px 0 var(--red-dark);
}
/* 大きな帯：各ページのヒーローで角度・太さ・位置を変えて使う */
.band {
  position: absolute; z-index: 0; left: -10vw; width: 120vw;
  height: var(--band-h, 64px); top: var(--band-top, 50%);
  background: var(--red); transform: translateY(-50%) rotate(var(--band-r, -9deg));
  box-shadow: inset 0 calc(var(--band-h, 64px) * -0.16) 0 var(--red-dark);
  display: flex; align-items: center; justify-content: space-around; pointer-events: none;
}
.band span { color: #fff; font-family: var(--font-head); font-weight: 900; font-size: clamp(1.125rem, 0.8rem + 1.2vw, 2rem); letter-spacing: 0.5em; white-space: nowrap; }

/* ---------- 中央寄せの見出しブロック ---------- */
.sec-head { max-width: 40em; margin-inline: auto; text-align: center; }
.sec-head > .sash { display: block; margin: 0 auto 22px; width: 38px; height: 11px; }
.sec-head h2 { font-size: var(--bl-fs-h2); line-height: 1.45; }
.sec-head .lead { margin-top: 18px; color: var(--ink-2); font-size: var(--bl-fs-lead); line-height: 1.95; }
/* 見出しの脇に帯を置く型（中央寄せの中で、ときどき崩す） */
.h-side { display: inline-flex; align-items: center; gap: 16px; font-size: var(--bl-fs-h2); line-height: 1.4; }
.h-side .sash { width: 34px; height: 10px; margin-top: 4px; }
/* 中央に置いて、文字は左 */
.col { width: min(100%, var(--col)); margin-inline: auto; text-align: left; }
.center { text-align: center; }

/* ---------- ボタン ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; font-weight: 700; padding: 15px 26px; border: 2px solid var(--ink); transition: background-color .2s, color .2s, border-color .2s; }
.btn-main { background: var(--ink); color: var(--paper); }
.btn-main:hover { background: var(--red); border-color: var(--red); }
.btn-sub { background: transparent; }
.btn-sub:hover { background: var(--ink); color: var(--paper); }
.btn .arrow { font-family: var(--font-head); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 18px; }
.text-link { font-weight: 700; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-color: var(--red); text-decoration-thickness: 2px; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--bl-header-h);
  background: rgba(244, 241, 234, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ink);
  view-transition-name: site-header;   /* ページ遷移でヘッダーは動かさない */
}
.site-header .bl-container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 900; font-size: 1.25rem; letter-spacing: 0.14em; }
.logo svg { width: 30px; height: 30px; }
.logo small { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.06em; color: var(--ink-muted); margin-left: 4px; }
.gnav { display: flex; align-items: center; gap: 28px; font-size: 0.875rem; }
.gnav a { text-decoration: none; padding-block: 6px; }
.gnav a:hover, .gnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--red); }
.gnav .gnav-cta { background: var(--ink); color: var(--paper); padding: 9px 16px; font-weight: 700; }
.gnav .gnav-cta:hover, .gnav .gnav-cta[aria-current="page"] { background: var(--red); text-decoration: none; }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font-size: 0.875rem; font-weight: 700; padding: 8px 12px; border: 1px solid var(--ink); }
.menu summary::-webkit-details-marker { display: none; }
.menu ul { position: absolute; right: 0; top: calc(100% + 8px); background: var(--white); border: 1px solid var(--ink); min-width: 210px; padding: 8px 0; }
.menu li a { display: block; padding: 10px 18px; text-decoration: none; }
.menu li a[aria-current="page"] { color: var(--red-dark); font-weight: 700; }

/* ---------- 下層ページのヒーロー（中央構図） ---------- */
.page-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--ink); text-align: center; padding-block: clamp(48px, 7vw, 96px) clamp(56px, 7vw, 96px); }
.page-hero .bl-container { position: relative; z-index: 1; }
.crumb { font-size: 0.8125rem; color: var(--ink-muted); }
.crumb a { text-underline-offset: 4px; }
.page-hero h1 { margin-top: 18px; font-size: clamp(2rem, 1.25rem + 3.2vw, 3.75rem); line-height: 1.3; letter-spacing: 0.04em; }
.page-hero .lead { margin: 22px auto 0; max-width: 36em; font-size: var(--bl-fs-lead); line-height: 2; color: var(--ink-2); }

/* ---------- スマホ枠に入れたアカウント画面（運用しているXの実物） ---------- */
.phone { position: relative; display: block; width: var(--pw, 230px); max-width: 100%; flex: none; text-decoration: none; transform: rotate(var(--pr, 0deg)); }
.phone-body { position: relative; display: block; padding: 9px; background: var(--ink); border-radius: 30px; box-shadow: 7px 8px 0 rgba(28, 27, 25, 0.16); }
.phone-body::before { content: ""; position: absolute; z-index: 2; left: 50%; top: 15px; width: 26%; height: 7px; border-radius: 4px; background: var(--ink); transform: translateX(-50%); }
.phone-body img { width: 100%; aspect-ratio: 9 / 16; object-fit: contain; object-position: 50% 0; border-radius: 22px; background: #fff; }
.phone-cap { display: block; margin-top: 14px; text-align: center; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-2); }
.phone-cap b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 0.9375rem; color: var(--ink); }
.phone-cap .handle { color: var(--red-dark); font-variant-numeric: tabular-nums; }
a.phone:hover .handle { text-decoration: underline; }

/* ---------- 写真（実景）と出典 ---------- */
.photo { margin: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; background: var(--paper-2); }
.photo figcaption { margin-top: 8px; font-size: 0.75rem; line-height: 1.7; color: var(--ink-muted); }
.photo figcaption a { text-underline-offset: 3px; }

/* ---------- 手描きの説明図（インラインSVG） ---------- */
.illust { margin-inline: auto; }
.illust svg { width: 100%; height: auto; overflow: visible; }
.illust .ink { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.illust .red { fill: none; stroke: var(--red); stroke-linecap: round; stroke-linejoin: round; }
.illust .fill-red { fill: var(--red); }
.illust .fill-paper { fill: var(--white); }
.illust text { font-family: var(--font-head); font-weight: 700; fill: var(--ink); }
.illust text.r { fill: var(--red-dark); }
.illust figcaption { margin-top: 12px; text-align: center; font-size: 0.8125rem; color: var(--ink-muted); }

/* ---------- お客様の声 ---------- */
.voice { padding-left: 20px; border-left: 3px solid var(--ink); text-align: left; }
.voice p { font-size: 1rem; line-height: 1.95; }
.voice p + p { margin-top: 12px; }
.voice cite { display: block; margin-top: 10px; font-style: normal; font-size: 0.8125rem; color: var(--ink-muted); }

/* ---------- 数字の帯（中央） ---------- */
.figures { display: flex; flex-wrap: wrap; justify-content: center; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); width: fit-content; max-width: 100%; margin-inline: auto; }
.figures > div { padding: 16px clamp(18px, 3vw, 40px); text-align: center; }
.figures > div + div { border-left: 1px solid var(--rule); }
.figures dt { font-size: 0.8125rem; color: var(--ink-muted); line-height: 1.6; }
.figures dd { font-size: clamp(2rem, 1.4rem + 2vw, 2.75rem); line-height: 1.2; }
.figures dd small { font-size: 0.9375rem; font-weight: 700; margin-left: 2px; }

/* ---------- ご相談の帯（全ページ共通・中央） ---------- */
.cta-band { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); text-align: center; }
.cta-band::before { content: ""; position: absolute; left: -8%; top: 64px; width: 34%; height: 20px; background: var(--red); transform: rotate(-8deg); transform-origin: left; box-shadow: inset 0 -5px 0 var(--red-dark); }
.cta-band::after { content: ""; position: absolute; right: -6%; bottom: 72px; width: 22%; height: 12px; background: var(--red); transform: rotate(-8deg); transform-origin: right; box-shadow: inset 0 -3px 0 var(--red-dark); }
.cta-band .bl-container { position: relative; z-index: 1; }
.cta-band h2 { font-size: clamp(1.625rem, 1.15rem + 2vw, 2.75rem); line-height: 1.45; }
.cta-band .lead { margin: 22px auto 0; max-width: 34em; color: rgba(244, 241, 234, 0.82); }
.cta-band .cta-row { margin-top: 36px; }
.cta-band .btn { border-color: var(--paper); }
.cta-band .btn-main { background: var(--paper); color: var(--ink); }
.cta-band .btn-main:hover { background: var(--red); border-color: var(--red); color: #fff; }
.cta-band .btn-sub { color: var(--paper); }
.cta-band .btn-sub:hover { background: var(--paper); color: var(--ink); }
.cta-band .meta { margin-top: 18px; font-size: 0.8125rem; color: rgba(244, 241, 234, 0.7); }

/* ---------- フッター（中央） ---------- */
.site-footer { background: var(--paper); border-top: 1px solid var(--ink); padding-block: 48px 96px; font-size: 0.875rem; text-align: center; }
.site-footer .logo { justify-content: center; }
.site-footer address { font-style: normal; margin-top: 10px; color: var(--ink-2); line-height: 1.9; }
.fnav { margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
.fnav a { text-underline-offset: 4px; }
.credits { width: min(100%, 52em); margin: 28px auto 0; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 0.6875rem; line-height: 1.8; color: var(--ink-muted); }
.credits a { text-underline-offset: 3px; }
.copy { margin-top: 16px; font-size: 0.75rem; color: var(--ink-muted); }

/* スマホ固定バー */
.fbar { display: none; }

@media (max-width: 768px) {
  .gnav { display: none; }
  .menu { display: block; }
  .fbar {
    display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--ink); border-top: 3px solid var(--red);
  }
  .fbar a { color: var(--paper); text-decoration: none; text-align: center; padding: 14px 8px; font-weight: 700; font-size: 0.9375rem; }
  .fbar a + a { border-left: 1px solid rgba(244, 241, 234, 0.25); }
  .band span { display: none; }
}
@media (max-width: 480px) {
  .logo small { display: none; }
  .btn { width: 100%; }
  .figures { width: 100%; }
  .figures > div { flex: 1 1 50%; padding-inline: 10px; }
  .figures > div:nth-child(3) { flex-basis: 100%; border-left: 0; border-top: 1px solid var(--rule); }
  .phone-cap { font-size: 0.75rem; }
  .cta-band::after { display: none; }
}

/* スマホでは3行を超えるリード文を左揃えにする（中央揃えの長文は行頭が揃わず読みにくい） */
@media (max-width: 480px) {
  .hero-lead, p.lead { text-align: left; }
}
@media (max-width: 480px) {
  .figures dt { font-size: 0.75rem; word-break: auto-phrase; }
}

/* ---------- 右下に浮かぶ相談ボタン（shared.js が生成。PCのみ） ---------- */
.fcta { display: none; }
@media (min-width: 769px) {
  .fcta {
    display: block; position: fixed; z-index: 900; right: 24px; bottom: 24px; width: 272px;
    padding: 20px 20px 18px; background: var(--paper); border: 2px solid var(--ink);
    box-shadow: 8px 8px 0 var(--red);
    opacity: 0; visibility: hidden; transform: translateY(16px);
    transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
  }
  .fcta.is-shown { opacity: 1; visibility: visible; transform: none; transition: opacity .3s ease, transform .3s ease, visibility 0s; }
  /* 左上に襷の小さな帯 */
  .fcta::before { content: ""; position: absolute; left: -10px; top: -12px; width: 64px; height: 12px; background: var(--red); transform: rotate(-18deg); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
  .fcta-lead { font-size: 0.8125rem; line-height: 1.75; color: var(--ink-2); padding-right: 18px; }
  .fcta-main { display: block; margin-top: 12px; padding: 12px 14px; background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 700; font-size: 0.9375rem; text-align: center; transition: background-color .2s; }
  .fcta-main:hover { background: var(--red); }
  .fcta-sub { display: block; margin-top: 10px; font-size: 0.8125rem; text-align: center; text-underline-offset: 4px; }
  .fcta-close { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; background: transparent; font-size: 1.125rem; line-height: 1; color: var(--ink-muted); cursor: pointer; }
  .fcta-close:hover { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .fcta, .fcta.is-shown { transition: none; transform: none; }
}
