/* General styles for both frontend and editor */
.latest-posts-grid,
.editor-styles-wrapper .latest-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(250px, 400px)); /* Default for larger screens */
    gap: 50px;
    padding: 20px;
    justify-content: center; /* Centers grid */
    align-items: start; /* Ensures items align properly */
    position: relative;
}

/* Offset every second (right column) post */
.latest-posts-grid .post-card:nth-child(2n),
.editor-styles-wrapper .latest-posts-grid .post-card:nth-child(2n) {
 transform: translateY(200px); /* Moves right column down */
}
.latest-posts-grid::after {
    content: "";
    display: block;
    width: 100%;
    height:150px; /* Pushes the container down */
}

/* Individual Post Card */
.post-card,
.editor-styles-wrapper .post-card {
    background: #0c1c3c;
    border: 2px solid #0073e6;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 300px; /* Ensures consistency */
    max-width: 400px; /* Default limit on larger screens */
    width: 100%;
    height: 100%;
    position: relative;
}

/* Featured Image */
.post-image img,
.editor-styles-wrapper .post-image img {
    width: 100%;
    height: 180px; /* Keep a fixed height for consistency */
    object-fit: cover;
    border-bottom: 2px solid #0073e6;
}

/* Placeholder Image */
.post-image img[src*="placeholder.jpg"],
.editor-styles-wrapper .post-image img[src*="placeholder.jpg"] {
    background: #ccc;
    color: #666;
    text-align: center;
    padding: 50px;
}

/* Post Content */
.post-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to left */
    padding: 20px;
    flex-grow: 1;
}

/* Post Title */
.post-title,
.editor-styles-wrapper .post-title {
    color: #fff;
    font-size: 1.2em;
    margin: 0 0 1em;
    font-weight: bold;
    text-align: left; /* Align title to the left */
}

/* "Saiba Mais" Button */
.post-button,
.editor-styles-wrapper .post-button {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 10px 15px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    margin-top: auto; /* Pushes button to the bottom */
    align-self: flex-end; /* Align button to the right */
}

.post-button:hover,
.editor-styles-wrapper .post-button:hover {
    background: #e0a800;
}

/* Full-Width Cards on Mobile */
@media (max-width: 768px) {
    .latest-posts-grid,
    .editor-styles-wrapper .latest-posts-grid {
        grid-template-columns: 1fr; /* 1 column, full width */
        gap: 15px;
    }

    .post-card,
    .editor-styles-wrapper .post-card {
        width: 100%;
        max-width: 100%;
        padding: 20px;
    }


/* Offset every second (right column) post */
.latest-posts-grid .post-card:nth-child(2n),
.editor-styles-wrapper .latest-posts-grid .post-card:nth-child(2n) {
    transform: translateY(0); /* Moves right column down */
}

.latest-posts-grid::after {
    display: none;
}
}
