/**
 * Category Tabs Posts Block Styles
 *
 * @package Hedredesign
 */

/* Block Container */
.category-tabs-posts-block {
    padding: 20px 0;
    background-color: #fff;
}

.category-tabs-posts-container {
    max-width: 100%;
    padding: 0 30px;
}

/* Block Title */
.category-tabs-posts-title {
    color: #005463;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
}

/* Category Tabs Navigation */
.category-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.category-tab {
    background-color: transparent;
    border: 0;
    color: #ccc;
    padding: 12px 24px;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0;
    position: relative;
    margin-bottom: -2px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.category-tab:hover {
    background-color: #f2f2f2;
    color: #00414d;
}

.category-tab.active {
    background-color: #f2f2f2;
    border-color: #f2f2f2;
    color: #00414d;
    border-bottom-color: #f2f2f2;
}

.category-tab.active:hover {
    background-color: #f2f2f2;
    color: #00414d;
}

.category-tab:focus {
    outline: 2px solid #7bc792;
    outline-offset: 2px;
}

.category-count {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
}

.category-tab.active .category-count {
    opacity: 0.9;
}

/* Posts Container */
.category-posts-container {
    position: relative;
    min-height: 200px;
}

.category-posts-content {
    display: none;
}

.category-posts-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Posts Grid - Changed to column layout for row-based posts */
.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

/* Post Item - Row layout with image left, content right */
.category-post-item {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}


/* Post Thumbnail - Left side, fixed width */
.post-thumbnail {
    width: 200px;
    min-width: 200px;
    height: auto;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.posts-grid article:first-child .post-thumbnail{
    width: 300px;
    min-width: 300px;
}
.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}



.post-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Post Content - Right side, flexible width */
.post-content {
    padding: 25px 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    line-height: 1.4;
}

.post-title a {
    color: #333;
    text-decoration: none;
}

.post-title a:hover {
    color: #333;
}
.posts-grid article:first-child .post-title {
    font-size: 24px;
    font-weight: 700;
}
.posts-grid article:first-child .post-title a {
    color: #00414d;
    text-decoration: none;
}
.posts-grid article:first-child .post-title a:hover {
    color: #00414d;
}
/* Post Meta */
.post-meta {
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;

}

.post-date {
    background-color: #7bc792;
    color: #00414c;
    font-size: 16px;
    padding: 7px 10px;
    font-weight: 700;
    display: inline-block;
}

/* Post Excerpt - Display 5 lines without ellipsis */
.post-excerpt {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: clip;
}

/* Read More Link */
.post-read-more {
    font-style: italic;
    color: #7bc792;
    text-decoration: none;
    display: inline-block;
    margin-top: auto;
}


/* Show More Button */
.show-more-container {
    text-align: center;
    margin-top: 30px;
    padding: 20px 0;
}

.show-more-btn {
    background-color: #00414d;
    color: #fff;
    border: 2px solid #00414d;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.show-more-btn:hover:not(:disabled) {
    background-color: #005463;
    border-color: #005463;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.show-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.show-more-btn:focus {
    outline: 2px solid #7bc792;
    outline-offset: 2px;
}

/* Loading Indicator */
.category-posts-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #00414d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-text {
    color: #666;
    font-size: 16px;
}

/* No Posts Message */
.no-posts-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.no-posts-message p {
    margin: 0;
}

/* Empty State */
.category-tabs-posts-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

.category-tabs-posts-empty p {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-tabs-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .category-tab {
        width: 100%;
        justify-content: center;
        border-radius: 4px;
        bottom: 0;
        margin-bottom: 0;
    }
    
    .category-tab.active {
        border-bottom-color: #00414d;
    }
    
    /* Switch to column layout on tablets and mobile */
    .category-post-item {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
    
    .posts-grid {
        gap: 20px;
    }
    
    .category-tabs-posts-title {
        font-size: 24px;
    }
    
    .post-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .category-tabs-posts-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .category-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .post-thumbnail {
        height: 180px;
    }
    
    .post-content {
        padding: 15px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-excerpt {
        font-size: 14px;
    }
}
