/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-cyan), var(--brand-pink));
    z-index: 1000;
    transform-origin: 0 50%;
}

/* Article Layout */
.article-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 4rem;
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    position: relative;
}

.article-wrapper {
    max-width: 800px;
}

/* Article Header */
.article-header {
    text-align: center;
    margin-bottom: 4rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-primary); /* Matches CTA button base color */
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-gray-50);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.article-meta-item:hover {
    background: var(--bg-gray-100);
}

.article-meta i {
    color: var(--brand-primary);
}

/* Article Content */
.article-content {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-primary);
}

/* Article highlights and special styles */
.article-highlight {
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-primary) 100%);
}

.article-callout {
    border-left: 4px solid var(--brand-pink);
}

.premium-article::before {
    background: var(--brand-purple);
}

.article-rating .stars {
    color: var(--brand-orange);
}

.article-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 2.5rem 0 1rem;
    position: relative;
    padding-bottom: 1rem;
}

.article-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-primary);
    border-radius: 2px;
}

.article-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--brand-primary);
    margin: 2rem 0 1rem;
}

.article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
    margin: 2rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    position: relative;
    padding-left: 0.5rem;
}

.article-content li::marker {
    color: var(--brand-primary);
}

/* Enhanced Blockquotes */
blockquote {
    border-left: 4px solid var(--brand-pink);
    background: rgba(255, 77, 152, 0.05);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

/* Enhanced Info Boxes */
.info-box {
    border-left: 4px solid var(--brand-cyan);
    background: rgba(22, 196, 234, 0.05);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.warning-box {
    border-left: 4px solid var(--brand-orange);
    background: rgba(255, 166, 71, 0.05);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

/* Table of Contents Styles */
.article-toc {
    position: sticky;
    top: 2rem;
    background: var(--bg-gray-50);
    border-radius: 12px;
    padding: 1.5rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.toc-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.toc-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toc-item {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toc-item:hover {
    color: var(--brand-pink);
    background: var(--bg-gray-100);
}

.toc-item.active {
    color: var(--brand-cyan);
    background: var(--bg-gray-100);
    font-weight: 500;
    border-left: 2px solid var(--brand-cyan);
    padding-left: calc(0.5rem - 2px);
}

/* TOC hierarchy styling */
.toc-h2 {
    font-weight: 500;
}

.toc-h3 {
    padding-left: 1.5rem;
    font-size: 0.9rem;
}

/* Article Footer */
.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-gray-50);
    color: var(--text-secondary);
    border-radius: 24px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tag:hover {
    background: var(--brand-primary);
    color: white;
    transform: translateY(-2px);
}

.article-tag:nth-child(4n+1):hover {
    background: var(--brand-cyan);
}
.article-tag:nth-child(4n+2):hover {
    background: var(--brand-pink);
}
.article-tag:nth-child(4n+3):hover {
    background: var(--brand-orange);
}
.article-tag:nth-child(4n+4):hover {
    background: var(--brand-purple);
}

.article-tag i {
    font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .article-container {
        grid-template-columns: 1fr;
    }

    .article-toc {
        display: none; /* Hide TOC on mobile */
    }
}

@media (max-width: 768px) {
    .article-container {
        margin: 2rem auto;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .article-content {
        font-size: 1.1rem;
    }

    .article-content h2 {
        font-size: 1.75rem;
    }

    .article-content h3 {
        font-size: 1.35rem;
    }
}

/* Print styles */
@media print {
    .article-toc {
        display: none;
    }

    .article-container {
        display: block;
        margin: 0;
        padding: 0;
    }

    .article-content {
        font-size: 12pt;
    }

    .article-tags,
    .article-meta {
        display: none;
    }
}

/* CTA Section Styles */
.content-cta {
    margin: 6rem auto;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, var(--brand-primary) 0%, #1d4ed8 100%);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    text-align: center;
    isolation: isolate;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(29, 78, 216, 0.25);
    max-width: 1200px;
}

.content-cta::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    animation: shimmer 8s linear infinite;
    z-index: 0;
}

.content-cta::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(
        circle at 2px 2px,
        rgba(255, 255, 255, 0.1) 1px,
        transparent 0
    );
    background-size: 24px 24px;
    animation: float 15s linear infinite;
    z-index: 1;
    opacity: 0.5;
}

.content-cta-inner {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.content-cta-icon {
    width: 140px;
    height: 140px;
    margin: 0 auto 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    transform: rotate(-5deg);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.content-cta-icon::before {
    content: '';
    position: absolute;
    inset: -10px;
    background: radial-gradient(
        circle at center,
        rgba(255, 255, 255, 0.2) 0%,
        transparent 70%
    );
    border-radius: inherit;
    z-index: -1;
    animation: pulse 2s ease-in-out infinite;
}

.content-cta-icon::after {
    content: '✨';
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.content-cta:hover .content-cta-icon {
    transform: rotate(0deg) scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.content-cta h2 {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    text-fill-color: #FFFFFF !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

/* Add explicit !important override for any h2 within content-cta */
.content-cta h2,
.content-cta h2 * {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    text-fill-color: #FFFFFF !important;
}

.content-cta p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.4rem;
    margin-bottom: 3rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.content-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: white;
    color: var(--brand-primary);
    padding: 1.5rem 3rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.content-cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    background: #f8fafc;
}

.content-cta-btn:hover::before {
    transform: translateX(100%);
}

.content-cta-decoration {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    opacity: 0.2;
    pointer-events: none;
}

.content-cta-decoration:nth-child(1) {
    top: 20%;
    left: 10%;
    animation: float 4s ease-in-out infinite;
}

.content-cta-decoration:nth-child(2) {
    top: 60%;
    right: 15%;
    animation: float 6s ease-in-out infinite reverse;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Explicit CTA Text Color Override */
.article-container .content-cta h2,
.article-container .content-cta h2 *,
.content-cta h2,
.content-cta h2 *,
h2.content-cta-heading,
.article-wrapper .content-cta h2 {
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    text-fill-color: #FFFFFF !important;
    background: none !important;
    background-image: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    position: relative;
    z-index: 10;
}

/* Ensure no background effects are interfering */
.content-cta {
    position: relative;
    isolation: isolate;
}

.content-cta::before,
.content-cta::after {
    z-index: 1;
}

.content-cta-inner {
    position: relative;
    z-index: 2;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .content-cta {
        margin: 2rem 0;
        padding: 2rem 1rem;
        border-radius: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .content-cta-inner {
        padding: 0;
        width: 100%;
    }

    .content-cta h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
        padding: 0;
        width: 100%;
        word-wrap: break-word;
    }

    .content-cta p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0;
        line-height: 1.4;
    }

    .content-cta-icon {
        width: 80px;
        height: 80px;
        font-size: 2rem;
        border-radius: 20px;
        margin-bottom: 1rem;
    }

    .content-cta-btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        width: auto;
        min-width: 200px;
        max-width: 100%;
    }

    .content-cta-decoration {
        width: 8px;
        height: 8px;
    }

    .article-container {
        width: 100%;
        max-width: 100%;
        padding: 0 1rem;
        box-sizing: border-box;
        margin: 1rem auto;
    }

    .article-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 0;
    }

    .article-content {
        margin-bottom: 2rem;
    }

    .article-footer {
        margin-bottom: 2rem;
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .content-cta {
        margin: 1.5rem 0;
        padding: 1.5rem 1rem;
    }

    .content-cta h2 {
        font-size: 1.5rem;
    }

    .content-cta p {
        font-size: 0.95rem;
    }

    .content-cta-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .content-cta-btn {
        padding: 0.75rem 1.25rem;
        min-width: 160px;
    }
}