@charset "UTF-8";

/**
 * Modern Blog Details Page - Book Reading Experience
 * 
 * Purpose: Professional blog reading experience with book-like layout
 * Features:
 * - Book-style typography and spacing
 * - Smooth scroll animations
 * - Modern social sharing
 * - Related posts section
 * - 100% responsive
 * 
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   BLOG DETAILS CONTAINER
   ============================================================ */

.nx-blog-details-section {
    padding: 2rem 0 4rem;
    background: #fafafa;
    min-height: 100vh;
}

.nx-blog-details-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1200px) {
    .nx-blog-details-container {
        max-width: 1000px;
    }
}

/* ============================================================
   BLOG HEADER
   ============================================================ */

.nx-blog-details-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s ease-out;
}

.nx-blog-details-title {
    font-size: 3rem;
    font-weight: 700;
    color: #1d1d1f;
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .nx-blog-details-title {
        font-size: 2rem;
        line-height: 1.3;
    }
}

@media (max-width: 576px) {
    .nx-blog-details-title {
        font-size: 1.75rem;
    }
}

.nx-blog-details-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: #6e6e73;
}

.nx-blog-details-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.nx-blog-details-meta-item:hover {
    color: var(--bs-primary, #0d6efd);
}

.nx-blog-details-meta-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .nx-blog-details-meta {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .nx-blog-details-meta-item svg {
        width: 16px;
        height: 16px;
    }
}

/* ============================================================
   FEATURED IMAGE
   ============================================================ */

.nx-blog-details-image {
    margin: 0 0 3rem 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: fadeInUp 0.6s ease-out 0.2s both;
    position: relative;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.nx-blog-details-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: cover;
}

.nx-blog-details-image:hover img {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .nx-blog-details-image {
        border-radius: 12px;
        margin-bottom: 2rem;
    }
}

/* ============================================================
   BLOG CONTENT - BOOK READING STYLE
   ============================================================ */

.nx-blog-details-content {
    background: #ffffff;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    position: relative;
}

@media (max-width: 768px) {
    .nx-blog-details-content {
        padding: 2rem 1.5rem;
        border-radius: 12px;
    }
}

@media (max-width: 576px) {
    .nx-blog-details-content {
        padding: 1.5rem 1rem;
    }
}

/* Book-style typography - base styles for container */
/* These are fallback styles - inline styles will override them */
.nx-blog-details-content {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    font-size: 1.125rem;
    line-height: 1.9;
    color: #1d1d1f;
    letter-spacing: 0.01em;
}

/* CRITICAL: Inline styles have highest CSS specificity (1000 points) */
/* They automatically override all CSS rules - no special handling needed */
/* This selector is for documentation only */
.nx-blog-details-content *[style] {
    /* Inline styles work automatically - CSS specificity handles it */
}

/* IMPORTANT: Inline styles have the highest CSS specificity (1000 points) */
/* Any element with style="" attribute will automatically override these rules */
/* No need for !important or special handling - CSS specificity handles it */

/* Headings in content - only if no inline style */
.nx-blog-details-content h1:not([style]),
.nx-blog-details-content h2:not([style]),
.nx-blog-details-content h3:not([style]),
.nx-blog-details-content h4:not([style]),
.nx-blog-details-content h5:not([style]),
.nx-blog-details-content h6:not([style]) {
    font-weight: 700;
    color: #1d1d1f;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Headings with inline styles - preserve them */
.nx-blog-details-content h1[style],
.nx-blog-details-content h2[style],
.nx-blog-details-content h3[style],
.nx-blog-details-content h4[style],
.nx-blog-details-content h5[style],
.nx-blog-details-content h6[style] {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    /* Inline styles will override font-size, color, etc. */
}

.nx-blog-details-content h1:not([style]) {
    font-size: 2.5rem;
    margin-top: 0;
}

.nx-blog-details-content h2:not([style]) {
    font-size: 2rem;
}

.nx-blog-details-content h3:not([style]) {
    font-size: 1.75rem;
}

.nx-blog-details-content h4:not([style]) {
    font-size: 1.5rem;
}

.nx-blog-details-content h5:not([style]) {
    font-size: 1.25rem;
}

.nx-blog-details-content h6:not([style]) {
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    .nx-blog-details-content:not([style]) {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    /* Only apply to elements without inline styles */
    .nx-blog-details-content h1:not([style]) { font-size: 2rem; }
    .nx-blog-details-content h2:not([style]) { font-size: 1.75rem; }
    .nx-blog-details-content h3:not([style]) { font-size: 1.5rem; }
    .nx-blog-details-content h4:not([style]) { font-size: 1.25rem; }
    .nx-blog-details-content h5:not([style]) { font-size: 1.125rem; }
    .nx-blog-details-content h6:not([style]) { font-size: 1rem; }
}

/* Paragraphs - only apply default styles if no inline style */
.nx-blog-details-content > p:not([style]),
.nx-blog-details-content p:not([style]) {
    margin-bottom: 1.5rem;
    text-align: justify;
    hyphens: auto;
}

/* Paragraphs with inline styles - preserve ALL inline styles completely */
/* Inline styles have highest specificity (1000), so they automatically override */
.nx-blog-details-content p[style] {
    margin-bottom: 1.5rem; /* Keep spacing even with inline styles */
    /* Inline styles in the style attribute will override any inherited values */
}

/* CRITICAL: Preserve inline styles from TinyMCE */
/* Inline styles have CSS specificity of 1000 (highest) */
/* They will automatically override any CSS rules below */
/* We only set defaults for elements WITHOUT inline styles */

/* Ensure elements with inline styles are not affected by default rules */
.nx-blog-details-content *[style] {
    /* Inline styles take precedence - no CSS can override them */
    /* This selector is just for documentation - inline styles work automatically */
}

/* Links - only apply if no inline style */
.nx-blog-details-content a:not([style]) {
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    border-bottom: 1px solid rgba(13, 110, 253, 0.3);
    transition: all 0.2s ease;
}

.nx-blog-details-content a:not([style]):hover {
    color: var(--bs-primary, #0d6efd);
    border-bottom-color: var(--bs-primary, #0d6efd);
}

/* Links with inline styles - preserve them, remove default border */
.nx-blog-details-content a[style] {
    border-bottom: none;
    text-decoration: none;
    /* Inline styles in the style attribute will override any inherited values */
}

.nx-blog-details-content a[style]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Lists */
.nx-blog-details-content ul,
.nx-blog-details-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.nx-blog-details-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.nx-blog-details-content ul li {
    list-style-type: disc;
}

.nx-blog-details-content ol li {
    list-style-type: decimal;
}

/* Blockquotes */
.nx-blog-details-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    border-left: 4px solid var(--bs-primary, #0d6efd);
    background: rgba(13, 110, 253, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4a4a4f;
    position: relative;
}

.nx-blog-details-content blockquote::before {
    content: '"';
    font-size: 4rem;
    color: var(--bs-primary, #0d6efd);
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    opacity: 0.2;
    font-family: Georgia, serif;
}

/* Images in content */
.nx-blog-details-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: block;
}

/* Code blocks */
.nx-blog-details-content pre {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.nx-blog-details-content code {
    background: rgba(13, 110, 253, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--bs-primary, #0d6efd);
}

.nx-blog-details-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Tables */
.nx-blog-details-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    overflow-x: auto;
    display: block;
}

.nx-blog-details-content table thead {
    background: rgba(0, 0, 0, 0.05);
}

.nx-blog-details-content table th,
.nx-blog-details-content table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.nx-blog-details-content table th {
    font-weight: 600;
    color: #1d1d1f;
}

/* Horizontal rules */
.nx-blog-details-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 3rem 0;
}

/* ============================================================
   SOCIAL SHARING
   ============================================================ */

.nx-blog-share {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin: 3rem 0;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.nx-blog-share-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

.nx-blog-share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nx-blog-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    color: #1d1d1f;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nx-blog-share-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.nx-blog-share-btn svg,
.nx-blog-share-btn i {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.nx-blog-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: currentColor;
}

.nx-blog-share-btn:hover::before {
    opacity: 0.1;
}

.nx-blog-share-btn:hover svg,
.nx-blog-share-btn:hover i {
    transform: scale(1.1);
    color: currentColor;
}

/* Platform-specific colors */
.nx-blog-share-btn.nx-share-facebook {
    color: #1877f2;
}

.nx-blog-share-btn.nx-share-facebook:hover {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

.nx-blog-share-btn.nx-share-twitter {
    color: #1da1f2;
}

.nx-blog-share-btn.nx-share-twitter:hover {
    background: #1da1f2;
    color: #ffffff;
    border-color: #1da1f2;
}

.nx-blog-share-btn.nx-share-pinterest {
    color: #bd081c;
}

.nx-blog-share-btn.nx-share-pinterest:hover {
    background: #bd081c;
    color: #ffffff;
    border-color: #bd081c;
}

.nx-blog-share-btn.nx-share-google {
    color: #ea4335;
}

.nx-blog-share-btn.nx-share-google:hover {
    background: #ea4335;
    color: #ffffff;
    border-color: #ea4335;
}

.nx-blog-share-btn.nx-share-email {
    color: #6e6e73;
}

.nx-blog-share-btn.nx-share-email:hover {
    background: #6e6e73;
    color: #ffffff;
    border-color: #6e6e73;
}

@media (max-width: 576px) {
    .nx-blog-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nx-blog-share-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   RELATED POSTS SECTION
   ============================================================ */

.nx-blog-related-section {
    padding: 4rem 0;
    background: #ffffff;
}

.nx-blog-related-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.nx-blog-related-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1d1d1f;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .nx-blog-related-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }
}

.nx-blog-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 991px) {
    .nx-blog-related-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nx-blog-related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.nx-blog-related-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.nx-blog-related-card:nth-child(1) { animation-delay: 0.1s; }
.nx-blog-related-card:nth-child(2) { animation-delay: 0.2s; }
.nx-blog-related-card:nth-child(3) { animation-delay: 0.3s; }
.nx-blog-related-card:nth-child(n+4) { animation-delay: 0.4s; }

.nx-blog-related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    border-color: rgba(13, 110, 253, 0.2);
}

.nx-blog-related-image {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
}

.nx-blog-related-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nx-blog-related-card:hover .nx-blog-related-image img {
    transform: scale(1.1);
}

.nx-blog-related-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nx-blog-related-title-link {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1d1d1f;
    text-decoration: none;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.nx-blog-related-title-link:hover {
    color: var(--bs-primary, #0d6efd);
}

.nx-blog-related-excerpt {
    font-size: 0.9375rem;
    color: #6e6e73;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nx-blog-related-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--bs-primary, #0d6efd);
    text-decoration: none;
    transition: all 0.2s ease;
    margin-top: auto;
}

.nx-blog-related-read-more:hover {
    gap: 0.75rem;
}

.nx-blog-related-read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.nx-blog-related-read-more:hover svg {
    transform: translateX(4px);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Reading progress indicator */
.nx-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--bs-primary, #0d6efd), #6366f1);
    z-index: 9999;
    transition: width 0.1s ease;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 576px) {
    .nx-blog-details-section {
        padding: 1.5rem 0 3rem;
    }
    
    .nx-blog-details-container {
        padding: 0 1rem;
    }
}

/* Print styles */
@media print {
    .nx-blog-share,
    .nx-blog-related-section {
        display: none;
    }
    
    .nx-blog-details-content {
        box-shadow: none;
        padding: 0;
    }
}
