/**
 * Walliux — Blog listing & detail pages
 */

/* Hero */
.blog-hero {
    position: relative;
    padding: 48px 0 56px;
    overflow: hidden;
}

.blog-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.blog-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 15, 27, 0.75) 0%, rgba(124, 77, 255, 0.25) 50%, rgba(9, 11, 20, 0.9) 100%);
}

.blog-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.blog-hero-breadcrumb {
    justify-content: flex-start;
    margin-bottom: 20px;
}

.blog-hero-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--home-primary);
    background: rgba(124, 77, 255, 0.15);
    border: 1px solid rgba(124, 77, 255, 0.35);
    padding: 6px 14px;
    border-radius: var(--home-radius-pill);
    margin-bottom: 16px;
}

.blog-hero-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 0 16px;
    color: var(--home-text);
}

.blog-hero-accent {
    color: var(--home-primary);
}

.blog-hero-desc {
    font-size: 16px;
    line-height: 1.6;
    color: var(--home-text-secondary);
    margin: 0;
    max-width: 560px;
}

/* Main section */
.blog-main-section {
    padding: 32px 0 48px;
}

.blog-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--home-border);
}

.blog-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-category-tab {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--home-text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--home-radius-pill);
    text-decoration: none;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.blog-category-tab:hover {
    color: var(--home-text);
    background: rgba(255, 255, 255, 0.04);
}

.blog-category-tab.is-active {
    color: var(--home-primary);
    background: rgba(124, 77, 255, 0.12);
    border-color: rgba(124, 77, 255, 0.35);
}

.blog-tab-count {
    opacity: 0.7;
    font-weight: 400;
}

.blog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.blog-toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(18, 24, 39, 0.9);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-pill);
    padding: 8px 16px;
    min-width: 200px;
}

.blog-toolbar-search i {
    color: var(--home-text-secondary);
    font-size: 14px;
}

.blog-toolbar-search input {
    background: transparent;
    border: none;
    color: var(--home-text);
    font-size: 13px;
    width: 100%;
    outline: none;
}

.blog-toolbar-search input::placeholder {
    color: var(--home-text-secondary);
}

.blog-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blog-sort-select {
    appearance: none;
    background: rgba(18, 24, 39, 0.9);
    border: 1px solid var(--home-border);
    border-radius: var(--home-radius-pill);
    color: var(--home-text);
    font-size: 13px;
    padding: 8px 32px 8px 14px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.blog-view-toggle {
    display: flex;
    gap: 4px;
    background: rgba(18, 24, 39, 0.9);
    border: 1px solid var(--home-border);
    border-radius: 10px;
    padding: 4px;
}

.blog-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--home-text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.blog-view-btn:hover {
    color: var(--home-text);
}

.blog-view-btn.is-active {
    background: rgba(124, 77, 255, 0.2);
    color: var(--home-primary);
}

/* Layout */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.blog-layout-main {
    min-width: 0;
}

/* Article grid */
.blog-articles-grid {
    display: grid;
    gap: 28px;
}

.blog-articles-grid.is-grid {
    grid-template-columns: repeat(2, 1fr);
}

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

.blog-articles-grid.is-list .blog-card {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
    align-items: start;
}

.blog-articles-grid.is-list .blog-card-image-wrap {
    aspect-ratio: 16 / 10;
}

.blog-card {
    background: rgba(18, 24, 39, 0.5);
    border: 1px solid var(--home-border);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.blog-card:hover {
    border-color: rgba(124, 77, 255, 0.35);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.blog-card-image-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

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

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

.blog-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.badge-guides {
    background: rgba(124, 77, 255, 0.85);
    color: #fff;
}

.badge-trends {
    background: rgba(59, 130, 246, 0.85);
    color: #fff;
}

.badge-news {
    background: rgba(99, 102, 241, 0.85);
    color: #fff;
}

.badge-tips {
    background: rgba(16, 185, 129, 0.85);
    color: #fff;
}

.badge-inspiration {
    background: rgba(236, 72, 153, 0.85);
    color: #fff;
}

.badge-technical {
    background: rgba(245, 158, 11, 0.85);
    color: #fff;
}

.blog-card-body {
    padding: 20px;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--home-text-secondary);
    margin-bottom: 10px;
}

.blog-card-dot {
    opacity: 0.5;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
}

.blog-card-title a {
    color: var(--home-text);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card-title a:hover {
    color: var(--home-primary);
}

.blog-card-excerpt {
    font-size: 14px;
    line-height: 1.55;
    color: var(--home-text-secondary);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--home-text-secondary);
}

.blog-card-author img {
    border-radius: 50%;
    object-fit: cover;
}

/* Sidebar */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.blog-widget {
    background: rgba(18, 24, 39, 0.6);
    border: 1px solid var(--home-border);
    border-radius: 16px;
    padding: 20px;
}

.blog-widget-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--home-text);
}

.blog-widget-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-widget-categories li + li {
    margin-top: 4px;
}

.blog-widget-categories a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--home-text-secondary);
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.blog-widget-categories a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--home-text);
}

.blog-widget-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(124, 77, 255, 0.12);
    color: var(--home-primary);
    font-size: 14px;
}

.blog-widget-cat-name {
    flex: 1;
}

.blog-widget-cat-count {
    font-size: 12px;
    color: var(--home-text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
}

.blog-widget-popular {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-widget-popular li + li {
    margin-top: 12px;
}

.blog-popular-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    align-items: flex-start;
}

.blog-popular-item img {
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.blog-popular-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--home-text);
    line-height: 1.4;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.blog-popular-item:hover .blog-popular-title {
    color: var(--home-primary);
}

.blog-popular-item time {
    font-size: 11px;
    color: var(--home-text-secondary);
}

.blog-widget-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.blog-tag-pill {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--home-radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--home-border);
    color: var(--home-text-secondary);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.blog-tag-pill:hover {
    border-color: rgba(124, 77, 255, 0.4);
    color: var(--home-primary);
    background: rgba(124, 77, 255, 0.08);
}

.blog-tags-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--home-primary);
    text-decoration: none;
}

.blog-tags-more:hover {
    text-decoration: underline;
}

/* Pagination */
.blog-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.blog-pager-ellipsis {
    display: flex;
    align-items: center;
    padding: 0 4px;
    color: var(--home-text-secondary);
}

/* Empty state */
.blog-empty {
    text-align: center;
    padding: 60px 24px;
    color: var(--home-text-secondary);
}

.blog-empty i {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 16px;
    display: block;
}

.blog-empty p {
    margin-bottom: 20px;
}

.blog-newsletter {
    margin-top: 0;
}

/* Detail page */
.blog-detail-hero {
    position: relative;
    padding: 40px 0 48px;
    overflow: hidden;
}

.blog-detail-hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.blog-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 11, 20, 0.6) 0%, rgba(9, 11, 20, 0.95) 100%);
}

.blog-detail-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.blog-detail-badge {
    position: static;
    display: inline-block;
    margin-bottom: 16px;
}

.blog-detail-title {
    font-size: clamp(28px, 4.5vw, 42px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 24px;
    color: var(--home-text);
}

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

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

.blog-detail-author img {
    border-radius: 50%;
    object-fit: cover;
}

.blog-detail-author-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: var(--home-text);
}

.blog-detail-author-role {
    display: block;
    font-size: 12px;
    color: var(--home-text-secondary);
}

.blog-detail-meta-items {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--home-text-secondary);
}

.blog-detail-meta-items i {
    margin-right: 6px;
    color: var(--home-primary);
}

.blog-detail-main {
    padding: 40px 0 48px;
}

.blog-detail-layout {
    align-items: start;
}

.blog-detail-featured {
    margin: 0 0 32px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--home-border);
}

.blog-detail-featured img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-article-content {
    font-size: 16px;
    line-height: 1.75;
    color: var(--home-text-secondary);
}

.blog-article-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--home-text);
    margin: 32px 0 16px;
    letter-spacing: -0.02em;
}

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

.blog-article-content ul {
    margin: 0 0 20px;
    padding-left: 24px;
}

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

.blog-detail-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--home-border);
}

.blog-detail-tags-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-text);
}

.blog-detail-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 28px;
    padding: 20px;
    background: rgba(18, 24, 39, 0.5);
    border: 1px solid var(--home-border);
    border-radius: 12px;
}

.blog-detail-share span {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-text);
}

.blog-share-buttons {
    display: flex;
    gap: 8px;
}

.blog-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--home-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--home-text-secondary);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.blog-share-btn:hover {
    border-color: rgba(124, 77, 255, 0.4);
    color: var(--home-primary);
    background: rgba(124, 77, 255, 0.1);
}

.blog-related {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--home-border);
}

.blog-related-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px;
    color: var(--home-text);
}

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

.blog-related-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    background: rgba(18, 24, 39, 0.5);
    border: 1px solid var(--home-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.blog-related-card:hover {
    border-color: rgba(124, 77, 255, 0.35);
    transform: translateY(-2px);
}

.blog-related-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.blog-related-card div {
    padding: 0 14px 14px;
}

.blog-related-card .blog-card-badge {
    position: static;
    display: inline-block;
    margin-bottom: 8px;
}

.blog-related-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--home-text);
    line-height: 1.4;
    margin: 0 0 6px;
    transition: color 0.2s;
}

.blog-related-card:hover h3 {
    color: var(--home-primary);
}

.blog-related-card time {
    font-size: 11px;
    color: var(--home-text-secondary);
}

/* Responsive */
@media (max-width: 1199px) {
    .blog-layout {
        grid-template-columns: 1fr 280px;
        gap: 28px;
    }
}

@media (max-width: 991px) {
    .blog-layout,
    .blog-detail-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        order: 2;
    }

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

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

    .blog-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .blog-toolbar {
        justify-content: space-between;
    }
}

@media (max-width: 767px) {
    .blog-articles-grid.is-list .blog-card {
        grid-template-columns: 1fr;
    }

    .blog-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .blog-category-tab {
        flex-shrink: 0;
    }
}
