/* ==========================================================================
   ラトリス SEO 記事のスタイル(記事パーツカタログ 08 準拠)
   - 本文パーツ(.art 配下)は scripts/build-article.js が出す HTML に対応する。仕様は docs/article-format.md
   - ページ部品(.artp-*)はパンくず・カテゴリタグ・メタ情報・CTA バンド・関連記事。記事ページのテンプレート側が出す
   - 色・フォントは LP(latris-engine web/public/css/style.css)の変数と同じ値。LP の CSS と併用するときは :root を二重に定義しても同値なので衝突しない
   - このファイルは final.html / Word のプレビューと、latris-engine の記事ページで共通に使う(1か所で直す)
   ========================================================================== */

:root {
  --red: #7B1F2F; --red-soft: #F4E9EA;
  --gold: #B08A4F; --gold-ink: #7D5C2E; --gold-soft: #E8DCC3; --gold-pale: #F2EADB;
  --cream: #F6F1E7; --cream-2: #FAF6EE; --white: #fff;
  --ink: #14100F; --ink-2: #2B2626; --body: #574E49; --muted: #6B615C; --faint: #8C837D;
  --line: #E7E0D4; --line-2: #EFEAE0;
  --sans: "Noto Sans JP", system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --art-w: 760px;
}

/* ---------- ページ部品(テンプレート側) ---------- */
.artp { background: var(--cream-2); color: var(--body); font-family: var(--sans); font-size: 15px; line-height: 1.95; padding: 28px 16px 56px; }
.artp-in { max-width: var(--art-w); margin: 0 auto; }
.artp-crumb { font-size: 12px; color: var(--faint); margin: 0 0 18px; }
.artp-crumb a { color: var(--faint); text-decoration: none; }
.artp-crumb a:hover { color: var(--red); }
.artp-crumb span + span::before, .artp-crumb a + span::before, .artp-crumb a + a::before { content: "›"; margin: 0 .5em; }
.artp-tag { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--gold-ink); background: var(--gold-pale); border: 1px solid var(--gold-soft); border-radius: 3px; padding: 1px 8px; line-height: 1.8; }
.artp h1 { font-size: 26px; line-height: 1.5; color: var(--ink); font-weight: 700; margin: 12px 0 10px; }
.artp-meta { font-size: 12px; color: var(--faint); margin: 0 0 20px; }
.artp-meta span + span::before { content: "・"; margin: 0 .4em; }
.artp-eyecatch { margin: 0 0 24px; }
.artp-eyecatch img { width: 100%; height: auto; border-radius: 4px; display: block; }
.artp-cta { text-align: center; margin: 48px 0 0; padding: 32px 16px; border-top: 1px solid var(--line); }
.artp-cta p { margin: 0 0 14px; font-weight: 700; color: var(--ink-2); font-size: 17px; }
.artp-cta a { display: inline-block; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; border-radius: 4px; padding: 10px 22px; }
.artp-cta a:hover { background: #6A1928; }
.artp-cta small { display: block; margin-top: 10px; color: var(--faint); font-size: 12px; }
.artp-related { margin: 40px 0 0; }
.artp-related h2 { font-size: 17px; color: var(--ink-2); margin: 0 0 14px; }
.artp-related ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.artp-related li { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 14px; }
.artp-related a { color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 13.5px; line-height: 1.6; display: block; margin-top: 8px; }

/* ---------- 本文(.art 配下) ---------- */
.art { color: var(--body); font-family: var(--sans); font-size: 15px; line-height: 1.95; overflow-wrap: anywhere; }
/* リセットは :where() で優先度を 0 にし、下の「兄弟要素の間の余白」が必ず勝つようにする */
.art :where(p, ul, ol, figure, blockquote) { margin: 0; }
.art > * + * { margin-top: 1.1em; }
.art a { color: var(--gold-ink); text-decoration: underline; text-underline-offset: 3px; }
.art a:hover { color: var(--red); }
.art strong { color: var(--ink-2); font-weight: 700; }
.art-lead { color: var(--body); line-height: 1.9; }

.art h2 { font-size: 20px; line-height: 1.5; color: var(--ink); font-weight: 700; margin: 2.4em 0 0; padding: 2px 0 2px 12px; border-left: 4px solid var(--gold); scroll-margin-top: 88px; }
.art h3 { font-size: 16.5px; line-height: 1.6; color: var(--ink-2); font-weight: 700; margin: 1.8em 0 0; }
.art h4 { font-size: 15px; color: var(--ink-2); font-weight: 700; margin: 1.4em 0 0; }
.art h2 + *, .art h3 + * { margin-top: .8em; }

/* 目次ボックス */
.art-toc { background: var(--gold-pale); border: 1px solid var(--gold-soft); border-radius: 4px; padding: 16px 20px; font-size: 13.5px; line-height: 1.8; }
.art-toc__title { font-weight: 700; color: var(--ink-2); margin: 0 0 6px !important; }
.art-toc ol { margin: 0; padding-left: 1.4em; }
.art-toc a { color: var(--body); text-decoration: none; }
.art-toc a:hover { color: var(--red); text-decoration: underline; }

/* 要点ボックス(AIO。data-aio="summary") */
.art-summary { background: var(--cream); border-left: 4px solid var(--red); border-radius: 4px; padding: 16px 20px; }
.art-summary__title { font-weight: 700; color: var(--ink-2); margin: 0 0 8px !important; }
.art-summary ul { margin: 0; }

/* 箇条書き・番号リスト */
.art ul, .art ol { padding-left: 1.5em; }
.art li + li { margin-top: .35em; }
.art ul > li::marker { color: var(--gold); }
.art > ol, .art-steps, .art-a > ol { list-style: none; padding-left: 0; counter-reset: art-n; }
.art > ol > li, .art-steps > li, .art-a > ol > li { counter-increment: art-n; position: relative; padding-left: 2.1em; }
.art > ol > li::before, .art-steps > li::before, .art-a > ol > li::before {
  content: counter(art-n); position: absolute; left: 0; top: .28em; width: 1.45em; height: 1.45em; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.45em; text-align: center;
}

/* 表(ヘッダー行 + ゼブラ) */
.art-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.art-table table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 13.5px; line-height: 1.7; background: var(--white); border: 1px solid var(--line); }
.art-table th { background: var(--gold-pale); color: var(--ink-2); font-weight: 700; text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--gold-soft); }
.art-table td { padding: 9px 12px; border-top: 1px solid var(--line-2); vertical-align: top; }
.art-table tbody tr:nth-child(even) td { background: var(--cream-2); }
.art-table td:first-child { font-weight: 700; color: var(--ink-2); }

/* 画像(フル幅 + キャプション / 2カラム) */
.art-fig { margin: 0; }
.art-fig img { width: 100%; height: auto; display: block; border-radius: 3px; }
/* 本文の写真(3:2 など縦に高いもの)は 16:9 に切り抜く。幅いっぱいだと1枚で画面の半分近くを占めるため。図解(--diagram)は切らない */
.art-fig:not(.art-fig--diagram) img { aspect-ratio: 16 / 9; object-fit: cover; object-position: center; }
.art-fig figcaption { font-size: 12px; color: var(--faint); text-align: center; margin-top: 6px; line-height: 1.6; }
.art-fig2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .art-fig2 { grid-template-columns: 1fr; } }

/* 引用 */
.art-quote { margin: 0; background: var(--cream); border: 1px solid var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 3px; padding: 16px 20px; }
.art-quote p { color: var(--red); font-weight: 700; }
.art-quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 12px; color: var(--faint); }
.art-quote cite::before { content: "— "; }

/* コールアウト(ポイント / 注意) */
.art-callout { border-radius: 4px; padding: 14px 18px; font-size: 14px; }
.art-callout > * + * { margin-top: .6em; }
.art-callout__title { font-weight: 700; margin: 0 0 4px !important; }
.art-callout--point { background: #F5EBDD; border: 1px solid var(--gold-soft); }
.art-callout--point .art-callout__title { color: var(--gold-ink); }
.art-callout--point .art-callout__title::before { content: "✓ "; }
.art-callout--caution { background: var(--white); border: 1px solid var(--red); }
.art-callout--caution .art-callout__title { color: var(--red); }
.art-callout--caution .art-callout__title::before { content: "⚠ "; }

/* 区切り線・注記 */
.art-hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.art-note { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.art-note--fictional { border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; background: var(--white); }

/* FAQ */
.art-faq > * + * { margin-top: 1.2em; }
.art-q { position: relative; padding-left: 2em; font-size: 15.5px !important; margin: 0 !important; }
.art-q::before { content: "Q"; position: absolute; left: 0; top: .1em; width: 1.5em; height: 1.5em; border-radius: 3px; background: var(--red); color: #fff; font-size: 13px; line-height: 1.5em; text-align: center; }
.art-a { position: relative; padding-left: 2em; margin-top: .5em; }
.art-a::before { content: "A"; position: absolute; left: 0; top: .2em; width: 1.5em; height: 1.5em; border-radius: 3px; background: var(--gold-pale); color: var(--gold-ink); font-size: 13px; font-weight: 700; line-height: 1.5em; text-align: center; }
.art-a > * + * { margin-top: .8em; }

@media (max-width: 560px) {
  .artp h1 { font-size: 22px; }
  .art h2 { font-size: 18px; }
}

/* ---------- サイドバー(PC 幅だけ。ラトリスのバナー + ほかの記事) ---------- */
.artp-side { display: none; }
@media (min-width: 1100px) {
  .artp-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, var(--art-w)) 300px; gap: 48px; justify-content: center; }
  .artp-grid > .artp-in { margin: 0; }
  .artp-side { display: block; }
}
.artp-side__in { position: sticky; top: 84px; /* 背の高いときは js/articles.js が下端で止まる値に変える */ display: flex; flex-direction: column; gap: 22px; }
.artp-banner { display: flex; text-decoration: none; transition: transform .2s, box-shadow .2s; flex-direction: column; justify-content: space-between; aspect-ratio: 3 / 5; box-sizing: border-box; border-radius: 6px; overflow: hidden; line-height: 1.7;
  background: linear-gradient(180deg, #2A161B 0%, #7B1F2F 62%, var(--cream) 62%); box-shadow: 0 6px 20px rgba(42, 22, 27, .14); }
/* 背景画像: 上 6 割が深紅(文字は白)、波の下が生成り(文字は濃い色)。波の位置は画像の高さの 6 割強 */
.artp-banner--img { background: #5A1724 url("/assets/article-side-banner.webp") center / cover no-repeat; }
.artp-banner__top { padding: 26px 24px 0; }
.artp-banner:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(42, 22, 27, .22); }
.artp-banner:hover .artp-banner__btn { background: #6A1928; }
.artp-banner__top, .artp-banner__bottom, .artp-banner__copy, .artp-banner__lead { display: block; }
.artp-banner__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: .08em; color: var(--gold-soft); }
.artp-banner__brand svg { width: 24px; height: 24px; color: var(--gold-soft); }
.artp-banner__copy { font-family: "Noto Serif JP", serif; font-size: 24px; font-weight: 700; line-height: 1.6; margin: 18px 0 0; color: #fff; text-shadow: 0 1px 12px rgba(42, 22, 27, .45); }
.artp-banner__bottom { padding: 0 22px 20px; }
.artp-banner__lead { font-size: 12px; line-height: 1.75; color: var(--ink-2); margin: 0 0 12px; }
.artp-banner__btn { display: block; text-align: center; background: var(--red); color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; border-radius: 4px; padding: 10px 0; box-shadow: 0 4px 12px rgba(123, 31, 47, .25); transition: background .2s, transform .2s; }
.artp-banner__sub { display: block; text-align: center; margin-top: 9px; font-size: 12px; color: var(--gold-ink); }
.artp-side__rel h2 { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--gold); line-height: 1.5; }
.artp-side__rel ul { list-style: none; margin: 0; padding: 0; }
.artp-side__rel li + li { border-top: 1px solid var(--line); }
.artp-side__rel a { display: block; padding: 10px 2px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 700; line-height: 1.6; }
.artp-side__rel a:hover { color: var(--red); }
.artp-side__rel .artp-tag { display: table; margin-bottom: 4px; font-size: 10.5px; }

/* ---------- 経営判断ライブラリ(一覧 /articles/・テーマ別・ページ送り) ---------- */
a.artp-tag { text-decoration: none; }
a.artp-tag:hover { border-color: var(--gold); }
.lib { background: var(--cream-2); color: var(--body); font-family: var(--sans); font-size: 15px; line-height: 1.8; }
.lib-hero { position: relative; overflow: hidden; color: #fff; padding: 64px 16px 72px;
  background: radial-gradient(circle at 85% 20%, rgba(176, 138, 79, .28), transparent 42%), linear-gradient(135deg, #2A161B 0%, #4A1A26 55%, #7B1F2F 100%); }
.lib-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(232, 220, 195, .55) 1px, transparent 1.5px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 100%); mask-image: linear-gradient(90deg, transparent 35%, #000 100%); }
.lib-hero--sub { padding: 44px 16px 48px; }
.lib-hero__in { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.lib-hero__label { margin: 0 0 10px; font-size: 12px; letter-spacing: .28em; color: var(--gold-soft); font-weight: 700; }
.lib-hero h1 { margin: 0; font-family: "Noto Serif JP", serif; font-size: 40px; line-height: 1.35; font-weight: 700; color: #fff; }
.lib-hero--sub h1 { font-size: 30px; }
.lib-hero__lead { max-width: 640px; margin: 16px 0 0; font-size: 15px; line-height: 1.9; color: rgba(255, 255, 255, .82); }
.lib-hero__stats { display: flex; gap: 28px; margin: 24px 0 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.lib-hero__stats b { font-family: "Noto Serif JP", serif; font-size: 28px; color: var(--gold-soft); margin-right: 4px; font-weight: 700; }
.lib-in { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }
.lib-h2 { display: flex; align-items: baseline; gap: 12px; margin: 40px 0 18px; font-size: 20px; color: var(--ink); font-weight: 700; padding-left: 12px; border-left: 4px solid var(--gold); line-height: 1.4; }
.lib-h2 small { font-size: 12px; color: var(--faint); font-weight: 500; }

/* テーマから探す */
.lib-themes ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.lib-themes a { position: relative; display: block; height: 100%; box-sizing: border-box; padding: 18px 20px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; transition: border-color .2s, box-shadow .2s, transform .2s; }
.lib-themes a::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px; background: var(--red); border-radius: 0 2px 2px 0; }
.lib-themes a:hover { border-color: var(--gold-soft); box-shadow: 0 8px 22px rgba(42, 22, 27, .08); transform: translateY(-2px); }
.lib-themes__name { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.lib-themes__desc { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.lib-themes__count { display: block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--gold-ink); }

/* テーマの切り替え(2 ページ目以降・テーマ別ページ) */
.lib-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.lib-chips a, .lib-chips span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; font-size: 13px; text-decoration: none; border: 1px solid var(--line); background: var(--white); color: var(--ink-2); }
.lib-chips a:hover { border-color: var(--gold); color: var(--red); }
.lib-chips small { font-size: 11px; color: var(--faint); }
.lib-chips [aria-current] { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }

/* 記事カード */
.lib-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.lib-card a { display: flex; flex-direction: column; height: 100%; background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.lib-card a:hover { box-shadow: 0 12px 28px rgba(42, 22, 27, .10); transform: translateY(-3px); }
.lib-card__img { aspect-ratio: 16 / 9; background: var(--cream); overflow: hidden; }
.lib-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.lib-card a:hover .lib-card__img img { transform: scale(1.04); }
.lib-card__noimg { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #4A1A26, #7B1F2F); }
.lib-card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.lib-card__body .lib-card__tags { align-self: flex-start; }
.lib-card h3 { margin: 10px 0 8px; font-size: 16px; line-height: 1.6; color: var(--ink); font-weight: 700; }
.lib-card a:hover h3 { color: var(--red); }
.lib-card p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card__meta { margin-top: auto; padding-top: 12px; font-size: 12px; color: var(--faint); }
.lib-empty { color: var(--faint); }

/* ページ送り */
.lib-pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; margin: 36px 0 0; }
.lib-pager a, .lib-pager span { min-width: 40px; height: 40px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border-radius: 4px; font-size: 14px; text-decoration: none; }
.lib-pager a { background: var(--white); border: 1px solid var(--line); color: var(--ink-2); }
.lib-pager a:hover { border-color: var(--gold); color: var(--red); }
.lib-pager__cur { background: var(--red); color: #fff; font-weight: 700; }
.lib-pager__gap { color: var(--faint); min-width: 20px !important; padding: 0 !important; }
.lib .artp-cta { margin-top: 64px; background: var(--white); border: 1px solid var(--line); border-radius: 6px; }

@media (max-width: 560px) {
  .lib-hero { padding: 44px 16px 48px; }
  .lib-hero h1 { font-size: 28px; }
  .lib-hero--sub h1 { font-size: 24px; }
  .lib-grid { grid-template-columns: 1fr; }
  .lib-pager__nav { flex-basis: 100%; order: 9; max-width: 200px; }
}
.lib-card__tags { display: flex; align-items: center; gap: 8px; }
.lib-fiction { display: inline-block; margin-left: 8px; font-family: "Noto Serif JP", serif; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--red); border: 1px solid currentColor; border-radius: 2px; padding: 0 7px; line-height: 1.9; vertical-align: middle; }
.lib-card__tags .lib-fiction { margin-left: 0; }

/* キーワード検索(一覧ページのヒーローの中) */
.lp-hd { display: contents; }
.lib-search { display: flex; max-width: 560px; margin: 28px 0 0; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.lib-search input { flex: 1; min-width: 0; border: 0; padding: 14px 16px; font: inherit; font-size: 15px; color: var(--ink); outline: none; background: transparent; }
.lib-search input::placeholder { color: var(--faint); font-size: 13.5px; }
.lib-search button { border: 0; background: var(--gold); color: #fff; font: inherit; font-weight: 700; font-size: 14px; padding: 0 22px; cursor: pointer; }
.lib-search button:hover { background: var(--gold-ink); }
.lib-results { margin-bottom: 8px; }
.lib-results__clear { margin-left: auto; border: 1px solid var(--line); background: var(--white); color: var(--muted); font: inherit; font-size: 12px; border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.lib-results__clear:hover { color: var(--red); border-color: var(--gold); }
.lib-results__none { padding: 28px 20px; background: var(--white); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: 14px; }
