/* Add/Modify these styles in your style.css file */

.post-section {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 10px;
    /* Removed flex-wrap: wrap; as we want image and caption to be in one line */
    /* Removed justify-content: center; */
}

.image-and-caption-wrapper {
    display: flex; /* Make this a flex container */
    flex-direction: column; /* Stack image and caption vertically within this wrapper */
    align-items: flex-start; /* Align image and caption to the start */
    width: 48%; /* This wrapper will take up half the post-section width */
    box-sizing: border-box;
}

.post-image {
    width: 100%; /* Image takes full width of its wrapper */
    height: auto;
    object-fit: contain;
    border: 1px solid #ff0000;
    box-sizing: border-box;
    margin-bottom: 0; /* No margin here, caption will be right next to it */
}

.image-caption {
    /* Styles for the caption itself */
    display: block; /* Ensures it acts like a block element for width/padding */
    width: 100%; /* Take full width of its parent wrapper */
    background-color: #ff0000; /* Red background */
    color: black; /* Black font */
    font-family: "Press Start 2P";
    font-size: 75%; /* Similar size to app-title */
    padding: 5px 10px; /* Padding inside the caption */
    text-align: center; /* Center the text within the caption */
    box-sizing: border-box;
}

.image-caption a  {
    color: inherit;
    background-color: inherit;
}


.post-text {
    width: 48%; /* Almost 50%, leaving a small gap */
    padding: 0 1%;
    color: white;
    font-size: 14px;
    text-align: left;
    box-sizing: border-box;
}

/* Adjustments for left/right image positioning */
.left-image .image-and-caption-wrapper {
    order: 1; /* Wrapper (image + caption) first */
    margin-right: 1%; /* Space between wrapper and text */
}
.left-image .post-text {
    order: 2; /* Text second */
}

.right-image .image-and-caption-wrapper {
    order: 2; /* Wrapper (image + caption) second */
    margin-left: 1%; /* Space between wrapper and text */
}
.right-image .post-text {
    order: 1; /* Text first */
}


/* Ensure the existing #app p styles don't conflict with .post-text p */
.app p {
    padding: 10px 0px;
    color: white;
    padding: 10px;
    text-align: center;
}

/* Override the general #app p for paragraphs inside .post-text */
.post-text p {
    padding: 0;
    text-align: left;
}


/* Adjustments for mobile responsiveness */
@media (max-width: 768px) {
    .post-section {
        flex-direction: column;
        align-items: center;
    }

    .image-and-caption-wrapper,
    .post-image,
    .image-caption,
    .post-text {
        width: 90%; /* Make them take up more width on mobile */
        margin: 5px 0;
        text-align: center;
    }

    /* Reset order for mobile so elements stack naturally */
    .left-image .image-and-caption-wrapper,
    .left-image .post-text,
    .right-image .image-and-caption-wrapper,
    .right-image .post-text {
        order: unset;
        margin-right: 0;
        margin-left: 0;
    }
}