/* 環境調整の道具箱: フラット・白基調・静かで温かい */
:root {
  --bg: #FFFFFF;
  --ink: #1F2B25;
  --accent: #3A5944;
  --accent-dark: #2C4435;
  --sub: #9DBBA8;
  --line: #E6EAE6;
  --tint: #F2F6F3;
  --muted: #5C6B62;
  --marker: #D9E8DF;
  /* 購買ボタンはブランド外の色。ストアの慣習色を、白文字でAA（4.5:1）を満たす濃さに寄せて使う。
     Amazon系オレンジ #E47911 は白文字だと2.98:1で不足するため、同系の濃いオレンジにしている。 */
  --amazon: #B4530A;
  --amazon-dark: #93440A;
  --rakuten: #BF0000;
  --rakuten-dark: #9E0000;
  --radius: 10px;
  --measure: 42em;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; display: block; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic Medium", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) { body { font-size: 17px; } }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 660px; }
.section { padding: 40px 0; }
@media (min-width: 768px) { .section { padding: 56px 0; } }
.band { background: var(--tint); }

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 50;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--radius);
  transition: top .15s ease;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---- ヘッダー ---- */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.head-in {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding-top: 14px; padding-bottom: 10px;
}
@media (min-width: 900px) {
  .head-in { flex-wrap: nowrap; gap: 24px; padding-bottom: 14px; }
}
.brand { display: flex; flex-direction: column; color: var(--ink); flex: 1 1 auto; min-width: 0; }
@media (min-width: 900px) { .brand { flex: 0 0 auto; } }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: 0.05em; }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: 0.08em; white-space: nowrap; }
.site-nav {
  display: flex; gap: 4px 16px; flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
  flex: 1 1 100%; min-width: 0;
}
.site-nav::-webkit-scrollbar { display: none; }
@media (min-width: 900px) {
  .site-nav { flex: 1 1 auto; order: 2; flex-wrap: wrap; overflow: visible; justify-content: flex-end; }
}

/* 検索ボタン */
.head-actions { display: flex; align-items: center; flex: 0 0 auto; }
@media (min-width: 900px) { .head-actions { order: 3; } }
.search-toggle {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); color: var(--ink); cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.js .search-toggle { display: inline-flex; }
.search-toggle:hover { background: var(--tint); border-color: var(--sub); }
.search-toggle[aria-expanded="true"] { background: var(--tint); border-color: var(--sub); }

/* 検索パネル（JSが索引を読んで絞り込む） */
.search-panel { border-top: 1px solid var(--line); background: var(--tint); }
.search-panel[hidden] { display: none; }
.search-in { padding-top: 14px; padding-bottom: 16px; }
.search-input {
  width: 100%; min-height: 44px; padding: 8px 14px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--radius); -webkit-appearance: none;
}
.search-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.search-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.search-note:empty { display: none; }
.search-results { margin-top: 6px; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results li:last-child { border-bottom: 0; }
.search-results a { display: block; padding: 10px 2px; color: var(--ink); }
.search-results a:hover .search-hit-title { color: var(--accent); }
.search-hit-title { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.6; }
.search-hit-cat { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.site-nav a {
  position: relative; white-space: nowrap; font-size: 13.5px; color: var(--ink);
  padding: 6px 0; min-height: 32px; display: inline-flex; align-items: center;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 2px; width: 0; height: 1px;
  background: var(--accent); transition: width .25s ease;
}
.site-nav a:hover::after, .site-nav a[aria-current]::after { width: 100%; }
.site-nav a[aria-current] { color: var(--accent); font-weight: 700; }

/* ---- ヒーロー（全幅画像に白い札で文字を重ねる） ---- */
.hero { position: relative; }
.hero-art { margin: 0; width: 100%; }
.hero-art img { display: block; width: 100%; height: clamp(420px, 60vw, 480px); object-fit: cover; object-position: 50% 50%; }
/* ファーストビューの1回だけのフェードイン。既存 .reveal の仕組みに乗せ、少しだけゆっくり遅らせる */
.hero-art.reveal { transition-duration: .6s; transition-delay: .15s; }
.hero-overlay { position: absolute; inset: 0; display: flex; align-items: center; }
.hero-plate {
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px; max-width: 560px;
}
@media (min-width: 768px) { .hero-plate { padding: 32px 36px; } }
.hero h1 { font-size: clamp(24px, 6vw, 32px); font-weight: 700; line-height: 1.45; }
.hero-tag { color: var(--accent); font-size: 14px; font-weight: 700; margin-top: 10px; letter-spacing: 0.06em; }
.hero-lead { color: var(--muted); margin-top: 16px; max-width: var(--measure); font-size: 16px; }
/* 画像フェードのあとに、タイトルから順にせり上がる（JSが動くときだけ・1回きり） */
.js .hero-plate h1, .js .hero-plate .hero-tag, .js .hero-plate .hero-lead {
  opacity: 0; animation: hero-rise .6s ease forwards;
}
.js .hero-plate h1 { animation-delay: .35s; }
.js .hero-plate .hero-tag { animation-delay: .5s; }
.js .hero-plate .hero-lead { animation-delay: .65s; }
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---- 見出し ---- */
.section-title {
  font-size: 19px; font-weight: 700; line-height: 1.5;
  padding-left: 12px; border-left: 4px solid var(--accent); margin-bottom: 24px;
}
.section-lead { color: var(--muted); font-size: 14px; margin: -14px 0 20px; max-width: var(--measure); }
.page-title { font-size: clamp(22px, 5vw, 28px); font-weight: 700; line-height: 1.5; }
.page-lead { color: var(--muted); margin-top: 12px; margin-bottom: 28px; font-size: 15px; max-width: var(--measure); }

/* ---- カードグリッド ---- */
.grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }

.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); transition: transform .22s ease, border-color .22s ease; }
.card:hover { transform: translateY(-2px); border-color: var(--sub); }
.card:hover .card-title { color: var(--accent); }
.card-link { display: block; color: inherit; height: 100%; }
.card-thumb { aspect-ratio: 16 / 9; background: var(--tint); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; }
.card-title {
  font-size: 16px; font-weight: 700; line-height: 1.6; margin: 8px 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-date { font-size: 12.5px; color: var(--muted); }

.chip {
  display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--tint); border-radius: 999px; padding: 3px 10px; letter-spacing: 0.04em;
}
a.chip:hover { background: var(--accent); color: #fff; }

/* ---- パンくず ---- */
.crumbs { font-size: 12.5px; color: var(--muted); padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span[aria-current] {
  max-width: 22em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumb-sep { color: var(--muted); }

/* ---- 記事 ---- */
.post-head { padding: 32px 0 0; }
.post-head h1 { font-size: clamp(22px, 5.2vw, 29px); font-weight: 700; line-height: 1.55; }
.byline { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 13px; }
.byline-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--tint); flex-shrink: 0; }
.byline a { color: var(--muted); }
.byline a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pr-notice {
  font-size: 12.5px; color: var(--muted); margin-top: 14px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; background: var(--tint);
}
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.eyecatch { margin: 24px 0 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.eyecatch img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* ---- 目次（h2から自動生成・JSなし） ---- */
.toc {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--tint); padding: 14px 18px; margin: 2em 0;
}
.toc-label {
  font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em;
  cursor: pointer; list-style: none;
}
.toc-label::-webkit-details-marker { display: none; }
.toc-label::after { content: "－"; float: right; color: var(--muted); font-weight: 400; }
.toc:not([open]) .toc-label::after { content: "＋"; }
.toc-list { margin: 12px 0 2px; padding-left: 1.4em; }
.toc-list li { margin: 6px 0; font-size: 14px; line-height: 1.7; }
.toc-list li::marker { color: var(--accent); font-weight: 700; }
.toc-list a { color: var(--ink); text-decoration: none; }
.toc-list a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.prose { padding: 8px 0 8px; font-size: 17px; line-height: 2; }
@media (min-width: 768px) { .prose { font-size: 18px; } }
.prose p { margin: 1.5em 0; }
.prose h2 {
  font-size: 20px; font-weight: 700; line-height: 1.55; margin: 2.4em 0 .9em;
  padding-left: 12px; border-left: 4px solid var(--accent); scroll-margin-top: 20px;
}
.prose h3 {
  font-size: 17px; font-weight: 700; line-height: 1.6; margin: 2em 0 .7em;
  padding-bottom: .35em; border-bottom: 2px solid var(--tint);
}
@media (min-width: 768px) { .prose h2 { font-size: 22px; } .prose h3 { font-size: 18px; } }
/* 見出し群の字間はここで一元化（個別ルール側では持たない） */
.hero h1, .post-head h1, .page-title, .section-title, .prose h2, .prose h3, .card-title {
  letter-spacing: 0.04em; font-feature-settings: "palt";
}
.prose ul, .prose ol { margin: 1.3em 0; padding-left: 1.4em; }
.prose li { margin: .5em 0; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.1em; }
.prose ul > li::before {
  content: ""; position: absolute; left: 0; top: .78em; width: 6px; height: 2px; background: var(--sub);
}
.prose ol > li::marker { color: var(--accent); font-weight: 700; }
.prose strong { font-weight: 700; }
/* 本文の太字にさりげないマーカー（sageの薄い下地を下半分に敷くだけ・影ではない） */
.prose > p strong, .prose > ul li strong, .prose > ol li strong {
  box-shadow: inset 0 -0.42em 0 var(--marker);
}
.prose code {
  background: var(--tint); border-radius: 4px; padding: 1px 6px; font-size: .92em;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.6em 0; }
.prose blockquote {
  border-left: 3px solid var(--sub); padding: 2px 0 2px 16px; margin: 1.6em 0; color: var(--ink);
}
.prose blockquote.note { font-size: 14px; color: var(--muted); }
.prose a { position: relative; color: var(--accent); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: var(--sub); transition: text-decoration-color .2s ease; }
.prose a:hover { text-decoration-color: var(--accent); }
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.7; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--tint); font-weight: 700; }

/* 商品ボックス・関連リンクカード */
.product {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 1.6em 0;
  background: var(--bg); transition: border-color .22s ease;
}
.product:hover { border-color: var(--sub); }
.product-label { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: var(--muted); margin: 0 0 6px; }
.product-name { font-weight: 700; font-size: 15px; line-height: 1.6; margin: 0 0 12px; }
.product-note { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin: 0 0 12px; }
.product-links { margin: 0; font-size: 14px; }
.product-links a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; display: inline-block; margin: 4px 6px 0 0; transition: background .2s ease, border-color .2s ease; }
.product-links a:hover { background: var(--tint); border-color: var(--sub); }

/* 購買ボタン。色はストアの慣習に合わせ、白文字とのコントラストはAA以上を確保する。
   .prose a より詳細度を上げないと本文リンクの色・下線に負けるため、2クラスで書く。 */
.product-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.product-buttons .pbtn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 1 1 160px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius); color: #fff; font-size: 14px; font-weight: 700;
  text-decoration: none; letter-spacing: 0.02em; transition: background .2s ease;
}
.product-buttons .pbtn:hover { color: #fff; text-decoration: none; }
.product-buttons .pbtn-amazon { background: var(--amazon); }
.product-buttons .pbtn-amazon:hover { background: var(--amazon-dark); }
.product-buttons .pbtn-rakuten { background: var(--rakuten); }
.product-buttons .pbtn-rakuten:hover { background: var(--rakuten-dark); }
.product-buttons .pbtn-plain { background: var(--accent); }
.product-buttons .pbtn-plain:hover { background: var(--accent-dark); }

.linkcard {
  display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line);
  border-left: 4px solid var(--sub); border-radius: var(--radius);
  padding: 12px 16px; margin: 1.6em 0; transition: border-color .22s ease;
}
.linkcard:hover { border-color: var(--sub); }
.linkcard-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; }
.linkcard-body { font-size: 14.5px; line-height: 1.7; }

/* ---- プロフィール ---- */
.profile {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  margin: 48px 0 0; background: var(--bg);
}
.profile-label { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.profile-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--tint); flex-shrink: 0; }
.profile-name { display: block; font-size: 17px; font-weight: 700; }
.profile-credit { display: block; font-size: 13px; color: var(--accent); margin-top: 2px; }
.profile-text { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-size: 13.5px; }
.profile-links a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sub); }

/* ---- ボタン ---- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px;
  border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 700; font-size: 14.5px;
  transition: background .2s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-quiet { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn-quiet:hover { background: var(--tint); color: var(--accent-dark); }

/* ---- フッター ---- */
.site-foot { border-top: 1px solid var(--line); margin-top: 56px; padding: 36px 0 28px; background: var(--tint); }
.foot-in { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 760px) { .foot-in { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (min-width: 1000px) { .foot-in { grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; } }
.foot-brand { font-weight: 700; letter-spacing: 0.05em; }
.foot-tag { font-size: 13px; color: var(--muted); margin-top: 4px; }
.site-foot h2 { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 8px; }
.site-foot nav a { display: block; font-size: 13.5px; padding: 5px 0; color: var(--ink); }
.site-foot nav a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.copyright { max-width: 1040px; margin: 26px auto 0; padding: 0 20px; font-size: 12px; color: var(--muted); }

/* ---- スクロール時のフェードイン（さりげなく） ----
   JSが動く環境（html.js）でだけ初期状態を隠す。JS無効時は最初から見える。 */
.reveal { transition: opacity .5s ease, transform .5s ease; }
.js .reveal { opacity: 0; transform: translateY(8px); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js.reveal-off .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero-art { transition-delay: 0s !important; }
  .hero-plate h1, .hero-plate .hero-tag, .hero-plate .hero-lead { opacity: 1 !important; animation: none !important; transform: none !important; }
  .card:hover { transform: none; }
}
