/*
 * Plugin: Firearms Glossary (実銃用語表示)
 * File:   fglossary-style.css
 *
 * Color and typography values are output as CSS custom properties on :root
 * by PHP (via wp_add_inline_style in Fglossary_Replacer::enqueue_assets).
 * This file references them with var() — keeping PHP template strings
 * out of the static CSS file.
 *
 * Variables injected by PHP:
 *   --fg-color-underline : underline color for matched terms
 *   --fg-color-bg        : tooltip background color
 *   --fg-color-accent    : tooltip left-border accent color
 *   --fg-color-text      : term text color ("inherit" when not set)
 *   --fg-bold            : term font-weight ("bold" or "inherit")
 */

/* ── Term span ──────────────────────────────────────────────── */
.fglossary-term {
    border-bottom: 2px solid var(--fg-color-underline, #888888);
    color: var(--fg-color-text, inherit);
    cursor: help;
    font-weight: var(--fg-bold, inherit);
    position: relative;
    display: inline;
    white-space: nowrap;
}

/*
 * リンク内の用語はリンク色を優先する。
 * --fg-color-text に色が指定されていても <a> の color を上書きしないよう
 * a 要素の直下・子孫どちらのケースも color: inherit で親から引き継ぐ。
 */
a .fglossary-term,
a.fglossary-term {
    color: inherit;
}

/* ── Tooltip popup ──────────────────────────────────────────── */
.fglossary-popup {
    display: none;
    position: fixed;
    z-index: 9999;
    max-width: 300px;
    min-width: 180px;
    background: var(--fg-color-bg, #2c2c2c);
    color: #eee;
    border-left: 4px solid var(--fg-color-accent, #d32f2f);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .5);
    padding: 8px 12px;
    font-size: .875em;
    line-height: 1.6;
    border-radius: 3px;
    pointer-events: none;
    word-break: break-word;
    white-space: normal;
}

.fglossary-popup.fglossary-visible {
    display: block;
}
