/* =====================================================
   Smart Post Grid & Carousel for Elementor
   Frontend Styles
   ===================================================== */

/* ----- Grid ----- */
.spg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.spg-grid--masonry {
    align-items: start;
}

/* ----- Card ----- */
.spg-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
}
.spg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

/* Thumbnail */
.spg-card__thumb-link {
    display: block;
    overflow: hidden;
}
.spg-card__thumb {
    height: 220px;
    overflow: hidden;
    background: #f0f0f0;
}
.spg-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.spg-card:hover .spg-card__img {
    transform: scale(1.05);
}

/* Body */
.spg-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category badge */
.spg-card__meta-top {
    margin-bottom: 10px;
}
.spg-card__cat {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    text-decoration: none;
    line-height: 1.6;
}
.spg-card__cat:hover {
    opacity: .85;
    text-decoration: none;
    color: #fff;
}

/* Title */
.spg-card__title {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}
.spg-card__title a {
    text-decoration: none;
    color: inherit;
    transition: color .2s;
}
.spg-card__title a:hover {
    color: #0073aa;
}

/* Meta row */
.spg-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}
.spg-card__date,
.spg-card__author {
    display: flex;
    align-items: center;
    gap: 4px;
}
.spg-card__meta svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

/* Excerpt */
.spg-card__excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 16px;
    flex: 1;
}

/* Button */
.spg-card__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #0073aa;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: background .2s, transform .15s;
    align-self: flex-start;
    margin-top: auto;
}
.spg-card__btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.spg-card__btn:hover {
    background: #005d8f;
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

/* ----- Pagination ----- */
.spg-pagination {
    margin-top: 32px;
    text-align: center;
}
.spg-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 3px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
}
.spg-pagination .page-numbers.current,
.spg-pagination .page-numbers:hover {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}
.spg-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ----- Load More ----- */
.spg-load-more-wrap {
    margin-top: 32px;
    text-align: center;
}
.spg-load-more {
    display: inline-block;
    padding: 12px 32px;
    background: #0073aa;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s;
}
.spg-load-more:hover { background: #005d8f; }
.spg-load-more:disabled { opacity: .6; cursor: not-allowed; }

/* ----- No posts ----- */
.spg-no-posts {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 24px 0;
}

/* ----- Carousel wrapper (relative for arrows) ----- */
.spg-carousel-wrap {
    position: relative;
}
.spg-carousel {
    overflow: hidden;
}
.spg-carousel .spg-card {
    height: 100%; /* equal-height slides */
}

/* Arrow buttons */
.spg-carousel__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0073aa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    transition: background .2s, transform .2s;
}
.spg-carousel__btn--prev { left: -22px; }
.spg-carousel__btn--next { right: -22px; }
.spg-carousel__btn:hover { background: #005d8f; }
.spg-carousel__btn svg   { stroke: #fff; }

/* Pagination dots spacing */
.spg-carousel__pagination {
    margin-top: 16px;
    position: relative !important;
    bottom: auto !important;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .spg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .spg-grid { grid-template-columns: 1fr; }
    .spg-carousel__btn--prev { left: 0; }
    .spg-carousel__btn--next { right: 0; }
}
