/* ===========================================
   Nafanesia Blog Styles
   =========================================== */

/* Blog Variables */
:root {
    --blog-content-width: 800px;
    --blog-sidebar-width: 280px;
}

/* ===========================================
   Blog Layout
   =========================================== */

.blog-header {
    padding: 120px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--background) 0%, #1a1a1c 100%);
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(248, 181, 34, 0.05) 0%, transparent 50%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.blog-header-content {
    position: relative;
    z-index: 1;
}

.blog-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary), #fff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* ===========================================
   Search & Filters
   =========================================== */

.blog-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(248, 181, 34, 0.2);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results-count {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1rem;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.lang-btn.active {
    background: var(--primary);
    color: #000;
}

.lang-btn:hover:not(.active) {
    color: var(--primary);
}

/* Category & Tag Filters */
.filter-section {
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-btn {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

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

/* ===========================================
   Blog Grid
   =========================================== */

.blog-section {
    padding: var(--spacing-lg) 0;
    min-height: 50vh;
}

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

/* Article Card */
.article-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(248, 181, 34, 0.1);
}

.article-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-thumbnail img {
    transform: scale(1.1);
}

.article-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 4px 12px;
    background: rgba(248, 181, 34, 0.9);
    color: #000;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 50px;
}

.article-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.article-card:hover .article-title {
    color: var(--primary);
}

.article-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tag {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

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

/* Featured Article */
.article-card.featured {
    grid-column: span 2;
}

.article-card.featured .article-thumbnail {
    height: 300px;
}

.article-card.featured .article-title {
    font-size: 1.75rem;
}

/* ===========================================
   Pagination
   =========================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===========================================
   Article Detail Page
   =========================================== */

.article-header {
    padding: 140px 0 60px;
    text-align: center;
    background: linear-gradient(135deg, var(--background) 0%, #1a1a1c 100%);
}

.article-header-content {
    max-width: var(--blog-content-width);
    margin: 0 auto;
}

.breadcrumb {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

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

.breadcrumb-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

.article-header h1 {
    font-size: 2.75rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.article-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.article-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-featured-image {
    width: 100%;
    max-width: 1000px;
    margin: -30px auto 0;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Article Body */
.article-body {
    display: grid;
    grid-template-columns: 1fr min(var(--blog-content-width), 100%) 1fr;
    padding: var(--spacing-lg) 1rem;
}

.article-body>* {
    grid-column: 2;
}

/* Article Content Typography */
.article-prose {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.article-prose h2 {
    font-size: 1.75rem;
    color: var(--text);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.article-prose h3 {
    font-size: 1.4rem;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.article-prose h4 {
    font-size: 1.2rem;
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.article-prose p {
    margin-bottom: 1.5rem;
}

.article-prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-prose a:hover {
    color: var(--secondary);
}

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

.article-prose em {
    font-style: italic;
}

.article-prose ul,
.article-prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-prose li {
    margin-bottom: 0.5rem;
}

.article-prose ul li {
    list-style-type: disc;
}

.article-prose ol li {
    list-style-type: decimal;
}

.article-prose blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: rgba(248, 181, 34, 0.05);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
}

.article-prose blockquote p:last-child {
    margin-bottom: 0;
}

.article-prose code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.article-prose pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #1a1a1c;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-prose pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 2rem 0;
}

.article-prose table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.article-prose th,
.article-prose td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.article-prose th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-weight: 600;
}

.article-prose hr {
    margin: 3rem 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Table of Contents */
.toc {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.toc-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.5rem;
}

.toc-list a {
    color: var(--text-muted);
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: block;
    padding: 4px 0;
}

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

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

.toc-list .toc-h4 {
    padding-left: 2rem;
    font-size: 0.85rem;
}

/* Share Buttons */
.share-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.share-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

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

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
}

.share-btn.whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
}

.share-btn.twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.share-btn.linkedin:hover {
    background: #0077B5;
    border-color: #0077B5;
}

/* Related Articles */
.related-section {
    padding: var(--spacing-lg) 0;
    background: rgba(255, 255, 255, 0.02);
}

.related-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ===========================================
   Empty State
   =========================================== */

.empty-state {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* ===========================================
   Loading State
   =========================================== */

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===========================================
   Responsive
   =========================================== */

@media (max-width: 992px) {
    .article-card.featured {
        grid-column: span 1;
    }

    .article-card.featured .article-thumbnail {
        height: 200px;
    }

    .article-card.featured .article-title {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .blog-header h1 {
        font-size: 2rem;
    }

    .blog-header p {
        font-size: 1rem;
    }

    .blog-controls {
        flex-direction: column;
    }

    .search-container {
        max-width: 100%;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }

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

    .article-prose {
        font-size: 1rem;
    }

    .article-prose h2 {
        font-size: 1.5rem;
    }

    .article-prose h3 {
        font-size: 1.25rem;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        justify-content: center;
    }
}

/* ===========================================
   AMP Specific Overrides (for inline CSS)
   =========================================== */

.amp-article img {
    max-width: 100%;
    height: auto;
}

.amp-article .article-prose {
    word-wrap: break-word;
    overflow-wrap: break-word;
}