/*
File: utility.css
Contains styles for sitewide utilities and definitive plugin accessibility fixes.
*/

/* --- Back to Top Button --- */
#back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #1e293b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    z-index: var(--z-index-back-to-top);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}
#back-to-top-btn::before {
    content: '';
    display: block;
    width: 24px;
    height: 24px;
    background-color: currentColor; 
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/></svg>');
    -webkit-mask-size: cover;
    mask-size: cover;
}
#back-to-top-btn:hover {
    background-color: #334155;
    color: #ffffff;
    text-decoration: none;
}
#back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Reading Progress Bar --- */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--color-primary);
    width: 0%;
    z-index: var(--z-index-mobile-menu);
    transition: width 0.1s ease-out;
}

/* --- AdSense Styling --- */
ins.adsbygoogle {
    display: block;
    margin: 30px auto;
    text-align: center;
    background-color: #f8fafc;
    min-height: 100px;
}

/*
 * ==========================================================================
 * DEFINITIVE ACCESSIBILITY FIX FOR LUCKYWP TABLE OF CONTENTS
 * ==========================================================================
 */

/* Use a highly specific selector to override the plugin's default styles */
.lwptoc .lwptoc_header .lwptoc_toggle .lwptoc_toggle_label {
    color: var(--color-primary) !important; /* Use the theme's primary color for high contrast */
    background-color: transparent !important; /* Ensure no background color interferes */
    text-decoration: none !important;
    font-weight: bold;
    font-size: 0.9em;
}

.lwptoc .lwptoc_header .lwptoc_toggle .lwptoc_toggle_label:hover {
    text-decoration: underline !important;
}

/* Optional: Style the title to match the theme better */
.lwptoc .lwptoc_header .lwptoc_title {
    font-weight: 700 !important;
    color: var(--color-headings) !important;
}