/**
 * Glossar Styles
 *
 * @author Kopf & Hand
 * @package Kopf & Hand Theme
 */

/* ============================================================
   GLOSSAR-TERM IM TEXT
   ============================================================ */

.glossar-term {
    position: relative;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: .15em;
    cursor: help;
}

/* ============================================================
   TOOLTIP
   ============================================================ */

.glossar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    padding: 12px 16px;
    max-width: 280px;
    min-width: 200px;
    width: max-content;
    background-color: var(--color-1);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    line-height: 1.5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* Pfeil nach unten */
.glossar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--color-1);
}

/* Tooltip sichtbar */
.glossar-term.tooltip-visible .glossar-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Tooltip Text */
.glossar-tooltip-text {
    display: block;
    margin-bottom: 8px;
}

/* Link im Tooltip */
.glossar-tooltip-link {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--color-white);
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.glossar-tooltip-link:hover {
    opacity: 1;
    color: var(--color-white);
}

/* ============================================================
   RESPONSIVE: MOBILE ANPASSUNGEN
   ============================================================ */

@media (max-width: 768px) {
    .glossar-tooltip {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        margin-bottom: 0;
        max-width: calc(100vw - 40px);
    }

    .glossar-tooltip::after {
        display: none;
    }

    /* Overlay für Mobile */
    .glossar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }

    .glossar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================================
   GLOSSAR-LISTE (SHORTCODE)
   ============================================================ */

.glossar-liste {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.glossar-gruppe {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.glossar-buchstabe {
    font-family: var(--font-1);
    font-size: var(--font-size-l);
    color: var(--color-3);
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-3);
}

.glossar-eintrag {
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    scroll-margin-top: 100px;
}

.glossar-eintrag:last-child {
    border-bottom: none;
}

.glossar-begriff {
    font-family: var(--font-1);
    font-size: var(--font-size-m);
    margin: 0 0 8px 0;
    color: var(--color-1);
}

.glossar-beschreibung {
    font-family: var(--font-2);
    font-size: var(--font-size-s);
    line-height: 1.6;
    margin: 0;
    /* color: var(--color-1); */
}
