/* Single Post Page Styles */
/* Extracted from single.php to improve performance and maintainability */

/* Ensure sticky title works on all devices including mobile */
#sticky-title-container {
    position: -webkit-sticky !important;
    position: sticky !important;
    z-index: 50 !important;
    background-color: white !important;
    transition: all 0.3s ease !important;
}

/* Mobile sticky - stick to top of viewport */
@media (max-width: 1023px) {
    #sticky-title-container {
        top: 0 !important;
    }
}

.sticky-post-title {
    font-size: 35px !important;
    /* Safe default for mobile and fallback */
    line-height: 1.2 !important;
    transition: all 0.3s ease !important;
}

/* Default state for Desktop: 56px */
@media (min-width: 1024px) {
    body:not(.article-title-stuck) .sticky-post-title {
        font-size: 56px !important;
    }
}

.sticky-post-title:hover {
    color: #d31c29 !important;
}

@media (max-width: 1023px) {

    /* Center the title on mobile when stuck */
    body.article-title-stuck .mobile-center-stuck {
        text-align: center !important;
        font-size: 24px !important;
        /* Slightly smaller for mobile sticky */
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Center all ads on mobile */
    .simplified-ad-banner,
    .simplified-ad-banner *,
    .ad-banner,
    .ad-banner * {
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center !important;
    }
}

/* Special styling for stuck state: 35px specifically when stuck on desktop */
body.article-title-stuck .sticky-post-title {
    font-size: 35px !important;
    line-height: 1.1 !important;
}

/* Ensure container looks good when stuck */
body.article-title-stuck #sticky-title-container .container {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

/* Share Count Display Styles */
.share-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-right: 1rem;
}

.share-count-number {
    font-size: 1.25rem;
    font-weight: 900;
    color: #374151;
    line-height: 1;
}

.share-count-text {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.025em;
}

.share-count-number.updating {
    animation: pulse 0.7s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Social share buttons styling moved to assets/css/social-share.css for consistency */

/* Sticky Social Share Bar (Desktop Only) */
.sticky-social-share {
    position: -webkit-sticky;
    /* For Safari */
    position: sticky;
    top: 9rem;
    z-index: 10;
    background-color: transparent;
    padding: 0.75rem;
    border-radius: 0;
    box-shadow: none;
    align-self: flex-start;
    max-height: calc(100vh - 128px);
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

.sticky-social-share.visible {
    opacity: 1;
    pointer-events: auto;
}

.sticky-social-share .share-count {
    margin-right: 0;
}

.sticky-social-share .share-count-number {
    font-size: 0.875rem !important;
    line-height: 1.2 !important;
}

.sticky-social-share .share-count-text {
    font-size: 0.625rem !important;
    line-height: 1.2 !important;
}

.sticky-social-share .social-share-btn {
    width: 2.5rem !important;
    height: 2.5rem !important;
    transition: transform 0.2s ease !important;
}

.sticky-social-share .social-share-btn:hover {
    transform: scale(1.1) !important;
}

.sticky-social-share .social-share-btn svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
}

/* Hide on mobile devices */
@media (max-width: 1023px) {
    .sticky-social-share {
        display: none !important;
    }
}

/* Related News Section Styling */
.related-title {
    font-family: 'Mukta', sans-serif !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    color: #111827 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.3s ease !important;
}

.related-title:hover {
    color: #d31c29 !important;
}

.line-clamp-3 {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.related-news-card {
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.related-news-card:hover {
    transform: translateY(-2px) !important;
}

.related-news-card img {
    transition: transform 0.3s ease !important;
}

.related-news-card:hover img {
    transform: scale(1.05) !important;
}

/* Read Also Section Styling */
.readalso-title {
    font-family: 'Mukta', sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    color: #111827 !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.3s ease !important;
}

.readalso-title:hover {
    color: #d31c29 !important;
}

/* Ensure consistent image sizes in Read Also section */
.read-also-image {
    width: 110px !important;
    height: 75px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
}

.read-also-placeholder {
    width: 110px !important;
    height: 75px !important;
    flex-shrink: 0 !important;
    border-radius: 4px !important;
    background-color: #e5e7eb !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.separator {
    display: none;
}

.meta-info-bar .separator {
    display: block;
    width: 1px;
    height: 1.25rem;
    background: #e5e7eb;
    margin: 0 0.5rem;
}

@media (max-width: 640px) {
    .separator {
        display: none;
    }

    .np-reactions {
        padding: 1rem !important;
        /* Reduced from p-6 */
        margin-top: 1.5rem !important;
    }

    .np-reactions .font-semibold.text-lg {
        font-size: 1rem !important;
        /* Smaller text for question */
        margin-bottom: 0.75rem !important;
    }

    .np-reactions .flex.flex-wrap.justify-center.gap-6 {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        /* Allow wrapping instead of scrolling if needed */
        justify-content: center !important;
        gap: 0.5rem !important;
        /* Reduced gap */
        align-items: center !important;
        overflow-x: hidden !important;
        /* Remove horizontal scroll */
    }

    .np-reaction-btn {
        min-width: 65px !important;
        /* Smaller min-width */
        flex: 0 0 auto !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.4rem 0.2rem !important;
        border-radius: 0.5rem !important;
    }

    .np-reaction-btn span.text-4xl {
        font-size: 1.5rem !important;
        /* Smaller emojis */
        margin: 0 0 0.125rem 0 !important;
    }

    .np-reaction-btn span.np-reaction-count {
        font-size: 0.75rem !important;
        /* Smaller count */
    }

    .np-reaction-btn span.text-gray-700,
    .np-reaction-btn span.text-red-600 {
        font-size: 0.7rem !important;
        /* Smaller labels */
        margin: 0 !important;
    }

    /* Author box mobile styles: row layout, smaller avatar */
    .author-box-mobile {
        flex-direction: row !important;
        align-items: center !important;
        text-align: left !important;
        gap: 0.75rem !important;
    }

    .author-box-mobile .flex.items-center.gap-4.flex-1 {
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .author-box-mobile img {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 0 !important;
    }

    .author-box-mobile .flex.gap-3 {
        justify-content: flex-start !important;
    }

    .author-box-mobile .flex-1>div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
}

/* News Summary v2 (High-Fidelity) */
.news-summary-v2 {
    border-color: #d31c29 !important;
}

.summary-list-v2 {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.summary-list-v2 li {
    position: relative !important;
    padding: 0.75rem 0 0.75rem 1.5rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    color: #374151 !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
}

.summary-list-v2 li:last-child {
    border-bottom: none !important;
}

.summary-list-v2 li::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 1.25rem !important;
    width: 8px !important;
    height: 8px !important;
    background-color: #d31c29 !important;
    border-radius: 50% !important;
}

@media (max-width: 640px) {
    .summary-list-v2 li {
        font-size: 1rem !important;
    }
}