/*=====================================================
  THEME TOGGLE (Dark Mode)
======================================================*/

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--tss-border);
    background: var(--tss-bg-alt);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--tss-transition);
}

.theme-toggle:hover {
    border-color: var(--tss-primary);
}

.theme-toggle-icon {
    font-size: 16px;
    line-height: 1;
    display: none;
}

.theme-toggle-icon--sun {
    display: inline-block;
}

html[data-theme="dark"] .theme-toggle-icon--sun {
    display: none;
}

html[data-theme="dark"] .theme-toggle-icon--moon {
    display: inline-block;
}

/*=====================================================
  READING PROGRESS BAR (single.php)
======================================================*/

.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--tss-accent);
    z-index: 10000;
    transition: width 0.1s ease-out;
}

/*=====================================================
  SOCIAL SHARE BUTTONS (single.php)
======================================================*/

.article-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0;
    padding: 18px 0;
    border-top: 1px solid var(--tss-border);
    border-bottom: 1px solid var(--tss-border);
}

.article-share-label {
    font-weight: 700;
    color: var(--tss-heading);
    margin-right: 6px;
    font-size: 0.9rem;
}

.article-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    transition: var(--tss-transition);
    text-decoration: none;
}

.article-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--tss-shadow-sm);
}

.article-share-btn.share-twitter { background: #000000; }
.article-share-btn.share-facebook { background: #1877f2; }
.article-share-btn.share-linkedin { background: #0a66c2; }
.article-share-btn.share-whatsapp { background: #25d366; }
.article-share-btn.share-copy {
    background: var(--tss-bg-alt);
    color: var(--tss-heading);
    border: 1px solid var(--tss-border);
    cursor: pointer;
    font-family: inherit;
}

.article-share-btn.share-copy.is-copied {
    background: var(--tss-primary);
    color: #fff;
    border-color: var(--tss-primary);
}

.article-id-line {
    font-size: 0.85rem;
    color: var(--tss-text-muted);
    margin: -10px 0 20px;
}

.article-id-line a {
    color: var(--tss-primary);
}

/*=====================================================
  TABLE OF CONTENTS (auto-generated, single.php)
======================================================*/

.article-toc {
    background: var(--tss-bg-alt);
    border: 1px solid var(--tss-border);
    border-radius: var(--tss-radius-md);
    padding: 20px 24px;
    margin: 24px 0 30px;
}

.article-toc summary {
    font-weight: 700;
    cursor: pointer;
    color: var(--tss-heading);
    font-size: 0.95rem;
}

.article-toc ol {
    margin: 14px 0 0;
    padding-left: 20px;
}

.article-toc li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.article-toc a {
    color: var(--tss-primary);
}

.article-toc a:hover {
    text-decoration: underline;
}

/*=====================================================
  VIEW COUNT / MOST READ
======================================================*/

.article-views {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sidebar-post .sidebar-post-views {
    color: var(--tss-text-muted);
    font-size: 0.78rem;
}

/*=====================================================
  BACK TO TOP BUTTON
======================================================*/

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--tss-primary);
    color: #fff;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--tss-shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    z-index: 9998;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--tss-primary-dark);
}

@media (max-width: 600px) {
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
}
