/* ==========================================================================
   遺言寺 — 第二階層（サービス詳細）共通スタイル
   トップページ（index.html）のデザイントークン・ヘッダー・フッターを
   そのまま引き継ぎ、詳細ページ用のコンポーネントを追加している。
   ========================================================================== */

/* --------------------------------------------------------------
   Tailwind v4 の @import "tailwindcss" (Preflight) 相当のリセット。
   -------------------------------------------------------------- */
*, ::before, ::after { box-sizing: border-box; border: 0 solid; }
html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}
body { line-height: inherit; }
hr { height: 0; color: inherit; border-top-width: 1px; }
abbr:where([title]) { text-decoration: underline dotted; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1em; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -0.25em; }
sup { top: -0.5em; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
button, input, optgroup, select, textarea {
  font-family: inherit; font-size: 100%; font-weight: inherit;
  line-height: inherit; color: inherit; margin: 0; padding: 0;
}
button, select { text-transform: none; }
button, [type='button'], [type='reset'], [type='submit'] {
  -webkit-appearance: button; background-color: transparent; background-image: none;
}
:-moz-focusring { outline: auto; }
progress { vertical-align: baseline; }
summary { display: list-item; }
blockquote, dl, dd, h1, h2, h3, h4, h5, h6,
hr, figure, p, pre { margin: 0; }
fieldset { margin: 0; padding: 0; }
legend { padding: 0; }
ol, ul, menu { list-style: none; margin: 0; padding: 0; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { opacity: 1; color: #9ca3af; }
button, [role="button"] { cursor: pointer; }
:disabled { cursor: default; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
[hidden] { display: none; }

:root {
  --ink: #18201a;
  --moss: #263a2e;
  --deep: #14231b;
  --paper: #f3f0e7;
  --sand: #e5dfd1;
  --gold: #ad8951;
  --line: rgba(24, 32, 26, .16);
  --font-jp: "Zen Old Mincho", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --font-en: "Jost", "Helvetica Neue", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-jp);
  font-size: 20px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ==========================================================================
   ヘッダー（トップページと共通）
   ========================================================================== */
.site-header {
  height: 88px;
  padding: 0 4.5vw;
  display: flex;
  align-items: center;
  gap: 3vw;
  background: rgba(243, 240, 231, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 170px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--paper);
  background: var(--deep);
  border-radius: 50%;
  font-size: 19px;
}
.brand strong { display: block; font-size: 21px; letter-spacing: .24em; line-height: 1; }
.brand small { display: block; margin-top: 6px; font: 13px/1 var(--font-en); letter-spacing: .36em; color: #6e746f; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 2.5vw; font-size: 15px; }
.site-header nav a { font-size: 15px; letter-spacing: .1em; position: relative; }
.site-header nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -8px; height: 1px; background: var(--ink); transition: .25s; }
.site-header nav a:hover::after { right: 0; }
.header-cta {
  margin-left: 1vw;
  padding: 15px 22px;
  color: white;
  background: var(--deep);
  font-size: 12px;
  letter-spacing: .1em;
  white-space: nowrap;
}

/* ==========================================================================
   パンくず
   ========================================================================== */
.breadcrumb {
  padding: 20px 4.5vw;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 231, .6);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; color: #6b716c; }
.breadcrumb li { display: flex; align-items: center; gap: 12px; letter-spacing: .06em; }
.breadcrumb li + li::before { content: "／"; color: #a7ada7; }
.breadcrumb a { border-bottom: 1px solid transparent; padding-bottom: 2px; transition: border-color .2s; }
.breadcrumb a:hover { border-bottom-color: var(--ink); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* ==========================================================================
   ページヒーロー（詳細ページ上部）
   ========================================================================== */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 95px 8vw 0;
  background: var(--deep);
  color: #f2efe6;
}
.page-hero::after {
  content: attr(data-kanji);
  position: absolute;
  right: 2vw;
  bottom: -6vw;
  font-size: 27vw;
  line-height: 1;
  font-weight: 700;
  color: rgba(255, 255, 255, .035);
  letter-spacing: -.1em;
  pointer-events: none;
}
.page-hero-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; }
.section-kicker { display: flex; align-items: center; gap: 15px; font: 10px var(--font-en); letter-spacing: .25em; }
.section-kicker span { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; letter-spacing: 0; }
.section-kicker.light { color: #abb4ad; }
.section-kicker.light span { border-color: rgba(255, 255, 255, .25); }
.jp-kicker { color: var(--gold); letter-spacing: .25em; font-size: 12px; }
.page-hero .jp-kicker { display: block; margin-top: 26px; }
.page-hero h1 {
  margin: 26px 0 28px;
  font-size: clamp(34px, 4.6vw, 66px);
  line-height: 1.45;
  letter-spacing: .08em;
  font-weight: 500;
}
.page-hero h1 em { font-style: normal; color: var(--gold); }
.page-hero-lead {
  max-width: 720px;
  color: #b7c0b8;
  font-size: 21px;
  line-height: 2;
  letter-spacing: .04em;
}
.page-hero-actions { margin-top: 42px; display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }

.at-a-glance {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 70px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, .2);
}
.at-a-glance div { padding: 30px 34px 34px 0; border-right: 1px solid rgba(255, 255, 255, .2); }
.at-a-glance div:last-child { border-right: 0; }
.at-a-glance div:not(:first-child) { padding-left: 34px; }
.at-a-glance dt { color: var(--gold); font-size: 11px; letter-spacing: .2em; }
.at-a-glance dd { margin: 12px 0 0; font-size: 19px; line-height: 1.75; letter-spacing: .04em; }

/* ==========================================================================
   共通セクション
   ========================================================================== */
.section { padding: 95px 8vw; }
.section-inner { max-width: 1160px; margin: 0 auto; }
.section-alt { background: #f7f5ee; }
.section-sand { background: #ebe7dc; }
.section-head { display: grid; grid-template-columns: .8fr 1.2fr; gap: 6vw; align-items: start; }
.section-head h2,
.section-title { margin: 22px 0 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.5; letter-spacing: .08em; font-weight: 500; }
.section-head > p:last-child { color: #5d645e; font-size: 20px; line-height: 1.95; }
.lede { max-width: 780px; color: #5d645e; font-size: 21px; line-height: 1.95; }

.button { display: inline-flex; align-items: center; justify-content: space-between; min-width: 230px; padding: 18px 20px; font-size: 13px; letter-spacing: .08em; transition: transform .2s, background .2s; }
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--deep); color: white; }
.button-gold { background: var(--gold); color: #14231b; }
.button-ghost { border: 1px solid rgba(255, 255, 255, .45); color: #f2efe6; }
.button span { font: 18px var(--font-en); }
.text-link { font-size: 13px; border-bottom: 1px solid currentColor; padding: 7px 0; }
.text-link span { margin-left: 18px; }

/* こんなご事情に — チェックリスト */
.case-list { margin-top: 55px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 6vw; }
.case-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 18px;
  align-items: start;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  font-size: 19px;
  line-height: 1.8;
  letter-spacing: .04em;
}
.case-list li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(173, 137, 81, .55);
  border-radius: 50%;
  color: var(--gold);
  font-size: 14px;
}

/* 遺言寺ができること — 番号付きブロック */
.offer-list { margin-top: 60px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.offer-list article {
  padding: 40px 36px 44px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.offer-list article:not(:nth-child(3n + 1)) { padding-left: 36px; }
.offer-list article:nth-child(3n) { border-right: 0; }
.offer-list .offer-number { color: var(--gold); font: 11px var(--font-en); letter-spacing: .2em; }
.offer-list h3 { margin: 18px 0 14px; font-size: 23px; font-weight: 500; letter-spacing: .1em; line-height: 1.5; }
.offer-list p { color: #5d645e; font-size: 18px; line-height: 1.85; }

/* 流れ */
.flow { margin-top: 60px; border-top: 1px solid rgba(23, 49, 40, .22); }
.flow li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 4vw;
  padding: 34px 0;
  border-bottom: 1px solid rgba(23, 49, 40, .18);
}
.flow .flow-step { display: flex; align-items: baseline; gap: 12px; color: #8b6b3e; }
.flow .flow-step span { font: 10px var(--font-en); letter-spacing: .2em; }
.flow .flow-step strong { font-size: 30px; font-weight: 500; letter-spacing: .06em; }
.flow h3 { margin: 0 0 10px; font-size: 22px; font-weight: 500; letter-spacing: .1em; }
.flow p { color: #4f5b54; font-size: 18px; line-height: 1.85; }

/* 定義リスト（必要書類・料金の目安など） */
.spec-list { margin-top: 45px; border-top: 1px solid var(--line); }
.spec-list div { display: grid; grid-template-columns: 220px 1fr; gap: 3vw; padding: 22px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: #8b6b3e; font-size: 15px; letter-spacing: .12em; line-height: 1.7; }
.spec-list dd { margin: 0; color: #263a31; font-size: 19px; line-height: 1.8; }

/* WEB供養・記録パネル */
.web-memorial {
  padding: 95px 8vw;
  background: var(--deep);
  color: #f2efe6;
  position: relative;
  overflow: hidden;
}
.web-memorial::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 22%, rgba(173, 137, 81, .18) 0 12%, transparent 46%);
  pointer-events: none;
}
.web-memorial-inner { position: relative; z-index: 1; max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: .95fr 1.05fr; gap: 7vw; align-items: start; }
.web-memorial h2 { margin: 20px 0 26px; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.5; letter-spacing: .08em; font-weight: 500; }
.web-memorial-copy > p { color: #aeb8b0; font-size: 19px; line-height: 1.95; }
.web-memorial-features { border-top: 1px solid rgba(255, 255, 255, .2); }
.web-memorial-features div { display: grid; grid-template-columns: 45px 1fr; gap: 20px; padding: 22px 0; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.web-memorial-features dt { color: var(--gold); font: 10px var(--font-en); letter-spacing: .12em; padding-top: 7px; grid-column: 1; }
.web-memorial-features dd { margin: 0; grid-column: 2; }
.web-memorial-features h3 { margin: 0 0 8px; font-size: 20px; font-weight: 500; letter-spacing: .1em; }
.web-memorial-features p { margin: 0; color: #aeb8b0; font-size: 17px; line-height: 1.8; }
.web-memorial-actions { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }
.web-memorial-note { margin-top: 26px; color: #8b968d; font-size: 13px; line-height: 1.8; }

/* FAQ */
.faq { margin-top: 55px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 26px 0;
  cursor: pointer;
  color: #173128;
  font-size: 21px;
  line-height: 1.6;
  letter-spacing: .06em;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; color: var(--gold); font: 15px var(--font-en); letter-spacing: .1em; }
.faq summary::after { content: "＋"; margin-left: auto; color: #8b6b3e; font-size: 18px; }
.faq details[open] summary::after { content: "－"; }
.faq details > p {
  display: grid;
  grid-template-columns: 33px 1fr;
  gap: 18px;
  padding: 0 0 30px;
  color: #5d645e;
  font-size: 18px;
  line-height: 1.9;
}
.faq details > p::before { content: "A"; color: #8b6b3e; font: 15px var(--font-en); letter-spacing: .1em; }

/* 注記 */
.note {
  margin-top: 45px;
  padding: 26px 30px;
  border-left: 2px solid var(--gold);
  background: rgba(173, 137, 81, .07);
  color: #4f5b54;
  font-size: 16px;
  line-height: 1.9;
}
.note strong { display: block; margin-bottom: 8px; color: #173128; font-size: 17px; font-weight: 500; letter-spacing: .08em; }

/* 関連するご相談 */
.related-list { margin-top: 55px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.related-list a {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 34px 32px 34px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.related-list a:not(:nth-child(3n + 1)) { padding-left: 32px; }
.related-list a:nth-child(3n) { border-right: 0; }
.related-list a:hover { background: rgba(173, 137, 81, .07); }
.related-list .related-number { color: var(--gold); font-size: 13px; }
.related-list strong { font-size: 22px; font-weight: 500; letter-spacing: .12em; }
.related-list p { color: #5d645e; font-size: 17px; line-height: 1.8; }
.related-list em { margin-top: auto; padding-top: 18px; font-style: normal; font-size: 13px; color: #6b716c; }

/* 相談導線 */
.cta-band { padding: 95px 8vw; background: #ebe7dc; }
.cta-inner { max-width: 1160px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8vw; align-items: center; }
.cta-band h2 { margin: 22px 0 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.5; letter-spacing: .08em; font-weight: 500; }
.cta-detail .contact-priest { color: #173128; margin-bottom: 14px; letter-spacing: .12em; }
.cta-detail .contact-priest strong { font-size: 18px; font-weight: 500; }
.cta-detail > p { color: #4f5b54; font-size: 20px; line-height: 1.9; max-width: 560px; }
.cta-detail .button { margin: 28px 0 12px; min-width: 300px; }
.cta-detail small { display: block; color: #6f756f; font-size: 13px; line-height: 1.8; }

/* ==========================================================================
   フッター（トップページと共通）
   ========================================================================== */
footer { min-height: 260px; padding: 65px 8vw 35px; background: #101914; color: #d7ddd8; display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 25px; }
.footer-brand .brand-mark { background: #d7ddd8; color: var(--deep); }
.footer-brand small { color: #8c968e; }
footer > p { margin: 10px 0; text-align: right; color: #8f9a92; font-size: 13px; letter-spacing: .12em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 30px; font-size: 12px; margin-top: 35px; }
footer > small { text-align: right; margin-top: 35px; font: 9px var(--font-en); color: #667168; letter-spacing: .15em; }

/* キーボード操作時のフォーカス表示 */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ==========================================================================
   モバイルナビゲーション（ハンバーガー + ドロワー + 固定CTA）
   ========================================================================== */
.nav-toggle { display: none; }
.nav-contact { display: none; }
.mobile-cta { display: none; }

@media (max-width: 900px) {
  .site-header { height: 72px; padding: 0 20px; }
  .header-cta { display: none; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    margin-left: auto;
    width: 46px;
    height: 46px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    position: relative;
    z-index: 40;
  }
  .nav-toggle span {
    display: block;
    height: 1px;
    width: 100%;
    background: var(--ink);
    transition: transform .28s ease, opacity .2s ease;
  }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-header nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: fixed;
    inset: 72px 0 0;
    z-index: 30;
    margin: 0;
    padding: 22px 8vw calc(22px + env(safe-area-inset-bottom));
    background: rgba(243, 240, 231, .985);
    backdrop-filter: blur(14px);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .28s ease, transform .28s ease, visibility .28s;
  }
  body.nav-open .site-header nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  body.nav-open { overflow: hidden; }

  .site-header nav a {
    padding: 20px 0;
    font-size: 19px;
    letter-spacing: .14em;
    border-bottom: 1px solid var(--line);
  }
  .site-header nav a::after { content: none; }
  .nav-contact {
    display: block;
    margin-top: 28px;
    padding: 20px 0;
    text-align: center;
    color: white;
    background: var(--deep);
    border-bottom: 0;
    font-size: 17px;
  }

  /* 画面下部に常設する相談導線 */
  .mobile-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    padding: 18px 8vw calc(18px + env(safe-area-inset-bottom));
    background: var(--deep);
    color: white;
    font-size: 17px;
    letter-spacing: .1em;
    box-shadow: 0 -6px 24px rgba(20, 35, 27, .18);
  }
  body.nav-open .mobile-cta { display: none; }
  footer { padding-bottom: 120px; }

  /* レイアウトの1カラム化 */
  .breadcrumb { padding: 16px 7vw; }
  .breadcrumb ol { font-size: 12px; gap: 8px; }
  .breadcrumb li { gap: 8px; }
  .page-hero { padding: 70px 7vw 0; }
  .page-hero::after { font-size: 52vw; right: -6vw; bottom: -10vw; }
  .page-hero-lead { font-size: 19px; }
  .page-hero-actions { flex-direction: column; align-items: flex-start; gap: 20px; }
  .at-a-glance { grid-template-columns: 1fr; margin-top: 55px; }
  .at-a-glance div { padding: 22px 0; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .2); }
  .at-a-glance div:not(:first-child) { padding-left: 0; }
  .at-a-glance div:last-child { border-bottom: 0; }
  .section { padding: 75px 7vw; }
  .section-head { grid-template-columns: 1fr; gap: 22px; }
  .case-list { grid-template-columns: 1fr; gap: 0; }
  .offer-list { grid-template-columns: 1fr; }
  .offer-list article { padding: 30px 0 34px; border-right: 0; }
  .offer-list article:not(:nth-child(3n + 1)) { padding-left: 0; }
  .flow li { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .spec-list div { grid-template-columns: 1fr; gap: 10px; }
  .web-memorial { padding: 75px 7vw; }
  .web-memorial-inner { grid-template-columns: 1fr; gap: 45px; }
  .web-memorial-actions { flex-direction: column; align-items: flex-start; gap: 20px; }
  .related-list { grid-template-columns: 1fr; }
  .related-list a { padding: 28px 0; border-right: 0; }
  .related-list a:not(:nth-child(3n + 1)) { padding-left: 0; }
  .cta-band { padding: 75px 7vw; }
  .cta-inner { grid-template-columns: 1fr; gap: 30px; }
  footer { grid-template-columns: 1fr; }
  footer > p, footer > small { text-align: left; }
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .page-hero h1 { font-size: 30px; letter-spacing: .04em; }
  .section-head h2, .section-title, .cta-band h2, .web-memorial h2 { font-size: 27px; }
  .desktop-only { display: none; }
  .cta-detail .button, .page-hero-actions .button, .web-memorial-actions .button { min-width: 100%; }
  .note { padding: 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
