/* Web3Navi — ダークテーマ（Notion のダークモードに近い配色） */
:root {
  --bg: #191919;
  --bg-2: #202020;
  --bg-3: #2a2a2a;
  --line: #2f2f2f;
  --text: #e6e6e4;
  --text-2: #9b9b9b;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --radius: 10px;
  --wrap: 1080px;
  --read: 760px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.8; font-size: 16px; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ヘッダー */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(25,25,25,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 6px; }
.site-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.site-nav a { color: var(--text-2); font-size: 14px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav-icon { margin-right: 4px; }
.menu-btn { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; }
.menu-btn span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; transition: .2s; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .site-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; }
  .nav-open .site-nav { display: flex; }
  .site-nav a { font-size: 16px; padding: 12px; }
}

/* ヒーロー画像 */
.hero { width: 100%; max-height: 300px; overflow: hidden; background: var(--bg-2); }
.hero img { width: 100%; height: 300px; object-fit: cover; }
.article-hero img { height: 280px; }
@media (max-width: 640px) { .hero img, .article-hero img { height: 160px; } }
.home.has-hero .page-icon { margin-top: -56px; position: relative; }
.page-icon { border-radius: 12px; width: 96px; height: 96px; object-fit: cover; margin: 24px 0 0; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.page-title { font-size: clamp(24px, 4.5vw, 36px); line-height: 1.4; margin: 24px 0 12px; font-weight: 700; letter-spacing: .01em; }
.article .article-meta { padding-bottom: 20px; border-bottom: 1px solid var(--line); }

/* パンくず・メタ */
.crumbs { font-size: 13px; color: var(--text-2); margin-top: 24px; }
.crumbs a { color: var(--text-2); }
.count { color: var(--text-2); font-size: 14px; margin-top: -4px; }
.article-meta, .card-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.updated::before { content: "・"; }

/* タグ */
a.tag:hover { text-decoration: none; filter: brightness(1.25); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; line-height: 1.7; background: #373737; color: #d4d4d4; }
.t-orange { background: #5c3b23; } .t-yellow { background: #564328; } .t-green { background: #243d30; }
.t-blue { background: #143a4e; } .t-purple { background: #3c2d49; } .t-pink { background: #4e2c3c; }
.t-red { background: #522e2a; } .t-brown { background: #4a3228; } .t-gray { background: #3a3a3a; }

/* トップのセクション */
.home-section { margin: 40px 0; }
.home-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.home-pair > div { min-width: 0; }
@media (max-width: 720px) { .home-pair { grid-template-columns: 1fr; gap: 0; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 16px; }
.notion .section-head h2, .section-head h2 { font-size: 20px; line-height: 1.4; margin: 0; padding: 0; border: 0; }
.section-head h2 a { color: var(--text); }
.section-head h2 span { margin-right: 6px; }
.more { font-size: 12.5px; white-space: nowrap; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; transition: color .15s, border-color .15s; }
.more:hover { color: var(--text); border-color: #555; text-decoration: none; }
.empty { color: var(--text-2); }

/* カード */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.column .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; }
.card { position: relative; }
.card-link { color: inherit; }
.card-link:hover { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-meta .tag { position: relative; z-index: 2; }
.card:hover { text-decoration: none; transform: translateY(-2px); border-color: #444; }
.card-thumb { aspect-ratio: 16 / 9; background: var(--bg-3); overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; background: linear-gradient(135deg, #1e293b, #312e81); }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.notion .card-title, .card-title { font-size: 15px; line-height: 1.55; margin: 0; padding: 0; border: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: calc(1.55em * 3); }
.card-icon { margin-right: 4px; }
.card-meta { padding-top: 10px; border-top: 1px solid var(--line); }
.card-meta time { margin-left: auto; white-space: nowrap; }

/* リスト */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 11px 8px; border-bottom: 1px solid var(--line); color: var(--text); line-height: 1.55; border-radius: 0; transition: background .15s; }
.row:hover { background: var(--bg-2); text-decoration: none; }
.row-icon { flex: none; }
.row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-title small { display: block; color: var(--text-2); font-size: 12px; }
.row time { color: var(--text-2); font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }

/* 絞り込み */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 20px; }
.filters button { background: var(--bg-2); color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.filters button:hover { color: var(--text); border-color: #555; }
.filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 記事本文 */
.article { max-width: var(--read); }
.article-icon { font-size: 56px; line-height: 1; margin-top: 24px; }
.article-icon-img { width: 64px; height: 64px; margin-top: 24px; border-radius: 8px; }
.home .notion { margin-bottom: 48px; }
.notion { margin-top: 24px; overflow-wrap: anywhere; }
.notion p { margin: .5em 0; }
.notion h2, .notion h3, .notion h4 { line-height: 1.45; scroll-margin-top: 72px; }
.notion h2 { font-size: 26px; margin: 1.8em 0 .5em; }
.notion h3 { font-size: 21px; margin: 1.6em 0 .4em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.notion h4 { font-size: 18px; margin: 1.4em 0 .3em; }
.notion ul, .notion ol { padding-left: 1.6em; margin: .4em 0; }
.notion li { margin: .2em 0; }
.notion hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.notion blockquote { margin: 1em 0; padding: 2px 16px; border-left: 3px solid var(--text); }
.notion code { background: var(--bg-3); color: #eb5757; padding: .1em .35em; border-radius: 4px; font-size: .88em; }
.notion pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px; overflow-x: auto; }
.notion pre code { background: none; color: var(--text); padding: 0; }
.notion figure { margin: 1.2em 0; }
.notion figure img { border-radius: 6px; margin: 0 auto; }
.notion figcaption { color: var(--text-2); font-size: 13px; margin-top: 6px; text-align: center; }
.spacer { height: .8em; }
.home .spacer { height: 0; }
.indent { padding-left: 1.6em; }
.callout { display: flex; gap: 12px; padding: 16px; border-radius: 8px; margin: 1em 0; background: #252525; }
.callout-icon { font-size: 20px; line-height: 1.6; flex: none; width: 24px; height: 24px; }
.callout-body { flex: 1; min-width: 0; }
.callout-body > :first-child { margin-top: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.columns { display: flex; gap: 24px; }
.column { flex: 1; min-width: 0; }
@media (max-width: 720px) { .columns { flex-direction: column; gap: 0; } .column { flex: auto !important; } }
.table-wrap { overflow-x: auto; margin: 1em 0; }
.notion table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
.notion th, .notion td { border: 1px solid #3a3a3a; padding: 8px 10px; text-align: left; vertical-align: top; }
.notion th { background: var(--bg-2); font-weight: 600; }
details.toggle, details.toggle-h { margin: .4em 0; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; width: 1.2em; transition: transform .15s; color: var(--text-2); }
details[open] > summary::before { transform: rotate(90deg); }
details.toggle-h > summary > * { display: inline; }
.toggle-body { padding-left: 1.2em; }
.todo { display: flex; gap: 8px; align-items: flex-start; margin: .3em 0; }
.todo .box { flex: none; width: 18px; height: 18px; margin-top: .3em; border: 1.5px solid var(--text-2); border-radius: 3px; display: grid; place-items: center; font-size: 12px; }
.todo.done .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.todo.done > span:last-child { color: var(--text-2); text-decoration: line-through; }
.bookmark { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: .8em 0; color: var(--text); background: var(--bg-2); }
.bookmark:hover { text-decoration: none; border-color: #444; }
.bm-title { font-weight: 600; font-size: 14.5px; }
.bm-url { color: var(--text-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-link { display: block; padding: 4px 0; color: var(--text); text-decoration: underline; text-decoration-color: #555; }
.embed-16x9 { position: relative; padding-top: 56.25%; }
.embed-16x9 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.notion video { width: 100%; border-radius: 8px; }
.mention { text-decoration: underline; }

/* 目次 */
.toc { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; margin: 24px 0; font-size: 14.5px; }
.toc-title { font-weight: 700; margin: 0 0 6px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 4px 0; }
.toc li.lv3 { padding-left: 1.2em; font-size: 13.5px; }
.toc a { color: var(--text-2); }
.toc a:hover { color: var(--text); }

/* シェア・関連記事 */
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 40px 0 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.share a, .share button { background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.share a:hover { text-decoration: none; border-color: #555; }
.related { max-width: var(--read); margin: 32px auto 56px; }
.related h2 { font-size: 18px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 0 0 16px; }
.related .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

/* 検索 */
.search-input { width: 100%; font: inherit; font-size: 16px; padding: 12px 16px; border-radius: 999px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); margin-top: 4px; outline: none; transition: border-color .15s; }
.search-input:focus { border-color: var(--accent); }
.filters small { opacity: .7; margin-left: 2px; }
.grid > .empty { grid-column: 1 / -1; }

/* フッター */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--text-2); font-size: 13px; margin-top: 48px; }
.site-footer p { margin: 6px 0; }
.site-footer a { color: var(--text-2); }
.center { text-align: center; padding: 64px 16px; }
.btn { display: inline-block; background: var(--bg-3); color: var(--text); padding: 8px 18px; border-radius: 8px; margin: 4px; }

/* Notion の文字色・背景色 */
.c-gray { color: #9b9b9b; } .c-brown { color: #ba856f; } .c-orange { color: #c77d48; } .c-yellow { color: #ca9849; }
.c-green { color: #529e72; } .c-blue { color: #5e87c9; } .c-purple { color: #9d68d3; } .c-pink { color: #d15796; } .c-red { color: #df5452; }
.c-gray_background, .c-gray_bg { background: #252525; } .c-brown_background, .c-brown_bg { background: #2e2724; }
.c-orange_background, .c-orange_bg { background: #36291f; } .c-yellow_background, .c-yellow_bg { background: #372e20; }
.c-green_background, .c-green_bg { background: #242b26; } .c-blue_background, .c-blue_bg { background: #1f282d; }
.c-purple_background, .c-purple_bg { background: #2a2430; } .c-pink_background, .c-pink_bg { background: #2e2328; }
.c-red_background, .c-red_bg { background: #332523; }
span[class*="_background"] { padding: 0 .2em; border-radius: 3px; }
.article-cover { width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0 0; border: 1px solid var(--line); }
.link-mention { display: inline-flex; align-items: center; gap: 4px; }
.link-mention img { display: inline; border-radius: 3px; }

/* スマホ：カードを横長（画像左・文字右）にして一覧を短く */
@media (max-width: 640px) {
  .grid, .column .grid, .related .grid { grid-template-columns: 1fr; gap: 10px; }
  .card { flex-direction: row; }
  .card:hover { transform: none; }
  .card-thumb { flex: none; width: 120px; aspect-ratio: auto; min-height: 92px; }
  .thumb-ph { font-size: 26px; }
  .card-body { padding: 10px 12px; gap: 6px; min-width: 0; }
  .notion .card-title, .card-title { font-size: 14px; -webkit-line-clamp: 2; min-height: 0; }
  .card-meta { padding-top: 0; border-top: 0; font-size: 12px; }
  .card-meta .tag { font-size: 11px; padding: 0 6px; }
  .home-section { margin: 28px 0; }
  .section-head h2 { font-size: 18px; }
  .page-icon { width: 64px; height: 64px; }
  .home.has-hero .page-icon { margin-top: 16px; }
  .home .page-title { margin-top: 12px; }
}
