/* Guiguzi デザイン方針(2026-10-10)
   - 主役は本の表紙。サイトは白地で静かに。全ページ白背景
   - 色は「押せる場所」(青緑)と「買う場所」(朱色)だけ
   - 区切りは線。影や塗りの箱は使わない。押せるものは白地＋枠線、塗りつぶしは購入ボタンだけ
   - 角丸は3種類: 丸(ボタン・検索窓・チップ) / 小さめ(カード) / ほぼなし(表紙)
   - 文字サイズは4段階: ページ見出し / 区分け見出し / 本文 / 補足
   - 新しい色・影・角丸は下の変数のどれかに当てはめる。当てはまらないなら足さない */
/* 2026-10-11 ユーザー指定: 特集見出しは文字に沿う黄色のハイライト。スマホの個別ページは購入バーを画面下に固定。 */
:root {
  color-scheme: light; /* ライト固定: 端末がダークモードでも白基調で表示する */
  --bg: #ffffff;
  --ink: #2b2b2b; --sub: #6b6b6b; --line: #e6e6e3;
  --accent: #2f6f6a; --accent-soft: #e9f2f0;   /* ロゴの「Gui」と同じ青緑: リンク・選択中・入力中 */
  --recommendation-bg: #ffff00;               /* 参考画像と同じ、文字に沿う黄色のハイライト */
  --cta: #d25a32; --cta-ink: #ffffff;           /* ロゴの i の点と同じ朱色: 購入ボタンだけ */
  --r-pill: 999px; --r-card: 10px; --r-cover: 3px;
  --fs-page: 1.45rem; --fs-section: 1.125rem; --fs-body: .95rem; --fs-small: .78rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.75; font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1 { font-size: var(--fs-page); line-height: 1.45; margin: 14px 0 8px; text-wrap: pretty; }
h2, h3 { text-wrap: pretty; }
p { margin: 0 0 14px; }
.lead { color: var(--sub); font-size: var(--fs-body); text-wrap: pretty; }

/* ---- ヘッダー・ロゴ ---- */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand:hover { text-decoration: none; }
.header-search { color: var(--sub); display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill); }
.header-search svg { width: 22px; height: 22px; }
@media (min-width: 601px) { .home-header .header-search { display: none; } }
.logo { font-family: "Outfit", "Avenir Next", "Futura", -apple-system, sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1; font-size: 1.5rem; white-space: nowrap; }
.logo .l1 { color: var(--accent); } .logo .l2 { color: var(--ink); }
.logo .li { position: relative; display: inline-block; }
.logo .li b { position: absolute; left: 50%; top: .06em; width: .19em; height: .19em; margin-left: -.095em; border-radius: 50%; background: var(--cta); }
.logo.sm { font-size: 1.15rem; }

/* ---- 押せるもの: 白地＋枠線(入力中・指を置くと青緑) ---- */
.home-search { position: relative; }
.home-search svg { position: absolute; left: 15px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--sub); pointer-events: none; }
.home-search input { width: 100%; font: inherit; font-size: 1rem; padding: 11px 16px 11px 43px; border-radius: var(--r-pill);
  border: 1px solid #d4d4d0; background: var(--bg); color: var(--ink); outline: none; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.home-search input::placeholder { color: #8a8a86; }
.home-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.qchip, .chip { flex: 0 0 auto; font-size: .82rem; color: var(--ink); padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg); }
.qchip:hover, .chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- 表紙 ---- */
.cover { flex: 0 0 auto; position: relative; border-radius: var(--r-cover); box-shadow: 0 1px 3px rgba(0,0,0,.18); overflow: hidden;
  background: linear-gradient(150deg, hsl(var(--h) 38% 40%), hsl(calc(var(--h) + 30) 42% 28%)); color: #fff; }
.cover.xs { width: 44px; height: 62px; }
.cover.sm { width: 64px; height: 90px; }
.cover.md { width: 96px; height: 136px; }
.cover.lg { width: 112px; height: 158px; }
.cover-text { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 7px; font-weight: 700; line-height: 1.3; word-break: break-all; text-align: left; }
.cover.xs .cover-text { font-size: .45rem; padding: 4px; } .cover.sm .cover-text { font-size: .6rem; }
.cover.md .cover-text { font-size: .66rem; } .cover.lg .cover-text { font-size: .95rem; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---- トップ・カテゴリ・技術書の入口(共通の部品: テーマの列) ---- */
.home { padding-bottom: 8px; }
.home-search-area { padding-top: 14px; }
.home-tag { margin: 0 2px 8px; color: var(--sub); font-size: var(--fs-small); letter-spacing: .05em; }
.qchips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scroll-padding: 0 16px; scrollbar-width: none; max-width: 760px; margin: 0 auto; }
.qchips::-webkit-scrollbar { display: none; }
.results { margin-top: 14px; }
.result-count { color: var(--sub); font-size: .85rem; margin: 0 0 10px; }
.shelf { max-width: 760px; margin: 0 auto; padding: 18px 0 10px; border-top: 1px solid var(--line); }
#browse > .shelf:first-child { border-top: 0; margin-top: 6px; }
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 16px; margin-bottom: 10px; }
.shelf-head h2 { font-size: var(--fs-section); margin: 0; }
.more { font-size: .85rem; white-space: nowrap; }
.shelf-row, .guide-row { list-style: none; margin: 0; padding: 0 16px 6px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; }
.shelf-row::-webkit-scrollbar, .guide-row::-webkit-scrollbar { display: none; }
.shelf-item { flex: 0 0 96px; scroll-snap-align: start; }
.shelf-item a { display: flex; flex-direction: column; gap: 7px; color: var(--ink); }
.shelf-item a:hover { text-decoration: none; }
.shelf-title { font-size: var(--fs-small); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.guide { flex: 0 0 236px; scroll-snap-align: start; }
.guide a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border-radius: var(--r-card); border: 1px solid var(--line); color: var(--ink); background: var(--bg); }
.guide a:hover { text-decoration: none; border-color: var(--accent); }
.guide-covers { display: flex; gap: 6px; margin-bottom: 6px; }
.guide-cat { font-size: .72rem; color: var(--accent); font-weight: 700; }
.guide-title { font-size: .92rem; font-weight: 700; line-height: 1.5; }
.guide-count { font-size: var(--fs-small); color: var(--sub); margin-top: auto; }
.ti-soon { color: var(--sub); font-size: .8rem; margin-top: 14px; }
.tech-title { font-size: 1.35rem; margin: 2px 0 6px; }
.tech-lead { color: var(--sub); font-size: .9rem; margin: 0; }

/* ---- 下層ページ ---- */
.page { padding-top: 2px; }
.crumbs { font-size: var(--fs-small); color: var(--sub); margin: 14px 0 0; }
.crumbs i { font-style: normal; margin: 0 4px; }
.section-title { font-size: var(--fs-section); color: var(--ink); font-weight: 700; margin: 0 0 10px; }
.section-title.pick-heading-highlight, .section-title.book-list-heading { margin-bottom: 16px; }
.heading-highlight { background: var(--recommendation-bg); padding: 2px 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.heading-unit { white-space: nowrap; }
section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 22px; }
.home section, #browse section, .item-top + section { border-top: 0; padding-top: 0; margin-top: 0; }
.home .shelf { border-top: 1px solid var(--line); padding-top: 18px; }
#browse > .shelf:first-child { border-top: 0; }
.topic-grid, .book-list { list-style: none; padding: 0; margin: 0; }

/* テーマ一覧(分野のページ) */
.topic-grid { display: grid; gap: 10px; }
.topic-card a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-card); color: var(--ink); position: relative; }
.topic-card a:hover { text-decoration: none; border-color: var(--accent); }
.topic-card h3 { margin: 0 0 4px; font-size: 1rem; }
.topic-card p { color: var(--sub); font-size: .86rem; margin: 0; padding-right: 48px; }
.topic-card .count { position: absolute; right: 16px; top: 14px; color: var(--accent); font-weight: 700; font-size: .86rem; }

/* 迷ったらまずこの1冊 */
.pick-link { display: flex; gap: 16px; align-items: flex-end; color: var(--ink); }
.pick-link:hover { text-decoration: none; } .pick-link:hover h3 { color: var(--accent); }
.pick h3 { font-size: 1.05rem; line-height: 1.5; margin: 0 0 4px; }
.pick .cta { margin: 16px 0 4px; }

/* 本の一覧(線で区切る) */
.book-list { display: block; }
.book-card { border-top: 1px solid var(--line); }
.book-card:first-child { border-top: 0; }
.book-card .card-link { display: flex; gap: 14px; padding: 14px 2px; color: var(--ink); position: relative; }
.book-card .card-link:hover { text-decoration: none; }
.book-card .card-link:hover h3 { color: var(--accent); }
/* 道具の写真も本の表紙と同じ幅で並べる */
.product-image { flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-cover); }
.product-image.sm { width: 64px; height: 90px; }
.product-image.md { width: 96px; height: 136px; }
.product-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-feature { display: flex; gap: 16px; align-items: flex-start; }
.product-card .card-link { cursor: default; }
.product-specs { margin: 6px 0; padding-left: 1.2em; font-size: var(--fs-small); color: var(--ink); }
.product-specs li { margin: 0 0 2px; }
.product-card .meta, .product-feature .meta { margin-bottom: 4px; }
.product-card .tagline, .product-feature .tagline { margin-bottom: 4px; }
.more-link { margin: 12px 0 0; font-size: .9rem; }
.topic-products .product-note { margin: 24px 0 0; font-size: var(--fs-small); color: var(--sub); }
.topic-grid h2 { margin: 0 0 4px; font-size: var(--fs-section); }
.book-card h3 { font-size: .98rem; line-height: 1.5; margin: 0 0 4px; }
/* 一覧から直接買う: 本文の左端にそろえた小さな購入ボタン(表紙64px＋すき間14px＋2px) */
.buy { display: inline-block; margin: -4px 0 14px 80px; padding: 5px 16px; border-radius: var(--r-pill); background: var(--cta); color: var(--cta-ink); font-weight: 700; font-size: .82rem; }
.buy:hover { text-decoration: none; filter: brightness(1.05); }
.card-body { min-width: 0; }
.tagline { color: var(--sub); font-size: .88rem; margin: 0 0 4px; }
.meta { color: var(--sub); font-size: var(--fs-small); margin: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: var(--r-pill); color: var(--accent); background: var(--accent-soft); line-height: 1.6; }
.badge-depth { border: 1px solid var(--accent); background: var(--bg); padding: 0 7px; }

/* 1冊のページ */
.item { margin-top: 14px; }
.item-top { display: flex; gap: 16px; align-items: flex-end; }
.item h1 { font-size: 1.25rem; margin: 4px 0; }
.item .tagline { font-size: .92rem; }
.cta { display: block; text-align: center; background: var(--cta); color: var(--cta-ink); font-weight: 800; padding: 14px; border-radius: var(--r-pill); margin: 18px 0 22px; }
.cta:hover { text-decoration: none; filter: brightness(1.05); }
.item section p { font-size: var(--fs-body); }
.item-page .section-title { color: var(--accent); }
.item-main .item-meta { margin-top: 8px; }
.facts { display: grid; grid-template-columns: 5.5em 1fr; gap: 6px 10px; margin: 0 0 12px; font-size: .9rem; }
.facts dt { color: var(--sub); } .facts dd { margin: 0; }

/* 読み物(サイトについて・プライバシー・404) */
.prose { padding-bottom: 8px; }
.prose h2 { font-size: var(--fs-section); margin-top: 24px; }
.nf-chips { flex-wrap: wrap; padding: 6px 0 0; }

/* ---- フッター ---- */
.site-footer { margin-top: 40px; background: var(--bg); border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--sub); font-size: .82rem; }
.foot-brand { margin-bottom: 8px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; }

/* ---- 言語の入口 ---- */
.entrance { text-align: center; padding-top: 18vh; }
.entrance .brand-name { font-size: 2.6rem; font-weight: 800; }
.lang-list { list-style: none; padding: 0; margin: 28px 0 0; }
.lang-link { display: inline-block; padding: 10px 28px; border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--ink); font-weight: 700; }

/* 最終更新日(本文が変わったときだけ更新) */
.updated { color: var(--sub); font-size: var(--fs-small); margin: 28px 0 0; }

/* 迷ったらまずこれ: なぜここから / 別の入口 */
.pick-note { margin: 14px 0 4px; font-size: var(--fs-body); }
.pick-alt { color: var(--sub); font-size: .88rem; margin: 0 0 4px; }

/* note の紹介を踏まえた特集。コメントはタイトルのリンクから分け、読みやすくする。 */
.selection-link, .guide-source a { text-decoration: underline; text-underline-offset: 3px; }
.foot-nav .selection-link { text-decoration: none; }
.book-comment { font-size: var(--fs-body); line-height: 1.8; }
.book-comment p { margin: 0; }
.book-comment .comment-label { font-size: var(--fs-small); font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.pick .book-comment { margin-top: 16px; }
.book-card.has-comment .card-link { padding-bottom: 8px; }
.book-card .book-comment { margin: 0 2px 14px 80px; }
.guide-source { border-top: 1px solid var(--line); margin: 22px 0 0; padding-top: 18px; font-size: .88rem; }
.external-label { font-size: var(--fs-small); }
.selection-criteria li { margin-bottom: 16px; }
.selection-criteria p { margin: 4px 0 0; }

/* 本のテーマページ → 困りごとのページ(道具)へのリンク。押せるものは白地＋枠線、矢印で遷移が分かるように */
.goods-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-card); background: var(--bg); color: var(--accent); font-size: .9rem; line-height: 1.6; }
.goods-link:hover { text-decoration: none; border-color: var(--accent); background: var(--accent-soft); }
.goods-link svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--accent); }

/* 広い画面では購入ボタンを間延びさせない(スマホは押しやすい全幅のまま) */
@media (min-width: 600px) {
  .cta { max-width: 360px; }
}

/* 1冊のページ: スマホは表紙→中身、購入バーは画面下。広い画面は左に表紙とボタン、右に中身の2列 */
.item-grid { display: grid; gap: 22px; }
.item-side { display: flex; flex-direction: column; align-items: center; }
.item-side .cta { width: 100%; max-width: none; margin: 18px 0 0; }
.cover.xl { width: 200px; height: 284px; }
.cover.xl .cover-text { font-size: 1.05rem; padding: 12px; }
.item-main h1 { font-size: 1.3rem; margin: 6px 0 4px; }
.item-main > section:first-of-type { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.item-main > section.item-comment { border-top: 0; border-left: 3px solid var(--accent); padding: 0 0 0 14px; margin: 20px 0; }
.item-comment .section-title { margin-bottom: 8px; }
.item-comment p { margin-bottom: 0; }
.learn-list { margin: 0; padding-left: 1.2em; }
.learn-list li { font-size: var(--fs-body); margin: 4px 0; }
@media (max-width: 719px) {
  body:has(.item-page) { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  html:has(.item-page) { scroll-padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .item-buy-bar { position: fixed; inset: auto 0 0; z-index: 50; background: var(--bg); border-top: 1px solid var(--line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .item-buy-bar .cta { margin: 0; padding: 11px 14px; min-height: 46px; font-size: var(--fs-body); line-height: 1.5;
    font-weight: 700; border-radius: var(--r-cover); }
}
/* 本のページだけ、広い画面ではページ(とヘッダー)を広げて表紙を主役にする。文章の列は読みやすい幅に保つ */
@media (min-width: 900px) {
  .item-page, body:has(.item-page) .site-header .wrap { max-width: 1040px; }
  .item-page .item-grid { grid-template-columns: 280px minmax(0, 660px); gap: 56px; }
  .item-page .cover.xl { width: 280px; height: 398px; }
}
@media (min-width: 720px) {
  .item-grid { grid-template-columns: 200px 1fr; gap: 32px; align-items: start; }
  .item-side { align-items: stretch; position: sticky; top: 20px; }
  .cover.xl { width: 200px; height: 284px; }
  .item-main h1 { font-size: 1.5rem; margin-top: 0; }
}

/* 表紙・商品画像を押すと Amazon へ(押せると分かるよう、指を置くと少し沈む) */
.cover-link { display: block; }
.cover-link:hover .cover, a.product-image:hover { opacity: .88; }
