/* Default styles for the copy icon */
.clth-copy-icon {
    display: inline-block;
    width: calc(0.8em);
    height: calc(0.8em);
    margin-left: calc(-1.2em);
    margin-top: calc(0.2em);
    cursor: pointer;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
    opacity: 0;
    transition: opacity 0.2s 0.3s; /* fade out after 0.3s delay */
}


.clth-copy-icon:hover {
    opacity: 1;
    transition: opacity 0.2s; /* fade in immediately */
}


h2:hover .clth-copy-icon,
h3:hover .clth-copy-icon,
h4:hover .clth-copy-icon,
h5:hover .clth-copy-icon,
h6:hover .clth-copy-icon {
    opacity: 1;
    transition: opacity 0.2s; /* fade in immediately */
}


/* Hide on mobile */
@media (max-width: 768px) {
     .clth-copy-icon {
        display: none !important;
    }
}


/* Tooltip container */
.clth-copy-icon {
    position: absolute;
}

/* Tooltip text */
.clth-tooltip {
    visibility: hidden;
    background-color: black;
    color: #fff;
    text-align: center;
    font-size: 12px; /* Compact font size */
    padding: 3px 6px; /* Adjust padding for smaller size */
    border-radius: 3px; /* Subtle rounding */

    /* Position the tooltip */
    position: absolute;
    z-index: 99;
    bottom: 150%; /* Position above the icon */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* Tooltip arrow */
.clth-tooltip::after {
    content: '';
    position: absolute;
    top: 100%; /* Position arrow below the tooltip */
    left: 50%;
    margin-left: -5px; /* Center the arrow */
    border-width: 5px;
    border-style: solid;
    border-color: black transparent transparent transparent; /* Arrow pointing down */
}

/* Show the tooltip on hover */
.clth-copy-icon:hover .clth-tooltip {
    visibility: visible;
    opacity: 1;
}