/* ==========================================================================
   CSS Variables & Scoped Reset
   ========================================================================== */
:root {
    --jop-color-bg: #0f061c;
    --jop-card-bg: #1a1a2e;
    --jop-card-border: #2a2a44;
    --jop-text-primary: #f0f4ff;
    --jop-text-secondary: #c0ccf0;
    --jop-accent-blue: #5b8def;
    --jop-badge-bg: #2a2a50;
    --jop-badge-text: #aac0ff;
    --jop-hover-glow: #3a4a8a;
}

.jop-wrapper {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.jop-wrapper * {
    box-sizing: border-box;
}

.programs-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Page Specific Video Background
   ========================================================================== */
.jop-page-bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.jop-page-bg-overlay {
    position: fixed;
    inset: 0;
    background: var(--jop-color-bg);
    opacity: 0.85;
    z-index: 0;
}

.jop-page-glow {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
      radial-gradient(circle at 20% 20%, rgba(0,245,255,0.14), transparent 40%),
      radial-gradient(circle at 80% 80%, rgba(91,141,239,0.14), transparent 40%);
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.jop-hero {
    background: linear-gradient(135deg, rgba(1, 6, 28, 0.85) 0%, rgba(15, 42, 71, 0.85) 100%), url('https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2000&q=80') center/cover no-repeat;
    color: var(--jop-text-primary);
    padding: 4.5rem 1.5rem;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1;
}

.jop-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    font-family: 'Poppins', sans-serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    color: #f0f7ff;
}

.jop-hero p {
    font-size: 1.2rem;
    color: var(--jop-accent-blue);
    margin: 0;
    font-weight: 600;
}

/* ==========================================================================
   Posts Grid & Cards
   ========================================================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.post-card {
    background: var(--jop-card-bg);
    border-radius: 24px;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.15), 0 12px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.25s ease;
    overflow: hidden;
    border: 1px solid rgba(0, 245, 255, 0.4);
    display: flex;
    flex-direction: column;
    color: var(--jop-text-primary);
    text-decoration: none;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 0 25px rgba(68, 130, 255, 0.4), 0 20px 40px rgba(0, 0, 0, 0.8);
    border-color: rgba(68, 130, 255, 0.8);
}

.post-image {
    width: 100%;
    height: auto;              
    min-height: 180px;
    background: #1e1e32;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.post-image img {
    width: 100%;
    height: auto;              
    object-fit: contain;       
    display: block;
    position: relative;
}

.post-card-header {
    padding: 1.25rem 1.5rem 0.25rem 1.5rem;
}

.post-card-header .badge {
    display: inline-block;
    background: var(--jop-badge-bg);
    color: var(--jop-badge-text);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 0.25rem 0.8rem;
    border-radius: 40px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.post-card-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #f0f4ff;
    line-height: 1.3;
    margin-bottom: 0.2rem;
    margin-top: 0;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--jop-text-secondary);
    font-size: 0.85rem;
    margin: 0.4rem 0 0.2rem 0;
}

.post-meta i {
    margin-right: 0.25rem;
    color: var(--jop-accent-blue);
    width: 1rem;
}

.post-card .caption {
    padding: 0.25rem 1.5rem 0.75rem 1.5rem;
    color: #d0ddff;
    font-size: 0.95rem;
    line-height: 1.5;
    border-bottom: 1px solid #2a2a4a;
    flex: 1;
}

.post-card .read-more-link {
    display: block;
    padding: 0.9rem 1.5rem 1.2rem 1.5rem;
    text-align: right;
    color: var(--jop-accent-blue);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: background 0.15s;
    border-radius: 0 0 24px 24px;
}

.post-card .read-more-link i {
    margin-left: 0.4rem;
    transition: transform 0.2s;
}

.post-card .read-more-link:hover {
    background: #252540;
}

.post-card .read-more-link:hover i {
    transform: translateX(4px);
}

.program-footer {
    margin-top: 2rem;
    text-align: center;
    color: #b0c4e8;
    font-size: 0.85rem;
    border-top: 1px solid #2a2a4a;
    padding-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.program-footer span i {
    margin-right: 0.3rem;
    color: var(--jop-accent-blue);
}

/* ==========================================================================
   Detail Page Structure (Static PHP version)
   ========================================================================== */
.detail-page {
    background: var(--jop-card-bg);
    border-radius: 28px;
    padding: 2.5rem 2.5rem 2rem;
    max-width: 900px;
    margin: 0 auto 2rem;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.15), 0 16px 40px rgba(0,0,0,0.7);
    border: 1px solid rgba(0, 245, 255, 0.4);
    color: var(--jop-text-primary);
    animation: fadeSlideIn 0.5s ease forwards;
    position: relative;
    z-index: 1;
}

@keyframes fadeSlideIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.detail-page .back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--jop-accent-blue);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.detail-page .back-link:hover {
    color: #8ab0ff;
}

.detail-page .back-link i {
    margin-right: 0.5rem;
}

.detail-page .detail-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    background: #1e1e32;
    display: block;
}

.detail-page h2 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: #f0f4ff;
    margin-top: 0;
}

.detail-page .detail-meta {
    color: var(--jop-text-secondary);
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}

.detail-page .detail-meta i {
    margin-right: 0.25rem;
    color: var(--jop-accent-blue);
}

.detail-page .detail-content {
    line-height: 1.7;
    color: #d0ddff;
}

.detail-page .detail-content h3 {
    color: #e0ecff;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.2rem;
}

.detail-page .detail-content ul {
    margin: 0.5rem 0 0.75rem 1.5rem;
}

.detail-page .detail-content ul li {
    margin-bottom: 0.4rem;
}

.detail-page .detail-content p {
    margin-bottom: 0.75rem;
}

.detail-page .chip-group {
    margin-top: 1rem;
}

.detail-page .chip {
    display: inline-block;
    background: #2a2a50;
    color: #aac0ff;
    padding: 0.25rem 1rem;
    border-radius: 40px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.detail-page .detail-content strong {
    color: #e0ecff;
}

/* Detail grid for project categories */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0 1rem 0;
}

.project-grid .chip {
    text-align: center;
    background: #22224a;
    border: 1px solid #3a3a6a;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .jop-page-bg-video {
        width: 100vh;
        height: 100vw;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
    }
}

@media (max-width: 700px) {
    .jop-wrapper {
        padding: 1rem;
    }
    
    .jop-hero {
        padding: 2.5rem 1rem;
    }
    
    .jop-hero h1 {
        font-size: 2rem;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-card-header h3 {
        font-size: 1.2rem;
    }
    
    .post-image {
        height: auto;
        min-height: 150px;
    }
    
    .detail-page {
        padding: 1.5rem;
    }
    
    .detail-page h2 {
        font-size: 1.6rem;
    }
}
