/* ==========================================================
   JT MAISON — Posts Grid Widget
   ========================================================== */

.jtm-posts-grid {
    padding: 120px 0;
    background: var(--jtm-white);
    width: 100%;
    box-sizing: border-box;
}

.jtm-posts-grid__inner {
    width: 100%;
    margin: 0;
}

/* TOP HEADER */
.jtm-posts-grid__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.jtm-posts-grid__title {
    font-family: var(--jtm-font-ui);
    font-size: 24px;
    font-weight: 500;
    color: var(--jtm-dark);
    text-transform: uppercase;
    margin: 0;
}

.jtm-posts-grid__filter {
    background: none;
    border: none;
    font-family: var(--jtm-font-ui);
    font-size: 16px;
    font-weight: 500;
    color: var(--jtm-dark);
    text-transform: uppercase;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.jtm-posts-grid__filter:hover {
    opacity: 0.6;
}

.jtm-posts-grid__meta {
    text-align: right;
    margin-bottom: 60px;
}

.jtm-posts-grid__results {
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(0,0,0,0.4);
    text-transform: uppercase;
}

/* GRID LIST */
.jtm-posts-grid__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 80px 40px; /* row gap, column gap */
}

/* INDIVIDUAL POST CARD */
.jtm-post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.jtm-post-card:hover {
    opacity: 0.9;
}

.jtm-post-card__img-wrap {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #f4f4f4; /* Light gray background for placeholder */
    margin-bottom: 24px;
    overflow: hidden;
    position: relative;
}

.jtm-post-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.jtm-post-card:hover .jtm-post-card__img-wrap img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

.jtm-post-card__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    box-sizing: border-box;
}

.jtm-post-card__overlay span {
    color: var(--jtm-white);
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--jtm-white);
    padding-bottom: 4px;
}

.jtm-post-card:hover .jtm-post-card__overlay {
    opacity: 1;
}

/* Placeholder for posts without images */
.jtm-post-card__placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--jtm-font-ui);
    font-size: 28px;
    font-weight: 600;
    color: rgba(0,0,0,0.2);
}

/* CARD TEXT CONTENT */
.jtm-post-card__cats {
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: rgba(0,0,0,0.6);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.jtm-post-card__title {
    font-family: var(--jtm-font-ui);
    font-size: 20px;
    font-weight: 500;
    color: var(--jtm-dark);
    line-height: 1.3;
    margin: 0 0 16px 0;
}

.jtm-post-card__date {
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(0,0,0,0.6);
    text-transform: uppercase;
}

/* ==========================================================
   RESPONSIVE MOBILE
   ========================================================== */
@media (max-width: 768px) {
    .jtm-posts-grid {
        padding: 60px 0;
    }
    
    .jtm-posts-grid__top {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    
    .jtm-posts-grid__title {
        font-size: 18px;
    }
    
    .jtm-posts-grid__filter {
        font-size: 14px;
    }
    
    .jtm-posts-grid__meta {
        margin-bottom: 40px;
    }
    
    .jtm-posts-grid__list {
        grid-template-columns: 1fr; /* Switch to 1 column */
        gap: 60px;
    }
    
    .jtm-post-card__title {
        font-size: 24px; /* Larger titles on mobile usually read better */
    }

    .jtm-posts-grid__pagination {
        margin-top: 60px;
    }
}

/* PAGINATION */
.jtm-posts-grid__pagination {
    margin-top: 80px;
    display: flex;
    justify-content: center;
    gap: 16px;
    font-family: var(--jtm-font-ui);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.jtm-posts-grid__pagination a,
.jtm-posts-grid__pagination span {
    text-decoration: none;
    color: rgba(0,0,0,0.4);
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.jtm-posts-grid__pagination a:hover,
.jtm-posts-grid__pagination span.current {
    color: var(--jtm-dark);
}

.jtm-posts-grid__pagination .prev,
.jtm-posts-grid__pagination .next {
    text-decoration: underline;
}
