/**
 * NewsOne – UX improvements (reading progress, scroll-to-top)
 * Scoped classes to avoid layout conflicts
 */

/* Reading progress – above header, 3px only */
.newsone-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.06);
    z-index: 100001;
    pointer-events: none;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}
.newsone-reading-progress-bar {
    height: 100%;
    background: #dc2626;
    width: 0%;
    transition: width 0.08s ease-out;
}

/* Scroll-to-top – below header, no layout impact */
.newsone-scroll-to-top {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: calc(20px + env(safe-area-inset-right, 0px));
    width: 48px;
    height: 48px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: opacity 0.2s, transform 0.2s;
}
.newsone-scroll-to-top.visible { display: flex; }
.newsone-scroll-to-top:hover {
    background: #333;
    transform: translateY(-2px);
}
.newsone-scroll-to-top:active {
    transform: scale(0.95);
}
.newsone-scroll-to-top svg {
    width: 24px;
    height: 24px;
}
@media (max-width: 768px) {
    .newsone-scroll-to-top {
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: calc(20px + env(safe-area-inset-right, 0px));
        width: 44px;
        height: 44px;
    }
    .newsone-scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Breadcrumb – minimal, single line */
.newsone-breadcrumb {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}
.newsone-breadcrumb a { color: #000; text-decoration: none; font-weight: 600; }
.newsone-breadcrumb a:hover { color: #dc2626; }
.newsone-breadcrumb span { margin: 0 6px; color: #999; }
.newsone-breadcrumb span:last-child { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }
@media (max-width: 768px) {
    .newsone-breadcrumb {
        font-size: 12px;
        margin-bottom: 10px;
    }
    .newsone-breadcrumb span:last-child { max-width: 180px; }
}
@media (max-width: 480px) {
    .newsone-breadcrumb { display: none; }
}

/* Focus visible for accessibility */
.newsone-scroll-to-top:focus-visible,
.article-container .share-btn-inline:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* Infinite scroll sentinel */
.newsone-infinite-sentinel {
    min-height: 1px;
    padding: 24px 0;
}
.newsone-infinite-sentinel.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    border: 3px solid #eee;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: newsone-spin 0.8s linear infinite;
}
.newsone-infinite-sentinel.done { display: none; }
@keyframes newsone-spin {
    to { transform: rotate(360deg); }
}

/* Infinite scroll – article block separator */
.newsone-infinite-article {
    border-top: 1px solid #e5e5e5;
    padding-top: 48px;
    margin-top: 24px;
}
.newsone-infinite-article .article-title a { color: inherit; text-decoration: none; }
.newsone-infinite-article .article-title a:hover { color: #dc2626; }
.newsone-infinite-article .article-read-more { font-weight: 600; color: #dc2626; text-decoration: none; }
.newsone-infinite-article .article-read-more:hover { text-decoration: underline; }
