@import url('https://fonts.googleapis.com/css2?family=Zen+Old+Mincho:wght@400;500;600&display=swap');

/* --- 1. 基本変数（Minimalテーマ・Obsidian標準変数を上書き） --- */
:root,
body.theme-dark {
  --background-primary: transparent !important;
  --background-primary-alt: transparent !important;
  --background-secondary: transparent !important;
  --background-secondary-alt: transparent !important;

  --text-normal: #FFFFFF !important;
  --text-muted: #8E95A0 !important;
  --text-accent: #B0B5C0 !important;
  --divider-color: rgba(255, 255, 255, 0.15) !important;

  --text-selection: rgba(245, 255, 0, 0.4) !important;
  --text-highlight-bg: rgba(245, 255, 0, 0.4) !important;
  --text-highlight-bg-active: rgba(245, 255, 0, 0.55) !important;
  --text-mark: rgba(245, 255, 0, 0.4) !important;
  --highlight-color: rgba(245, 255, 0, 0.4) !important;

  --link-color: #B0B5C0 !important;
  --link-color-hover: #FFFFFF !important;
  --link-external-color: #B0B5C0 !important;
  --link-external-color-hover: #FFFFFF !important;

  --font-text: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --font-default: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --inline-title-font: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --page-title-font: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --font-heading: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --font-serif: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  --font-monospace: "JetBrains Mono", "SF Mono", monospace;
}

/* --- 2. 背景：漫画の網点トーン（最下層） --- */
html,
body {
  background-color: #050507 !important;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px) !important;
  background-size: 4px 4px !important;
  background-position: 0 0, 2px 2px !important;
  background-attachment: fixed !important;
}

.app-container,
.workspace,
.site-body,
.site-body-main-column,
.page-view,
.page-content,
.markdown-rendered {
  background-color: transparent !important;
}

/* --- 3. 見出しのアンカーマーク消去 --- */
.heading-anchor,
.anchor-link,
a.heading-anchor {
  display: none !important;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
.inline-title a {
  border-bottom: none !important;
}

/* --- 4. ハイライト --- */
::selection,
*::selection {
  background-color: rgba(245, 255, 0, 0.4) !important;
  color: inherit !important;
}

mark,
.markdown-rendered mark {
  background-color: rgba(245, 255, 0, 0.4) !important;
  color: #FFFFFF !important;
  padding: 1px 4px !important;
  border-radius: 2px !important;
}

/* --- 5. タイポグラフィ（PC基準設定） --- */
.markdown-rendered,
.markdown-rendered p,
.markdown-rendered li,
p, li {
  font-family: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  font-size: 0.88rem !important;
  font-weight: 400;
  color: #FFFFFF !important;
  line-height: 1.95;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
}

em, i {
  color: #8E95A0 !important;
  font-style: italic !important;
}

.markdown-rendered p a,
.markdown-rendered li a {
  color: #B0B5C0 !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(176, 181, 192, 0.45) !important;
  padding-bottom: 2px !important;
  transition: color 0.15s ease, border-bottom-color 0.15s ease;
}

.markdown-rendered p a:hover,
.markdown-rendered li a:hover {
  color: #FFFFFF !important;
  border-bottom-color: #FFFFFF !important;
}

.inline-title,
h1, h2, h3, h4, h5, h6 {
  font-family: "Zen Old Mincho", "Yu Mincho", "游明朝", "Hiragino Mincho ProN", serif !important;
  font-weight: 500 !important;
  color: #FFFFFF !important;
  -webkit-font-smoothing: antialiased;
}

.inline-title, h1 {
  font-size: 1.7rem !important;
  margin-top: 2rem;
  margin-bottom: 1.2rem;
  line-height: 1.35;
}

h2 {
  font-size: 1.18rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
}

/* --- 6. スマホ専用フォントサイズ --- */
@media (max-width: 768px) {
  .markdown-rendered,
  .markdown-rendered p,
  .markdown-rendered li,
  p, li {
    font-size: 1.08rem !important;
    line-height: 1.85 !important;
    letter-spacing: 0.03em !important;
  }

  .inline-title, h1 {
    font-size: 1.65rem !important;
    line-height: 1.35 !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }
}

/* --- 7. 画像設定 & キャプション --- */
img {
  position: relative;
  z-index: 2;
  border-radius: 2px;
}

.caption {
  font-family: var(--font-monospace);
  font-size: 0.72rem;
  color: #8E95A0;
  margin-top: -0.5rem;
  margin-bottom: 2rem;
  text-align: right;
}