/* Blog Page Styles */

html:has(body.blog-page) {
    touch-action: auto;
    overflow-x: hidden;
}

body.blog-page {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    touch-action: auto;
    overscroll-behavior: auto;
}

body.blog-page .container {
    overflow: visible;
}

/* Hero / page title */
.blog-hero {
    text-align: center;
    padding: 3rem 1.5rem 1.5rem;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
}

.blog-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Blog groups */
.blog-groups {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

.blog-group {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    min-width: 0;
}

.blog-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1.25rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
}

.blog-group-header:hover {
    background: #f9f9f9;
}

.blog-group-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.blog-group-chevron {
    width: 24px;
    height: 24px;
    color: #888;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.blog-group.open .blog-group-chevron {
    transform: rotate(180deg);
}

.blog-group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.blog-group.open .blog-group-content {
    max-height: none;
    overflow: visible;
}

/* Search bar */
.blog-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0.5rem;
    position: relative;
}

.blog-search-icon {
    width: 18px;
    height: 18px;
    color: #888;
    position: absolute;
    left: 2.25rem;
    pointer-events: none;
}

.blog-search-input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #333;
    background: #f9f9f9;
    outline: none;
    transition: border-color 0.2s;
}

.blog-search-input:focus {
    border-color: #3C4BFB;
    background: #fff;
}

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

.blog-no-results {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #888;
    font-size: 0.95rem;
}

/* Category filter chips */
.blog-category-filters {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.blog-category-filters::-webkit-scrollbar {
    display: none;
}

.blog-category-chip {
    flex-shrink: 0;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1.5px solid #e0e0e0;
    background: #fff;
    color: #555;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.blog-category-chip:hover {
    border-color: #3C4BFB;
    color: #3C4BFB;
}

.blog-category-chip.active {
    background: #3C4BFB;
    border-color: #3C4BFB;
    color: #fff;
}

.blog-category-entries {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.blog-group-content .blog-entry {
    box-shadow: none;
    border-radius: 0;
    border-top: 1px solid #eee;
    width: 100%;
    min-width: 0;
}

.blog-group-content .blog-entry:hover {
    box-shadow: none;
    transform: none;
    background: #f9f9f9;
}

/* Blog list (legacy) */
.blog-list {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Individual entry */
.blog-entry {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.blog-entry:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.blog-entry-cover {
    width: 120px;
    max-width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.blog-entry-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    overflow-wrap: break-word;
}

.blog-entry-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 0.4rem;
}

.blog-entry-author {
    font-size: 0.9rem;
    color: #888;
    margin: 0 0 0.6rem;
}

.blog-entry-desc {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

/* Mobile */
@media (max-width: 600px) {
    .blog-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .blog-entry-cover {
        width: 100px;
        height: 150px;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

    .blog-group-header {
        padding: 1rem 1.25rem;
    }

    .blog-group-title {
        font-size: 1.05rem;
    }
}
