/* =====================================================
   Posenda Blog Grid — assets/css/blog-grid.css
   Version: 1.0.0 | posenda.com
   ===================================================== */

/* ---------- Wrapper & Grid ---------- */
.pbg-wrapper {
    width: 100%;
}

.pbg-grid {
    display: grid;
    width: 100%;
}

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

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

@media (max-width: 640px) {
    .pbg-cols-2,
    .pbg-cols-3,
    .pbg-cols-4 { grid-template-columns: 1fr; }
}

/* ---------- Card ---------- */
.pbg-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.pbg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* ---------- Card Image ---------- */
.pbg-card-image {
    display: block;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
    text-decoration: none;
}

.pbg-card-image::after {
    content: '';
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.15) 100%);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.pbg-card:hover .pbg-card-image::after {
    opacity: 1;
}

.pbg-no-image {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #94a3b8;
}

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

/* ---------- Category Badge ---------- */
.pbg-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c3fda;
    text-decoration: none;
    line-height: 1;
}

.pbg-category:hover {
    text-decoration: underline;
}

/* ---------- Title ---------- */
.pbg-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
}

.pbg-title a {
    color: #1a1a2e;
    text-decoration: none;
    transition: color 0.2s;
}

.pbg-title a:hover {
    color: #6c3fda;
}

/* ---------- Excerpt ---------- */
.pbg-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #64748b;
    flex-grow: 1;
}

/* ---------- Date ---------- */
.pbg-date {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 4px;
}

/* ---------- Read More ---------- */
.pbg-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 9px 18px;
    background-color: #6c3fda;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    align-self: flex-start;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    line-height: 1;
}

.pbg-read-more:hover {
    background-color: #5a32b8;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108, 63, 218, 0.35);
    color: #ffffff;
}

.pbg-rm-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.pbg-read-more:hover .pbg-rm-arrow {
    transform: translateX(3px);
}

/* ---------- No Posts ---------- */
.pbg-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 16px;
}

/* ---------- Loading / Spinner ---------- */
.pbg-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.pbg-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #6c3fda;
    border-radius: 50%;
    animation: pbgSpin 0.7s linear infinite;
}

@keyframes pbgSpin {
    to { transform: rotate(360deg); }
}

/* ---------- Fade-in animation ---------- */
.pbg-card {
    animation: pbgFadeUp 0.4s ease both;
}

@keyframes pbgFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delays */
.pbg-card:nth-child(1)  { animation-delay: 0.00s; }
.pbg-card:nth-child(2)  { animation-delay: 0.05s; }
.pbg-card:nth-child(3)  { animation-delay: 0.10s; }
.pbg-card:nth-child(4)  { animation-delay: 0.15s; }
.pbg-card:nth-child(5)  { animation-delay: 0.20s; }
.pbg-card:nth-child(6)  { animation-delay: 0.25s; }
.pbg-card:nth-child(7)  { animation-delay: 0.30s; }
.pbg-card:nth-child(8)  { animation-delay: 0.35s; }

/* ---------- Pagination ---------- */
.pbg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pbg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.pbg-page-btn:hover:not(.disabled) {
    border-color: #6c3fda;
    color: #6c3fda;
    background: #f5f0ff;
}

.pbg-page-btn.active {
    background: #6c3fda;
    border-color: #6c3fda;
    color: #fff;
    pointer-events: none;
}

.pbg-page-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pbg-page-btn.prev,
.pbg-page-btn.next {
    font-size: 18px;
    padding: 0 10px;
}

.pbg-page-dots {
    color: #94a3b8;
    font-size: 16px;
    letter-spacing: 2px;
    padding: 0 4px;
    user-select: none;
}

/* ---------- Hata mesajı ---------- */
.pbg-no-posts.pbg-error {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 14px;
}
