/* Posts Page Styles - University of Perpetual Help System */

:root {
    --primary-color: #1c4da1;
    --secondary-color: #143980;
    --tertiary-color: #527bbd;
    --alt-color-1: #ffc63e;
    --alt-color-2: #e0b03c;
    --text-dark: #2a2a2a;
    --text-light: #94a3b8;
}

.posts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    margin-top: 100px;
    font-family: 'Montserrat', sans-serif;
}

.posts-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--primary-color);
}

.posts-title {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.posts-title i {
    color: var(--alt-color-1);
    font-size: 2.5rem;
}

.posts-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.posts-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.posts-main {
    min-height: 400px;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    position: relative;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.post-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    /* Image loading optimizations */
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    /* Clean image rendering */
    transform: translateZ(0);
    backface-visibility: hidden;
    /* Force smooth loading - removed opacity 0 to prevent white images */
    transition: transform 0.3s ease;
}

/* Removed .loaded class - images are now visible by default */

.post-card:hover .card-image {
    transform: scale(1.05);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--tertiary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover .post-card-overlay {
    opacity: 1;
}

.read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--alt-color-1);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: var(--alt-color-2);
    transform: scale(1.1);
}

.post-card-content {
    padding: 25px;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-card-meta i {
    color: var(--primary-color);
    width: 14px;
}

.post-card-title {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    line-height: 1.4;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-card-title a:hover {
    color: var(--primary-color);
}

.post-card-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.post-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.post-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-views i {
    color: var(--primary-color);
}

.read-more-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.read-more-link:hover {
    color: var(--secondary-color);
    transform: translateX(3px);
}

/* Pagination */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 50px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f8fafc;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-number:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination-number.active {
    background: var(--primary-color);
    color: white;
}

.pagination-ellipsis {
    color: var(--text-light);
    font-weight: 600;
}

.pagination-info {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Empty State */
.empty-posts {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.empty-posts-content {
    text-align: center;
    color: var(--text-light);
}

.empty-posts-content i {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-posts-content h3 {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-posts-content p {
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Sidebar */
.posts-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.sidebar-title {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.recent-post-item {
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-link {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.recent-post-link:hover {
    color: var(--primary-color);
}

.recent-post-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
}

.recent-post-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.posts-sidebar .university-info {
    text-align: center;
}

.posts-sidebar .university-info p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.posts-sidebar .quick-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%) !important;
    border: 1px solid #e2e8f0 !important;
    color: var(--text-dark) !important;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    min-height: 48px;
}

.posts-sidebar .quick-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.posts-sidebar .quick-link:hover::before {
    left: 0;
}

.posts-sidebar .quick-link:hover {
    color: white !important;
    transform: translateX(8px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(28, 77, 161, 0.3);
    border-color: var(--primary-color) !important;
}

.posts-sidebar .quick-link i {
    color: var(--primary-color) !important;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    font-size: 16px;
}

.posts-sidebar .quick-link:hover i {
    color: white !important;
    transform: scale(1.1);
}

.posts-sidebar .quick-link span {
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .posts-container {
        padding: 20px 15px;
        margin-top: 100px;
    }
    
    .posts-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .posts-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .post-card-content {
        padding: 20px;
    }
    
    .post-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .posts-title {
        font-size: 1.5rem;
    }
    
    .post-card-content {
        padding: 15px;
    }
    
    .post-card-title {
        font-size: 1.1rem;
    }
    
    .pagination-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}
