/* Stardust Log — glossary.css
 * 用語リンク(記事内)・プレビュー・用語辞典ページのスタイル。
 * 色変数は style.css から継承するので、必ず style.css より後に読み込む。
 * 記事ページでは glossary.js が自動で読み込む(版は glossary.json の css_version)。
 */

/* ---- 記事内の用語リンク ---- */
.post-body a.gl-term,
a.gl-term{
  color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  cursor: help;
  transition: color 0.3s;
}
.post-body a.gl-term:hover,
a.gl-term:hover,
a.gl-term[aria-describedby]{ color: var(--accent); }

/* ---- プレビュー ---- */
.gl-pop{
  position: absolute; z-index: 60;
  width: min(340px, calc(100vw - 24px));
  padding: 16px 18px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: 3px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.55), 0 0 0 1px rgba(11,14,26,0.6);
  font-size: 13.5px; line-height: 1.8; color: var(--text-muted);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
}
.gl-pop.is-above{ transform: translateY(-4px); }
.gl-pop.is-open{ opacity: 1; transform: none; }
.gl-pop[hidden]{ display: none; }
.gl-pop-head{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.gl-pop-term{
  margin: 0;
  font-family: 'Shippori Mincho', serif; font-size: 16.5px; font-weight: 600;
  color: var(--text); letter-spacing: 0.02em; line-height: 1.5;
}
.gl-pop-reading{
  margin-left: 10px;
  font-family: 'Noto Sans JP', sans-serif; font-size: 11.5px; font-weight: 400;
  color: var(--text-faint); letter-spacing: 0.05em;
}
.gl-pop-close{
  flex-shrink: 0;
  width: 26px; height: 26px; margin: -4px -6px 0 0;
  font: inherit; font-size: 17px; line-height: 1;
  color: var(--text-faint); background: transparent; border: 0; border-radius: 2px;
  cursor: pointer;
}
.gl-pop-close:hover{ color: var(--text); }
.gl-pop-body{ margin: 0 0 10px; }
.gl-pop-more{
  display: inline-block;
  font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--accent); text-decoration: none;
}
.gl-pop-more:hover{ text-decoration: underline; text-underline-offset: 3px; }

/* ---- 用語ページ ---- */
.gl-reading{
  margin: -6px 0 22px;
  font-size: 12.5px; color: var(--text-faint); letter-spacing: 0.06em;
}
.gl-body sup{ font-size: 0.7em; line-height: 0; margin-left: 1px; }
.gl-body sup a{ text-decoration: none; color: var(--accent); }
.gl-see{ margin-top: 44px; }
.gl-see h2{ font-size: 16px; margin: 0 0 14px; }
.gl-see ul{ list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gl-see li{ font-size: 14px; line-height: 1.7; }
.gl-see .gl-year{
  display: inline-block; min-width: 3.2em;
  font-family: 'EB Garamond', serif; font-size: 14px; color: var(--text-faint);
}
.gl-see .gl-short{ display: block; font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }

/* ---- 用語辞典の一覧 ---- */
.gl-index{ margin: 0; padding: 0; }
.gl-index-item{ padding: 20px 0; border-top: 1px solid var(--line); }
.gl-index-item:last-child{ border-bottom: 1px solid var(--line); }
.gl-index-item dt{ margin: 0 0 6px; }
.gl-index-item dt a{
  font-family: 'Shippori Mincho', serif; font-size: 17.5px; font-weight: 600;
  color: var(--text); text-decoration: none; letter-spacing: 0.02em;
}
.gl-index-item dt a:hover{ color: var(--accent); }
.gl-index-item dt .gl-pop-reading{ font-size: 11.5px; }
.gl-index-item dd{ margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--text-muted); }

@media (max-width: 640px){
  .gl-pop{ font-size: 13px; padding: 14px 16px 12px; }
  .gl-index-item dt a{ font-size: 16.5px; }
}

/* ---- 用語辞典の一覧: 分野への目次(v2) ---- */
.gl-toc{ display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 6px 0 8px; }
.gl-toc a{
  font-size: 12.5px; letter-spacing: 0.03em; white-space: nowrap;
  color: var(--text-muted); text-decoration: none;
  padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: 999px;
  transition: color 0.3s, border-color 0.3s;
}
.gl-toc a:hover{ color: var(--text); border-color: var(--accent); }
.section-label[id]{ scroll-margin-top: 20px; }
