/**
 * Blog Archiv Plugin Styles
 * Compatible with Enfold Theme
 * Author: Maximilian von Heyden
 */

/* Filter and Sort Controls */
.custom-posts-filter {
    margin-bottom: 20px;
}

.filter-sort-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
}

.filter-group,
.sort-group,
.view-toggle-group {
    display: flex;
    align-items: center;
}

.filter-group label,
.sort-group label,
.view-toggle-group label {
    margin-right: 10px;
    font-weight: bold;
    white-space: nowrap;
}

.filter-group select,
.sort-group select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 2px solid #FBF9F6;
    background-color: #fbf9f6;
    min-width: 200px;
    font-size: 14px;
}

/* Select - Remove bottom margin */
.custom-posts-filter .filter-group select {
    margin-bottom: 0px !important;
}

.custom-posts-filter .sort-group select {
    margin-bottom: 0px !important;
}

/* View Toggle Buttons */
.view-toggle-buttons {
    display: flex;
    gap: 5px;
}

.view-toggle-button {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-toggle-button:hover {
    background-color: #e9e9e9;
}

.view-toggle-button.active {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Grid View Styles */
.custom-recent-posts.view-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.custom-recent-posts.view-grid article {
    flex: 0 0 calc(33.333% - 20px);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    background-color: #fbf9f6;
    border-radius: 10px;
    overflow: hidden;
}

.custom-recent-posts.view-grid .post-thumbnail {
    width: 100%;
    height: 261px;
    overflow: hidden;
}

.custom-recent-posts.view-grid .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.custom-recent-posts.view-grid .post-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 15px 30px 20px;
}

.custom-recent-posts.view-grid .post-header {
    margin-bottom: 10px;
}

.custom-recent-posts.view-grid h4 {
    margin: 10px 0;
    font-size: 26px;
}

.custom-recent-posts.view-grid .post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 5px;
}

.custom-recent-posts.view-grid .post-excerpt {
    font-size: 16px;
    line-height: 1.5;
    flex-grow: 1;
}

.custom-recent-posts.view-grid .list-excerpt {
    display: none;
}

.custom-recent-posts.view-grid .post-meta {
    display: flex;
    align-items: center;
    margin-top: 15px;
}

.custom-recent-posts.view-grid .post-date-badge {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

/* List View Styles */
.custom-recent-posts.view-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.custom-recent-posts.view-list article {
    display: block;
    background-color: #fbf9f6;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.custom-recent-posts.view-list article:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.custom-recent-posts.view-list .post-thumbnail-link {
    display: none;
}

.custom-recent-posts.view-list .post-content {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.custom-recent-posts.view-list .post-header {
    margin-bottom: 10px;
}

.custom-recent-posts.view-list .post-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.custom-recent-posts.view-list h4 {
    margin: 5px 0 10px;
    font-size: 20px;
    line-height: 1.3;
}

.custom-recent-posts.view-list .post-date-badge {
    font-weight: bold;
    color: #0073aa;
    font-size: 14px;
}

.custom-recent-posts.view-list .post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.custom-recent-posts.view-list .post-category {
    font-size: 11px;
    padding: 3px 8px;
}

.custom-recent-posts.view-list .grid-excerpt {
    display: none;
}

.custom-recent-posts.view-list .list-excerpt {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #555;
}

.custom-recent-posts.view-list .post-meta {
    display: flex;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Common Post Styles */
.custom-recent-posts .post-category {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 20px;
    display: inline-block;
    background-color: rgba(38, 84, 87, 0.1);
}

.custom-recent-posts .post-meta .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.custom-recent-posts .author-date {
    font-size: 14px;
}

.custom-recent-posts .author-name {
    font-weight: normal;
}

.custom-recent-posts .post-meta .author-date.science-category {
    padding-left: 0;
}

.custom-recent-posts .post-thumbnail-link {
    display: block;
    overflow: hidden;
}

.custom-recent-posts .post-thumbnail-link img {
    transition: transform 0.3s ease;
}

.custom-recent-posts .post-thumbnail-link:hover img {
    transform: scale(1.05);
}

.custom-recent-posts .no-posts-message {
    width: 100%;
    padding: 40px 20px;
    background-color: #fbf9f6;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    color: #666;
}

/* Load More Button - Uses Enfold Theme Variables */
.load-more-container {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.load-more-button {
    /* Enfold theme button variables */
    font-family: var(--button_typography-font-family, inherit);
    font-weight: var(--button_typography-font-weight, 600);
    font-style: var(--button_typography-font-style, normal);
    letter-spacing: var(--button_typography-letter-spacing, normal);
    border-width: var(--button_border_width-top, 2px) var(--button_border_width-right, 2px) var(--button_border_width-bottom, 2px) var(--button_border_width-left, 2px);
    border-style: solid;
    border-radius: var(--button_border_radius, 4px);
    text-transform: var(--button_text_transform, none);
    transition: all .2s;
    background: var(--button_gradient_top_color, #265457);
    color: var(--button_accent_color, #ffffff);
    border-color: var(--button_border_color, #265457);
    padding: var(--button_padding-top, 10px) var(--button_padding-right, 20px) var(--button_padding-bottom, 10px) var(--button_padding-left, 20px);
    font-size: var(--button_font_size, 16px);
    line-height: var(--button_line_height, 1.5);
    cursor: pointer;
}

.load-more-button:hover {
    background: var(--button_gradient_top_color_hover, #1a3b3d);
    color: var(--button_accent_hover_color, #ffffff);
    border-color: var(--button_border_hover_color, #1a3b3d);
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .custom-recent-posts.view-grid article {
        flex: 0 0 calc(50% - 15px);
    }

    .custom-recent-posts.view-grid {
        gap: 20px;
    }

    .custom-recent-posts.view-grid h4 {
        font-size: 22px;
    }

    .custom-recent-posts.view-grid .post-thumbnail {
        height: 220px;
    }

    .custom-recent-posts.view-list .post-thumbnail-link {
        flex: 0 0 180px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 767px) {
    .filter-sort-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-group,
    .sort-group,
    .view-toggle-group {
        width: 100%;
        justify-content: space-between;
    }

    .custom-recent-posts.view-grid article {
        flex: 0 0 100%;
    }

    .custom-recent-posts.view-grid {
        gap: 15px;
    }

    .custom-recent-posts.view-grid h4 {
        font-size: 20px;
    }

    .custom-recent-posts.view-grid .post-content {
        padding: 15px 20px;
    }

    .custom-recent-posts.view-grid .post-excerpt {
        font-size: 14px;
    }

    .custom-recent-posts.view-grid .post-thumbnail {
        height: 200px;
    }

    .custom-recent-posts.view-list article {
        flex-direction: column;
    }

    .custom-recent-posts.view-list .post-thumbnail-link {
        flex: none;
        width: 100%;
    }

    .custom-recent-posts.view-list .post-thumbnail {
        height: 180px;
    }

    .custom-recent-posts.view-list .post-meta-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-recent-posts.view-list .post-categories {
        justify-content: flex-start;
        margin-top: 5px;
    }
}
