/* ======================================================== */
/* Link To Headline Pro - Frontend CSS (v2.1.4)             */
/* ======================================================== */

/* -------------------------------------------------------- */
/* Anchor Link Styles                                       */
/* -------------------------------------------------------- */
h2[id], h3[id], h4[id], h5[id], h6[id] { position: relative; }

.lthalgp-anchor-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1em; height: 1em; text-decoration: none; color: inherit;
    opacity: 0.6; transition: opacity 0.2s ease, transform 0.2s ease;
    cursor: pointer; position: relative;
}
.lthalgp-anchor-link:hover { opacity: 1; transform: scale(1.1); }
.lthalgp-anchor-link.lthalgp-copied .lthalgp-icon-wrapper { color: #00a32a; opacity: 1; }
.lthalgp-custom-icon { width: 0.8em; height: 0.8em; vertical-align: middle; }

/* Positioning */
body.lthalgp-icon-left .lthalgp-anchor-link { margin-right: 8px; }
body.lthalgp-icon-right .lthalgp-anchor-link { margin-left: 8px; }

/* Visibility on Hover */
body.lthalgp-icon-hover h2[id] .lthalgp-anchor-link,
body.lthalgp-icon-hover h3[id] .lthalgp-anchor-link,
body.lthalgp-icon-hover h4[id] .lthalgp-anchor-link,
body.lthalgp-icon-hover h5[id] .lthalgp-anchor-link,
body.lthalgp-icon-hover h6[id] .lthalgp-anchor-link {
    opacity: 0; pointer-events: none;
}
body.lthalgp-icon-hover h2[id]:hover .lthalgp-anchor-link,
body.lthalgp-icon-hover h3[id]:hover .lthalgp-anchor-link,
body.lthalgp-icon-hover h4[id]:hover .lthalgp-anchor-link,
body.lthalgp-icon-hover h5[id]:hover .lthalgp-anchor-link,
body.lthalgp-icon-hover h6[id]:hover .lthalgp-anchor-link {
    opacity: 0.6; pointer-events: auto;
}

/* Tooltip */
.lthalgp-tooltip {
    position: absolute; background: #1d2328; color: #fff;
    padding: 5px 10px; border-radius: 4px; font-size: 12px;
    line-height: 1.4; bottom: 150%; left: 50%;
    transform: translateX(-50%); white-space: nowrap;
    animation: lthalgp-fadeIn 0.3s ease; z-index: 10000;
}
.lthalgp-tooltip::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 5px solid transparent; border-top-color: #1d2328;
}
@keyframes lthalgp-fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(5px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ======================================================== */
/* Professional Table of Contents Styles                    */
/* ======================================================== */
.lthalgp-toc {
    border: 1px solid var(--lthalgp-border-color);
    background-color: var(--lthalgp-bg-color);
    color: var(--lthalgp-text-color);
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 2em;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.05);
}

/* **FIX:** Increased specificity for list reset to override theme styles */
nav.lthalgp-toc ul,
nav.lthalgp-toc li {
    margin: 0;
    padding: 0;
    list-style: none outside none;
}

.lthalgp-toc-header {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 1px solid var(--lthalgp-border-color);
}
.lthalgp-toc .lthalgp-toc-title {
    color: inherit; margin: 0 !important; padding: 0 !important;
    font-size: 1.1em !important; font-weight: 600;
}
.lthalgp-toc-toggle {
    background: none; border: none; cursor: pointer; padding: 5px;
    display: flex; align-items: center; justify-content: center;
    color: var(--lthalgp-text-color);
}
.lthalgp-toggle-icon svg {
    width: 16px; height: 16px; transition: transform 0.3s ease;
    fill: currentColor;
}
.lthalgp-toc.lthalgp-toc-closed .lthalgp-toggle-icon svg { transform: rotate(-90deg); }
.lthalgp-toc-list {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    max-height: 1000px; opacity: 1;
}
.lthalgp-toc.lthalgp-toc-closed .lthalgp-toc-list { max-height: 0; opacity: 0; }

/* **FIX:** Increased specificity for nested list to override theme styles */
nav.lthalgp-toc ul.lthalgp-toc-list-nested {
    padding-left: 16px;
    margin: 8px 0;
}

.lthalgp-toc-item a {
    display: block; padding: 6px 12px; text-decoration: none;
    border-radius: 5px; color: var(--lthalgp-link-color);
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}
.lthalgp-toc-item a:hover {
    background-color: var(--lthalgp-hover-bg-color);
    color: var(--lthalgp-hover-text-color);
    transform: translateX(4px);
}
.lthalgp-toc-item a[aria-current="true"] {
    color: var(--lthalgp-active-text-color);
    font-weight: 600;
    border-left-color: var(--lthalgp-active-border-color);
    background-color: var(--lthalgp-hover-bg-color);
}

/* Indentation */
.lthalgp-toc-item-h3 a { font-size: 0.95em; }
.lthalgp-toc-item-h4 a { font-size: 0.9em; }
.lthalgp-toc-item-h5 a { font-size: 0.85em; }
.lthalgp-toc-item-h6 a { font-size: 0.8em; }

/* Presets */
.lthalgp-toc-preset-minimal-light {
    --lthalgp-bg-color: #ffffff; --lthalgp-border-color: #e5e7eb;
    --lthalgp-text-color: #374151; --lthalgp-link-color: #4b5563;
    --lthalgp-hover-bg-color: #f9fafb; --lthalgp-hover-text-color: #1f2937;
    --lthalgp-active-border-color: #6366f1; --lthalgp-active-text-color: #1f2937;
}
.lthalgp-toc-preset-modern-blue {
    --lthalgp-bg-color: #f0f5fa; --lthalgp-border-color: #cddcee;
    --lthalgp-text-color: #1d4f7a; --lthalgp-link-color: #2a6a9d;
    --lthalgp-hover-bg-color: #e1eaf3; --lthalgp-hover-text-color: #0b2e4d;
    --lthalgp-active-border-color: #3b82f6; --lthalgp-active-text-color: #0b2e4d;
}
.lthalgp-toc-preset-earthy-calm {
    --lthalgp-bg-color: #fdfaf5; --lthalgp-border-color: #e4d8c6;
    --lthalgp-text-color: #6d5d4b; --lthalgp-link-color: #8b7967;
    --lthalgp-hover-bg-color: #f5efe4; --lthalgp-hover-text-color: #594a3a;
    --lthalgp-active-border-color: #a16207; --lthalgp-active-text-color: #594a3a;
}
.lthalgp-toc-preset-dark-elegant {
    --lthalgp-bg-color: #1f2937; --lthalgp-border-color: #4b5563;
    --lthalgp-text-color: #d1d5db; --lthalgp-link-color: #9ca3af;
    --lthalgp-hover-bg-color: #374151; --lthalgp-hover-text-color: #f9fafb;
    --lthalgp-active-border-color: #6366f1; --lthalgp-active-text-color: #f9fafb;
}