/*
 * Diccionario SEO - Tooltip (Fase 1)
 * Diseño e implementación propios de BarmetMedia. No reutiliza CSS de
 * ningún plugin de terceros.
 */

/*
 * Revisión 2: el disparador y el panel ya no están anidados (uno dentro
 * del otro) — son hermanos dentro de .ds-term-wrap, por accesibilidad
 * (ver includes/Tooltip/class-ds-tooltip-render.php). El wrapper es quien
 * establece el contexto de posicionamiento para el panel.
 */
.ds-term-wrap {
    position: relative;
    display: inline;
}

.ds-term {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.ds-term-link {
    cursor: pointer;
    text-decoration: underline;
}

span.ds-term-tooltip {
    color: inherit;
}

.ds-term-tooltip:focus-visible,
.ds-term-tooltip:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}

.ds-tooltip-panel {
    position: absolute;
    z-index: 100000;
    display: none;
    box-sizing: border-box;
    width: max-content;
    max-width: 320px;
    min-width: 180px;
    padding: 12px 14px;
    background: #1d2327;
    color: #f0f0f1;
    border-radius: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    text-decoration: none;
    white-space: normal;
}

.ds-tooltip-panel.is-open {
    display: block;
}

.ds-tooltip-panel::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    background: inherit;
    transform: rotate(45deg);
}

.ds-tooltip-panel[data-ds-placement="top"]::after {
    bottom: -5px;
    left: 16px;
}

.ds-tooltip-panel[data-ds-placement="bottom"]::after {
    top: -5px;
    left: 16px;
}

.ds-tooltip-title {
    display: block;
    margin: 0 0 4px;
    font-weight: 700;
    color: #fff;
}

.ds-tooltip-excerpt {
    display: block;
    margin: 0 0 8px;
    color: #f0f0f1;
}

.ds-tooltip-more {
    display: inline-block;
    color: #72aee6;
    font-weight: 600;
    text-decoration: none;
}

.ds-tooltip-more:hover,
.ds-tooltip-more:focus {
    text-decoration: underline;
}

@media (max-width: 782px) {
    .ds-tooltip-panel {
        max-width: min(320px, calc(100vw - 32px));
    }
}
