/* ============================================
    BLOG PAGE STYLES - ALL ARTICLE
    ============================================ */

/* --- Container & Layout --- */
.blog-page {
    padding: 40px 0 60px;
    background: var(--bg-color);
    min-height: 100vh;
}

.blog-page .container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Theme Toggle --- */
.theme-toggle-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-btn svg {
    width: 20px;
    height: 20px;
}

.theme-toggle-btn:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* --- Blog Header --- */
.blog-header {
    text-align: center;
    padding: 20px 0 20px;
    border-bottom: 2px solid var(--border-color);
}

.blog-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    color: var(--main-color-deep);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.blog-subtitle {
    font-size: 16px;
    color: var(--text-soft);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Search Section --- */
.blog-search-section {
    margin-bottom: 28px;
}

.search-filter-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.search-form {
    flex: 1;
    min-width: 280px;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-input-wrapper:focus-within {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(47, 185, 88, 0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    margin: 0 12px 0 16px;
    color: var(--text-soft);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-color);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-soft);
    opacity: 0.7;
}

.search-btn {
    padding: 14px 28px;
    background: var(--secondary-color);
    color: var(--main-color-deep);
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--secondary-color-soft);
}

.clear-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.clear-filter-btn svg {
    width: 18px;
    height: 18px;
}

.clear-filter-btn:hover {
    border-color: #dc3545;
    color: #dc3545;
}

/* --- Tags Filter --- */
.tags-filter {
    margin-bottom: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.tags-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-right: 4px;
}

.tag-link {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-link:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.tag-link.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--main-color-deep);
    font-weight: 600;
}

/* --- Result Info --- */
.result-info {
    margin-bottom: 28px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border-left: 4px solid var(--secondary-color);
}

.result-info p {
    font-size: 14px;
    color: var(--text-soft);
    margin: 0;
}

.result-info strong {
    color: var(--text-color);
}

/* --- Blog Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* --- Blog Card --- */
.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.blog-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Thumbnail */
.blog-card-thumbnail {
    position: relative;
    padding-top: 56.25%;
    background: var(--border-color);
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.blog-card-thumbnail svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    color: var(--text-soft);
    opacity: 0.3;
}

.blog-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 14px;
    background: var(--secondary-color);
    color: var(--main-color-deep);
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Content */
.blog-card-content {
    padding: 20px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--main-color-deep);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
    color: var(--secondary-color);
}

.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Meta */
.blog-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-soft);
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    color: var(--main-color-deep);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.blog-card-meta time {
    font-size: 12px;
}

/* Tags in card */
.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}

.blog-card-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-color);
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-soft);
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-card-tag:hover {
    background: var(--secondary-color);
    color: var(--main-color-deep);
}

.blog-card-tag-more {
    font-size: 11px;
    color: var(--text-soft);
    padding: 3px 6px;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.no-results svg {
    width: 64px;
    height: 64px;
    color: var(--text-soft);
    opacity: 0.3;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 22px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 15px;
    color: var(--text-soft);
    margin-bottom: 24px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 32px;
    background: var(--secondary-color);
    color: var(--main-color-deep);
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--secondary-color-soft);
    transform: translateY(-2px);
}

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

.pagination-wrapper nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-wrapper nav a,
.pagination-wrapper nav span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination-wrapper nav a:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--main-color-deep);
}

.pagination-wrapper nav .active span {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--main-color-deep);
    font-weight: 600;
}

.pagination-wrapper nav .disabled span {
    opacity: 0.4;
    cursor: not-allowed;
}

/* --- Dark Mode --- */
body.dark-mode .blog-page {
    background: #1a1a2e;
}

body.dark-mode .blog-card {
    background: #16213e;
    border-color: #2a2a4a;
}

body.dark-mode .blog-card-title {
    color: #e0e0e0;
}

body.dark-mode .blog-card-excerpt {
    color: #a0a0b8;
}

body.dark-mode .blog-card-meta {
    border-color: #2a2a4a;
}

body.dark-mode .search-input-wrapper {
    background: #16213e;
    border-color: #2a2a4a;
}

body.dark-mode .search-input {
    color: #e0e0e0;
}

body.dark-mode .search-input::placeholder {
    color: #6a6a8a;
}

body.dark-mode .tag-link {
    background: #16213e;
    border-color: #2a2a4a;
    color: #b0b0c8;
}

body.dark-mode .tag-link.active {
    background: var(--secondary-color);
    color: var(--main-color-deep);
}

body.dark-mode .result-info {
    background: #16213e;
}

body.dark-mode .pagination-wrapper nav a,
body.dark-mode .pagination-wrapper nav span {
    background: #16213e;
    border-color: #2a2a4a;
    color: #b0b0c8;
}

body.dark-mode .clear-filter-btn {
    background: #16213e;
    border-color: #2a2a4a;
    color: #b0b0c8;
}

body.dark-mode .theme-toggle-btn {
    background: #16213e;
    border-color: #2a2a4a;
    color: #e0e0e0;
}

body.dark-mode .blog-header {
    border-color: #2a2a4a;
}

body.dark-mode .blog-card-tag {
    background: #1a1a3e;
    color: #8a8aaa;
}

body.dark-mode .tags-filter {
    border-color: #2a2a4a;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .blog-page {
        padding: 24px 0 40px;
    }

    .blog-page .container {
        padding: 0 16px;
    }

    .blog-header {
        padding: 20px 0 16px;
        margin-bottom: 28px;
    }

    .blog-title {
        font-size: 28px;
    }

    .blog-subtitle {
        font-size: 14px;
    }

    .search-filter-wrapper {
        flex-direction: column;
        gap: 12px;
    }

    .search-form {
        min-width: 100%;
    }

    .search-btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    .clear-filter-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    .tags-list {
        gap: 6px 10px;
    }

    .tag-link {
        font-size: 12px;
        padding: 4px 12px;
    }

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

    .blog-card-content {
        padding: 16px 18px 20px;
    }

    .blog-card-title {
        font-size: 16px;
    }

    .blog-card-excerpt {
        font-size: 13px;
    }

    .result-info {
        padding: 10px 14px;
    }

    .result-info p {
        font-size: 13px;
    }

    .theme-toggle-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .theme-toggle-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .blog-page {
        padding: 16px 0 32px;
    }

    .blog-page .container {
        padding: 0 12px;
    }

    .blog-title {
        font-size: 24px;
    }

    .blog-subtitle {
        font-size: 13px;
    }

    .search-input-wrapper {
        flex-wrap: wrap;
    }

    .search-input {
        padding: 12px 0;
        font-size: 14px;
        width: 100%;
        padding-left: 12px;
    }

    .search-icon {
        display: none;
    }

    .search-btn {
        width: 100%;
        padding: 10px;
        font-size: 13px;
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .blog-grid {
        gap: 16px;
    }

    .blog-card-thumbnail {
        padding-top: 60%;
    }

    .blog-card-content {
        padding: 14px 14px 16px;
        gap: 8px;
    }

    .blog-card-title {
        font-size: 15px;
    }

    .blog-card-meta {
        font-size: 12px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .blog-card-tags {
        gap: 4px;
    }

    .blog-card-tag {
        font-size: 10px;
        padding: 2px 8px;
    }

    .pagination-wrapper nav a,
    .pagination-wrapper nav span {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 8px;
    }
}

@media (max-width: 360px) {
    .blog-title {
        font-size: 20px;
    }

    .blog-card-title {
        font-size: 14px;
    }

    .blog-card-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .tags-label {
        font-size: 12px;
        width: 100%;
    }

    .tag-link {
        font-size: 11px;
        padding: 3px 10px;
    }
}