/* ============================================================
   Masonry Post Grid — masonry-grid.css
   ============================================================ */

/* ---------- Layout ---------- */
.mpg-wrapper {
    --mpg-cols: 3;
    --mpg-gap: 20px;
    --mpg-radius: 10px;
    --mpg-trans: 0.25s ease;

    column-count: var(--mpg-cols);
    column-gap: var(--mpg-gap);
    width: 100%;
}

.mpg-card {
    display: inline-block; /* masonry trick: break-inside avoid + display inline-block */
    width: 100%;
    break-inside: avoid;
    margin-bottom: var(--mpg-gap);
    background: #fff;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    transition: transform var(--mpg-trans), box-shadow var(--mpg-trans), opacity var(--mpg-trans);
    position: relative;
}

.mpg-card.mpg-rounded {
    border-radius: var(--mpg-radius);
}

/* ---------- Thumbnail ---------- */
.mpg-thumb {
    display: block;
    overflow: hidden;
    line-height: 0;
}

.mpg-thumb img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

/* ---------- Card Body ---------- */
.mpg-card-body {
    padding: 18px 20px 20px;
}

/* ---------- Category badges ---------- */
.mpg-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.mpg-cat-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 30px;
    background: #f0f0f0;
    color: #555;
    text-decoration: none;
    transition: background var(--mpg-trans), color var(--mpg-trans);
}

.mpg-cat-badge:hover {
    background: #222;
    color: #fff;
}

/* ---------- Title ---------- */
.mpg-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 8px;
    color: #000;
}

.mpg-title a {
    color: #000;
    text-decoration: none;
    transition: color var(--mpg-trans), text-decoration-color var(--mpg-trans);
}

.mpg-title a:hover {
    color: inherit; /* falls back to the theme's <a> colour = site default */
    text-decoration: underline;
}

/* ---------- Meta ---------- */
.mpg-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 10px;
}

.mpg-meta time,
.mpg-meta .mpg-author {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Excerpt ---------- */
.mpg-excerpt {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #000;
    margin: 0 0 14px;
}

/* ---------- Read More ---------- */
.mpg-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: #0073aa;
    transition: gap var(--mpg-trans), color var(--mpg-trans);
}

.mpg-read-more:hover {
    gap: 9px;
    color: #005177;
}

/* ---------- No posts ---------- */
.mpg-no-posts {
    color: #888;
    font-style: italic;
}

/* ============================================================
   CONTAINER & FEATURED CARD
   ============================================================ */

/*
 * .mpg-container wraps the featured row + the masonry grid.
 * Style/hover modifier classes live here so both sections inherit them.
 */
.mpg-container {
    width: 100%;
}

/* Featured card sits above the masonry grid, full width */
.mpg-featured-wrap {
    margin-bottom: var(--mpg-gap, 20px);
}

.mpg-featured-wrap .mpg-card--featured {
    width: 100%;
    margin-bottom: 0;
}

/* Featured thumbnail: fixed height so the full-width image doesn't get enormous */
.mpg-featured-wrap .mpg-card--featured .mpg-thumb {
    overflow: hidden;
    max-height: 420px;
}

.mpg-featured-wrap .mpg-card--featured .mpg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Slightly larger title inside the featured card for visual hierarchy */
.mpg-featured-wrap .mpg-card--featured .mpg-title {
    font-size: 1.3rem;
}


/* ============================================================
   CARD STYLES
   ============================================================ */

/* ---- minimal ---- */
.mpg-style-minimal .mpg-card {
    border: none;
    border-bottom: 1px solid #e8e8e8;
    border-radius: 0 !important;
    background: transparent;
}

.mpg-style-minimal .mpg-card-body {
    padding: 14px 0 18px;
}

/* ---- bold ---- */
.mpg-style-bold .mpg-card {
    border: 3px solid #111;
    box-shadow: 5px 5px 0 #111;
}

.mpg-style-bold .mpg-card.mpg-rounded {
    border-radius: 0;
}

.mpg-style-bold .mpg-title a {
    color: #111;
}

.mpg-style-bold .mpg-title a:hover {
    color: #c00;
    text-decoration: underline;
}

.mpg-style-bold .mpg-cat-badge {
    background: #111;
    color: #fff;
    border-radius: 0;
}

.mpg-style-bold .mpg-cat-badge:hover {
    background: #c00;
}

.mpg-style-bold .mpg-read-more {
    color: #c00;
}

/* ---- dark ---- */
.mpg-style-dark .mpg-card {
    background: #1a1a2e;
    border-color: #2e2e4a;
    color: #d8d8e8;
}

.mpg-style-dark .mpg-title {
    color: #e8e8f8;
}

.mpg-style-dark .mpg-title a {
    color: #e8e8f8;
}

.mpg-style-dark .mpg-title a:hover {
    color: #7eb8ff;
    text-decoration: underline;
}

.mpg-style-dark .mpg-excerpt {
    color: #bbbbd8;
}

.mpg-style-dark .mpg-meta {
    color: #6060a0;
}

.mpg-style-dark .mpg-cat-badge {
    background: #2e2e4a;
    color: #9090d0;
}

.mpg-style-dark .mpg-cat-badge:hover {
    background: #7eb8ff;
    color: #111;
}

.mpg-style-dark .mpg-read-more {
    color: #7eb8ff;
}

.mpg-style-dark .mpg-read-more:hover {
    color: #a0d0ff;
}


/* ============================================================
   HOVER EFFECTS
   ============================================================ */

/* ---- lift (default) ---- */
.mpg-hover-lift .mpg-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

/* Featured card with lift: subtle since it's already prominent */
.mpg-hover-lift .mpg-card--featured:hover {
    transform: translateY(-3px);
}

/* ---- zoom ---- */
.mpg-hover-zoom .mpg-card:hover .mpg-thumb img {
    transform: scale(1.07);
}

/* ---- fade ---- */
.mpg-hover-fade .mpg-container:hover .mpg-card {
    opacity: 0.55;
}

.mpg-hover-fade .mpg-container:hover .mpg-card:hover {
    opacity: 1;
}

/* ---- none ---- */
.mpg-hover-none .mpg-card:hover {
    transform: none;
    box-shadow: none;
}


/* ============================================================
   RESPONSIVE BREAKPOINTS
   (column-count is set via inline CSS var; we reduce at smaller screens)
   ============================================================ */
@media (max-width: 1024px) {
    .mpg-wrapper {
        column-count: min(var(--mpg-cols), 2);
    }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.mpg-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}

.mpg-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    background: #fff;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.mpg-pagination .page-numbers:hover {
    background: #f5f5f5;
    border-color: #aaa;
}

.mpg-pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
    cursor: default;
}

.mpg-pagination .page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* Dark style pagination */
.mpg-style-dark ~ .mpg-pagination .page-numbers {
    background: #1a1a2e;
    border-color: #2e2e4a;
    color: #d8d8e8;
}

.mpg-style-dark ~ .mpg-pagination .page-numbers:hover {
    background: #2e2e4a;
}

.mpg-style-dark ~ .mpg-pagination .page-numbers.current {
    background: #7eb8ff;
    border-color: #7eb8ff;
    color: #111;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1024px) {
    .mpg-wrapper {
        column-count: min(var(--mpg-cols), 2);
    }
}

@media (max-width: 600px) {
    .mpg-wrapper {
        column-count: 1;
    }

    .mpg-card-body {
        padding: 14px 16px 18px;
    }
}
