/* blog.css */

/* --- Blog Index Styles --- */
.blog-hero {
    padding: 8rem 0 4rem;
    text-align: center;
    background-color: transparent;
    position: relative;
    overflow: hidden;
}

.blog-eyebrow {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: #3b82f6;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
    color: #ffffff;
}

.blog-hero .section-subtitle {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    color: #a1a1aa;
    line-height: 1.6;
}

.blog-content {
    padding-top: 0;
}

.blog-search-container {
    max-width: 600px;
    margin: -2rem auto 3rem;
    position: relative;
    z-index: 10;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border-radius: 0.5rem;
    background-color: #0F1115;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-search-container:focus-within {
    border-color: #2563EB;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.2);
}

.blog-search-icon {
    color: #a1a1aa;
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
}

.blog-search-input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
    outline: none;
    padding: 0.5rem 0;
}

.blog-search-input::placeholder {
    color: #71717a;
}

/* Category Filter */
.blog-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.category-btn {
    background-color: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #d4d4d8;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-btn:hover {
    background-color: #27272a;
    color: #ffffff;
}

.category-btn.active {
    background-color: #2563EB;
    border-color: #2563EB;
    color: #ffffff;
}

/* Featured Article Layout */
.featured-article {
    margin-bottom: 4rem;
    background-color: #0F1115;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.featured-article:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.featured-article-card {
    display: flex;
    flex-direction: column;
}

.featured-image-wrapper {
    width: 100%;
    aspect-ratio: 16/10;
    height: auto;
    position: relative;
    overflow: hidden;
}

.featured-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-article:hover .featured-image-wrapper img {
    transform: scale(1.05);
}

.featured-content {
    padding: 2rem;
    position: relative;
}

.featured-content .article-category-badge {
    position: relative;
    top: auto; left: auto;
    display: inline-block;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.featured-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-title a:hover {
    color: #3b82f6;
}

.featured-excerpt {
    color: #a1a1aa;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .featured-article-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    .featured-image-wrapper {
        height: auto;
        min-height: auto;
    }
    .featured-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
    }
}

/* Article Grid */
.article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 1rem;
    display: none;
}

.no-results i {
    width: 48px;
    height: 48px;
    color: #a1a1aa;
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.no-results p {
    color: #71717a;
}

/* Article Card Components */
.article-card {
    background-color: #0F1115;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
}

.article-card-image-link {
    display: block;
    width: 100%;
    overflow: hidden;
}

.article-card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #18181b;
}

.article-card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.article-category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(15, 17, 21, 0.8);
    backdrop-filter: blur(4px);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 2;
}

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

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #a1a1aa;
    margin-bottom: 0.75rem;
}

.meta-separator {
    color: #3f3f46;
}

.article-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.article-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #3b82f6;
}

.article-excerpt {
    color: #a1a1aa;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.article-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
}

.article-read-more i {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.article-read-more:hover {
    color: #60a5fa;
    gap: 0.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0F1115;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #27272a;
    color: #ffffff;
    border-color: rgba(255,255,255,0.1);
}

.pagination-btn.active {
    background-color: #2563EB;
    color: #ffffff;
    border-color: #2563EB;
}

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

/* Breadcrumb Styles */
.breadcrumb-container {
    padding-top: 8rem;
    margin-bottom: 1rem;
}

.breadcrumb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.875rem;
    color: #a1a1aa;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: #a1a1aa;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #3b82f6;
}

.breadcrumb-item.active {
    color: #ffffff;
    font-weight: 500;
}

.breadcrumb-item .breadcrumb-separator {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

/* --- Article Page Styles --- */
.article-header {
    padding: 2rem 0 3rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.article-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin: 1rem 0;
    line-height: 1.2;
}

.article-header .article-meta {
    justify-content: center;
    margin-top: 1.5rem;
    font-size: 1rem;
}

.article-featured-image {
    max-width: 1000px;
    margin: 0 auto 4rem;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-body-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 1100px;
    margin: 0 auto 5rem;
    padding: 0 1.5rem;
}

@media (min-width: 1024px) {
    .article-body-wrapper {
        grid-template-columns: 1fr 300px;
        gap: 4rem;
    }
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #d4d4d8;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    color: #ffffff;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
}

.article-content h2 { font-size: 2rem; }
.article-content h3 { font-size: 1.5rem; }

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

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

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

.article-content blockquote {
    border-left: 4px solid #2563EB;
    padding-left: 1.5rem;
    font-style: italic;
    color: #a1a1aa;
    margin: 2rem 0;
    background: rgba(37, 99, 235, 0.05);
    padding: 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

/* TOC / Sidebar */
.article-sidebar {
    position: relative;
}

.toc-container {
    background-color: #0F1115;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1.5rem;
    position: sticky;
    top: 6rem;
}

.toc-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-toggle-btn {
    background: none;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    display: none;
}

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

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

.toc-list li:last-child {
    margin-bottom: 0;
}

.toc-list a {
    color: #a1a1aa;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
    display: block;
    line-height: 1.5;
}

.toc-list a:hover,
.toc-list a.active {
    color: #3b82f6;
}

@media (max-width: 1023px) {
    .toc-container {
        position: relative;
        top: 0;
    }
    .toc-toggle-btn {
        display: block;
    }
    .toc-list {
        display: none;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    .toc-list.show {
        display: block;
    }
}

/* Responsive Table & Content Wrapping in Articles */
.article-content table {
    width: 100%;
    max-width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 2rem 0;
    border-collapse: collapse;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
}

.article-content th,
.article-content td {
    padding: 0.85rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: left;
    vertical-align: top;
    font-size: 0.95rem;
    line-height: 1.6;
}

.article-content th {
    background-color: rgba(37, 99, 235, 0.15);
    color: #ffffff;
    font-weight: 600;
    white-space: nowrap;
}

.article-content tr:nth-child(even) td {
    background-color: rgba(255, 255, 255, 0.02);
}

.article-content tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
}

.article-container {
    overflow: hidden;
}

