/* ============================================================
   Divi Blog Grid Module — blog-grid.css
   ============================================================ */

/* Grid wrapper */
.dbg-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.dbg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ── Card ───────────────────────────────────────────────── */
.dbg-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s ease;
    position: relative;
}

/* ── Image ──────────────────────────────────────────────── */
.dbg-card-image-link {
    display: block;
    text-decoration: none;
}

.dbg-image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 default, overridden inline */
    overflow: hidden;
    background: #e8e8f0;
}

.dbg-image-wrap img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.dbg-placeholder-img {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e8e8f4 0%, #d0d0e8 100%);
}

/* ── Card Body ──────────────────────────────────────────── */
.dbg-card-body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

/* ── Category Badge ─────────────────────────────────────── */
.dbg-category-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    background: #5b5fc7;
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none !important;
    align-self: flex-start;
    line-height: 1.6;
    transition: opacity 0.2s ease;
}
.dbg-category-badge:hover {
    opacity: 0.85;
}

/* ── Title ──────────────────────────────────────────────── */
.dbg-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0 0;
    color: #1a1a2e;
}
.dbg-title a {
    color: inherit !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}
.dbg-title a:hover {
    opacity: 0.72;
}

/* ── Meta ───────────────────────────────────────────────── */
.dbg-meta {
    font-size: 12px;
    color: #888899;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}
.dbg-meta-sep {
    opacity: 0.5;
}
.dbg-meta-author {
    color: inherit !important;
    text-decoration: none !important;
}
.dbg-meta-author:hover {
    text-decoration: underline !important;
}

/* ── Excerpt ────────────────────────────────────────────── */
.dbg-excerpt {
    font-size: 14px;
    line-height: 1.65;
    color: #555577;
    margin: 4px 0 0;
    flex: 1;
}

/* ── Read More ──────────────────────────────────────────── */
.dbg-read-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    position: relative;
    align-self: flex-start;
    letter-spacing: 0.02em;
    /* color is set via scoped inline CSS with !important so the picker wins */
}
.dbg-read-more::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 1.5px;
    width: 0;
    /* background also set via scoped inline CSS */
    transition: width 0.25s ease;
}
.dbg-read-more:hover::after {
    width: 100%;
}

/* ── No Posts ───────────────────────────────────────────── */
.dbg-no-posts {
    padding: 24px;
    color: #888;
    font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 980px) {
    .dbg-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 18px !important;
    }
}

@media (max-width: 600px) {
    .dbg-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .dbg-card-body {
        padding: 16px;
    }
    .dbg-title {
        font-size: 16px;
    }
}

/* ── Numbered Pagination ─────────────────────────────────── */
.dbg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
}

.dbg-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1.5px solid currentColor;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.dbg-page-link.is-active {
    cursor: default;
    pointer-events: none;
}

.dbg-page-dots {
    display: inline-flex;
    align-items: center;
    padding: 0 4px;
    font-size: 14px;
    color: #aaa;
    letter-spacing: 0.1em;
}

/* ── Load More ───────────────────────────────────────────── */
.dbg-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.dbg-load-more-btn {
    display: inline-block;
    padding: 12px 32px;
    border: 2px solid currentColor;
    border-radius: 8px;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.22s ease, color 0.22s ease;
    letter-spacing: 0.03em;
}

.dbg-load-more-btn:disabled,
.dbg-load-more-btn.is-loading {
    opacity: 0.5;
    cursor: not-allowed;
}
