/* ============================================================
   Futake Post Grid — Frontend CSS
   ============================================================ */

/* ── Wrapper & Grid ─────────────────────────────────────── */
.fpg-wrapper {
    width: 100%;
    margin: 0 auto;
}

.fpg-grid {
    display: grid;
    grid-template-columns: repeat(var(--fpg-cols, 2), 1fr);
    gap: var(--fpg-gap, 24px);
}

/* ── Card ───────────────────────────────────────────────── */
.fpg-card-item {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: box-shadow .25s ease, transform .25s ease;
    background: #fff;
}

.fpg-card-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
    transform: translateY(-3px);
}

/* ── Thumbnail ──────────────────────────────────────────── */
.fpg-card-thumb {
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}

.fpg-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.fpg-card-item:hover .fpg-card-thumb img {
    transform: scale(1.04);
}

.fpg-card-link {
    display: block;
    text-decoration: none;
}

/* ── No thumbnail placeholder ───────────────────────────── */
.fpg-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8edf2;
}

.fpg-no-thumb .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #a0aec0;
}

/* ── Badge Tanggal ──────────────────────────────────────── */
.fpg-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 48px;
    min-height: 54px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.fpg-badge-day {
    font-size: 18px;
    font-weight: 700;
    display: block;
}

.fpg-badge-month {
    font-size: 11px;
    font-weight: 600;
    display: block;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ── Card Body ──────────────────────────────────────────── */
.fpg-card-body {
    padding: 16px 18px 18px;
    text-align: center;
}

.fpg-card-date {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 6px;
    letter-spacing: .02em;
}

.fpg-card-title {
    margin: 0 0 10px;
    line-height: 1.4;
    font-weight: 700;
}

.fpg-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s;
}

.fpg-card-title a:hover {
    color: #C0392B;
}

.fpg-card-excerpt {
    font-size: 14px;
    line-height: 1.65;
    margin: 0;
}

/* ── No posts ───────────────────────────────────────────── */
.fpg-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: #94a3b8;
    padding: 40px;
    font-size: 15px;
}

/* ── Load More ──────────────────────────────────────────── */
.fpg-load-more-wrap {
    text-align: center;
    margin-top: 32px;
}

.fpg-load-more-btn {
    display: inline-block;
    padding: 13px 36px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    letter-spacing: .02em;
    font-family: inherit;
    transition: opacity .2s ease, transform .15s ease;
    min-width: 200px;
}

.fpg-load-more-btn:hover {
    opacity: .88;
}

.fpg-load-more-btn:active {
    transform: scale(.97);
}

.fpg-load-more-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.fpg-load-more-btn.fpg-done {
    opacity: .6;
    cursor: default;
}

/* ── Loading spinner ────────────────────────────────────── */
.fpg-load-more-btn.fpg-loading {
    pointer-events: none;
    position: relative;
    padding-left: 48px;
}

.fpg-load-more-btn.fpg-loading::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: fpg-spin .7s linear infinite;
}

@keyframes fpg-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Animasi masuk card baru ────────────────────────────── */
.fpg-card-item.fpg-animate-in {
    animation: fpg-fade-up .4s ease both;
}

@keyframes fpg-fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 540px) {
    .fpg-grid {
        grid-template-columns: 1fr !important;
    }
}
