/* ============================================================
 * skin-yomu — tegalog.css
 * 2026 シンプルモダン / ブルーグレー / 文字主体
 * ============================================================ */

/* ============================================================
 * 01. Root — CSS カスタムプロパティ
 * ============================================================ */
:root {
  /* Color: Light */
  --color-bg: #FAFBFC;
  --color-bg-subtle: #F0F2F4;
  --color-bg-muted: #E8EBEE;
  --color-text: #2C3338;
  --color-text-muted: #6B7680;
  --color-text-faint: #9AA3AD;
  --color-accent: #5B7080;
  --color-accent-hover: #4A6274;
  --color-accent-subtle: #8DA4B4;
  --color-border: #DDE1E6;
  --color-border-subtle: #ECEEF0;
  --color-link: var(--color-accent);
  --color-link-visited: #6B7B8A;
  --color-focus: var(--color-accent);

  /* Font */
  --font-sans: "Noto Sans JP", sans-serif;
  --font-serif: "Noto Serif JP", serif;
  --font-mono: "Noto Sans Mono", ui-monospace, monospace;
  --font-body: var(--font-sans);

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-reading: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.625rem;
  --text-3xl: 1.875rem;

  /* Line Height / Letter Spacing */
  --line-height-body: 2;
  --line-height-reading: 2.05;
  --line-height-heading: 1.45;
  --line-height-tight: 1.35;
  --letter-spacing-body: 0.04em;
  --letter-spacing-reading: 0.05em;
  --letter-spacing-heading: 0.02em;
  --letter-spacing-wide: 0.06em;

  /* Space */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --layout-left-width: 240px;
  --layout-right-width: 240px;
  --layout-main-max: 680px;
  --layout-gap: var(--space-xl);
  --toolbar-height: 48px;
  --mobile-nav-height: 48px;
  --right-col-display: none;
  --heatmap-display: none;

  /* Radius / Shadow / Border */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --border-width: 1px;
  --focus-ring: 2px solid var(--color-focus);
  --focus-offset: 2px;

  /* Motion */
  --transition-speed: 200ms;
  --transition-ease: ease;
}

/* ============================================================
 * 02. Reset — 最小限
 * ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* ============================================================
 * 03. Base — 本文基礎
 * ============================================================ */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  letter-spacing: var(--letter-spacing-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-feature-settings: "palt" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
 * 04. Dark Theme — ダーク / システム準拠
 * ============================================================ */
[data-theme="dark"] {
  --color-bg: #1A1D21;
  --color-bg-subtle: #242830;
  --color-bg-muted: #2E333B;
  --color-text: #E8EAED;
  --color-text-muted: #9AA3AD;
  --color-text-faint: #6B7680;
  --color-accent: #8DA4B4;
  --color-accent-hover: #A3B8C6;
  --color-accent-subtle: #5B7080;
  --color-border: #3A4048;
  --color-border-subtle: #2E333B;
  --color-link-visited: #7A8E9C;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #1A1D21;
    --color-bg-subtle: #242830;
    --color-bg-muted: #2E333B;
    --color-text: #E8EAED;
    --color-text-muted: #9AA3AD;
    --color-text-faint: #6B7680;
    --color-accent: #8DA4B4;
    --color-accent-hover: #A3B8C6;
    --color-accent-subtle: #5B7080;
    --color-border: #3A4048;
    --color-border-subtle: #2E333B;
    --color-link-visited: #7A8E9C;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  }
}

/* ============================================================
 * 05. Font Theme — セリフ切替
 * ============================================================ */
[data-font="serif"] {
  --font-body: var(--font-serif);
}

/* ============================================================
 * 06. Layout — グリッド
 * ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--layout-left-width) 1fr;
  gap: var(--layout-gap);
  max-width: calc(var(--layout-left-width) + var(--layout-main-max) + var(--layout-gap) * 2);
  margin-inline: auto;
  padding: var(--space-xl);
}

.content-area {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--layout-gap);
  min-width: 0;
}

@media (min-width: 1200px) {
  .layout:has(.sidebar-right) {
    max-width: calc(
      var(--layout-left-width) +
      var(--layout-main-max) +
      var(--layout-right-width) +
      var(--layout-gap) * 3
    );
  }

  .content-area {
    grid-template-columns: 1fr var(--layout-right-width);
  }
}

#main-content {
  max-width: var(--layout-main-max);
  min-width: 0;
}

/* ============================================================
 * 07. Skip Link
 * ============================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 9999;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-md);
}

/* ============================================================
 * 08. Header / Site Title
 * ============================================================ */
.site-header {
  margin-bottom: var(--space-lg);
}

.site-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-wide);
  line-height: var(--line-height-tight);
  margin: 0;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--color-accent);
}

.site-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 0;
}

.onelog .site-title {
  font-size: var(--text-sm);
  font-weight: 400;
}

.onelog .site-title a {
  color: var(--color-text-muted);
}

/* ============================================================
 * 09. Sidebar / Navigation
 * ============================================================ */
.sidebar {
  position: sticky;
  top: var(--space-xl);
  align-self: start;
}

.nav-top {
  display: none;
}

.nav-top__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-top__row::-webkit-scrollbar {
  display: none;
}

.nav-top__list,
.nav-side__list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.nav-top__list {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-md);
}

.nav-side__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.nav-top a,
.nav-side a,
.nav-top__categories .catlink,
.nav-side__categories .catlink {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.nav-top a:hover,
.nav-side a:hover,
.nav-top__categories .catlink:hover,
.nav-side__categories .catlink:hover {
  color: var(--color-accent);
}

/* カテゴリ — About 等と同じナビスタイル */
.nav-top__categories,
.nav-side__categories {
  min-width: 0;
}

.nav-top__categories .cattree,
.nav-side__categories .cattree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-top__categories .cattree {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--space-md);
  white-space: nowrap;
}

.nav-side__categories .cattree {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: var(--space-sm) 0;
}

.nav-top__categories .depth2,
.nav-side__categories .depth2,
.nav-top__categories .num,
.nav-side__categories .num {
  display: none;
}

/* ============================================================
 * 11. Sidebar Controls
 * ============================================================ */
.sidebar-controls {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.sidebar-controls button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  transition: color var(--transition-speed) var(--transition-ease),
              border-color var(--transition-speed) var(--transition-ease);
}

.sidebar-controls button:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ============================================================
 * 12. Situation — 状況見出し
 * ============================================================ */
.situationhead,
.situationtitle,
.situation {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}

/* ============================================================
 * 13. About
 * ============================================================ */
.about-page {
  font-size: var(--text-reading);
  line-height: var(--line-height-reading);
  letter-spacing: var(--letter-spacing-reading);
  max-width: 42em;
  margin-bottom: var(--space-xl);
}

.mode-about #entries,
.mode-about .pagination {
  display: none;
}

.mode-about .quickpost-area {
  display: none;
}

/* ============================================================
 * 13b. Quickpost — クイック投稿
 * ============================================================ */
.quickpost-area {
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  border: var(--border-width) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}

.quickpost-area textarea {
  width: 100%;
  min-height: 6em;
  padding: var(--space-sm);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  resize: vertical;
}

.quickpost-area input[type="submit"],
.quickpost-area button[type="submit"] {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

/* ============================================================
 * 14. Bookmarks Page
 * ============================================================ */
.bookmarks-page__title {
  font-size: var(--text-2xl);
  margin: 0 0 var(--space-lg);
}

.bookmarks-page__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bookmarks-page__list li {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.bookmarks-page__link {
  flex: 1;
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
}

.bookmarks-page__link:hover {
  color: var(--color-accent);
}

.bookmarks-page__date {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.bookmarks-page__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  font-size: 1rem;
}

.bookmarks-page__remove:hover {
  color: var(--color-accent);
}

.bookmarks-page__empty {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

body.is-bookmarks #entries,
body.is-bookmarks .pagination,
body.is-bookmarks .about-page,
body.is-bookmarks .quickpost-area {
  display: none !important;
}

body.is-bookmarks .bookmarks-page[hidden] {
  display: block !important;
}

/* ============================================================
 * 15. Entry — 投稿カード（通常一覧）
 * ============================================================ */
.entry {
  position: relative;
}

.entry--list {
  padding-bottom: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.entry__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.entry__header-inner {
  flex: 1;
  min-width: 0;
}

.entry__header .entry__title {
  margin-bottom: var(--space-sm);
}

.entry__header .entry__meta {
  margin-bottom: 0;
}

.entry--single .entry__body--full {
  display: none;
}

.entry--body-first .entry__date-link--dot,
.entry--single:not(.entry--body-first) .entry__date-link--slash {
  display: none;
}

.entry--body-first .entry__title--split,
.entry--body-first .entry__body--split,
.entry--body-first .entry__meta-extra {
  display: none !important;
}

.entry--body-first .entry__body--full {
  display: block;
}

/* 単独ページでは日付リンク不要（すでにその投稿を表示中） */
.entry--single.entry--body-first .entry__date-link {
  pointer-events: none;
  color: var(--color-text-muted);
  cursor: default;
  text-decoration: none;
}

.entry__meta--single .entry__date-link {
  color: var(--color-accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.entry__meta--single .entry__date-link:hover {
  text-decoration: underline;
}

.entry--body-first {
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-lg);
  border-bottom: var(--border-width) solid var(--color-border-subtle);
}

.entry--body-first .entry__header {
  margin-bottom: var(--space-sm);
}

.entry__meta--body-first {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.entry__meta--body-first a {
  color: var(--color-accent);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.entry__meta--body-first a:hover {
  text-decoration: underline;
}

body.selected-cat.cat-index .dateseparator {
  display: none;
}

.entry__gallery-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.entry__gallery-head .entry__title {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.entry__title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-sm);
  color: var(--color-text);
}

.entry--list .entry__title a,
.entry--gallery .entry__title a {
  color: inherit;
  text-decoration: none;
}

.entry--list .entry__title a:hover,
.entry--gallery .entry__title a:hover {
  color: var(--color-accent);
}

.entry--single .entry__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-md);
}

.entry__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.entry__meta a {
  color: var(--color-accent);
  text-decoration: none;
}

.entry__meta a:hover {
  text-decoration: underline;
}

.entry__id {
  color: var(--color-text-faint);
}

.entry__admin {
  display: inline-flex;
  gap: var(--space-sm);
}

.entry__admin a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
}

.entry__admin a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.entry__meta--gallery {
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
}

/* 非ログイン時は管理系 UI を非表示 */
body.nologin .Login-Required,
body.nologin .quickpost-area {
  display: none !important;
}

.entry__body {
  font-size: var(--text-reading);
  line-height: var(--line-height-reading);
  letter-spacing: var(--letter-spacing-reading);
  max-width: 42em;
}

.entry--list .entry__body img,
.entry--list .entry__body .embeddedpictbox {
  max-width: min(100%, 480px);
  width: auto;
  height: auto;
}

.entry--list .entry__body .embeddedpictbox img {
  max-width: 100%;
}

.entry--single .entry__body {
  margin-top: var(--space-sm);
}

/* ============================================================
 * 16. Entry Gallery — ギャラリーグリッド
 * ============================================================ */
.mode-gallery #entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.entry--gallery {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.entry--gallery .entry__image-link {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 1;
}

.entry--gallery .entry__image-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed) var(--transition-ease);
}

.entry--gallery .entry__image-link:hover img {
  transform: scale(1.03);
}

.entry--gallery .entry__title {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: var(--space-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry--gallery .entry__title a {
  color: inherit;
  text-decoration: none;
}

.entry--gallery .entry__title a:hover {
  color: var(--color-accent);
}

/* ============================================================
 * 17. Bookmark Button
 * ============================================================ */
.bookmark-btn {
  position: static;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  cursor: pointer;
  font-size: 1.125rem;
  transition: color var(--transition-speed) var(--transition-ease);
}

.entry__gallery-head .bookmark-btn {
  margin-top: 0;
}

.bookmark-btn:hover,
.bookmark-btn[aria-pressed="true"] {
  color: var(--color-accent);
}

.bookmark-btn__icon--active {
  font-weight: bold;
}

/* ============================================================
 * 18. Date Bar — 日付境界バー
 * ============================================================ */
.dateseparator {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-2xl) 0;
  padding: 0;
  border: none;
  background: none;
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.dateseparator::before {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border-subtle);
}

.datetitle {
  white-space: nowrap;
}

.datefunclinks {
  display: none;
}

.fixedseparator .datefunclinks {
  display: none;
}

/* ============================================================
 * 19. Pagination
 * ============================================================ */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-2xl);
  font-size: var(--text-sm);
}

.pagination a {
  color: var(--color-accent);
  text-decoration: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.pagination a:hover {
  background: var(--color-bg-muted);
}

.pagination .current,
.pagination .nowpage {
  color: var(--color-text);
  font-weight: 500;
  background: var(--color-bg-muted);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

/* ============================================================
 * 20. Footer
 * ============================================================ */
.site-footer {
  padding: var(--space-xl) var(--space-md);
  border-top: var(--border-width) solid var(--color-border-subtle);
  text-align: center;
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.site-footer a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-accent);
}

.site-footer__version {
  margin: var(--space-md) 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  letter-spacing: var(--letter-spacing-body);
}

.site-footer__version a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer__version a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* ============================================================
 * 21. Mobile Toolbar
 * ============================================================ */
.mobile-toolbar {
  display: none;
}

/* ============================================================
 * 22. Scroll Top FAB
 * ============================================================ */
.scroll-top {
  position: fixed;
  right: var(--space-md);
  bottom: calc(var(--toolbar-height) + var(--space-md));
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed) var(--transition-ease),
              visibility var(--transition-speed) var(--transition-ease);
}

.scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
 * 23. Right Column — オプションウィジェット
 * ============================================================ */
.sidebar-right {
  display: var(--right-col-display);
  font-size: var(--text-sm);
}

.sidebar-right > * + * {
  margin-top: var(--space-xl);
}

.heatmap-area {
  display: var(--heatmap-display);
  max-width: var(--layout-main-max);
  margin: var(--space-xl) auto;
  padding: 0 var(--space-xl);
}

.sidebar-right form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.sidebar-right input[type="text"],
.sidebar-right input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: var(--space-sm);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.sidebar-right input[type="submit"] {
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-size: var(--text-sm);
}

.sidebar-right ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-right li {
  margin-bottom: var(--space-xs);
}

.sidebar-right a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.sidebar-right a:hover {
  color: var(--color-accent);
}

/* ハンバーガーボタン（PC では非表示） */
.sidebar-toggle {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

.sidebar-drawer-backdrop {
  display: none;
}

body.is-sidebar-open {
  overflow: hidden;
}

/* ============================================================
 * 24. Typography — 本文装飾（てがろぐ記法）
 * ============================================================ */
.entry__body h2 {
  font-size: var(--text-xl);
  line-height: var(--line-height-heading);
  margin: var(--space-xl) 0 var(--space-sm);
}

.entry__body h3 {
  font-size: var(--text-lg);
  line-height: var(--line-height-heading);
  margin: var(--space-lg) 0 var(--space-sm);
}

.entry__body h4 {
  font-size: var(--text-base);
  line-height: var(--line-height-heading);
  margin: var(--space-md) 0 var(--space-xs);
}

.entry__body p {
  margin: 0 0 var(--space-md);
}

.entry__body ul,
.entry__body ol {
  margin: 0 0 var(--space-md);
  padding-left: var(--space-lg);
}

.entry__body li {
  margin-bottom: var(--space-xs);
}

.entry__body b,
.entry__body strong {
  font-weight: 700;
}

.entry__body em {
  font-style: normal;
  font-weight: 500;
  color: var(--color-accent);
}

.entry__body q {
  display: block;
  margin: var(--space-md) 0;
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--color-accent-subtle);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  quotes: none;
}

.entry__body code,
.deco-code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-bg-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.entry__body pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-bg-subtle);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.entry__body pre code {
  background: none;
  padding: 0;
}

.deco-note {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--color-bg-subtle);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.deco-separator {
  display: block;
  border: none;
  border-top: var(--border-width) solid var(--color-border-subtle);
  margin: var(--space-lg) 0;
}

.entry__body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--text-sm);
}

.entry__body th,
.entry__body td {
  padding: var(--space-sm);
  border: var(--border-width) solid var(--color-border);
  text-align: left;
}

.entry__body th {
  background: var(--color-bg-subtle);
  font-weight: 500;
}

.entry__body a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-subtle);
  text-underline-offset: 2px;
}

.entry__body a:visited {
  color: var(--color-link-visited);
}

.entry__body a:hover {
  color: var(--color-accent-hover);
}

.readmorebutton {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--text-sm);
}

.readmorebutton:hover {
  text-decoration: underline;
}

.readmorearea {
  display: block;
  margin: var(--space-sm) 0;
}

.entry__body del,
.entry__body s {
  color: var(--color-text-muted);
}

.entry__body u {
  text-decoration-color: var(--color-accent-subtle);
}

/* ============================================================
 * 25b. Card Link — カード型リンク
 * ============================================================ */
.entry__body a.url.cardlink {
  display: inline-block;
  width: 100%;
  max-width: 520px;
  margin: var(--space-md) 0;
  padding: 0;
  font-size: var(--text-sm);
  text-decoration: none;
  vertical-align: middle;
}

.entry__body a.url.cardlink:hover {
  text-decoration: none;
}

.cardlinkbox {
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: var(--color-bg-subtle);
  display: flex;
  overflow: hidden;
  transition: border-color var(--transition-speed) var(--transition-ease),
              background-color var(--transition-speed) var(--transition-ease);
}

.cardlinkbox:hover {
  background-color: var(--color-bg-muted);
  border-color: var(--color-accent-subtle);
}

.cardlinkimage {
  background-image: linear-gradient(135deg, var(--color-bg-muted), var(--color-border-subtle));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.cardlinktextbox {
  display: flex;
  flex-direction: column;
  padding: var(--space-sm) var(--space-md);
  min-width: 0;
}

.cardlinktitle,
.cardlinkdescription,
.cardlinkurl {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  text-overflow: ellipsis;
}

.cardlinktitle {
  padding-bottom: var(--space-xs);
  color: var(--color-text);
  font-weight: 500;
}

.cardlinkdescription {
  line-height: 1.45;
  color: var(--color-text-muted);
  line-clamp: 2;
  -webkit-line-clamp: 2;
}

.cardlinkurl {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
}

.cardsize-S {
  flex-direction: row;
}

.cardsize-S .cardlinkimage {
  min-width: 100px;
  min-height: 100px;
  flex-shrink: 0;
}

.cardsize-S .cardlinktextbox {
  border-left: var(--border-width) solid var(--color-border);
  justify-content: center;
}

.cardsize-S .cardlinktitle { order: 2; }
.cardsize-S .cardlinkdescription { order: 3; }
.cardsize-S .cardlinkurl { order: 1; }

.cardsize-L {
  flex-direction: column;
}

.cardsize-L .cardlinkimage {
  aspect-ratio: 1.91 / 1;
  width: 100%;
  height: auto;
}

.cardsize-L .cardlinktextbox {
  border-top: var(--border-width) solid var(--color-border);
}

.cardsize-L .cardlinktitle {
  font-weight: 700;
}

.cardsize-L .cardlinkdescription {
  min-height: 2.5em;
}

.cardsize-L .cardlinkurl {
  border-top: var(--border-width) solid var(--color-border-subtle);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
}

/* ============================================================
 * 25c. Datebox — 月別一覧（非表示）
 * ============================================================ */
.datelimitlist,
.dateboxdetails,
.datebox-expand,
details.datebox,
.heatmap-area .datelimitlist {
  display: none !important;
}

/* ============================================================
 * 26. Images / Lightbox
 * ============================================================ */
.entry__body img {
  border-radius: var(--radius-md);
}

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

.entry__body figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-xs);
}

.embeddedpictbox {
  margin: var(--space-sm);
  padding: 0;
  display: inline-table;
  border-collapse: collapse;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  vertical-align: top;
  overflow: hidden;
}

.embeddedpictbox figcaption {
  display: table-caption;
  caption-side: bottom;
  font-size: var(--text-sm);
  text-align: center;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  padding: var(--space-xs);
}

.lb-outerContainer {
  border-radius: var(--radius-md);
}

.lb-dataContainer {
  font-family: var(--font-body);
}

.lb-data .lb-caption {
  font-size: var(--text-sm);
}

/* ============================================================
 * 26. Entry Meta — カテゴリリンク（内側スキン）
 * ============================================================ */
.entry__categories .catlink,
.entry__categories .categorylink {
  color: var(--color-text-muted);
  text-decoration: none;
}

.entry__categories .catlink:hover,
.entry__categories .categorylink:hover {
  color: var(--color-accent);
}

/* ============================================================
 * 27. Utilities
 * ============================================================ */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .entry--gallery .entry__image-link:hover img {
    transform: none;
  }

  .sidebar-right {
    transition: none;
  }
}

/* ============================================================
 * 28. Media Queries — モバイル
 * ============================================================ */
@media (max-width: 767px) {
  .layout {
    grid-template-columns: 1fr;
    padding: var(--space-md);
    padding-top: calc(var(--mobile-nav-height) + var(--space-md));
    padding-bottom: calc(var(--toolbar-height) + var(--space-md));
  }

  .sidebar {
    position: static;
    display: contents;
  }

  .nav-top {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 110;
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg);
    border-bottom: var(--border-width) solid var(--color-border-subtle);
  }

  .nav-top__row {
    max-width: calc(var(--layout-main-max) + var(--space-md) * 2);
    margin-inline: auto;
  }

  .sidebar-toggle {
    display: flex;
  }

  .site-header {
    margin-bottom: var(--space-md);
  }

  .nav-side,
  .sidebar-controls {
    display: none;
  }

  .mode-gallery #entries {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
  }

  /* 右カラム → ドロワー */
  .sidebar-right {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    width: min(320px, 88vw);
    margin: 0;
    padding: var(--space-lg) var(--space-md);
    padding-top: calc(var(--mobile-nav-height) + var(--space-md));
    overflow-y: auto;
    background: var(--color-bg);
    border-left: var(--border-width) solid var(--color-border);
    box-shadow: var(--shadow-md);
    transform: translateX(100%);
    transition: transform var(--transition-speed) var(--transition-ease);
    visibility: hidden;
  }

  body.is-sidebar-open .sidebar-right {
    transform: translateX(0);
    visibility: visible;
  }

  .sidebar-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(26, 29, 33, 0.45);
  }

  body.is-sidebar-open .sidebar-drawer-backdrop {
    display: block;
  }

  [data-theme="dark"] .sidebar-drawer-backdrop {
    background: rgba(0, 0, 0, 0.6);
  }

  .mobile-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: var(--toolbar-height);
    background: var(--color-bg-subtle);
    border-top: var(--border-width) solid var(--color-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-toolbar button,
  .mobile-toolbar a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1.25rem;
  }

  .content-area {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .scroll-top {
    bottom: var(--space-md);
  }
}
