/*
  読みもの（public/guide/）の見た目。色・書体・ヘッダー・フッター・ボタンは、LP（public/lp/index.html）に合わせる。
  ページは scripts/build-guide.mjs が作る。日本語の文は、ことばの切れ目（<wbr>）でだけ折り返す（LP と同じ）
*/
:root {
  color-scheme: light;
  --bg: #f6faf8;
  --hero: #e4f2ec;
  --surface: #ffffff;
  --ink: #18201d;
  --ink-2: #3f4b46;
  --sub: #56625d;
  --line: #e1e8e5;
  --ring: #d3e7df;
  --accent: #0e7a6a;
  --accent-dark: #0a5f52;
  --accent-mid: #a7d3ca;
  --pen: #13917c;
  --marker: #c4eadf;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Meiryo", "IPAPGothic",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

/* 日本語の文は、ことばの切れ目（<wbr>）でだけ折り返す。入らないほど長いときだけ、どこでも折り返す */
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid var(--accent-mid);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.45;
  font-feature-settings: "palt";
  letter-spacing: 0.03em;
  text-wrap: balance;
}

p {
  margin: 0;
}

/* 最後の行に1〜2文字だけ残らないように */
p,
li,
td,
figcaption {
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.small {
  color: var(--sub);
  font-size: 14px;
}

/* ボタン */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.15s,
    box-shadow 0.15s,
    transform 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(14, 122, 106, 0.16);
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #fff;
  box-shadow: 0 0 0 7px rgba(14, 122, 106, 0.18);
}

.btn-primary:active {
  transform: translateY(1px);
}

/* ヘッダー（浮いた白い帯。LP と同じ） */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(env(safe-area-inset-top) + 10px) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 1056px;
  height: 56px;
  margin: 0 auto;
  padding: 0 8px 0 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  box-shadow:
    0 0 0 1px rgba(24, 32, 29, 0.05),
    0 10px 24px -18px rgba(10, 60, 52, 0.45);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.header-cta {
  min-height: 40px;
  padding: 0 16px;
  font-size: 15px;
  box-shadow: none;
}

.header-cta:hover {
  box-shadow: none;
}

/* 見出しのところ（LP のはじめの画面と同じ色を、ヘッダーの下まで敷く） */
.article-head {
  position: relative;
  margin-top: calc(-66px - env(safe-area-inset-top));
  padding: calc(92px + env(safe-area-inset-top)) 0 44px;
  background: linear-gradient(180deg, var(--hero) 0%, #e8f4ef 100%);
}

/* 下の波（LP と同じ） */
.article-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 14'%3E%3Cpath d='M0 14V8c6 0 6-6 12-6s6 6 12 6 6-6 12-6 6 6 12 6v6z' fill='%23f6faf8'/%3E%3C/svg%3E")
    0 0 / 48px 14px repeat-x;
}

.article-head .wrap,
.article-body,
.reads-wrap {
  max-width: 760px;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--sub);
  font-size: 13px;
}

.crumbs li + li::before {
  content: "›";
  margin-right: 6px;
}

.crumbs a {
  color: var(--sub);
}

.article-head h1 {
  margin-top: 12px;
  font-size: clamp(25px, 6.6vw, 34px);
}

.byline {
  margin-top: 14px;
  color: var(--sub);
  font-size: 13.5px;
  line-height: 1.7;
}

.byline a {
  color: var(--sub);
}

.article-head .lead {
  margin-top: 14px;
  color: var(--ink-2);
}

/* 本文 */
.article-body {
  padding-top: 36px;
  padding-bottom: 8px;
  font-size: 16.5px;
  line-height: 1.9;
}

.article-body > * + * {
  margin-top: 18px;
}

.article-body h2 {
  position: relative;
  margin-top: 60px;
  padding-bottom: 12px;
  font-size: clamp(21px, 5.6vw, 25px);
}

/* 見出しの下の、手で引いたような線（LP の「やらないこと」と同じ） */
.article-body h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c18-4 30 2 46 0s30-5 46-2 18 3 24 1' fill='none' stroke='%2313917c' stroke-width='2.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}

.article-body h3 {
  margin-top: 40px;
  font-size: 18.5px;
}

.article-body > h2 + *,
.article-body > h3 + * {
  margin-top: 14px;
}

.article-body ul,
.article-body ol {
  margin-bottom: 0;
  padding-left: 1.5em;
}

.article-body li + li {
  margin-top: 6px;
}

.article-body li::marker {
  color: var(--accent);
  font-weight: 700;
}

/* 大事なところに引くマーカー */
.article-body strong {
  background: linear-gradient(transparent 62%, var(--marker) 62%);
  font-weight: 700;
}

/* 表（やらないこと・固定費の一覧） */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 15px;
  line-height: 1.7;
}

.article-body th,
.article-body td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body thead th {
  border-top: 0;
  background: #e3efea;
  color: var(--ink-2);
  font-size: 14px;
}

.article-body tbody th {
  white-space: nowrap;
}

/* アプリでのやり方を添えるところ */
.article-body .note {
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--hero);
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.85;
}

/* アプリの画面（上のほうだけを見せる） */
.shot {
  width: min(270px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.article-body > .shot {
  margin-top: 32px;
}

.shot-frame {
  position: relative;
  aspect-ratio: 720 / 1040;
  overflow: hidden;
  border: 5px solid var(--surface);
  border-radius: 30px;
  background: #eef1ef;
  box-shadow:
    0 0 0 1.5px var(--ring),
    0 22px 40px -30px rgba(10, 60, 52, 0.45);
}

.shot-frame::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: linear-gradient(rgba(238, 241, 239, 0), #eef1ef);
}

.shot figcaption {
  margin-top: 12px;
  color: var(--sub);
  font-size: 13.5px;
  line-height: 1.7;
  text-align: center;
}

/* 最後の、アプリの紹介 */
.app-box {
  margin-top: 64px;
  padding: 26px 22px 28px;
  border-radius: 30px;
  background: var(--surface);
  box-shadow:
    0 0 0 1.5px var(--ring),
    0 22px 40px -30px rgba(10, 60, 52, 0.35);
  text-align: center;
}

.app-box-mark {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
}

.app-box-title {
  font-weight: 700;
  font-size: 17px;
}

/* 長い文は左にそろえる（真ん中にそろえると、行の頭がそろわず読みにくい） */
.app-box p {
  font-size: 15px;
  line-height: 1.85;
  text-align: left;
}

.app-box .app-box-title {
  text-align: center;
}

.app-box p + p {
  margin-top: 10px;
}

.app-box .small {
  font-size: 13.5px;
}

.app-box .btn {
  margin-top: 20px;
}

/* 読みものの一覧（LP の「読みもの」と同じ） */
.reads-wrap {
  padding-top: 56px;
  padding-bottom: 72px;
}

.reads {
  padding: 6px;
  border-radius: 28px;
  background: #e3efea;
}

.reads h2 {
  padding: 12px 18px 10px;
  color: var(--ink-2);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.reads-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(10, 60, 52, 0.06);
}

.reads-list li + li {
  border-top: 1px solid var(--line);
}

.reads-list a {
  position: relative;
  display: block;
  padding: 16px 52px 16px 20px;
  color: var(--ink);
  text-decoration: none;
}

.reads-list a::after {
  content: "";
  position: absolute;
  right: 24px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--sub);
  border-bottom: 2px solid var(--sub);
  transform: translateY(-50%) rotate(-45deg);
}

.reads-name {
  display: block;
  font-weight: 700;
  line-height: 1.6;
}

.reads-list a:hover .reads-name {
  color: var(--accent-dark);
}

.reads-sum,
.reads-date {
  display: block;
  margin-top: 4px;
  color: var(--sub);
  font-size: 14px;
  line-height: 1.7;
}

.reads-date {
  font-size: 13px;
}

/* 一覧のページ */
.index-list {
  padding-top: 40px;
}

/* フッター（LP と同じ） */
.site-footer {
  padding: 44px 0 calc(44px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.footer-tagline {
  margin-top: 6px;
  color: var(--sub);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.site-footer li a {
  color: var(--ink-2);
}

.site-footer p {
  color: var(--sub);
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
