/* Blog-specific styles for genclic */

/* Blog Layout */
.blog-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 60px 0;
}

@media (min-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr 280px;
        padding: 80px 0;
    }
}

/* Blog Header */
.blog-header {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border-muted);
}

.blog-header h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 12px;
}

.blog-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
}

/* Blog Main Content */
.blog-main {
    min-width: 0; /* Prevents grid overflow */
}

/* Article Grid */
.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Article Card */
.article-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: all 150ms ease-out;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-card h2 {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    margin: 0 0 12px;
}

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

.article-card h2 a:hover {
    color: var(--accent);
}

.article-card-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.article-card-image {
    display: block;
    width: 100%;
    margin: 0 0 20px;
    border-radius: 8px;
    overflow: hidden;
}

.article-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 200ms ease-out;
}

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

.article-card-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 150ms ease-out;
}

.article-tag:hover {
    background: #2563eb;
    color: white;
}

/* Blog Sidebar */
.blog-sidebar {
    /* Removed sticky positioning to allow full page scroll */
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Archive List */
.archive-list {
    list-style: none;
}

.archive-year {
    margin-bottom: 16px;
}

.archive-year-label {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 8px;
    display: block;
}

.archive-months {
    list-style: none;
    padding-left: 12px;
}

.archive-month {
    margin-bottom: 6px;
}

.archive-month a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 150ms ease-out;
}

.archive-month a:hover {
    color: var(--accent);
}

.archive-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Categories List */
.categories-list {
    list-style: none;
}

.category-item {
    margin-bottom: 8px;
}

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 150ms ease-out;
}

.category-item a:hover {
    background: var(--accent-muted);
    color: var(--accent);
}

.category-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

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

.tag-cloud-item {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-surface);
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 150ms ease-out;
}

.tag-cloud-item:hover {
    background: var(--accent-muted);
    color: var(--accent);
}

.tag-cloud-item.size-sm {
    font-size: 0.8125rem;
}

.tag-cloud-item.size-lg {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-muted);
}

.pagination button,
.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 150ms ease-out;
    cursor: pointer;
}

.pagination button:hover,
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-muted);
}

.pagination .active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Breadcrumb Navigation */
.breadcrumb {
    padding: 16px 0;
    margin-bottom: 0;
}

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

.breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--border);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 150ms ease-out;
}

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

.breadcrumb li[aria-current="page"] {
    color: var(--text);
    font-weight: 500;
}

/* Article Single Page */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.article-header {
    padding: 60px 0 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-muted);
    margin-bottom: 40px;
}

.article-category-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 20px;
    transition: all 150ms ease-out;
}

.article-category-link:hover {
    background: var(--accent);
    color: white;
}

.article-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

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

.article-meta-item svg {
    width: 16px;
    height: 16px;
}

.article-meta-item::after {
    content: '•';
    margin-left: 16px;
    color: var(--border);
}

.article-meta-item:last-child::after {
    content: none;
}

/* Article Featured Image */
.article-featured-image {
    margin: 40px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

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

/* Article Content */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-secondary);
    margin-bottom: 60px;
}

.article-content h2 {
    font-size: 1.75rem;
    margin-top: 48px;
    margin-bottom: 20px;
    color: var(--text);
}

.article-content h3 {
    font-size: 1.375rem;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--text);
}

.article-content h4 {
    font-size: 1.125rem;
    margin-top: 32px;
    margin-bottom: 12px;
    color: var(--text);
}

.article-content p {
    margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 24px;
    padding-left: 28px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-muted);
    transition: border-color 150ms ease-out;
}

.article-content a:hover {
    border-bottom-color: var(--accent);
}

.article-content code {
    padding: 2px 6px;
    background: var(--bg-surface);
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
}

.article-content pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.article-content pre code {
    background: none;
    padding: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 32px 0;
    display: block;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    font-size: 0.9375rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.article-content thead {
    background: var(--bg-elevated);
}

.article-content th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--border);
}

.article-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-muted);
    color: var(--text-secondary);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content tbody tr:hover {
    background: var(--bg-elevated);
}

/* Article Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 32px 0;
    border-top: 1px solid var(--border-muted);
    border-bottom: 1px solid var(--border-muted);
    margin-bottom: 60px;
}

.article-tags-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 8px;
}

/* Article Navigation */
.article-nav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 60px;
}

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

.article-nav-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: all 150ms ease-out;
}

.article-nav-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.article-nav-item.next {
    text-align: right;
}

.article-nav-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.article-nav-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

/* Related Articles */
.related-articles {
    padding: 60px 0;
}

.related-articles h2 {
    font-size: 1.75rem;
    margin-bottom: 32px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 100px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-state p {
    color: var(--text-muted);
}

/* Search Box (optional future feature) */
.blog-search {
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text);
    transition: all 150ms ease-out;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elevated);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .blog-sidebar {
        position: static;
    }

    .sidebar-section {
        margin-bottom: 16px;
    }
}

@media (max-width: 767px) {
    .article-header {
        padding: 40px 0 30px;
        text-align: left;
    }

    .article-meta {
        justify-content: flex-start;
    }

    .articles-grid {
        gap: 24px;
    }
}
