/* posts.css */

.posts {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.post {
    padding: 1rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative; /* Ensure that the clickable area and actions are positioned correctly */
    transition: width 0.3s ease;
}

/* Width for posts without images */
.post.no-image {
    width: calc(50% - 1rem); /* Two posts per row */
}

/* Width for posts with images */
.post.with-image {
    width: calc(100% - 1rem); /* Full width for one post per row */
}

.post h3 {
    margin-top: 0;
}

.post img {
    max-width: 100%;
    border-radius: 5px;
    margin-top: 1rem;
}

/* Clickable content */
.clickable-content {
    height: 75%; /* Make the clickable area 75% of the post height */
    overflow: hidden; /* Hide overflow to prevent content from spilling out */
    cursor: pointer;
}

/* Ensure that actions are not covered by clickable area */
.post .actions {
    margin-top: 1rem; /* Add margin to separate actions from content */
    position: relative;
    z-index: 1; /* Ensure actions are above clickable content */
}

/* Popup container */
.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

/* Popup content */
.popup-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    max-width: 800px;
    text-align: left;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Title at the top, followed by image, then content */
.popup-content h3 {
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
}

.popup-content img {
    max-width: 100%;
    margin-bottom: 20px;
    border-radius: 10px;
}

.popup-content p {
    font-size: 1.1em;
    line-height: 1.5;
}

/* Close button */
.close-popup {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
}
