/* DTHC Frontend v2.4.1 — Footnote Tooltips */

/* Badge */
.dthc-footnote-ref {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px;
    background: #0073aa; color: #fff !important;
    font-size: 11px; font-weight: 700;
    border-radius: 50%; cursor: pointer;
    vertical-align: super; line-height: 1;
    text-decoration: none !important;
    position: relative; margin: 0 2px; z-index: 100;
    transition: background .2s, transform .15s;
    -webkit-user-select: none; user-select: none;
}
.dthc-footnote-ref:hover { transform: scale(1.1); }
.dthc-footnote-ref:focus { outline: 2px solid #0073aa; outline-offset: 2px; }

/* Popup — appended to body, position:fixed via JS */
.dthc-footnote-popup {
    display: none;
    position: fixed;
    background: #1e1e1e; color: #f0f0f0;
    padding: 14px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 400; line-height: 1.6;
    width: 300px; max-width: 90vw;
    z-index: 2147483647;
    box-shadow: 0 8px 30px rgba(0,0,0,.4);
    cursor: default;
    font-family: inherit;
    animation: dthcIn .2s ease;
}

.dthc-footnote-popup.dthc-visible {
    display: block;
}

@keyframes dthcIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Arrow — bottom (popup is above ref) */
.dthc-footnote-popup::after {
    content: ''; position: absolute;
    border: 7px solid transparent;
    left: 50%; transform: translateX(-50%);
}

.dthc-footnote-popup[data-arrow="bottom"]::after {
    top: 100%;
    border-top-color: #1e1e1e;
}

/* Arrow — top (popup is below ref) */
.dthc-footnote-popup[data-arrow="top"]::after {
    bottom: 100%;
    border-bottom-color: #1e1e1e;
}

/* Close button */
.dthc-footnote-close {
    position: absolute; top: 6px; left: 10px;
    background: none; border: none; color: #999;
    font-size: 18px; cursor: pointer; padding: 0; line-height: 1;
}
.dthc-footnote-close:hover { color: #fff; }

/* Links inside popup */
.dthc-footnote-popup a { color: #72b6e6; text-decoration: underline; }
.dthc-footnote-popup a:hover { color: #a8d4f0; }

/* RTL */
[dir="rtl"] .dthc-footnote-popup, .rtl .dthc-footnote-popup { text-align: right; }

/* Close button RTL fix */
[dir="rtl"] .dthc-footnote-close, .rtl .dthc-footnote-close { left: auto; right: 10px; }

@media (max-width: 600px) {
    .dthc-footnote-popup { width: 260px; font-size: 13px; padding: 10px 14px; }
}
