/* Cocoon 型の 2 カラム（本文＋右サイドバー）。色とフォントはラーメン訪問録に合わせる */
:root {
  --bg: #F4F6F8;
  --surface: #FFFFFF;
  --fg: #1E2A33;
  --muted: #55626C;
  --line: #D8DFE4;
  --accent: #0B6E8A;
  --accent-ink: #FFFFFF;
  --accent-strong: #0A3A52;
  --accent-soft: #E3F1F5;
  --water: #BFE3EC;
  --danger: #B42318;
  --marker-red: #FFD3CF;
  --code-bg: #F4F6F8;
  --focus: #1560BD;
  --shadow: 0 1px 2px rgba(20, 50, 70, .06), 0 2px 8px rgba(20, 50, 70, .05);
  --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  --font-body: "BIZ UDPGothic", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", sans-serif;
  --font-mono: "Consolas", "Menlo", "Monaco", monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D1820; --surface: #142430; --fg: #E4EEF2; --muted: #9FB1BC; --line: #27404F;
    --accent: #5CC3DB; --accent-ink: #06202A; --accent-strong: #A9DCE8; --accent-soft: #173544; --water: #1F5466;
    --danger: #FF8A80; --marker-red: #5A2A2A; --code-bg: #0D1820; --focus: #8AB4FF; --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.8; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.45; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
img { max-width: 100%; height: auto; }
button { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: 16px; top: -100px; background: var(--surface); color: var(--fg); padding: .5rem 1rem; z-index: 50; border: 2px solid var(--accent); border-radius: var(--r); }
.skip:focus { top: 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.linkish:hover { color: var(--accent-strong); text-decoration: underline; }

/* ヘッダー・フッター */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-block: 22px; }
.site-title { font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 4vw, 26px); letter-spacing: .06em; color: var(--fg); text-decoration: none; }
.site-title:hover { color: var(--accent); }
.site-footer { background: var(--surface); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.site-footer .wrap { padding-block: 20px; }

/* 2 カラム。狭い画面ではサイドバーが下に回る */
.layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; padding-block: 28px 64px; }
.main { flex: 999 1 560px; min-width: 0; background: var(--surface); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.sidebar { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; align-self: stretch; }
.widget { background: var(--surface); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.widget-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 6px 12px; border-radius: 6px; }
.widget-title label { cursor: inherit; }
.widget-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

/* 一覧 */
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); margin-bottom: 4px; }
.list-head h1 { font-size: 19px; }
.list-head .count { font-size: 13px; color: var(--muted); }
.entry { display: flex; gap: 20px; padding-block: 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.entry:hover { color: var(--fg); }
.entry:hover h2 { color: var(--accent); }
.thumb { flex: none; width: 220px; max-width: 40%; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: var(--accent-soft); position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .noimg { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.thumb .cat { position: absolute; left: 0; top: 0; background: var(--accent); color: var(--accent-ink); font-size: 12px; padding: 2px 10px; border-bottom-right-radius: 8px; line-height: 1.6; }
.entry-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.entry-body h2 { font-size: 18px; line-height: 1.55; transition: color .15s; }
.entry-tags { font-size: 13px; color: var(--muted); }
.entry-date { margin-top: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty, .notfound { padding: 32px 0; color: var(--muted); display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pager a { min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); text-decoration: none; display: inline-grid; place-items: center; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* サイドバー */
.search input { width: 100%; font: inherit; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--fg); }
.search input:focus-visible { border-color: var(--accent); }
.cat-list { display: flex; flex-direction: column; }
.cat-list a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 4px 8px calc(4px + var(--depth, 0) * 16px); min-height: 44px; align-items: center; border-bottom: 1px dashed var(--line); color: var(--fg); text-decoration: none; }
.cat-list a:last-child { border-bottom: 0; }
.cat-list a:hover, .cat-list a[aria-current="page"] { color: var(--accent); }
.cat-list a[aria-current="page"] { font-weight: 700; }
.cat-list .n, .tag .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; background: var(--accent-soft); color: var(--accent-strong); border: 1.5px solid transparent; padding: 3px 12px; border-radius: 999px; text-decoration: none; line-height: 1.6; }
.tag:hover { border-color: var(--accent); color: var(--accent-strong); }
.tag[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.tag[aria-current="page"] .n { color: inherit; }
.mini { display: flex; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--fg); text-decoration: none; align-items: flex-start; }
.mini:hover { color: var(--accent); }
.mini .thumb { width: 96px; border-radius: 6px; }
.side-toc { display: flex; flex-direction: column; font-size: 14px; line-height: 1.5; }
.side-toc a { text-decoration: none; padding: 5px 0; }
.side-toc a.h3 { padding-left: 16px; }
.side-toc a.h4 { padding-left: 32px; color: var(--muted); }
.side-toc a.h4:hover { color: var(--accent); }
.side-toc a.is-current { font-weight: 700; }

/* 記事 */
.article { display: flex; flex-direction: column; gap: 18px; }
.main:has(.article) { padding: 28px clamp(18px, 4vw, 40px) 40px; }
.article-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font-size: 14px; text-decoration: none; }
.back-link:hover { border-color: var(--accent); color: var(--accent); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.article > h1 { font-size: clamp(22px, 3.6vw, 28px); line-height: 1.5; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meta .cat-pill { background: var(--accent); color: var(--accent-ink); padding: 0 12px; border-radius: 999px; text-decoration: none; line-height: 1.9; }
.meta .tag { font-size: 12px; padding: 1px 10px; }
.eyecatch { width: 100%; max-height: 420px; object-fit: contain; background: var(--bg); border-radius: 8px; display: block; }
.toc { background: var(--bg); border-radius: var(--r); padding: 14px 24px; font-size: 15px; align-self: flex-start; min-width: min(100%, 360px); margin: 8px 0; }
.toc-head { display: flex; justify-content: center; align-items: baseline; gap: 8px; font-family: var(--font-display); font-weight: 700; }
.toc-head button { font-family: var(--font-body); font-weight: 400; font-size: 13px; }
.toc ol { margin: 8px 0 0; padding-left: 1.4em; line-height: 2; }
.toc ol ol { margin: 0; }
.section-title { font-size: 17px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.related-section { margin-top: 40px; display: flex; flex-direction: column; gap: 12px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.related .mini { flex-direction: column; }
.related .mini .thumb { width: 100%; max-width: 100%; }
.prevnext { margin-top: 32px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.prevnext a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r); color: var(--fg); text-decoration: none; line-height: 1.6; }
.prevnext a:hover { border-color: var(--accent); color: var(--fg); }
.prevnext .dir { font-size: 13px; color: var(--muted); }
.prevnext .next { text-align: right; align-items: flex-end; }

/* 本文（WordPress から移した HTML） */
.entry-content { display: flex; flex-direction: column; gap: 18px; overflow-wrap: anywhere; }
.entry-content > * { margin-block: 0; }
.entry-content h2 { margin-top: 24px; font-size: 22px; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; scroll-margin-top: 16px; }
.entry-content h3 { margin-top: 12px; font-size: 19px; padding: 4px 0 4px 12px; border-left: 6px solid var(--accent); scroll-margin-top: 16px; }
.entry-content h4 { margin-top: 4px; font-size: 17px; padding-bottom: 4px; border-bottom: 2px dotted var(--water); scroll-margin-top: 16px; }
.entry-content h5 { font-size: 16px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 2px; }
.entry-content figure { margin-inline: 0; }
.entry-content figure img { border-radius: 8px; }
.entry-content figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.entry-content video, .entry-content iframe { max-width: 100%; border-radius: 8px; }
.entry-content blockquote { margin-inline: 0; background: var(--bg); border-radius: var(--r); padding: 14px 20px; }
.entry-content blockquote p + p { margin-top: 8px; }
.entry-content details { background: var(--bg); border-radius: var(--r); padding: 12px 18px; }
.entry-content details summary { cursor: pointer; font-weight: 700; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); }
.entry-content .wp-block-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
.entry-content table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; line-height: 1.6; }
.entry-content th, .entry-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry-content thead { background: var(--bg); }
.entry-content tbody tr:last-child td { border-bottom: 0; }
.entry-content pre { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 14px; line-height: 1.7; }
.entry-content pre code { white-space: pre; font-family: inherit; }
.entry-content :not(pre) > code { background: var(--accent-soft); padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .9em; }
.code-wrap { position: relative; }
.code-wrap .copy { position: absolute; top: 6px; right: 6px; font-size: 12px; min-height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.code-wrap .copy:hover { color: var(--accent); border-color: var(--accent); }
.entry-content .wp-embed-youtube { position: relative; aspect-ratio: 16 / 9; }
.entry-content .wp-embed-youtube iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.entry-content .wp-block-columns { gap: 16px; margin-bottom: 0; }
.entry-content .wp-block-gallery { gap: 8px; }
/* Cocoon の文字装飾 */
.entry-content .red { color: var(--danger); }
.entry-content .bold-red { color: var(--danger); font-weight: 700; }
.entry-content .marker-under { background: linear-gradient(transparent 60%, var(--water) 60%); }
.entry-content .marker-under-red { background: linear-gradient(transparent 60%, var(--marker-red) 60%); }

@media (max-width: 560px) {
  .main { padding: 16px; }
  .entry { gap: 12px; padding-block: 14px; }
  .thumb { width: 120px; }
  .entry-body h2 { font-size: 15.5px; }
  .entry-tags { display: none; }
  .widget-toc { position: static; max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
