/* Search Filter Posts Plugin Styles */

.search-filter-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Search Form Styles */
.search-filter-form {
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: block;
}

.search-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: #ffffff;
    transition: all 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.search-field input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.search-field input::placeholder {
    color: #6c757d;
}

.search-button-field {
    display: flex;
    align-items: center;
}

.search-filter-button {
    background: #2d5d6f;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    color: white;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
}

.search-filter-button:hover {
    background: #005a87;
    transform: translateY(-1px);
}

.search-filter-button:active {
    transform: translateY(0);
}


/* Loading Styles */
.search-filter-loading {
    text-align: center;
    padding: 40px 20px;
    color: #8c8f94;
}

.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #007cba;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    max-width: 1200px;
    margin: 20px auto 0;
    gap: 30px;
}

@media (min-width: 900px) and (max-width: 1399px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .search-form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .search-button-field {
        grid-column: span 2;
        justify-content: center;
    }
}

@media (min-width: 1400px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Individual Post Item */
.post-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f1;
    position: relative;
}

.post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 124, 186, 0.1);
    border-color: #007cba;
}

/* Make entire card clickable */
.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.post-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 21/9;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card-link:hover .post-image {
    transform: scale(1.05);
}


.post-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.post-title {
    color: #1a1a1a;
    transition: color 0.3s ease;
}

.post-card-link:hover .post-title {
    color: #007cba;
}

.post-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #8c8f94;
}

.post-date {
    font-weight: 500;
}

/* Custom Fields Bottom Positioning */
.custom-fields-bottom {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Dated field (green styling) */
.dated-field {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #2d5a2d;
    border: 1px solid #4caf50;
    transition: all 0.2s ease;
}

.dated-field strong {
    color: #2e7d32;
    margin-right: 4px;
    font-weight: 600;
}

.dated-field:hover {
    background: linear-gradient(135deg, #ddf0dd 0%, #e8f5e8 100%);
    border-color: #388e3c;
}

/* Parish field (blue styling) */
.parish-field {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #1a237e;
    border: 1px solid #007cba;
    transition: all 0.2s ease;
}

.parish-field strong {
    color: #0056b3;
    margin-right: 4px;
    font-weight: 600;
}

.parish-field:hover {
    background: linear-gradient(135deg, #d1e7ff 0%, #e3f2fd 100%);
    border-color: #0056b3;
}

/* Ensure content has enough bottom padding for custom fields */
.post-content {
    padding: 20px;
    padding-bottom: 60px; /* Extra space for custom fields */
    position: relative;
}

/* No Posts Found */
.no-posts-found {
    text-align: center;
    padding: 60px 20px;
    color: #8c8f94;
}

.no-posts-found p {
    font-size: 16px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-filter-container {
        margin: 15px 0;
    }
    
    .search-filter-form {
        padding: 15px;
    }
    
    .search-form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .search-button-field {
        justify-content: center;
    }
    
    .search-filter-button {
        width: 100%;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 100%;
    }
    
    .post-content {
        padding: 16px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-excerpt {
        font-size: 13px;
    }
    
    .custom-fields-bottom {
        bottom: 16px;
        left: 16px;
        right: 16px;
        gap: 6px;
    }
    
    .dated-field,
    .parish-field {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .post-content {
        padding: 16px;
        padding-bottom: 50px;
    }
}

@media (max-width: 480px) {
    .search-filter-container {
        margin: 10px 0;
    }
    
    .search-filter-form {
        margin-bottom: 20px;
    }
    
    .posts-grid {
        gap: 15px;
    }
    
    .post-content {
        padding: 14px;
        padding-bottom: 45px;
    }
    
    .custom-fields-bottom {
        bottom: 14px;
        left: 14px;
        right: 14px;
    }
    
    .no-posts-found {
        padding: 40px 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .search-filter-form {
        background: #1a1a1a;
        border-color: #3c434a;
    }
    
    .search-field label {
        color: #e0e0e0;
    }
    
    .search-field input {
        background-color: #2c2c2c;
        border-color: #3c434a;
        color: #ffffff;
    }
    
    .search-field input:focus {
        border-color: #007cba;
        box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
    }
    
    .search-field input::placeholder {
        color: #8c8f94;
    }
    
    .post-item {
        background: #1a1a1a;
        border-color: #3c434a;
    }
    
    .post-title a {
        color: #ffffff;
    }
    
    .post-excerpt {
        color: #b5bcc2;
    }
    
    .dated-field {
        background: linear-gradient(135deg, #1a2e1a 0%, #243024 100%);
        border-color: #4caf50;
        color: #a5d6a7;
    }
    
    .dated-field strong {
        color: #66bb6a;
    }
    
    .parish-field {
        background: linear-gradient(135deg, #1a2332 0%, #1e2a3a 100%);
        border-color: #007cba;
        color: #90caf9;
    }
    
    .parish-field strong {
        color: #64b5f6;
    }
}

