/* Бесконечная прокрутка */

.infinite-scroll-article {
    margin-top: 4rem;
    padding-top: 2rem;
}

/* Рекламные блоки между статьями */
.infinite-scroll-ads {
    margin: 3rem 0;
    text-align: center;
}

.infinite-scroll-ad-block {
    margin: 2rem auto;
    max-width: 100%;
}

.infinite-scroll-ad-block:first-child {
    margin-top: 0;
}

.infinite-scroll-ad-block:last-child {
    margin-bottom: 0;
}

.article-separator {
    text-align: center;
    margin: 3rem 0 2rem;
    position: relative;
}

.article-separator hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 0;
}

.article-separator .separator-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 0 1.5rem;
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dark .article-separator hr {
    border-top-color: #333;
}

.dark .article-separator .separator-text {
    background: #1a1a1a;
    color: #999;
}

/* Loader */
.infinite-scroll-loader {
    text-align: center;
    padding: 3rem 0;
}

.loader-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.infinite-scroll-loader p {
    color: #666;
    font-size: 0.95rem;
}

.dark .infinite-scroll-loader p {
    color: #999;
}

.dark .loader-spinner {
    border-color: #333;
    border-top-color: #3498db;
}

/* Сообщение о конце */
.infinite-scroll-end {
    text-align: center;
    padding: 3rem 0;
    color: #999;
    font-size: 0.95rem;
}

.infinite-scroll-end p {
    margin: 0;
}

/* Sentinel для Intersection Observer */
.infinite-scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

/* Контент статьи */
.infinite-scroll-article .article-header {
    margin-bottom: 2rem;
}

.infinite-scroll-article .article-title {
    font-size: 2rem;
    line-height: 1.3;
    margin: 0 0 1rem;
}

.infinite-scroll-article .article-title a {
    color: inherit;
    text-decoration: none;
}

.infinite-scroll-article .article-title a:hover {
    color: #3498db;
}

.infinite-scroll-article .article-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: #666;
    font-size: 0.9rem;
}

.dark .infinite-scroll-article .article-meta {
    color: #999;
}

.infinite-scroll-article .article-category a {
    color: #3498db;
    text-decoration: none;
}

.infinite-scroll-article .article-category a:hover {
    text-decoration: underline;
}

.infinite-scroll-article .article-image {
    margin: 2rem 0;
}

.infinite-scroll-article .article-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.infinite-scroll-article .article-excerpt {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 2rem;
}

.dark .infinite-scroll-article .article-excerpt {
    color: #aaa;
}

.infinite-scroll-article .article-body {
    line-height: 1.8;
}

.infinite-scroll-article .article-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.dark .infinite-scroll-article .article-tags {
    border-top-color: #333;
}

.infinite-scroll-article .article-tags .tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    margin: 0.3rem;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
}

.infinite-scroll-article .article-tags .tag:hover {
    background: #e0e0e0;
}

.dark .infinite-scroll-article .article-tags .tag {
    background: #2a2a2a;
    color: #ccc;
}

.dark .infinite-scroll-article .article-tags .tag:hover {
    background: #333;
}

/* Адаптивность */
@media (max-width: 768px) {
    .infinite-scroll-article {
        margin-top: 2rem;
        padding-top: 1rem;
    }
    
    .infinite-scroll-article .article-title {
        font-size: 1.5rem;
    }
    
    .article-separator {
        margin: 2rem 0 1rem;
    }
}


/* Infinite Scroll Preview Mode */
.article-body-wrapper--preview {
    position: relative;
    overflow: hidden;
}

.article-body-wrapper--preview .article-body {
    max-height: var(--preview-height, 300px);
    overflow: hidden;
    position: relative;
}

.article-body-wrapper--preview .article-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to bottom, 
        rgba(242, 245, 247, 0) 0%,
        rgba(242, 245, 247, 0.8) 50%,
        rgba(242, 245, 247, 1) 100%
    );
    pointer-events: none;
}

html.dark .article-body-wrapper--preview .article-body::after,
.dark .article-body-wrapper--preview .article-body::after {
    background: linear-gradient(to bottom, 
        rgba(18, 18, 18, 0) 0%,
        rgba(18, 18, 18, 0.8) 50%,
        rgba(18, 18, 18, 1) 100%
    );
}

.article-preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    z-index: 10;
}

.article-preview-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: #dff2fd;
    color: #000000 !important;
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.article-preview-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #000000 !important;
    background-color: #c9e7f9;
}

.article-preview-button svg {
    transition: transform 0.3s ease;
}

.article-preview-button:hover svg {
    transform: translateX(4px);
}

html.dark .article-preview-button,
.dark .article-preview-button {
    background-color: #374151;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

html.dark .article-preview-button:hover,
.dark .article-preview-button:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
    background-color: #4b5563;
}
