/* Navigation styling */
.apf-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 10px;
}
.apf-nav-item {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}
.apf-nav-item.active {
    font-weight: 700;
    color: #000;
    border-bottom: 2px solid #000;
}

/* Grid layout with 3 columns */
.apf-posts-grid-container {
    position: relative;
}
.apf-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    width: 100%;
}

@media (max-width: 991px) {
    .apf-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .apf-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Post card styling */
.apf-post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
}

/* Correct containment of featured image */
.apf-post-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
}
.apf-post-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.apf-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.apf-post-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}
.apf-post-date {
    margin-right: 10px;
}
.apf-post-title {
    font-size: 18px;
    margin: 0 0 12px 0;
    line-height: 1.4;
}
.apf-post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}
.apf-post-title a:hover {
    color: #a82444;
}
.apf-post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}
.apf-post-readmore {
    font-size: 14px;
    color: #a82444;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Loader style */
.apf-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.loading .apf-loader-overlay {
    display: flex;
}
.apf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a82444;
    border-radius: 50%;
    animation: apfspin 1s linear infinite;
}
@keyframes apfspin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}