.apg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.apg-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.apg-card:hover {
    transform: translateY(-5px) scale(1.03);
}

.apg-thumb {
    width: 100%;
    background: #000;
}

.apg-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

.apg-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Title Styling */
.apg-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
    line-height: 1.3em;
    max-height: 3.9em; /* max 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Title link – no underline */
.apg-info a {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

.apg-info a h3 {
    text-decoration: none !important;
}

.apg-info a:hover h3 {
    color: #7b2cbf;
}

.apg-info p {
    font-size: 14px;
    color: #777;
    margin: 0;
}

.apg-pagination {
    margin-top: 30px;
    text-align: center;
}

/* Responsive Columns */
@media (max-width: 1200px) {
    .apg-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .apg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .apg-grid {
        grid-template-columns: 1fr;
    }
}
