/* =====================================================
   CSS Custom Properties & Reset
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;350;400;500&family=Noto+Serif+JP:wght@300;350;400;500&display=swap');

:root {
  /* Colors — 灰青背景 */
  --bg:          #7a8fa0;
  --bg-alt:      #6a7f90;
  --surface:     #8099aa;
  --border:      rgba(255,255,255,0.22);
  --text:        #f0f5f8;
  --text-muted:  #c0d0da;
  --accent:      #ffffff;
  --link:        #d8eaf2;
  --link-hover:  #ffffff;

  /* Typography */
  --font-gothic: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-mincho: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --line-height: 1.75;
  --content-width: 700px;
  --wide-width: 960px;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Transitions */
  --transition: 180ms ease;

  /* ── Markdowner 修飾カラー ── */
  --md-h1:        #f0f5f8;
  --md-h2:        #d8eaf2;
  --md-h3:        #c8dce8;
  --md-h4:        #e0eff6;
  --md-h5:        #b8d0de;
  --md-h6:        #c0d8e6;
  --md-strong:    #ffffff;
  --md-em:        #d8eaf2;
  --md-bq-border: rgba(255,255,255,0.5);
  --md-mark-bg:   rgba(255,255,255,0.2);
  --md-mark-fg:   #f0f5f8;
  --md-del:       rgba(255,255,255,0.35);
  --md-code-bg:   rgba(0,0,0,0.15);
  --md-code-fg:   #d8eaf2;
}

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

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-gothic);
  font-weight: 350;
  line-height: var(--line-height);
  min-height: 100vh;
  transition: background-color var(--transition), color var(--transition);
}

/* =====================================================
   Ruby — 行間を崩さない厳密調整
   ===================================================== */
/* ルビ — JIS 1-2-1 均等配置 */
/* ───── Ruby / Furigana ───────────────────────────── */
ruby {
  display: ruby;
  ruby-position: over;
  /* JIS X 4051: space-around が 1-2-1 均等割り付けに最も近い */
  ruby-align: space-around;
}

rt {
  font-size: 0.5em;
  line-height: 1;
  font-family: inherit;
  ruby-align: space-around;
  /* ルビを親文字に密着させる */
  margin-bottom: 0;
  padding-bottom: 0;
}

/* ルビ付き行が他行と同じ行高になるよう制御 */
ruby > rb,
ruby > span:first-child {
  display: inline;
}

/* 縦書き時のルビ */
.vertical ruby {
  ruby-position: right;
}

/* ─── スマホ: ルビによる行間拡大を防止 ─────────────────
   モバイルでは line-height を固定し、rt の高さを
   negative margin で吸収するテクニックを使用         */
/* ── モバイル Ruby: ネイティブ display:ruby + line-height 2.4 ──
   line-height 2.4 の半行間 = (2.4-1)/2 = 0.7em
   rt の高さ = font-size 0.5em × line-height 1 = 0.5em
   0.7em > 0.5em なので、ルビは行間内に収まり行高が揃う。
   display:ruby を使うことで Safari iOS での位置ズレを防ぐ。
   ruby-align: space-around で JIS 1-2-1 均等配置。          */
@media (max-width: 720px) {
  .poem-body,
  .poem-body p,
  .prose,
  .prose p {
    line-height: 2.4;
  }

  ruby {
    display: ruby;
    ruby-position: over;
    ruby-align: space-around;
  }

  rt {
    display: ruby-text;
    font-size: 0.5em;
    line-height: 1;
    text-align: center;
    ruby-align: space-around;
  }

  .vertical ruby {
    ruby-position: right;
  }
}

/* =====================================================
   Navigation
   ===================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition);
}

.nav-inner {
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 60px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

@media (max-width: 720px) {
  .nav-inner {
    padding: 0 var(--space-sm);
    gap: 0;  /* gap を無効化し、site-title の flex:1 で確実に右端へ */
  }
  .nav-inner .site-title {
    flex: 1;
    margin-right: 0;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
  }
}

.site-title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  margin-right: auto;
  transition: opacity var(--transition);
}
.site-title:hover { opacity: 0.6; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-links li {
  display: flex;
  align-items: center;
}
.nav-links a {
  font-size: 16px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
  line-height: 1;
}
/* (NET PRINTS) など副題用の小さい文字 */
.nav-small {
  font-size: 0.72em;
  line-height: 1;
  letter-spacing: 0.03em;
}
/* 連詩 — 少し大きめ（0.82em） */
.nav-renshi {
  font-size: 0.82em;
  line-height: 1;
  letter-spacing: 0.04em;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }



/* Mobile nav */
.nav-menu-toggle {
  display: none !important;
}

@media (max-width: 640px) {
  .nav-links a { font-size: 1rem; }
  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    background: var(--bg);
    border-bottom: none;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    z-index: 300;
    overflow-y: auto;
    animation: slideDown 0.22s ease forwards;
  }
  .nav-links.drawer-open { display: flex; }
  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* nav-drawer-overlay removed */
  .site-title { margin-right: 0; }
  /* Archive drawer button: visible on mobile */
  .mobile-archive-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.3em 0.8em;
    cursor: pointer;
    margin-bottom: var(--space-sm);
    transition: color var(--transition), border-color var(--transition);
  }
  .mobile-archive-btn:hover { color: var(--text); border-color: var(--text-muted); }
  /* mobile font sizes */
  .page-header h1 {
    font-size: 1.3rem;
  }
}

/* =====================================================
   Layout & Content
   ===================================================== */
.page-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
}

.page-wrapper.wide {
  max-width: var(--wide-width);
}

.page-header {
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-md);
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-xs);
}

.page-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* =====================================================
   Typography — Body Text
   ===================================================== */
.prose {
  line-height: var(--line-height);
}

.prose p {
  margin-bottom: 1.5em;
  white-space: normal;
  word-break: break-word;
  line-height: 2;
  font-size: 1rem;
  max-width: 35em;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
  hanging-punctuation: last;
}

.prose p:last-child { margin-bottom: 0; }

.prose a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.prose a:hover { color: var(--link-hover); }

.prose img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-md) 0;
  border-radius: 2px;
}

.prose figure {
  margin: var(--space-md) 0;
}

/* =====================================================
   Entry Styles (日記・記録類)
   ===================================================== */
.entry {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
  margin-top: var(--space-md);
}

.entry:last-child {
  border-bottom: none;
}

.entry:first-child {
  margin-top: 0;
}

.entry-heading {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  color: var(--text);
  line-height: 1.4;
}

.entry-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  font-weight: 400;
  margin-right: 2em;
}

/* =====================================================
   Month Navigation / Sidebar
   ===================================================== */
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--space-lg);
  align-items: start;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
}

.sidebar {
  position: sticky;
  top: calc(56px + var(--space-md));
}

.sidebar-title {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
}

.month-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.month-list a {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition);
  display: block;
}

.month-list a:hover,
.month-list a.active { color: var(--text); }

@media (max-width: 720px) {
  /* スマホ: sidebar を drawer 化し grid から除外 */
  .layout-with-sidebar {
    display: flex;
    flex-direction: column;
    padding: var(--space-md) var(--space-sm);
    max-width: var(--wide-width);
    margin: 0 auto;
  }
  .layout-with-sidebar > aside {
    display: none;
  }
  .layout-with-sidebar > main {
    display: block;
    width: 100%;
    min-height: 200px;
  }
  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: var(--space-lg) var(--space-md);
    overflow-y: auto;
    z-index: 200;
    transition: left 0.25s ease;
  }
  .sidebar.drawer-open {
    display: block !important;
    left: 0;
  }
  .drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 199;
  }
  .drawer-overlay.active { display: block; }
  .month-list {
    flex-direction: column;
    gap: 0.4rem;
  }
}

/* =====================================================
   Poetry — 縦書き
   ===================================================== */
.poetry-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: var(--space-lg);
}

.poetry-list a {
  font-family: var(--font-mincho);
  font-size: 20px;
  color: var(--link);
  text-decoration: none;
  letter-spacing: 0.06em;
  display: block;
  padding: var(--space-xs) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.poetry-list a:hover {
  color: var(--link-hover);
  border-color: var(--border);
}

/* 縦書きコンテナ */
.vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-mincho);
  line-height: var(--line-height);
  min-height: 50vh;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--space-md) 0;
}

.poem-content {
  font-family: var(--font-mincho);
  font-size: 1rem;
  letter-spacing: 0.08em;
  line-height: var(--line-height);
}

.poem-content p {
  margin-left: 1.5em; /* 縦書きでは margin-left が行間の役割 */
  display: inline-block;
  margin-bottom: 0;
}

.poem-title-display {
  font-family: var(--font-mincho);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-md);
}

/* =====================================================
   Index Page
   ===================================================== */
.index-root {
  display: grid;
  grid-template-columns: 12rem 1fr;
  column-gap: var(--space-lg);
  max-width: 980px;
  margin: 0 auto;
  padding: var(--space-sm) var(--space-md);
  align-items: start;
}

.index-profile {
  position: sticky;
  top: calc(3rem + var(--space-md));
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* プロフィール画像: 枠いっぱい */
.profile-img-wrap {
  width: 100%;
  overflow: visible;
}
.profile-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* コンタクト: ラベル/名前 をスラッシュ区切り */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0;
  margin-bottom: var(--space-sm);
}
.contact-list li {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.contact-list a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--transition);
}
.contact-list a:hover { color: var(--link-hover); }

/* アーカイブ */
.index-archive-wrap {
  padding-top: var(--space-sm);
  border-top: none;
}
.index-archive-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.index-archive-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}
.index-search-link {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}
.index-search-link:hover { color: var(--text); }

.index-tag-section {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

/* 日記フィード */
.index-feed { min-width: 0; }

/* スマホ */
@media (max-width: 720px) {
  .index-root {
    grid-template-columns: 1fr;
    padding: var(--space-md) var(--space-sm);
    gap: var(--space-md);
  }
  .index-profile {
    display: none;
  }
  .index-archive-wrap { display: none; }
}

/* =====================================================
   Loading / Error
   ===================================================== */
.loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  padding: var(--space-lg) 0;
}

.error-msg {
  color: #c0392b;
  font-size: 0.85rem;
  padding: var(--space-md) 0;
}

/* =====================================================
   Tool Page
   ===================================================== */
.tool-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  font-family: var(--font-gothic);
}

.tool-wrapper h1 {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}

.tool-section {
  margin-bottom: var(--space-md);
}

.tool-section label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.tool-section input,
.tool-section select,
.tool-section textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.8rem;
  color: var(--text);
  font-family: var(--font-gothic);
  font-size: 0.9rem;
  line-height: var(--line-height);
  outline: none;
  transition: border-color var(--transition);
}

.tool-section input:focus,
.tool-section select:focus,
.tool-section textarea:focus {
  border-color: var(--accent);
}

.tool-section textarea {
  min-height: 400px;
  resize: vertical;
  font-size: 0.88rem;
}

.tool-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  flex-wrap: wrap;
}

.tool-row .tool-section {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 3px;
  padding: 0.55rem 1.2rem;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
  font-family: var(--font-gothic);
}
.btn:hover { opacity: 0.75; }
.btn.secondary {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.secondary:hover { border-color: var(--accent); }

.insert-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.insert-btns button {
  font-family: var(--font-gothic);
  font-size: 0.78rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3rem 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}
.insert-btns button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.preview-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.88rem;
  line-height: var(--line-height);
  white-space: pre-wrap;
  font-family: monospace;
  max-height: 200px;
  overflow-y: auto;
  color: var(--text-muted);
}

/* =====================================================
   Utilities
   ===================================================== */
.separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

a { color: var(--link); }

::selection {
  background: var(--border);
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: var(--space-md) var(--space-sm);
  }
  .index-page {
    padding-top: 0;
  }
  .layout-with-sidebar {
    padding: var(--space-md) var(--space-sm);
  }
  .profile-image {
    margin-bottom: 0;
  }
  /* インデックス水平線 margin 1.5x */
  .recent-section {
    margin-top: calc(var(--space-sm) * 1.5);
    padding-top: calc(var(--space-sm) * 1.5);
  }
}

/* PC版マージン調整 */
@media (min-width: 768px) {
  .profile-image {
    margin-bottom: 0;
  }
  .contact-list {
    margin-top: var(--space-md);
  }
  .index-page {
    padding-top: 0;
  }
  .recent-section {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
  }
  .recent-section h2 {
    margin-bottom: 0.15rem;
  }
}

/* =====================================================
   Accordion sidebar (夢日記)
   ===================================================== */
.month-accordion {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.month-accordion details {
  border: none;
}
.month-accordion summary {
  cursor: pointer;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.15rem 0;
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.35em;
}
.month-accordion summary::-webkit-details-marker { display: none; }
.month-accordion summary::before {
  content: '▸';
  font-size: 0.6em;
  transition: transform 0.15s;
  display: inline-block;
}
.month-accordion details[open] > summary::before {
  transform: rotate(90deg);
}
.month-accordion .entry-links {
  list-style: none;
  padding-left: 0.8rem;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.month-accordion .entry-links a {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-decoration: none;
  display: grid;
  grid-template-columns: 4.2em 1fr;
  column-gap: 0.8em;
  padding: 0.1rem 0;
  transition: color var(--transition);
  letter-spacing: 0.02em;
}
.month-accordion .entry-links a:hover,
.month-accordion .entry-links a.active { color: var(--text); }

/* =====================================================
   Kosyoki flat sidebar list
   ===================================================== */
.kosyoki-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.kosyoki-nav-list a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  display: grid;
  grid-template-columns: 3em 1fr;
  column-gap: 0.8em;
  padding: 0.1rem 0;
  letter-spacing: 0.04em;
  transition: color var(--transition);
}
.kosyoki-nav-list a:hover,
.kosyoki-nav-list a.active { color: var(--text); }

/* =====================================================
   その他 font size increase
   ===================================================== */

/* page-subtitle */
.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
  margin-bottom: 0;
}

/* PC: site-title larger */
@media (min-width: 721px) {
  .site-title {
    font-size: 1.15rem;
    letter-spacing: 0;
  }

}

/* List marker styles for poetry/zyxt/other */
.poetry-list li::before,
.zyxt-list li::before,
.other-list li::before {
  content: '・';
  color: var(--text-muted);
  margin-right: 0.1em;
  font-size: 0.9em;
}
.poetry-list,
.zyxt-list,
.other-list {
  list-style: none;
}
.poetry-list li,
.other-list li {
  display: flex;
  align-items: baseline;
}
/* zyxt-item uses its own grid, handled in zyxt.html inline style */

/* Mobile archive button — hidden by default, shown by mobile media query */

/* =====================================================
   List item gaps for zyxt / other / poetry (narrow)
   ===================================================== */
/* PC: grid layout matching recent-list column-gap */
.zyxt-list {
  gap: 0.8rem;
  margin-top: var(--space-md);
}
.zyxt-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  column-gap: 0.8em;
  align-items: baseline;
  row-gap: 0;
  flex-wrap: unset;
}
.other-list {
  gap: 0.8rem;
  margin-top: var(--space-sm);
}

/* Mobile: stack annotation below */
@media (max-width: 640px) {
  .zyxt-item {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
  }
  .zyxt-guest {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .page-header .mobile-archive-btn {
    margin: var(--space-xs) 0;
  }
}

/* PC: sidebar archive button hidden */
@media (min-width: 721px) {
  .mobile-archive-btn {
    display: none;
  }
}

/* =====================================================
   Archive nav alignment (sidebar)
   ===================================================== */
/* archive alignment now handled per-selector above */

/* =====================================================
   Mobile OTHER font size
   ===================================================== */
@media (max-width: 640px) {
  .other-link {
    font-size: 0.9rem;
  }
}

/* III など連続ローマ字の字間を詰める */
.roman-iii { letter-spacing: 0; }

/* =====================================================
   全アーカイブページ
   ===================================================== */
.archive-list {
  list-style: none;
  display: grid;
  grid-template-columns: 6.2em 5.2em 1fr;
  column-gap: 1em;
  row-gap: 0.6rem;
  align-items: baseline;
  margin-top: var(--space-sm);
}
.archive-list li {
  display: contents;
}
.archive-list .item-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.archive-list .item-section {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0.7;
}
.archive-list a {
  font-size: 0.88rem;
  color: var(--link);
  text-decoration: none;
}
.archive-list a:hover { color: var(--link-hover); }

/* =====================================================
   ページネーションコントロール（インデックス）
   ===================================================== */
.recent-controls {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  flex-wrap: wrap;
}
.btn-more {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.2em 0.6em;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  font-family: var(--font-gothic);
}
.btn-more:hover { color: var(--text); border-color: var(--text-muted); }
.link-archive {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.8;
}
.link-archive:hover { color: var(--text); opacity: 1; }

/* =====================================================
   コンタクトリスト追加項目
   ===================================================== */
.contact-label {
  min-width: 4.5em;
  display: inline-block;
}

/* =====================================================
   ALL ARCHIVES — 年ごとグループ見出し
   ===================================================== */
.archive-year-heading {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: var(--space-md);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.archive-year-heading:first-child {
  margin-top: 0;
}
.archive-list {
  margin-bottom: var(--space-sm);
}

/* =====================================================
   日記 タグ表示
   ===================================================== */
.entry-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3em;
  margin-left: 0.6em;
  vertical-align: baseline;
}
.entry-tag {
  font-size: 0.65em;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.1em 0.45em;
  line-height: 1.4;
  opacity: 0.8;
}

/* =====================================================
   日記 サイドバー — 通常アーカイブ + タグ セクション
   ===================================================== */
.sidebar-section {
  margin-bottom: var(--space-md);
}
.sidebar-section:last-child {
  margin-bottom: 0;
}
.sidebar-section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-sm) 0;
}

/* tag accordion (details/summary) */
.tag-accordion {
  margin-bottom: 0.3rem;
}
.tag-accordion > summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.15rem 0;
  user-select: none;
}
.tag-accordion > summary::-webkit-details-marker { display: none; }
.tag-accordion > summary::before {
  content: "›";
  font-size: 0.85em;
  transition: transform 0.15s;
  display: inline-block;
  width: 0.8em;
}
.tag-accordion[open] > summary::before {
  transform: rotate(90deg);
}
.tag-count {
  font-size: 0.72em;
  opacity: 0.6;
}
.tag-entry-list {
  list-style: none;
  padding-left: 1.2em;
  margin-top: 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.tag-entry-list a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  display: grid;
  grid-template-columns: 3em 1fr;
  column-gap: 0.5em;
  padding: 0.05rem 0;
  transition: color var(--transition);
}
.tag-entry-list a:hover { color: var(--text); }

/* =====================================================
   モバイル: TAGS ボタン
   ===================================================== */
.mobile-tags-btn {
  display: none;
}
@media (max-width: 720px) {
  .mobile-tags-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.3em 0.8em;
    cursor: pointer;
    margin-bottom: var(--space-sm);
    margin-left: 0.5em;
    transition: color var(--transition), border-color var(--transition);
    font-family: var(--font-gothic);
  }
  .mobile-tags-btn:hover { color: var(--text); border-color: var(--text-muted); }

  /* sidebar sections: on mobile, show only the active one */
  .sidebar .sidebar-section { display: none; }
  .sidebar .sidebar-section.mobile-visible { display: block; }
  .sidebar-section-divider { display: none; }
}

/* =====================================================
   INDEX: 2カラム分割 (LATEST + 日記サイドバー)
   ===================================================== */
.index-split {
  margin-top: 0.15rem;
}
@media (min-width: 721px) {
  .index-split {
    display: grid;
    grid-template-columns: 1fr 11rem;
    column-gap: var(--space-md);
    align-items: start;
  }
}
.index-side-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.diary-index-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.diary-index-list li {
  display: flex;
  gap: 0.4em;
  align-items: baseline;
  min-width: 0;
}
.diary-index-list .di-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.diary-index-list a {
  font-size: 0.72rem;
  color: var(--link);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.diary-index-list a:hover { color: var(--link-hover); }
.btn-diary-more {
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 0.15em 0.5em;
  cursor: pointer;
  margin-top: 0.4rem;
  display: inline-block;
  font-family: var(--font-gothic);
  transition: color var(--transition), border-color var(--transition);
}
.btn-diary-more:hover { color: var(--text); border-color: var(--text-muted); }
.link-diary {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.4rem;
}
.link-diary:hover { color: var(--text); }

/* Mobile: index-split-side に margin-top */
@media (max-width: 720px) {
  .index-split-side {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border);
  }
}

/* =====================================================
   詩篇 / 書評 — 日付表示
   ===================================================== */
.poem-list-item {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
}
.poem-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* =====================================================
   書評ページ (poetry-list 共用)
   ===================================================== */
.review-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: var(--space-lg);
}
.review-list li::before {
  content: '・';
  color: var(--text-muted);
  margin-right: 0.1em;
  font-size: 0.9em;
}
.review-list li {
  display: flex;
  align-items: baseline;
}
.review-list a {
  font-family: var(--font-gothic);
  font-size: 1rem;
  color: var(--link);
  text-decoration: none;
  letter-spacing: 0.06em;
  transition: color var(--transition);
}
.review-list a:hover { color: var(--link-hover); }

/* =====================================================
   日記 検索 (sidebar + modal)
   ===================================================== */
.search-input-wrap {
  position: relative;
  margin-bottom: var(--space-sm);
}
.search-input-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  font-family: var(--font-gothic);
  padding: 0.35em 2em 0.35em 0.6em;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color var(--transition);
  box-sizing: border-box;
}
.search-input-wrap input:focus { border-color: var(--text-muted); }
.search-clear-btn {
  position: absolute;
  right: 0.4em;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85em;
  line-height: 1;
  padding: 0;
}
/* Search modal */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal-box {
  background: var(--bg);
  border: 1px solid var(--border);
  width: min(600px, calc(100vw - 2rem));
  max-height: 70vh;
  overflow-y: auto;
  padding: var(--space-md);
}
.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-bottom: var(--space-sm);
}
.search-modal-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font-gothic);
  padding: 0.4em 0.6em;
  outline: none;
}
.search-modal-input:focus { border-color: var(--text-muted); }
.search-modal-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.3em 0.6em;
  font-family: var(--font-gothic);
}
.search-result-item {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-title {
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.search-result-title a {
  color: var(--link);
  text-decoration: none;
}
.search-result-title a:hover { color: var(--link-hover); }
.search-result-context {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.search-result-context mark {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.search-no-results {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: var(--space-sm) 0;
}
/* Mobile search button */
.mobile-search-btn {
  display: none;
}
@media (max-width: 720px) {
  .mobile-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2em;
    height: 2em;
    color: var(--text-muted);
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-left: 0.4em;
    font-family: var(--font-gothic);
    transition: color var(--transition);
    position: relative;
  }
  .mobile-search-btn:hover { color: var(--text); }
  /* SVG 虫眼鏡アイコン via background (no image file needed) */
  .mobile-search-btn::before {
    content: '';
    display: block;
    width: 0.85em;
    height: 0.85em;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    position: relative;
    top: -0.05em;
  }
  .mobile-search-btn::after {
    content: '' !important;
    display: block;
    width: 1.5px;
    height: 0.45em;
    background: currentColor;
    transform: rotate(45deg);
    position: absolute;
    bottom: 0.25em;
    right: 0.35em;
  }
}

/* =====================================================
   OTHERS アノテーション
   ===================================================== */
.item-annotation {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-left: 0.6em;
}

/* =====================================================
   全リンク ↗ アイコン (本文・リスト系)
   ===================================================== */


/* recent-header LATEST + 日記ラベル横並び */
@media (min-width: 721px) {
  .recent-header .index-side-label-inline {
    display: inline-block;
  }
}
.index-side-label-inline {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

/* =====================================================
   外部リンクのみ ↗ アイコン
   ===================================================== */
a[href^="http"]::after,
a[href^="https"]::after {
  content: '\00a0↗';
  font-size: 0.7em;
  opacity: 0.6;
  vertical-align: super;
  font-style: normal;
}
/* nav・ボタン系には適用しない */
.site-title::after,
.nav-links a::after,
.poem-back::after,
.btn::after,
.btn-more::after,
.btn-diary-more::after,
.link-archive::after,
.link-diary::after,
.mobile-archive-btn::after,
.mobile-tags-btn::after,
.mobile-search-btn::after,
.search-modal-close::after,
.search-clear-btn::after {
  content: none !important;
}

/* =====================================================
   recent-header — LATEST見出し行
   ===================================================== */
.recent-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: var(--space-md);
  margin-bottom: 0.15rem;
}
.recent-header h2 {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* =====================================================
   引用 blockquote
   ===================================================== */
/* 引用ブロック前は段落マージン（margin-bottom）が自然な空きとして機能する */
.prose blockquote {
  background: none;
  border-left: 3px solid var(--border);
  margin: 0.4em 0;
  padding: 0.5em 0 0.5em 1.1em;
  color: var(--text);
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.9;
  font-family: var(--font-mincho);
}
.prose blockquote p {
  margin-bottom: 0.6em;
  white-space: pre-wrap;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
/* citation line (e.g. ／著者名) */
.prose blockquote cite,
.prose blockquote p:last-child:not(:first-child) {
  display: block;
  font-style: normal;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 0.6em;
  font-family: var(--font-gothic);
}
@media (max-width: 720px) {
  .prose blockquote {
    margin-left: 0.5em;
    margin-right: 0;
  }
}
.prose blockquote + p {
  margin-top: 0;
}

/* =====================================================
   Markdowner 修飾カラー（ライト／ダーク CSS変数対応）
   ===================================================== */
.prose h1, .diary-entry-body h1 { color: var(--md-h1); }
.prose h2, .diary-entry-body h2 { color: var(--md-h2); }
.prose h3, .diary-entry-body h3 { color: var(--md-h3); }
.prose h4, .diary-entry-body h4 { color: var(--md-h4); }
.prose h5, .diary-entry-body h5 { color: var(--md-h5); }
.prose h6, .diary-entry-body h6 { color: var(--md-h6); }

/* 見出し共通: 読みやすいマージン */
.prose h3, .prose h4, .prose h5, .prose h6,
.diary-entry-body h3, .diary-entry-body h4,
.diary-entry-body h5, .diary-entry-body h6 {
  font-weight: 500;
  letter-spacing: 0.06em;
  margin: 1.4em 0 0.5em;
  line-height: 1.4;
}

.prose strong, .diary-entry-body strong,
.prose b,      .diary-entry-body b      { color: var(--md-strong); }
.prose em,     .diary-entry-body em,
.prose i,      .diary-entry-body i      { color: var(--md-em); }

.prose blockquote,
.diary-entry-body blockquote { border-left-color: var(--md-bq-border); }

.prose mark, .diary-entry-body mark {
  background: var(--md-mark-bg);
  color: var(--md-mark-fg);
  padding: 0.05em 0.15em;
  border-radius: 2px;
}

.prose del, .diary-entry-body del,
.prose s,   .diary-entry-body s   { color: var(--md-del); }

.prose code, .diary-entry-body code {
  background: var(--md-code-bg);
  color: var(--md-code-fg);
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.prose pre, .diary-entry-body pre {
  background: var(--md-code-bg);
  color: var(--md-code-fg);
  padding: 1em 1.2em;
  overflow-x: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875em;
  border-radius: 3px;
  margin: 1em 0;
  line-height: 1.6;
}
.prose pre code, .diary-entry-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 1em;
  border-radius: 0;
}

.prose blockquote cite {
  display: block;
  font-size: 0.85em;
  font-style: normal;
  margin-top: 0.5em;
  opacity: 0.7;
}

/* =====================================================
   書評 書誌メタデータ
   ===================================================== */
.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  margin: 0.6rem 0 var(--space-md);
  padding: 0.7em 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.review-meta-item {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.review-meta-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-right: 0.3em;
}
.review-list-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: block;
  margin-top: 0.1em;
  padding-left: 1em;
}

/* =====================================================
   お知らせ (notice) LATEST表示
   ===================================================== */
.notice-body {
  font-size: 0.82rem;
  color: var(--text);
  letter-spacing: 0.04em;
  line-height: 1.6;
}
.notice-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* =====================================================
   tool.html — review meta fields + preview pane
   ===================================================== */
.tool-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
@media (max-width: 640px) {
  .tool-meta-grid { grid-template-columns: 1fr; }
}
.tool-preview-pane {
  border: 1px solid var(--border);
  padding: var(--space-md);
  margin-top: var(--space-sm);
  background: var(--surface);
  min-height: 160px;
  font-family: var(--font-mincho);
  font-size: 0.92rem;
  line-height: 1.75;
}
.tool-preview-pane .entry-heading {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-md);
  color: var(--text);
}
.tool-preview-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 720px) {
  .recent-list {
    row-gap: 0.55rem;
    grid-template-columns: 6em 4.5em 1fr;
    column-gap: 0.3em;
  }
  .recent-list .item-date {
    font-size: 0.72rem;
  }
  .recent-list .item-section {
    font-size: 0.72rem;
  }
}

/* =====================================================
   PC フォントサイズ調整 (≥721px) — スクリーンショット準拠
   ===================================================== */
@media (min-width: 721px) {
  .site-title {
    font-size: 1rem;
    letter-spacing: 0.16em;
  }
  .nav-links a {
    font-size: 16px;
    letter-spacing: 0.08em;
  }
  .nav-small {
    font-size: 0.68em;
  }
  .contact-label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }
  .contact-list li,
  .contact-list a {
    font-size: 0.78rem;
  }
  .recent-section h2,
  .recent-header h2 {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }
  .recent-list .item-date {
    font-size: 0.72rem;
  }
  .recent-list .item-section {
    font-size: 0.65rem;
  }
  .recent-list a {
    font-size: 0.82rem;
  }
  .diary-index-list .di-date {
    font-size: 0.62rem;
  }
  .diary-index-list a {
    font-size: 0.78rem;
  }
  .index-side-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }
  .page-header h1 {
    font-size: 1.3rem;
  }
  .page-header p {
    font-size: 0.8rem;
  }
  .poem-list-item a {
    font-size: 20px;
  }
  .poem-date {
    font-size: 0.7rem;
  }
  .review-list-meta {
    font-size: 0.68rem;
  }
  .archive-list a {
    font-size: 0.82rem;
  }
  .sidebar-title {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }
  .month-accordion summary {
    font-size: 0.75rem;
  }
  .month-accordion .entry-links a {
    font-size: 0.72rem;
  }
}

@media (min-width: 721px) {
  .prose p,
  .prose li {
    font-size: 1rem;
    line-height: 1.9;
  }
  .poem-body,
  .poem-body p,
  .poem-body center,
  .poem-body div {
    font-size: 1rem;
    line-height: 2.0;
  }
  .prose blockquote,
  .prose blockquote p {
    font-size: 1rem;
    line-height: 1.85;
  }
  .entry-heading {
    font-size: 1.1rem;
  }
  .entry-date {
    font-size: 0.85rem;
  }
}

/* =====================================================
   日記フィード (index.html)
   ===================================================== */
.latest-section {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.latest-heading,
.diary-feed-heading {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}

.diary-feed-section {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

.diary-entry {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  column-gap: 1.6rem;
  align-items: start;
}
.diary-entry:first-child {
  padding-top: 0;
}
.diary-entry:last-child {
  border-bottom: none;
}

/* ── 日付カラム ── */
.diary-entry-header {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
  padding-top: 0.15em;
}

.diary-entry-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}
.diary-entry-time .date-month {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.diary-entry-time .date-day {
  font-size: 2rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.diary-entry-time .date-year {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  line-height: 1.6;
}

.diary-entry-title {
  grid-column: 2;
  grid-row: 1;
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin: 0 0 0.8rem;
  color: var(--text);
  padding-top: 0.1em;
}

.diary-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  width: 100%;
  margin-top: 0.25em;
  margin-bottom: 0;
  order: 3;
}
.diary-tag {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* 本文: noteライク — カレンダー真下から全幅 */
.diary-entry-body {
  grid-column: 1 / -1;
  grid-row: 2;
  font-family: var(--font-gothic);
  font-size: 1rem;
  line-height: 2;
  color: var(--text);
  max-width: 35em;
  margin-top: 0.2rem;
  font-weight: 350;
}
.diary-entry-body p {
  margin-bottom: 1.6em;
  white-space: normal;
  word-break: break-word;
  line-height: 2;
  font-size: 1rem;
  max-width: 35em;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-ideograph;
  hanging-punctuation: last;
}
/* <b>/<strong> の約物行末半角（hanging-punctuationはinheritだが明示） */
.diary-entry-body p b,
.diary-entry-body p strong,
.prose p b,
.prose p strong {
  hanging-punctuation: last;
}
.diary-entry-body p:last-child { margin-bottom: 0; }
.diary-entry-body blockquote {
  background: none;
  border-left: 3px solid var(--border);
  margin: 0.4em 0;
  padding: 0.5em 0 0.5em 1.1em;
  color: var(--text);
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.9;
  font-family: var(--font-mincho);
}

.diary-entry-tags {
  grid-column: 1 / -1;
  grid-row: 3;
}
.entry-actions {
  grid-column: 1 / -1;
  grid-row: 4;
}

.diary-feed-ctrl {
  padding: var(--space-md) 0 var(--space-sm);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

@media (max-width: 720px) {
  .diary-entry {
    padding: 2.25rem 0;
    scroll-margin-top: 60px;
  }
  .diary-entry-title {
    font-size: 1.1rem;
  }
  .diary-entry-body,
  .diary-entry-body p {
    font-size: 1rem;
    line-height: 2;
  }
}








.diary-tag-details .diary-entry-tags {
  margin-top: 0.3em;
  padding-left: 0;
  order: unset;
  width: auto;
}

/* ── スマホ: 日記見出しバー ── */
.mobile-diary-header {
  display: none;
}
@media (max-width: 720px) {
  .mobile-diary-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem var(--space-sm) 0.6rem;
    background: var(--bg);
    transition: background var(--transition);
  }
  .mobile-diary-btns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }
  .mobile-profile-trigger,
  .mobile-archive-trigger,
  .mobile-search-trigger {
    font-size: 0.9rem;
    letter-spacing: 0;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    padding: 0.4em 1em;
    height: 2.2em;
    line-height: 1;
    cursor: pointer;
    font-family: var(--font-gothic);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
  }
  .mobile-profile-trigger:hover,
  .mobile-archive-trigger:hover,
  .mobile-search-trigger:hover { color: var(--text); border-color: var(--text-muted); }
}


@media (max-width: 720px) {
  html { font-size: 14px; }
  /* ナビ・ロゴはそのまま（overrideしない） */
  .nav-links a { font-size: 1rem; }
  .poetry-list a { font-size: 1rem; }
}

/* ── mobile-profile-drawer: 上からスライド ── */
.mobile-profile-drawer {
  display: none;
}
.mobile-profile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.mobile-profile-overlay.active { display: block; }

@media (max-width: 720px) {
  .mobile-profile-drawer {
    display: block;
    position: fixed;
    top: -100%;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md);
    overflow-y: auto;
    z-index: 200;
    transition: top 0.28s ease;
  }
  .mobile-profile-drawer.open {
    top: 0;
  }
  /* ドロワー内の index-profile はフルwidth縦並び */
  .mobile-profile-drawer .index-profile {
    display: flex;
    position: static;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .mobile-profile-drawer .profile-img-wrap {
    width: 120px;
    flex-shrink: 0;
  }
  .mobile-profile-drawer .contact-list {
    flex: unset;
    width: 100%;
  }
  /* アーカイブはドロワー内では非表示 */
  .mobile-profile-drawer .index-archive-wrap {
    display: none;
  }
}

/* ── モバイルでテーマ切替ボタンは右端（デフォルト） ── */

/* ── mobile-archive-drawer: PCでは非表示、スマホでは左スライドドロワー ── */
.mobile-archive-drawer {
  display: none; /* PCでは常に非表示 */
}
.index-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}
.index-drawer-overlay.active { display: block; }

@media (max-width: 720px) {
  .mobile-archive-drawer {
    display: block;
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: var(--space-lg) var(--space-md);
    overflow-y: auto;
    z-index: 200;
    transition: left 0.25s ease;
  }
  .mobile-archive-drawer.open {
    left: 0;
  }
}


.contact-icon {
  display: inline-block;
  vertical-align: middle;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── contact favicon icons ── */
.contact-favicon {
  display: inline-block;
  vertical-align: middle;
  color: var(--text-muted);
  flex-shrink: 0;
  position: relative;
  top: -0.05em;
}

/* ── 書評リスト スマホ改善 ── */
@media (max-width: 720px) {
  /* 書評リスト: grid で点・タイトル・メタを整列 */
  .review-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.2em;
    row-gap: 0.15em;
    align-items: start;
    padding: 0.6em 0;
    border-bottom: 1px solid var(--border);
  }
  .review-list li:last-child { border-bottom: none; }
  /* 点: col1/row1 */
  .review-list li::before {
    grid-column: 1;
    grid-row: 1;
    line-height: 1.6;
    align-self: start;
  }
  /* タイトル: col2/row1 */
  .review-list .poem-list-item {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }
  .review-list .poem-list-item a {
    white-space: normal;
    word-break: break-word;
    display: block;
  }
  /* メタ情報: col2/row2（タイトルの下に） */
  .review-list-meta {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.78rem;
    margin-top: 0;
    display: block;
  }
}

/* ── contact-sub: サービス名括弧 ── */
.contact-sub {
  font-size: 0.75em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ── review-list: スマホ版 点の位置修正 ── */



/* ── diary entry category line ── */



/* ── diary entry category ── */
.diary-entry-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── 記事アクションバー（いいね・シェア） ── */
.entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

/* いいねボタン */

.entry-like-btn:hover { color: #e05a6a; }
.entry-like-btn 

.entry-like-btn.liked 


/* シェアボタン */
.entry-share-wrap {
  position: relative;
}
.entry-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.3em 0.5em;
  border-radius: 4px;
  transition: color var(--transition);
}
.entry-share-btn:hover { color: var(--text); }

/* シェアポップアップ */
.entry-share-popup {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  background: var(--surface, var(--bg));
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 160px;
  z-index: 50;
  overflow: hidden;
}

.entry-share-popup.open { display: block; }
.share-popup-item {
  display: flex;
  align-items: center;
  gap: 0.55em;
  width: 100%;
  padding: 0.6em 1em;
  font-size: 0.82rem;
  font-family: var(--font-gothic);
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.share-popup-item svg { flex-shrink: 0; }
.share-popup-item:hover { background: var(--bg-alt, var(--border)); color: var(--text); }

/* ── OGP 埋め込みカード ── */
.ogp-card {
  margin: 1em 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  max-width: 35em;
  transition: border-color var(--transition);
}
.ogp-card:hover { border-color: var(--text-muted); }
.ogp-loading {
  padding: 0.8em 1em;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.ogp-inner {
  display: flex;
  align-items: stretch;
  text-decoration: none !important;
  border-bottom: none !important;
  color: inherit;
}
.ogp-inner::after { content: none !important; }
.ogp-inner:hover { border-bottom: none !important; text-decoration: none !important; }
.ogp-inner.ogp-fallback { padding: 0.8em 1em; }
/* prose a の下線を OGP カード内で打ち消す */
.prose .ogp-inner,
.diary-entry-body .ogp-inner {
  text-decoration: none !important;
}
.ogp-image {
  flex-shrink: 0;
  width: 110px;
  min-height: 90px;
  overflow: hidden;
  background: var(--bg-alt, var(--border));
}
.ogp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 90px;
}
.ogp-body {
  padding: 0.7em 0.9em;
  display: flex;
  flex-direction: column;
  gap: 0.25em;
  min-width: 0;
  flex: 1;
}
.ogp-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ogp-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ogp-host {
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 丸括弧: 87.5%縮小 + 和文仮想ボディ中央揃え */
.paren-sm {
  font-size: 0.875em;
  display: inline;
  vertical-align: baseline;
  position: relative;
  top: -0.08em;
  line-height: normal;
}

/* OGPカード スマホ対応：横並び強制維持 */
@media (max-width: 720px) {
  .ogp-card { max-width: 100%; }
  .ogp-inner {
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .ogp-image {
    width: 90px;
    min-width: 90px;
    flex-shrink: 0;
    min-height: unset;
  }
  .ogp-image img {
    width: 90px;
    height: 100%;
    min-height: unset;
    object-fit: cover;
  }
}

/* ── category sidebar pulldown ── */
.tags-section-details { margin-top: 0; }
.tags-section-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.3em;
  user-select: none;
}
.tags-section-summary::-webkit-details-marker { display: none; }
.tags-section-summary::after {
  content: '\25be';
  font-size: 0.8em;
  color: var(--text-muted);
  transition: transform 0.15s;
}
.tags-section-details[open] .tags-section-summary::after {
  transform: rotate(-180deg);
}

/* blockquote 前後 br の行間を吸収 */
.prose p:has(+ blockquote),
.diary-entry-body p:has(+ blockquote) {
  margin-bottom: 0;
}
.prose blockquote + p,
.diary-entry-body blockquote + p {
  margin-top: 0;
}
