/* Anchor Links Styles */

/* 1. Prevent header overlap on scroll */
/* Base styles (Desktop > 1440px) - Header height is 96px */
.entry-content h1[id],
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id],
.entry-content h5[id],
.entry-content h6[id] {
    scroll-margin-top: 120px;
    /* 96px header + 24px spacing */
    position: relative;
    display: block;
    width: fit-content;
    /* Ensure proper positioning for the icon */
}

/* @media (max-width: 1440px) and (min-width: 1269px) - Header height is 80px */
@media (max-width: 1440px) and (min-width: 1269px) {

    .entry-content h1[id],
    .entry-content h2[id],
    .entry-content h3[id],
    .entry-content h4[id],
    .entry-content h5[id],
    .entry-content h6[id] {
        scroll-margin-top: 104px;
        /* 80px header + 24px spacing */
    }
}

/* @media (max-width: 1268px) - Header height is 74px */
@media (max-width: 1268px) {

    .entry-content h1[id],
    .entry-content h2[id],
    .entry-content h3[id],
    .entry-content h4[id],
    .entry-content h5[id],
    .entry-content h6[id] {
        scroll-margin-top: 98px;
        /* 74px header + 24px spacing */
    }
}

/* @media (max-width: 767px) - Header height is 67px */
@media (max-width: 767px) {

    .entry-content h1[id],
    .entry-content h2[id],
    .entry-content h3[id],
    .entry-content h4[id],
    .entry-content h5[id],
    .entry-content h6[id] {
        scroll-margin-top: 91px;
        /* 67px header + 24px spacing */
    }
}

/* @media (max-width: 480px) - Header height is 60px */
@media (max-width: 480px) {

    .entry-content h1[id],
    .entry-content h2[id],
    .entry-content h3[id],
    .entry-content h4[id],
    .entry-content h5[id],
    .entry-content h6[id] {
        scroll-margin-top: 84px;
        /* 60px header + 24px spacing */
    }
}

/* 2. Anchor Link Icon Styles */
.anchor-link-icon {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 0.8em;
    /* Slightly smaller than the text */
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;

    margin-left: 10px;
    color: #cecece;
    /* Light gray */
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    cursor: pointer;
    vertical-align: middle;
}

/* Show icon on hover */
.entry-content h1[id]:hover .anchor-link-icon,
.entry-content h2[id]:hover .anchor-link-icon,
.entry-content h3[id]:hover .anchor-link-icon,
.entry-content h4[id]:hover .anchor-link-icon,
.entry-content h5[id]:hover .anchor-link-icon,
.entry-content h6[id]:hover .anchor-link-icon {
    opacity: 1;
}

/* Highlight icon on hover */
.anchor-link-icon:hover {
    color: #0c65af;
    /* Theme blue color */
}

/* Also ensure the heading text itself changes cursor if we make it clickable (optional, per user request "click on header OR icon") */
.entry-content h1[id],
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id],
.entry-content h5[id],
.entry-content h6[id] {
    cursor: pointer;
}

/* Toast Notification Styles */
#anchor-copy-toast {
    visibility: hidden;
    min-width: 250px;
    margin-left: -125px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 30px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#anchor-copy-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}