/*
 * Styles for Latest Posts Element
 */

.latest-posts-wrapper {
    width: 100%;
    margin-top: 50px;
    margin-bottom: 50px;
    font-family: 'Figtree', sans-serif; /* Applied to whole wrapper */
}

.latest-posts-container {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;  /* Gutter for mobile */
    padding-right: 15px; /* Gutter for mobile */
}

.latest-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    margin-bottom: 40px;
}

.latest-posts-wrapper h2 {
    font-family: 'Figtree', sans-serif;
    font-weight: 500;
    font-style: Medium; /* Note: 'style' is typically normal/italic. 'Medium' is a weight. */
    font-size: 2.25em; /* 36px / 16px */
    line-height: 150%;
    letter-spacing: 0%;
    color: #36194C;
    margin: 0;
}

.latest-posts-button {
    border: 2px solid #94268F;
    border-radius: 25px;
    padding: 8px 20px;
    color: #94268F;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* Prevent button from wrapping */
}

.latest-posts-button:hover {
    background-color: #94268F;
    color: #FFFFFF;
}

.latest-posts-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr; /* Default for mobile */
}

.latest-posts-card {
    background-color: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0px 10px 25px 0px #0000001A;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.latest-posts-card-image {
    display: block;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0; /* Placeholder bg */
}

.latest-posts-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.latest-posts-card:hover .latest-posts-card-image img {
    transform: scale(1.05);
}

.latest-posts-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
}
/* Optional: Add text to placeholder */
.latest-posts-image-placeholder:after {
    content: "No Image";
    font-size: 1em;
}

.latest-posts-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    color: #36194C;
}

.latest-posts-card-content h3 {
    font-weight: 500;
    font-size: 1.25em; /* 20px / 16px */
    color: #36194C;
    margin: 0 0 15px 0;
}

.latest-posts-card-content h3 a {
    color: inherit;
    text-decoration: none;
}

.latest-posts-card-content h3 a:hover {
    text-decoration: underline;
}

.latest-posts-card-content p {
    font-weight: 400;
    font-size: 1em; /* 16px */
    line-height: 150%;
    margin: 0 0 20px 0;
    flex-grow: 1; /* Pushes the link to the bottom */
}

.latest-posts-card-link {
    font-weight: 500;
    font-size: 1em; /* 16px */
    color: #36194C;
    text-decoration: none;
    margin-top: auto; /* Aligns to bottom */
    align-self: flex-start; /* Aligns to left */
    transition: color 0.3s ease;
}

.latest-posts-card-link:hover {
    color: #94268F;
}

/* --- Responsive --- */

/* Tablet */
@media (min-width: 768px) {
    .latest-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (min-width: 992px) {
    .latest-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile header adjustments */
@media (max-width: 767px) {
    .latest-posts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .latest-posts-wrapper h2 {
        font-size: 1.75em; /* 28px */
    }

    .latest-posts-button {
        align-self: flex-start;
    }
}