/**
 * Archive Post Styles
 * Styles for archive.php template (blog post archives)
 *
 * @package Melodica
 */

.archive-layout {
    display: flex;
    gap: 2rem;
    /* padding: 2rem; */
    background: transparent;
    min-height: 100vh;
}

.posts-main-content {
    flex: 1;
    width: 100%;
}

.posts-set {
    width: 15%;
}

@media screen and (max-width: 768px) {
    .posts-set {
        width: 50% !important;
    }
}

/* Posts Grid */
.posts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 100px;
}

.posts-grid.loading {
    position: relative;
}

.posts-grid.loading::after {
    content: ' ';
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--overlay-black-25);
    border-radius: 16px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Post Card */
.post-card {
    background: var(--color-primary-violet);
    border-radius: 18px;
    overflow: hidden;
    width: calc(33.333% - 1rem);
    min-width: 280px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--shadow-black-30);
}

.post-cover {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    display: block;
}

.post-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-cover img {
    transform: scale(1.05);
}

.post-overlay {
    display: none !important;
}

.post-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-purple);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--color-purple);
}

.post-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.post-meta-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-meta-item svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
}

.post-actions {
    display: none !important;
}

.post-read-more {
    display: none !important;
}

/* Sidebar */
.search-filters-sidebar-post {
    width: 300px;
    background: transparent;
    border-radius: 16px;
    padding: 1.5rem;
    padding-right: 0px;
    height: fit-content;
    position: sticky;
    top: 100px;
}
@media screen and (max-width: 768px) {
    .search-filters-sidebar-post {
        padding-right: 2px;
    }
}

.archive-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Search Input */
.search-input-wrapper-post {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-btn-post {
    position: absolute;
    left: 0;
    top: 0;
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.search-input-post {
    width: 100%;
    height: 48px;
    padding: 0.75rem 0.75rem 0.75rem 3.5rem;
    background: var(--color-primary-violet);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.search-input-post::placeholder {
    color: var(--text-secondary);
}

.search-results-post {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary-violet);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 10;
    display: none;
}

/* Filter Section */
.filter-section-post {
    margin-bottom: 1.5rem;
}

.custom-dropdown-post {
    position: relative;
}

.dropdown-toggle-post {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-primary-violet);
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.dropdown-toggle-post:hover {
    background: var(--color-purple);
    opacity: 0.8;
}

.dropdown-toggle-post svg {
    transition: transform 0.3s ease;
}

.custom-dropdown-post.open .dropdown-toggle-post svg {
    transform: rotate(180deg);
}

.dropdown-menu-post {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary-violet);
    border-radius: 12px;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    padding: 0.5rem;
    display: none;
    z-index: 10;
    box-shadow: 0 8px 24px var(--shadow-black-30);
}

.custom-dropdown-post.open .dropdown-menu-post {
    display: block;
}

.dropdown-item-post {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    color: var(--text-primary);
}

.dropdown-item-post:hover {
    background: var(--color-primary-violet);
}

.dropdown-item-post.active {
    background: var(--color-primary-violet);
}

.radio-custom-post {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.radio-custom-post.checked svg circle {
    fill: var(--color-purple);
}

/* Pagination */
.pagination-wrapper {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    display: inline-block;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--color-primary-violet);
    color: var(--text-primary);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--color-purple);
}

.pagination .current {
    background: var(--color-purple);
    color: white;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .archive-layout {
        flex-direction: column;
    }

    .search-filters-sidebar-post {
        width: 100%;
        position: static;
    }

    .post-card {
        width: calc(50% - 0.75rem);
    }
}

@media screen and (max-width: 768px) {
    .archive-layout {
        padding: 1rem;
    }

    .post-card {
        width: 100%;
    }

    .posts-grid {
        gap: 1rem;
    }
}

