/* ============================================================
   Japonica Lore — Historical Fact / Legend / Pop Culture・出典ブロック
   分類は「色」だけでなく「アイコンの形」「ラベル文字」「枠線の形」の3つでも区別する。
     Historical Fact  ■ 実線        藍
     Legend           ○ 二重線      朱
     Pop Culture      ★ 破線        山吹
     Unverified Claim △ 点線        鼠（出典のない Fact。Fact としては扱わない）
   エディターでも同じ見た目にするため、.is-style-lore-* にも同じスタイルを当てる。
   ============================================================ */

.jl-lore,
.wp-block-group[class*="is-style-lore-"] {
  --jl-lore-color: var(--jl-sumi);
  --jl-lore-bg: var(--jl-paper);
  background-color: var(--jl-lore-bg);
  border-left: 4px solid var(--jl-lore-color);
  border-radius: 0 var(--jl-radius) var(--jl-radius) 0;
  margin: 1.8em 0;
  padding: 1em 1.1em 0.4em;
}

.jl-lore--fact,
.wp-block-group.is-style-lore-fact {
  --jl-lore-color: var(--jl-fact);
  --jl-lore-bg: var(--jl-fact-bg);
  border-left-style: solid;
}
.jl-lore--legend,
.wp-block-group.is-style-lore-legend {
  --jl-lore-color: var(--jl-legend);
  --jl-lore-bg: var(--jl-legend-bg);
  border-left-style: double;
  border-left-width: 6px;
}
.jl-lore--pop,
.wp-block-group.is-style-lore-pop {
  --jl-lore-color: var(--jl-pop);
  --jl-lore-bg: var(--jl-pop-bg);
  border-left-style: dashed;
}
/* 出典なしの Fact には is-style-lore-fact も残っているため、同じ強さ以上のセレクタで後から上書きする */
.jl-lore.jl-lore--unsourced,
.wp-block-group.jl-lore--unsourced {
  --jl-lore-color: var(--jl-unsourced);
  --jl-lore-bg: var(--jl-unsourced-bg);
  border-left-style: dotted;
}

/* バッジ（表示時に挿入）と、本文に保存されたラベル（エディター・テーマ変更時に表示） */
.jl-lore-badge,
.wp-block-group[class*="is-style-lore-"] > .jl-lore-label,
.wp-block-group[class*="is-style-lore-"] .wp-block-group__inner-container > .jl-lore-label {
  color: var(--jl-lore-color);
  font-family: var(--jl-font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  margin: 0 0 0.6em;
  text-transform: uppercase;
}
.jl-lore-badge {
  align-items: center;
  display: flex;
  gap: 0.5em;
}
.jl-lore-icon {
  font-size: 1em;
  line-height: 1;
}
.jl-lore p:last-child {
  margin-bottom: 0.6em;
}

/* 出典欄 */
.jl-lore-source,
.jl-theme .article .jl-lore-source {
  border-top: 1px solid var(--jl-line);
  color: var(--jl-sumi-soft);
  font-size: var(--jl-text-sm);
  line-height: 1.6;
  margin-top: 0.8em;
  padding-top: 0.6em;
}
.jl-lore-source:empty {
  display: none;
}

/* 出典待ちの注意（ログイン中の編集者だけに表示） */
.jl-lore-editor-notice {
  background-color: var(--jl-paper);
  border: 1px dashed var(--jl-unsourced);
  color: var(--jl-sumi);
  font-family: var(--jl-font-ui);
  font-size: var(--jl-text-xs);
  padding: 0.5em 0.75em;
}

/* ---------- 凡例（分類ブロックがある記事だけに表示） ---------- */
.jl-lore-legend {
  background-color: var(--jl-kinari);
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius);
  margin: 0 0 2em;
  padding: 0.9em 1.1em;
}
.jl-theme .article .jl-lore-legend__title,
.jl-lore-legend__title {
  font-family: var(--jl-font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 0.6em;
  text-transform: uppercase;
}
.jl-theme .article .jl-lore-legend__list,
.jl-lore-legend__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.jl-theme .article .jl-lore-legend__item,
.jl-lore-legend__item {
  border-left: 4px solid var(--jl-lore-color);
  font-size: var(--jl-text-sm);
  line-height: 1.5;
  margin: 0 0 0.5em;
  padding-left: 0.6em;
}
.jl-lore-legend__item.jl-lore--fact { --jl-lore-color: var(--jl-fact); border-left-style: solid; }
.jl-lore-legend__item.jl-lore--legend { --jl-lore-color: var(--jl-legend); border-left-style: double; border-left-width: 6px; }
.jl-lore-legend__item.jl-lore--pop { --jl-lore-color: var(--jl-pop); border-left-style: dashed; }
.jl-lore-legend__item.jl-lore--unsourced { --jl-lore-color: var(--jl-unsourced); border-left-style: dotted; }
.jl-lore-legend__item .jl-lore-icon,
.jl-lore-legend__label {
  color: var(--jl-lore-color);
}
.jl-lore-legend__item .jl-lore-icon {
  margin-right: 0.35em;
}
.jl-lore-legend__desc {
  color: var(--jl-sumi-soft);
}

/* ---------- Sources & Further Reading ---------- */
.jl-sources {
  border-top: 3px double var(--jl-line-strong);
  margin-top: 3em;
  padding-top: 0.5em;
}
.jl-theme .article .jl-sources h2.jl-sources__title {
  border-bottom: none;
  font-size: var(--jl-h3);
  margin: 0.8em 0 0.6em;
}
.jl-theme .article .jl-sources h2.jl-sources__title::after {
  content: none;
}
.jl-sources__list {
  font-size: var(--jl-text-sm);
  line-height: 1.6;
}
.jl-sources__list li {
  margin-bottom: 0.6em;
  padding-left: 0.2em;
}

/* ---------- Image Credits ---------- */
.jl-image-credits {
  color: var(--jl-sumi-soft);
  font-size: var(--jl-text-xs);
  margin-top: 2em;
}
.jl-theme .article .jl-image-credits h3.jl-image-credits__title {
  border-left: none;
  font-family: var(--jl-font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  margin: 0 0 0.5em;
  padding-left: 0;
  text-transform: uppercase;
}
.jl-theme .article .jl-image-credits__list,
.jl-image-credits__list {
  line-height: 1.5;
  list-style: none;
  padding-left: 0;
}

/* 印刷時も分類が分かるように */
@media print {
  .jl-lore,
  .jl-lore-legend {
    break-inside: avoid;
    background: none;
  }
}
