/* Post 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;
}

/* Post Content Paragraphs */
.post-text p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    color: var(--text-dark);
    font-size: 1.1rem;
    text-align: justify;
}

.post-text p:first-child {
    margin-top: 0;
}

.post-text p:last-child {
    margin-bottom: 0;
}

/* Links within post content */
.post-text a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.post-text a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--alt-color-1);
    text-decoration: none;
}

.post-text a:visited {
    color: var(--tertiary-color);
}

.post-text a:focus {
    outline: 2px solid var(--alt-color-1);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Other HTML elements in post content */
.post-text h1,
.post-text h2,
.post-text h3,
.post-text h4,
.post-text h5,
.post-text h6 {
    color: var(--text-dark);
    margin: 2rem 0 1rem 0;
    font-weight: 700;
    line-height: 1.3;
}

.post-text h1 { font-size: 2rem; }
.post-text h2 { font-size: 1.75rem; }
.post-text h3 { font-size: 1.5rem; }
.post-text h4 { font-size: 1.25rem; }
.post-text h5 { font-size: 1.1rem; }
.post-text h6 { font-size: 1rem; }

.post-text ul,
.post-text ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-text li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-text blockquote {
    border-left: 4px solid var(--alt-color-1);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}

.post-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-text strong {
    font-weight: 700;
    color: var(--text-dark);
}

.post-text em {
    font-style: italic;
}

.post-text code {
    background: #f1f3f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-color);
}

.post-text pre {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
}

.post-text pre code {
    background: none;
    padding: 0;
    color: var(--text-dark);
}

.post-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    margin-top: 100px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    font-family: 'Montserrat', sans-serif;
}

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

.post-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.post-title {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.post-meta > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

/* Image Slider Styles */
.post-images {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.image-slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 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: opacity 0.4s ease-in-out;
}

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

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

.slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--alt-color-1);
    transform: scale(1.2);
}

.single-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
}

.featured-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Post Body */
.post-body {
    margin-bottom: 30px;
}

.post-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    white-space: pre-wrap;
}

/* Post Footer */
.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 2px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 20px;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.post-share {
    display: flex;
    align-items: center;
    gap: 15px;
}

.post-share span {
    font-weight: 600;
    color: var(--text-dark);
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.share-btn.facebook {
    background: #3b5998;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.post-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);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .post-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 15px;
        margin-top: 100px;
    }
    
    .post-content {
        padding: 25px;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .post-meta > div {
        justify-content: flex-start;
    }
    
    .image-slider,
    .single-image {
        height: 250px;
    }
    
    .slider-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .prev-btn {
        left: 10px;
    }
    
    .next-btn {
        right: 10px;
    }
    
    .post-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .sidebar-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .post-content {
        padding: 20px;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-meta {
        align-items: flex-start;
    }
    
    .post-meta > div {
        justify-content: flex-start;
        text-align: left;
    }
    
    .image-slider,
    .single-image {
        height: 200px;
    }
    
    .slider-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .slider-indicators {
        bottom: 10px;
    }
    
    .indicator {
        width: 10px;
        height: 10px;
    }
}
