/* ── Self-hosted fonts ── */
@font-face {
    font-family: 'Noto Sans JP';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/assets/fonts/noto-sans-jp-v56-japanese-300.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans JP';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/noto-sans-jp-v56-japanese-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Noto Sans JP';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/noto-sans-jp-v56-japanese-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Shippori Mincho';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/shippori-mincho-v17-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Shippori Mincho';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/shippori-mincho-v17-latin-500.woff2') format('woff2');
}

:root {
    --bg: #f7f7f5;
    --bg2: #efefed;
    --surface: #ffffff;
    --text: #111110;
    --text-muted: #505050;
    --text-subtle: #7a7a78;
    --accent: #1c3a6e;
    --accent-hover: #0d2248;
    --border: rgba(0,0,0,0.055);
    --border-mid: rgba(0,0,0,0.09);
    --shadow: 0 1px 12px rgba(0,0,0,0.06);
    --radius: 2px;
}

[data-theme="dark"] {
    --bg: #0e0e0d;
    --bg2: #181817;
    --surface: #1d1d1b;
    --text: #ededed;
    --text-muted: #969692;
    --text-subtle: #6a6a68;
    --accent: #5b8dd9;
    --accent-hover: #7aaae8;
    --border: rgba(255,255,255,0.05);
    --border-mid: rgba(255,255,255,0.09);
    --shadow: 0 1px 12px rgba(0,0,0,0.5);
}

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

html { font-size: clamp(14px, 2vw, 18px); scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.85;
    font-weight: 300;
    transition: background 0.35s, color 0.35s;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

/* ── Sidebar ── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 188px;
    height: 100vh;
    background: rgba(247, 247, 245, 0.72);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-right: 1px solid rgba(0,0,0,0.06);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] .sidebar {
    background: rgba(14, 14, 13, 0.78);
    border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2.2rem 0 1.6rem;
}

.sidebar .site-logo {
    padding: 0 1.4rem 1.8rem;
    border-bottom: 1px solid var(--border);
    font-family: 'Shippori Mincho', serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text);
}
.sidebar { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.4rem 0 0.8rem;
    gap: 0.05rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.52rem 1.4rem;
    font-size: 0.78rem;
    color: var(--text-subtle);
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: color 0.2s;
    border-left: 1.5px solid transparent;
    position: relative;
}

.sidebar-nav a:hover {
    color: var(--text);
}

.sidebar-nav a.active {
    color: var(--text);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-sub {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 0 0;
    border-top: 1px solid var(--border);
    gap: 0.05rem;
}

.sidebar-sub a {
    display: block;
    padding: 0.4rem 1.4rem;
    font-size: 0.7rem;
    color: var(--text-subtle);
    letter-spacing: 0.06em;
    transition: color 0.2s;
    opacity: 0.7;
}
.sidebar-sub a:hover { color: var(--text-muted); opacity: 1; }

.sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.4rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.8rem;
}

.sidebar-copy {
    font-size: 0.65rem;
    color: var(--text-subtle);
    letter-spacing: 0.05em;
    opacity: 0.6;
}

/* ── Mobile header ── */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(247, 247, 245, 0.72);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

[data-theme="dark"] .mobile-header {
    background: rgba(14, 14, 13, 0.78);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.mobile-header-inner {
    height: 52px;
    padding: 0 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ── Body offset ── */
body {
    padding-left: 188px;
    transition: padding-left 0.35s ease, background 0.35s, color 0.35s;
}

/* ── サイドバーホバートグル ── */

/* 記事読書モード：サイドバーを引っ込める */
body.sidebar-hidden {
    padding-left: 0;
}
body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
}

/* ホバーで飛び出るエフェクト */
body.sidebar-hidden .sidebar:hover,
body.sidebar-hidden .sidebar.peek {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.12);
}

[data-theme="dark"] body.sidebar-hidden .sidebar:hover,
[data-theme="dark"] body.sidebar-hidden .sidebar.peek {
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
}

/* 左端のホバートリガーエリア（サイドバーが隠れているとき） */
.sidebar-hover-trigger {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 100vh;
    z-index: 201;
    cursor: default;
}

body.sidebar-hidden .sidebar-hover-trigger {
    display: block;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .mobile-header { display: block; }
    body { padding-left: 0; }
    .hamburger { display: flex; }
    .sidebar-hover-trigger { display: none !important; }
}

.header-inner {
    max-width: auto;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: 'Shippori Mincho', serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text);
    transition: color 0.2s;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.header-nav {
    display: flex;
    gap: 1.8rem;
}

.header-nav a {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    transition: color 0.2s;
    font-weight: 400;
}
.header-nav a:hover,
.header-nav a.active { color: var(--text); }

.theme-btn {
    background: none;
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text); 
    transition: all 0.2s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ── Container ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container-wide {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ── Footer ── */
.site-footer {
    margin-top: 8rem;
    border-top: 1px solid var(--border);
    padding: 2.5rem 0;
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-copy {
    font-size: 0.72rem;
    color: var(--text-subtle);
    letter-spacing: 0.05em;
    opacity: 0.65;
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 1.2rem;
}

.footer-links a {
    font-size: 0.72rem;
    color: var(--text-subtle);
    letter-spacing: 0.05em;
    transition: color 0.2s;
    opacity: 0.65;
}
.footer-links a:hover { color: var(--accent); opacity: 1; }

/* ── Blog list ── */
.blog-section {
    padding: 3.5rem 0;
}

.section-label {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-subtle);
    margin-bottom: 2rem;
}

.post-list {
    list-style: none;
}

.post-item + .post-item {
    border-top: 1px solid var(--border);
}

.post-link {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: 1.1rem 0;
    transition: all 0.2s;
}

.post-link:hover .post-title {
    color: var(--accent);
}

.post-title {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text);
    transition: color 0.2s;
    flex: 1;
}

.post-date {
    font-size: 0.78rem;
    color: var(--text-subtle);
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ── Article ── */
.article-wrap {
    padding: 3.5rem 0;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-subtle);
    margin-bottom: 2.5rem;
    transition: color 0.2s;
}
.article-back:hover { color: var(--text-muted); }

.article-date {
    font-size: 0.78rem;
    color: var(--text-subtle);
    margin-bottom: 0.8rem;
    display: block;
}

.article-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 1.65rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: -2rem;
    padding-bottom: 2rem;
}

.article-body {
    font-size: 0.975rem;
    line-height: 1.95;
}

.article-body h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.article-body h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
}

.article-body p { margin-bottom: 1.4rem; }

.article-body img {
    margin: 2rem auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.article-body blockquote {
    border-left: 2px solid var(--accent);
    padding: 0.4rem 0 0.4rem 1.2rem;
    color: var(--text-muted);
    margin: 1.5rem 0;
    font-style: italic;
}

.article-body code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bg2);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    color: var(--accent);
}

.article-body pre {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.article-body ul,
.article-body ol {
    padding-left: 1.4rem;
    margin-bottom: 1.2rem;
}

.article-body li { margin-bottom: 0.3rem; }

.article-body strong,
.prose strong {
    color: var(--accent);
    font-weight: 500;
}

.article-body a {
    color: var(--accent);
    border-bottom: 1px solid var(--border-mid);
    transition: border-color 0.2s, color 0.2s;
}
.article-body a:hover {
    color: var(--accent-hover);
    border-color: var(--accent);
}

/* ── Hamburger ── */
.hamburger {
    display: none;
    background: none;
    border: none;
    border-radius: var(--radius);
    width: 30px; height: 30px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s;
}
.hamburger:hover { border-color: var(--accent); }

.hamburger span {
    display: block;
    width: 14px;
    height: 1px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: all 0.3s;
}

.hamburger.open span:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
    opacity: 0;
}
.hamburger.open span:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

/* モバイルメニュー */
.fullscreen-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    padding: 52px 2rem 2rem;
}

.fullscreen-menu.open {
    display: flex;
}

.fullscreen-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}

.fullscreen-menu-nav a {
    font-family: 'Shippori Mincho', serif;
    font-size: clamp(2rem, 10vw, 3rem);
    font-weight: 500;
    color: var(--text);
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border);
    transition: color 0.2s;
    letter-spacing: 0.02em;
}

.fullscreen-menu-nav a:last-child {
    border-bottom: none;
}

.fullscreen-menu-nav a:hover,
.fullscreen-menu-nav a.active {
    color: var(--accent);
}

.fullscreen-menu-sub {
    display: flex;
    gap: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.fullscreen-menu-sub a {
    font-size: 0.82rem;
    color: var(--text-subtle);
    transition: color 0.2s;
    letter-spacing: 0.06em;
}

.fullscreen-menu-sub a:hover {
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .container, .container-wide { padding: 0 1.5rem; }
    .header-inner { padding: 0 1.5rem; }
    .footer-inner { padding: 0 1.5rem; }
}

@media (max-width: 768px) {
    .container, .container-wide { padding: 0 1rem; }
    .header-inner { padding: 0 1rem; }
    .footer-inner { padding: 0 1rem; }
    .hero-name { font-size: 2.5rem; }
    .intro-grid { grid-template-columns: 1fr; gap: 2rem; }
    .play-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 640px) {
    .header-nav { display: none; }
    .hamburger { display: flex; }
    .container, .container-wide { padding: 0 1.2rem; }
    .header-inner { padding: 0 1.2rem; }
    .footer-inner { padding: 0 1.2rem; }
    .footer-copy {
    font-size: 1rem;
    color: var(--text-subtle);
}
    .article-title { font-size: 1.35rem; }
    .post-link { flex-direction: column; gap: 0.2rem; }
    .hero-name { font-size: 2rem; }
}

::selection {
    background: var(--accent);
    color: #fff;
}

::-moz-selection {
    background: var(--accent);
    color: #fff;
}

[data-theme="dark"] ::selection {
    background: var(--accent);
    color: #1a1a18;
}

[data-theme="dark"] ::-moz-selection {
    background: var(--accent);
    color: #1a1a18;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }

body, .sidebar, .site-footer {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================================
   Markdownテーブル スタイル改善（After A相当）
   既存のグローバルCSSに追記してください
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid var(--text);
  margin-bottom: 1.5em;
  font-size: 0.88rem;
  line-height: 1.7;
}

thead tr th {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 400;
  text-align: left;
  padding: 10px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border-mid);
}

tbody tr td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  vertical-align: top;
}

/* 左列（変更点）と右列（概要）の境界線 */
tbody tr td:first-child {
  border-right: 1px solid var(--border);
  width: 30%; /* 必要に応じて調整 */
}

/* ホバー */
tbody tr:hover td {
  background: var(--bg2);
  transition: background 0.15s;
}

/* リンクスタイル */
tbody tr td a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--text-muted);
  padding-bottom: 1px;
  transition: border-color 0.15s, color 0.15s;
}

tbody tr td a:hover {
  color: var(--text-subtle);
  border-color: var(--text-subtle);
}

mark {
    background-color: color-mix(in srgb, #e75480 20%, transparent);
    color: var(--text);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-style: normal;
}