/**
 * Post Grid Plugin Styles
 * Version: 1.0.0
 */

/* Container */
.post-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: "Barlow Semi Condensed", sans-serif;
}

/* Filter Tabs */
.post-grid-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

/* Mobile Select Menu - Hidden by default, shown on mobile */
.post-grid-mobile-select {
    display: none;
    width: 100%;
    margin-bottom: 20px;
}

.post-grid-mobile-select select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #1e1e1e;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-family: "Barlow Semi Condensed", sans-serif;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.post-grid-mobile-select select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
}

.post-grid-mobile-select option {
    background-color: #1e1e1e;
    color: #ffffff;
    padding: 8px;
}

.filter-btn {
    background-color: transparent;
    border: none;
    padding: 7px 12px;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-transform: capitalize;
    font-family: "Barlow Semi Condensed", sans-serif;
}

.filter-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
    background-color: #1e1e1e;
    color: #ffffff;
}

/* Grid Layout */
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

/* Desktop column variations */
@media (min-width: 1025px) {
    .post-grid[data-columns="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .post-grid[data-columns="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .post-grid[data-columns="5"] {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .post-grid[data-columns="6"] {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Grid Item */
.post-grid-item {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-grid-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Featured Image */
.post-grid-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

.post-grid-image img.grid-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-grid-no-image .no-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
}

/* Content Area */
.post-grid-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Category Badge */
.post-grid-category {
    margin-bottom: 12px;
}

.category-badge {
    display: inline-block;
    background-color: transparent;
    color: #ffffff;
    padding: 0;
    font-size: 12px;
    font-weight: 300;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.5px;
    border: none;
}

/* Title */
.post-grid-title {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
}

.post-grid-title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 800;
    font-size: 32px;
    line-height: 1.2;
}

.post-grid-title a:hover {
    color: #d1a05a;
}

/* Date */
.post-grid-date {
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 14px;
}

.post-grid-date time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-grid-date time::before {
    content: "📅";
    font-size: 14px;
}

/* Excerpt */
.post-grid-excerpt {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
}

/* Read More Button */
.post-grid-link {
    margin-top: auto;
}

.read-more-btn {
    display: inline-block;
    background-color: #000000;
    color: #ffffff;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.read-more-btn:hover {
   color: #d1a05a;
}

/* Loading Spinner */
.post-grid-loading {
    text-align: center;
    padding: 40px 0;
}

.post-grid-loading .spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d9653b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.post-grid-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-grid-no-results p {
    font-size: 18px;
    color: #ffffff;
    margin: 0;
    opacity: 0.8;
}

/* Pagination */
.post-grid-pagination {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 0px;
    padding: 20px 0;
}

.post-grid-pagination-links {
    margin-bottom: 15px;
}

.post-grid-pagination-links .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    background-color: transparent;
    color: #ffffff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-family: "Barlow Semi Condensed", sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.post-grid-pagination-links .page-numbers:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.post-grid-pagination-links .page-numbers.current {
    background-color: #1e1e1e;
    border-color: #1e1e1e;
    color: #ffffff; 
}

.post-grid-pagination-links .page-numbers.dots {
    border: none;
    background: none;
    cursor: default;
}

.post-grid-pagination-links .page-numbers.dots:hover {
    background: none;
    border: none;
}

.post-grid-page-count {
    color: #ffffff;
    font-size: 14px;
    opacity: 0.8;
    font-family: "Barlow Semi Condensed", sans-serif;
    display: none;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-grid-item {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive Design */

/* Large Tablets and Small Desktops (1024px and below) */
@media (max-width: 1024px) {
    .post-grid-container {
        max-width: 100%;
        padding: 20px 15px;
    }
    
    .post-grid,
    .post-grid[data-columns="3"],
    .post-grid[data-columns="4"],
    .post-grid[data-columns="5"],
    .post-grid[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .post-grid[data-columns="2"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    .post-grid-container {
        padding: 15px 10px;
    }
    
    .post-grid,
    .post-grid[data-columns="2"],
    .post-grid[data-columns="3"],
    .post-grid[data-columns="4"],
    .post-grid[data-columns="5"],
    .post-grid[data-columns="6"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    
    .post-grid-image {
        height: 220px;
    }
    
    .post-grid-filters {
        justify-content: center;
        gap: 8px;
        margin-bottom: 25px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .post-grid-title {
        font-size: 32px;
        line-height: 1.2;
    }
    
    .post-grid-excerpt {
        font-size: 14px;
    }
    
    .post-grid-content {
        padding: 16px;
    }
}

/* Mobile Landscape (640px and below) */
@media (max-width: 640px) {
    .post-grid,
    .post-grid[data-columns="2"],
    .post-grid[data-columns="3"],
    .post-grid[data-columns="4"],
    .post-grid[data-columns="5"],
    .post-grid[data-columns="6"] {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
    
    .post-grid-image {
        height: 250px;
    }
    
    /* Hide filter buttons on mobile */
    .filter-btn {
        display: none !important;
    }
    
    /* Show mobile select */
    .post-grid-mobile-select {
        display: block !important;
    }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
    .post-grid-container {
        padding: 10px 5px;
    }
    
    .post-grid {
        gap: 15px;
    }
    
    .post-grid-image {
        height: 200px;
    }
    
    .post-grid-filters {
        gap: 6px;
        margin-bottom: 20px;
    }
    
    .post-grid-title {
        font-size: 16px;
    }
    
    .post-grid-excerpt {
        font-size: 13px;
    }
    
    .post-grid-content {
        padding: 12px;
    }
    
    .read-more-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .category-badge {
        font-size: 10px;
    }
    
    .post-grid-date {
        font-size: 12px;
    }
    
    /* Mobile pagination */
    .post-grid-pagination-links .page-numbers {
        padding: 6px 10px;
        font-size: 13px;
        margin: 0 2px;
    }
    
    .post-grid-page-count {
        font-size: 13px;
    }
}

/* Extra Small Devices (360px and below) */
@media (max-width: 360px) {
    .post-grid-container {
        padding: 10px 0;
    }
    
    .post-grid-image {
        height: 180px;
    }
    
    .post-grid-title {
        font-size: 15px;
    }
    
    .post-grid-content {
        padding: 10px;
    }
    
    /* Ensure mobile select stays visible */
    .post-grid-mobile-select {
        display: block !important;
    }
    
    .post-grid-mobile-select select {
        font-size: 15px;
        padding: 10px 14px;
    }
}

