/* post.css - Radio Komal Grid Theme */

body {
    background-color: var(--light-bg);
    position: static; 
}

/* Page Header Wrapper */
.page-header {
    background: var(--gradient);
    padding: 60px 0 40px;
    margin-bottom: 40px;
    text-align: center;
    color: white;
}

.page-header h2 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* --- GRID LAYOUT CONTAINER --- */
.container-post {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 60vh;
    
    /* Desktop: 3 Column Grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    justify-content: center;
}

/* Individual Post Card */
.post {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
    
    /* Card layout */
    display: flex;
    flex-direction: column; /* Stack image on top of text */
    height: 100%; /* Equal height cards */
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 107, 53, 0.2);
}

/* Post Image */
.post img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Post Content Area */
.content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Default: Left aligned for desktop readability */
    text-align: left; 
    align-items: flex-start;
}

/* Category Label */
.category {
    display: inline-block;
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 50px;
    margin-bottom: 12px;
}

/* Title Button */
.post-title-btn {
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font-family: "Jost", sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    line-height: 1.3;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

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

/* Description Text */
.post p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Read More Button */
.read-more {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
}

.read-more:hover {
    background: var(--primary);
    color: white;
}

/* --- DETAIL PAGE (Not Grid) --- */
.container-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.post-detail-wrapper {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.feature-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 30px;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* Center the page header text */
    .page-header {
        padding: 40px 20px;
    }

    .container-post {
        grid-template-columns: 1fr; /* Force single column */
        padding: 15px;
    }

    .post {
        max-width: 450px; /* Prevent it from getting too wide on tablets */
        margin: 0 auto;   /* Center the card itself */
        text-align: center;
    }

    .content {
        align-items: center; /* Center flex items (buttons/tags) */
        text-align: center;  /* Center text */
    }

    .post-title-btn {
        text-align: center;
    }
    
    .post-detail-wrapper {
        padding: 20px;
        text-align: center;
    }
    
    .post-text {
        text-align: left; /* Keep long reading text left-aligned for readability */
    }
}