/* Blog Categories Section */
.blog-categories-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 24px;
    width: 100%;
    gap: 24px;
}

.blog-categories-container {
    max-width: 1200px;
}

.categories-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: flex-start;
}

/* Controls that align with the categories wrapper (View All button) */
.categories-controls {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
}

@media (max-width: 1200px) {
    .categories-controls {
        max-width: 100%;
        margin-top: 4px;
        padding-left: 0;
    }
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 13.306px 19.959px;
    border: 0.832px solid #403936;
    border-radius: 138.047px;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-item span {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #403936;
    line-height: normal;
    white-space: nowrap;
}

.category-item.active {
    background-color: #005b68;
    border-color: #403936;
}

.category-item.active span {
    color: #ffffff;
}

.category-item.view-all {
    background-color: #fdf5f1;
    border-color: #005b68;
}

.category-item.view-all span {
    color: #005b68;
}

.category-item:focus {
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .category-item:hover {
        background-color: #005b68;
        border-color: #403936;
    }

    .category-item:hover span {
        color: #ffffff;
    }

    .category-item.view-all:hover {
        background-color: #005b68;
        border-color: #005b68;
    }

    .category-item.view-all:hover span {
        color: #ffffff;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-categories-section {
        padding: 0;
    }

    .categories-wrapper {
        gap: 12px 8px;
    }
}

@media (max-width: 768px) {
    .blog-categories-section {
        padding: 0;
    }

    .category-item {
        height: 28px;
        padding: 10px 16px;
    }

    .category-item span {
        font-size: 14px;
    }
}

/* Collapse / View All helper
   JS will set inline max-height when collapsed. Keep overflow hidden here. */
.categories-wrapper.collapsed {
    overflow: hidden;
}

/* When view-all is not needed, keep it visually hidden (JS will remove this attribute)
   When shown, it behaves like other category items */
.category-item.view-all[aria-hidden='true'] {
    display: none !important;
}

.category-item.view-all[aria-hidden='false'] {
    display: flex !important;
}
