/* ==========================================================================
   Glossary — single-glossary.php, archive-glossary.php, and the anchors the
   AutoLinker injects into article bodies ([data-arz-autolink]).
   Plain CSS (style.css is a Tailwind build that cannot be rebuilt). Colours
   are the theme's own and switch through the theme-mode.css tokens.
   ========================================================================== */

.arz-gl, .arz-gl-index {
    --gl-surface: #fff;
    --gl-soft: rgb(246 247 251);
    --gl-line: rgb(232 234 242);
    --gl-title: rgb(55 59 79);
    --gl-text: rgb(75 79 99);
    --gl-muted: rgb(104 109 135);
    --gl-primary: rgb(0 168 116);
    --gl-primary-tint: rgb(230 252 245);
    color: var(--gl-text);
    min-width: 0;
    box-sizing: border-box;
}

html.dark-mode .arz-gl, html.dark-mode .arz-gl-index {
    --gl-surface: rgb(var(--arz-c-block));
    --gl-soft: rgb(var(--arz-c-over));
    --gl-line: rgb(var(--arz-c-border));
    --gl-title: rgb(var(--arz-c-title-strong));
    --gl-text: rgb(var(--arz-c-text));
    --gl-muted: rgb(var(--arz-c-muted));
    --gl-primary: rgb(var(--arz-c-primary-strong));
    --gl-primary-tint: rgb(var(--arz-c-primary-tint));
}

/* ---------- single term --------------------------------------------------- */

.arz-gl { padding: 16px; }
@media (min-width: 768px) { .arz-gl { padding: 32px; } }

.arz-gl__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gl-line);
}

.arz-gl__kicker {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: var(--gl-primary);
}

.arz-gl__english {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--gl-muted);
    text-align: start;
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.arz-gl__definition {
    margin: 0;
    font-size: 18px;
    line-height: 1.9;
    font-weight: 500;
    color: var(--gl-title);
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--gl-soft);
    border-inline-start: 3px solid var(--gl-primary);
}

.arz-gl__synonyms { margin: 0; font-size: 13px; color: var(--gl-muted); }
.arz-gl__synonyms span { font-weight: 500; margin-inline-end: 4px; }

.arz-gl__body { padding: 20px 0 8px; font-size: 16px; line-height: 2; }
.arz-gl__body p { margin: 0 0 1em; }

/* coin card */
.arz-gl__coin {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--gl-line);
    background: var(--gl-surface);
    color: var(--gl-title);
    text-decoration: none;
    transition: border-color .2s ease;
}
.arz-gl__coin:hover { border-color: var(--gl-primary); color: var(--gl-title); }
.arz-gl__coin-icon { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.arz-gl__coin-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.arz-gl__coin-name { font-size: 16px; font-weight: 600; }
.arz-gl__coin-symbol { font-size: 12px; font-weight: 500; color: var(--gl-muted); margin-inline-start: 6px; }
.arz-gl__coin-cta { font-size: 13px; color: var(--gl-primary); }
.arz-gl__coin-arrow { font-size: 18px; color: var(--gl-muted); }

/* prev / next */
.arz-gl__nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gl-line);
}
.arz-gl__nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--gl-title);
    text-decoration: none;
    min-width: 0;
}
.arz-gl__nav-link:hover { background: var(--gl-soft); color: var(--gl-title); }
.arz-gl__nav-link--next { text-align: end; align-items: flex-end; }
.arz-gl__nav-label { font-size: 12px; color: var(--gl-muted); }
.arz-gl__nav-title {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.arz-gl__nav-all {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--gl-line);
    font-size: 13px;
    font-weight: 500;
    color: var(--gl-text);
    text-decoration: none;
    white-space: nowrap;
}
.arz-gl__nav-all:hover { border-color: var(--gl-primary); color: var(--gl-primary); }

@media (max-width: 480px) {
    .arz-gl__nav { grid-template-columns: 1fr 1fr; }
    .arz-gl__nav-all { grid-column: 1 / -1; justify-self: center; order: 3; }
}

/* ---------- index --------------------------------------------------------- */

.arz-gl-index { padding: 16px; }
@media (min-width: 768px) { .arz-gl-index { padding: 32px; } }

.arz-gl-index__tools {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 14px;
    margin-bottom: 8px;
    background: var(--gl-surface);
    border-bottom: 1px solid var(--gl-line);
}

.arz-gl-index__search {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid var(--gl-line);
    background: var(--gl-soft);
    color: var(--gl-muted);
}
.arz-gl-index__search:focus-within { border-color: var(--gl-primary); }
.arz-gl-index__search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--gl-title);
    font: inherit;
    font-size: 15px;
}
.arz-gl-index__search input::placeholder { color: var(--gl-muted); }

.arz-gl-index__letters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.arz-gl-index__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--gl-line);
    font-size: 14px;
    font-weight: 600;
    color: var(--gl-title);
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.arz-gl-index__letter:hover,
.arz-gl-index__letter.is-active {
    background: var(--gl-primary-tint);
    border-color: var(--gl-primary);
    color: var(--gl-primary);
}
.arz-gl-index__letter.is-muted { opacity: .35; pointer-events: none; }

.arz-gl-index__empty {
    margin: 24px 0;
    text-align: center;
    color: var(--gl-muted);
}

.arz-gl-index__group { padding: 18px 0 6px; scroll-margin-top: 140px; }
.arz-gl-index__heading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 0 12px;
    border-radius: 10px;
    background: var(--gl-primary-tint);
    color: var(--gl-primary);
    font-size: 18px;
    font-weight: 700;
}

.arz-gl-index__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}
@media (min-width: 768px)  { .arz-gl-index__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .arz-gl-index__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.arz-gl-index__link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--gl-line);
    background: var(--gl-surface);
    color: var(--gl-title);
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease;
}
.arz-gl-index__link:hover { border-color: var(--gl-primary); color: var(--gl-title); transform: translateY(-1px); }
.arz-gl-index__term { font-size: 16px; font-weight: 600; }
.arz-gl-index__en { font-size: 12px; color: var(--gl-muted); text-align: start; font-family: ui-sans-serif, system-ui, sans-serif; }
.arz-gl-index__def { font-size: 13px; line-height: 1.8; color: var(--gl-text); }

/* ---------- injected links in article bodies ------------------------------ */

.entry-content a[data-arz-autolink] {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    color: inherit;
}
.entry-content a[data-arz-autolink]:hover { color: var(--gl-primary, rgb(0 168 116)); text-decoration-style: solid; }
.entry-content a[data-arz-autolink="glossary"]::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-inline-start: 3px;
    vertical-align: super;
    border-radius: 50%;
    background: rgb(0 168 116);
    opacity: .7;
}
html.dark-mode .entry-content a[data-arz-autolink="glossary"]::after { background: rgb(var(--arz-c-primary-strong)); }
