/* ======================================================== */
/* Link To Headline - Anchor Link Frontend CSS              */
/* ======================================================== */



/* -------------------------------------------------------- */
/* Anchor Link Base Styles                                  */
/* -------------------------------------------------------- */
.lthalg-anchor-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    text-decoration: none;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.lthalg-anchor-link:hover {
    opacity: 1;
    transform: scale(1.05);
}

.lthalg-anchor-link.lthalg-copied {
    color: #00a32a;
    opacity: 1;
}

/* Custom icon */
.lthalg-custom-icon {
    width: 16px;
    height: 16px;
}

/* -------------------------------------------------------- */
/* Icon positioning                                         */
/* -------------------------------------------------------- */

/* LEFT */
body.lthalg-icon-left h2[id],
body.lthalg-icon-left h3[id],
body.lthalg-icon-left h4[id],
body.lthalg-icon-left h5[id],
body.lthalg-icon-left h6[id] {
    flex-direction: row-reverse; /* move icon before text */
    justify-content: flex-start;
}

body.lthalg-icon-left .lthalg-anchor-link {
    margin-right: 6px;
    margin-left: 0;
}

/* RIGHT (default) */
body.lthalg-icon-right h2[id],
body.lthalg-icon-right h3[id],
body.lthalg-icon-right h4[id],
body.lthalg-icon-right h5[id],
body.lthalg-icon-right h6[id] {
    flex-direction: row; /* normal */
}

body.lthalg-icon-right .lthalg-anchor-link {
    margin-left: 6px;
}

/* -------------------------------------------------------- */
/* Hover visibility option                                  */
/* -------------------------------------------------------- */

body.lthalg-icon-hover .lthalg-anchor-link {
    opacity: 0;
    pointer-events: none;
}

body.lthalg-icon-hover h2[id]:hover .lthalg-anchor-link,
body.lthalg-icon-hover h3[id]:hover .lthalg-anchor-link,
body.lthalg-icon-hover h4[id]:hover .lthalg-anchor-link,
body.lthalg-icon-hover h5[id]:hover .lthalg-anchor-link,
body.lthalg-icon-hover h6[id]:hover .lthalg-anchor-link,
body.lthalg-icon-hover .lthalg-anchor-link:hover {
    opacity: 0.7;
    pointer-events: auto;
}

/* -------------------------------------------------------- */
/* Tooltip styling                                          */
/* -------------------------------------------------------- */
.lthalg-tooltip {
    position: absolute;
    background: #1d2328;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    animation: lthalg-fadeIn 0.3s ease;
    z-index: 9999;
}

.lthalg-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #1d2328;
}

@keyframes lthalg-fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* -------------------------------------------------------- */
/* Responsive tweak                                         */
/* -------------------------------------------------------- */
@media (max-width: 782px) {
    .lthalg-anchor-link {
        font-size: 18px;
        width: 22px;
        height: 22px;
    }
}
