/* ============================================================
   Modern Posts Ads — style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700;800&family=DM+Sans:wght@400;500&display=swap');

/* ── Grid ──────────────────────────────────────────────────── */
.mpa-grid {
    display: grid;
    gap: 24px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 4px 32px;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
}

.mpa-cols-1 { grid-template-columns: 1fr; }
.mpa-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mpa-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mpa-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 960px) {
    .mpa-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .mpa-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .mpa-cols-1,
    .mpa-cols-2,
    .mpa-cols-3,
    .mpa-cols-4 { grid-template-columns: 1fr; }
}

/* ── Card ──────────────────────────────────────────────────── */
.mpa-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 1px 3px rgba(0,0,0,.07),
        0 8px 24px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}

.mpa-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 6px rgba(0,0,0,.08),
        0 16px 40px rgba(0,0,0,.14);
}

/* ── Image area ────────────────────────────────────────────── */
.mpa-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f4f6;
    text-decoration: none;
}

.mpa-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.mpa-card:hover .mpa-img-wrap img {
    transform: scale(1.04);
}

.mpa-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8edf3 0%, #d1d9e4 100%);
    color: #9aa5b4;
}

/* ── Body ──────────────────────────────────────────────────── */
.mpa-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
    gap: 10px;
}

/* ── Title ─────────────────────────────────────────────────── */
.mpa-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0;
    color: #111827;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mpa-title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}

.mpa-title a:hover {
    color: #e0300e;
}

/* ── Excerpt ───────────────────────────────────────────────── */
.mpa-excerpt {
    font-size: .9rem;
    line-height: 1.6;
    color: #6b7280;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Button ────────────────────────────────────────────────── */
.mpa-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: 4px;
    padding: 9px 18px;
    background: #111827;
    color: #fff !important;
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: .03em;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background .2s, transform .15s;
}

.mpa-btn:hover {
    background: #e0300e;
    transform: translateX(2px);
}

.mpa-btn svg {
    flex-shrink: 0;
    transition: transform .2s;
}

.mpa-btn:hover svg {
    transform: translateX(3px);
}

/* ── NEW badge ─────────────────────────────────────────────── */
.mpa-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: #e0300e;
    color: #fff;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: .7rem;
    letter-spacing: .1em;
    padding: 4px 10px;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(224,48,14,.45);

    /* Blink animation */
    animation: mpa-blink 1.2s ease-in-out infinite;
}

@keyframes mpa-blink {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 2px 10px rgba(224,48,14,.45), 0 0 0 0 rgba(224,48,14,.5);
    }
    50% {
        opacity: .6;
        box-shadow: 0 2px 10px rgba(224,48,14,.45), 0 0 0 7px rgba(224,48,14,0);
    }
}

/* ── Separator line top of new cards ──────────────────────── */
.mpa-card--new {
    border-top: 3px solid #e0300e;
}

/* ── No posts fallback ─────────────────────────────────────── */
.mpa-no-posts {
    color: #9aa5b4;
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    text-align: center;
    padding: 40px;
}
