/* k-oo.com 共通スタイル — すべてのページで /assets/css/style.css として読み込みます */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --ink: #1b2430;
  --ink-soft: #3a4556;
  --muted: #667085;
  --line: #e8e5df;
  --line-strong: #d6d1c8;
  --accent: #e4572e;
  --accent-ink: #b8401d;
  --accent-soft: #fdeee8;
  --radius: 6px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --w-list: 1040px;
  --w-article: 700px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --ink: #eef0f3;
    --ink-soft: #cdd3dc;
    --muted: #9aa4b2;
    --line: #2a323d;
    --line-strong: #3a4452;
    --accent: #ff7a50;
    --accent-ink: #ff9a78;
    --accent-soft: #2b1f1a;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .01em;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 4px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--w-list); margin: 0 auto; padding: 0 20px; }
.wrap--article { max-width: calc(var(--w-article) + 40px); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line-strong); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 6px; }
.brand-text { display: flex; align-items: baseline; gap: 9px; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 21px; letter-spacing: .02em; }
.brand-kana { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-size: 14px; font-weight: 600;
  padding: 6px 0; line-height: 1.2; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--line-strong); background: var(--bg); }
.site-footer .wrap { padding-top: 36px; padding-bottom: 36px; display: grid; gap: 16px; }
.footer-top { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; font-size: 14px; }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-note { font-size: 12.5px; line-height: 1.8; color: var(--muted); margin: 0; }
.copyright { font-size: 12.5px; color: var(--muted); margin: 0; }

/* ---------- Home ---------- */
.hero { padding: 56px 0 8px; }
.hero h1 { font-size: clamp(25px, 4.2vw, 36px); line-height: 1.5; margin: 0 0 12px; letter-spacing: .01em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin: 0; color: var(--muted); max-width: 40em; font-size: 15px; }

.section-head { display: flex; align-items: center; gap: 16px; margin: 44px 0 22px; }
.section-head h2 { font-size: 15px; margin: 0; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 24px; list-style: none; margin: 0; padding: 0; }
.post-card { display: flex; flex-direction: column; position: relative; }
.post-card-thumb { aspect-ratio: 3 / 2; background: var(--accent-soft); overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.03); }
.post-card-body { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.post-card h3 { font-size: 17px; line-height: 1.6; margin: 0; font-weight: 700; }
.post-card h3 a { color: var(--ink); text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat; transition: background-size .25s ease; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; } /* カード全体をクリック可能に */
.post-card:hover h3 a { background-size: 100% 1px; }
.post-card p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-soft); border: 1px solid var(--line-strong); padding: 0 8px; border-radius: 3px; line-height: 1.7; }

.empty-state { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 64px 24px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* ---------- Article ---------- */
.breadcrumb { font-size: 13px; color: var(--muted); padding: 26px 0 8px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

.article-head { padding: 12px 0 8px; }
.article-head .tag { margin-bottom: 14px; }
.article-title { font-size: clamp(25px, 4.2vw, 34px); line-height: 1.5; margin: 0 0 14px; font-weight: 800; letter-spacing: .01em; }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; color: var(--muted); margin: 0; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article-eyecatch { margin: 24px 0 8px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.article-eyecatch img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.pr-notice {
  display: flex; gap: 10px; align-items: flex-start; margin: 20px 0 0; padding: 11px 14px;
  font-size: 13px; line-height: 1.7; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
}
.pr-notice b { flex: none; font-size: 11px; letter-spacing: .08em; background: var(--ink); color: var(--bg); padding: 1px 7px; border-radius: 2px; margin-top: 3px; }
.pr-notice span { display: block; }
.pr-notice small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }

.lead { font-size: 17px; color: var(--ink-soft); margin: 28px 0 0; }

.toc { margin: 32px 0; padding: 18px 24px 16px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.toc-title { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { margin: 4px 0; font-size: 15px; line-height: 1.7; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.article-body > :first-child { margin-top: 0; }
.article-body h2 {
  font-size: clamp(21px, 3.4vw, 26px); line-height: 1.5; margin: 72px 0 22px; padding: 0;
  font-weight: 800; letter-spacing: .01em;
}
.article-body h3 { font-size: 18.5px; line-height: 1.6; margin: 40px 0 12px; padding: 0; font-weight: 700; }
.article-body h4 { font-size: 17px; margin: 28px 0 8px; }
.article-body p { margin: 0 0 1.5em; }
.article-body ul, .article-body ol { margin: 0 0 1.5em; padding-left: 1.5em; }
.article-body li { margin: .3em 0; }
.article-body strong { font-weight: 800; }
.article-body figure { margin: 28px 0; }
.article-body figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.article-body figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.article-body blockquote { margin: 0 0 1.5em; padding: 14px 20px; background: var(--surface); border-left: 4px solid var(--line-strong); color: var(--ink-soft); }
.article-body blockquote p:last-child { margin-bottom: 0; }

.table-scroll { overflow-x: auto; margin: 0 0 1.5em; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.article-body table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 14.5px; line-height: 1.7; }
.article-body th, .article-body td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.article-body th { background: var(--bg); font-weight: 700; white-space: nowrap; }
.article-body tr:last-child td { border-bottom: 0; }

.callout { margin: 0 0 1.5em; padding: 16px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.callout-title { font-weight: 800; margin: 0 0 4px; font-size: 15px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- 商品紹介（アフィリエイト記事用） ---------- */
.product { display: grid; grid-template-columns: 200px 1fr; gap: 24px; margin: 0 0 2em; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.product-img { background: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; padding: 8px; }
.product-img img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; border: 0; border-radius: 0; }
.product-rank { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.product-name { font-size: 18px; font-weight: 800; line-height: 1.6; margin: 0 0 8px; }
.product-points { margin: 0 0 4px; padding-left: 1.3em; font-size: 14.5px; line-height: 1.8; color: var(--ink-soft); }
.product-points li { margin: .15em 0; }
.product .btn-amazon { margin: 16px 0 0; max-width: none; }

.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 1.5em; }
.proscons > div { padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.proscons h4 { margin: 0 0 6px; font-size: 14px; letter-spacing: .06em; }
.proscons ul { margin: 0; padding-left: 1.3em; font-size: 14.5px; line-height: 1.8; }

.spec-note { font-size: 12.5px; line-height: 1.7; color: var(--muted); margin: -.5em 0 1.8em; }

/* Amazon アフィリエイトのボタン（リンクには rel="sponsored nofollow noopener" を付ける） */
.btn-amazon {
  display: block; text-align: center; margin: 24px auto; max-width: 380px; padding: 14px 24px;
  background: #ff9900; color: #1b1b1b; font-weight: 800; border-radius: 8px; text-decoration: none;
  box-shadow: 0 3px 0 #d98200; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-amazon:hover { color: #1b1b1b; transform: translateY(1px); box-shadow: 0 2px 0 #d98200; }
.btn-amazon small { display: block; font-weight: 500; font-size: 11.5px; opacity: .8; }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); margin: 0 0 10px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q."; color: var(--accent); font-weight: 800; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq-a { padding: 14px 18px; margin: 0; }

.related { margin-top: 72px; }
.related .post-grid { grid-template-columns: repeat(2, 1fr); }

.back-home { display: inline-flex; margin-top: 40px; font-weight: 700; text-decoration: none; }
.back-home::before { content: "←"; margin-right: 8px; }

/* ---------- 広告枠（承認前は非表示。承認後 main.js の ADS_ENABLED を true に） ---------- */
.ad-slot { display: none; margin: 32px 0; text-align: center; overflow: hidden; }
html.ads-on .ad-slot { display: block; min-height: 280px; }
html.ads-on .ad-slot--top { min-height: 250px; }
.ad-label { display: block; font-size: 11px; color: var(--muted); letter-spacing: .1em; margin-bottom: 6px; }

/* ---------- 固定ページ（運営者情報・プライバシーポリシー） ---------- */
.page { padding: 48px 0 0; }
.page h1 { font-size: clamp(26px, 4.2vw, 32px); line-height: 1.5; margin: 0 0 8px; font-weight: 800; }
.page .page-lead { color: var(--muted); margin: 0 0 36px; padding-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.page h2 { font-size: 19px; margin: 48px 0 12px; padding: 0 0 8px; border-bottom: 1px solid var(--line-strong); line-height: 1.6; }
.page p, .page li { color: var(--ink-soft); }
.page p { margin: 0 0 1.2em; }
.page ul { margin: 0 0 1.2em; padding-left: 1.5em; }
.info-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line-strong); }
.info-table th, .info-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.info-table th { width: 9em; background: var(--bg); font-weight: 700; white-space: nowrap; }
.info-table tr:last-child th, .info-table tr:last-child td { border-bottom: 0; }

.notfound { text-align: center; padding: 96px 0 24px; }
.notfound .code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; margin: 0 0 12px; letter-spacing: .04em; }
.btn { display: inline-block; margin-top: 24px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 28px; border-radius: 6px; }
.btn:hover { color: #fff; filter: brightness(1.08); }

.to-top {
  position: fixed; right: 18px; bottom: 18px; width: 42px; height: 42px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 18px; line-height: 1; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }

/* 見出しの折り返しを均等にして、1文字だけ次の行に落ちるのを防ぐ */
.hero h1, .article-title, .post-card h3, .page h1, .article-body h2, .article-body h3 { text-wrap: balance; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 20px; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .site-header .wrap { height: 56px; }
  .brand-kana { display: none; }
  .site-nav { gap: 16px; }
  .hero { padding: 36px 0 4px; }
  .section-head { margin-top: 36px; }
  .post-grid, .related .post-grid { grid-template-columns: 1fr; }
  .article-body h2 { margin-top: 56px; }
  .product { grid-template-columns: 1fr; padding: 18px; gap: 16px; }
  .product-img { max-width: 240px; margin: 0 auto; width: 100%; }
  .proscons { grid-template-columns: 1fr; }
  .toc { padding: 14px 18px; }
  .info-table th { width: auto; display: block; border-bottom: 0; padding-bottom: 4px; white-space: normal; }
  .info-table td { display: block; padding-top: 4px; }
  .site-footer { margin-top: 72px; }
}

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

@media print {
  .site-header, .site-footer, .ad-slot, .to-top, .toc { display: none !important; }
  body { background: #fff; color: #000; }
}
