/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #1a1a1a;
    color: #e6e6e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
}

/* Top Bar with Home Link */
.top-bar {
    width: 100%;
    background-color: #1a1a1a;
    text-align: left;
    padding: 15px;
}

.home-link {
    font-size: 24px;
    background: linear-gradient(90deg, #ff4d4d, #ff1a1a);
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.home-link:hover {
    color: #ff4d4d;
}

/* Posts Heading */
.heading {
    margin: 20px 0;
    text-align: center;
}

.heading h1 {
    font-size: 36px;
    background: linear-gradient(90deg, #ff4d4d, #ff1a1a);
    -webkit-background-clip: text;
    color: transparent;
}

/* Posts Container */
.posts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.post-box {
    background-color: #2a2a2a;
    width: 250px;
    height: 150px;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #ff4d4d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.post-box:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.5);
}

.post-content {
    color: #e6e6e6;
    font-size: 16px;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limits text to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em; /* Approx. height for 3 lines of text */
}

.read-more-sign {
    color: #ff4d4d;
    display: block;
    text-align: right;
    margin-top: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Expanded Post Styling */
.post-box.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 85%;
    background: rgba(255, 77, 77, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    z-index: 10;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(255, 77, 77, 0.7);
}

.expanded .post-content {
    -webkit-line-clamp: unset; /* Remove line clamp when expanded */
    max-height: none;
}

.expanded .read-more-sign {
    display: none; /* Hide the 'Read more...' text when expanded */
}

.expanded .close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #ff4d4d;
    cursor: pointer;
}

body::-webkit-scrollbar {
    width: 10px;
}

body::-webkit-scrollbar-thumb {
    background-color: #ff4d4d;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-box {
        width: 100%;
        height: 180px;
    }
}