/* =========================================
   Glass Connect - Blog Styles
   ========================================= */

/* Blog Hero */
.blog-hero {
    padding: 140px 0 60px;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
    text-align: center;
}

.blog-hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 6vw, 56px);
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.1;
}

.blog-hero .highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-hero-desc {
    font-size: 18px;
    color: var(--text-light-secondary);
    line-height: 1.6;
}

/* Blog Filters */
.blog-filters {
    padding: 30px 0;
    background: var(--bg-light);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 70px;
    z-index: 90;
}

.blog-filters .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filters-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.search-wrapper {
    position: relative;
    min-width: 280px;
}

.blog-search {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 25px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.blog-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 138, 255, 0.1);
}

.search-wrapper svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light-muted);
}

/* Blog Grid Section */
.blog-grid-section {
    padding: 60px 0;
    background: var(--bg-light);
    min-height: 60vh;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* Blog Card */
.blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-content {
    padding: 24px;
}

.blog-card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-dark-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-light-muted);
}

.blog-card-read-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Loading & Empty States */
.blog-loading,
.blog-empty,
.blog-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-dark-secondary);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(22, 138, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.blog-empty svg,
.blog-error svg {
    color: var(--text-light-muted);
    margin-bottom: 20px;
}

.blog-empty h3,
.blog-error h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-number:hover,
.page-number.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-dots {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light-muted);
}

/* Newsletter */
.blog-newsletter {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-secondary) 100%);
}

.newsletter-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.newsletter-text h2 {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 10px;
}

.newsletter-text p {
    color: var(--text-light-secondary);
    font-size: 16px;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    flex: 1;
    max-width: 500px;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 15px;
}

.newsletter-form input::placeholder {
    color: var(--text-light-muted);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary);
}

/* =========================================
   Article Page Styles
   ========================================= */

/* Breadcrumb */
.article-breadcrumb {
    padding: 100px 0 20px;
    background: var(--bg-dark);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light-muted);
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    color: var(--text-light-muted);
}

.breadcrumb-list a {
    color: var(--text-light-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-list a:hover {
    color: var(--primary);
}

/* Article Hero */
.article-hero {
    padding: 40px 0 60px;
    background: var(--bg-dark);
}

.article-hero-content {
    max-width: 800px;
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.article-category {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    text-decoration: none;
}

.article-read-time {
    color: var(--text-light-muted);
    font-size: 14px;
}

.article-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-excerpt {
    font-size: 18px;
    color: var(--text-light-secondary);
    line-height: 1.6;
    margin-bottom: 30px;
}

.article-author-date {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    color: var(--text-light);
    font-weight: 600;
    font-size: 15px;
}

.author-role {
    color: var(--text-light-muted);
    font-size: 13px;
}

.article-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light-secondary);
    font-size: 14px;
}

/* Featured Image */
.article-featured-image {
    background: var(--bg-dark);
    padding-bottom: 40px;
}

.article-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
}

/* Article Body */
.article-body {
    padding: 60px 0;
    background: var(--bg-light);
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    align-items: start;
}

/* Article Content */
.article-content {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.article-content h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 40px 0 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.article-content h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.article-content h3 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 30px 0 15px;
}

.article-content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark-secondary);
    margin-bottom: 20px;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
}

.article-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.article-content li {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark-secondary);
    margin-bottom: 10px;
}

.article-content blockquote {
    margin: 30px 0;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(22, 138, 255, 0.05) 0%, rgba(22, 138, 255, 0.02) 100%);
    border-left: 4px solid var(--primary);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--text-dark);
}

.article-content pre {
    margin: 25px 0;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: 12px;
    overflow-x: auto;
}

.article-content code {
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 14px;
    color: var(--text-light);
}

.article-content p code {
    background: rgba(22, 138, 255, 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
}

.article-content table {
    width: 100%;
    margin: 25px 0;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
}

.article-content th,
.article-content td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.article-content th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.article-content hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: white;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.sidebar-widget h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

/* TOC */
.toc-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-nav li {
    margin-bottom: 10px;
}

.toc-nav li.toc-sub {
    padding-left: 15px;
}

.toc-nav a {
    color: var(--text-dark-secondary);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.5;
    transition: color 0.2s;
    display: block;
}

.toc-nav a:hover {
    color: var(--primary);
}

/* Share */
.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: white;
    transition: transform 0.2s, opacity 0.2s;
}

.share-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.share-btn.linkedin { background: #0077B5; }
.share-btn.facebook { background: #1877F2; }
.share-btn.twitter { background: #000000; }
.share-btn.copy { 
    background: var(--bg-light); 
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.cta-widget h3 {
    color: white;
}

.cta-widget p {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.btn-cta-small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    color: var(--primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
}

.btn-cta-small:hover {
    transform: scale(1.02);
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    padding: 6px 14px;
    background: var(--bg-light);
    color: var(--text-dark-secondary);
    font-size: 13px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--primary);
    color: white;
}

/* Author Bio */
.article-footer {
    padding: 0;
    background: var(--bg-light);
}

.author-bio {
    display: flex;
    gap: 25px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 40px;
}

.author-bio-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 24px;
    flex-shrink: 0;
}

.author-bio-content h3 {
    font-family: var(--font-display);
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.author-bio-content p {
    font-size: 15px;
    color: var(--text-dark-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.author-link {
    color: var(--primary);
    font-weight: 500;
    text-decoration: none;
}

.author-link:hover {
    text-decoration: underline;
}

/* Article Navigation */
.article-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-nav-link {
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.article-nav-link.next {
    text-align: right;
    align-items: flex-end;
}

.nav-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light-muted);
    margin-bottom: 8px;
}

.nav-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

/* Related Articles */
.related-articles {
    padding: 60px 0;
    background: var(--bg-light);
}

.related-articles h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.related-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.related-card a {
    text-decoration: none;
    color: inherit;
}

.related-card-image {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.related-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 15px;
    text-transform: uppercase;
}

.related-card h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    padding: 20px 20px 10px;
    line-height: 1.4;
}

.related-card p {
    font-size: 14px;
    color: var(--text-dark-secondary);
    padding: 0 20px 20px;
    line-height: 1.5;
}

/* Article Loading/Error */
.article-loading,
.article-error {
    text-align: center;
    padding: 60px 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .article-layout {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: relative;
        top: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 40px;
    }
    
    .blog-filters .container {
        flex-direction: column;
    }
    
    .filters-wrapper {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
    }
    
    .search-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 100%;
    }
    
    .article-sidebar {
        grid-template-columns: 1fr;
    }
    
    .article-content {
        padding: 25px;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    .article-navigation {
        grid-template-columns: 1fr;
    }
    
    .article-nav-link.next {
        text-align: left;
        align-items: flex-start;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-numbers {
        display: none;
    }
}
