/**
 * PR Ajax Listing — Estilos
 * Tema limpo e profissional alinhado ao Portal Revelação.
 */

/* ── Variáveis ────────────────────────────────────────────────────────────── */
:root {
    --pr-primary:     #1a3a5c;
    --pr-accent:      #c9952a;
    --pr-accent-soft: #f5e6c8;
    --pr-premium:     #7b2d8b;
    --pr-serie:       #1e6b3a;
    --pr-text:        #1f2937;
    --pr-muted:       #6b7280;
    --pr-border:      #e5e7eb;
    --pr-bg-card:     #ffffff;
    --pr-bg-hover:    #f9fafb;
    --pr-radius:      10px;
    --pr-shadow:      0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --pr-shadow-hover:0 4px 12px rgba(0,0,0,.12), 0 8px 32px rgba(0,0,0,.1);
    --pr-transition:  0.22s ease;
}

/* ── Container principal ─────────────────────────────────────────────────── */
.pr-ajax-container {
    position: relative;
    width: 100%;
}

.pr-listing-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pr-primary);
    margin: 0 0 1.25rem;
    padding-bottom: .625rem;
    border-bottom: 3px solid var(--pr-accent);
}

/* ── Grid de cards ───────────────────────────────────────────────────────── */
#pr-posts-grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
    gap: 1.25rem;
    transition: opacity .2s ease;
}

@media ( max-width: 640px ) {
    #pr-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.pr-card {
    background: var(--pr-bg-card);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    overflow: hidden;
    box-shadow: var(--pr-shadow);
    transition: transform var(--pr-transition), box-shadow var(--pr-transition);
}

.pr-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--pr-shadow-hover);
}

/* Animação de entrada ao carregar via AJAX */
.pr-card--animate {
    animation: pr-fade-in .32s ease both;
}

@keyframes pr-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pr-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Thumbnail */
.pr-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #e9edf2;
    flex-shrink: 0;
}

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

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

.pr-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient( 135deg, #dde3eb 0%, #c8d2df 100% );
}

/* Body */
.pr-card-body {
    padding: .9rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Badges */
.pr-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .5rem;
    min-height: 0;
}

.pr-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .7rem;
    font-weight: 600;
    padding: .2rem .55rem;
    border-radius: 4px;
    line-height: 1.2;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.pr-badge-premium {
    background: #f3e8ff;
    color: var(--pr-premium);
    border: 1px solid #ddd6fe;
}

.pr-badge-serie {
    background: #dcfce7;
    color: var(--pr-serie);
    border: 1px solid #bbf7d0;
    text-transform: none;
    font-size: .72rem;
}

.pr-badge-icon {
    font-size: .8em;
}

/* Título */
.pr-card-title {
    font-size: .975rem;
    font-weight: 700;
    color: var(--pr-primary);
    margin: 0 0 .4rem;
    line-height: 1.4;
    transition: color var(--pr-transition);
}

.pr-card:hover .pr-card-title {
    color: var(--pr-accent);
}

/* Excerpt */
.pr-card-excerpt {
    font-size: .845rem;
    color: var(--pr-muted);
    line-height: 1.55;
    margin: 0 0 .6rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Data */
.pr-card-date {
    font-size: .75rem;
    color: #9ca3af;
    margin-top: auto;
    font-variant-numeric: tabular-nums;
}

/* ── Mensagem sem posts ───────────────────────────────────────────────────── */
.pr-no-posts {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--pr-muted);
    padding: 2rem 1rem;
    font-size: .95rem;
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.pr-loading-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.72);
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--pr-radius);
    backdrop-filter: blur(2px);
}

.pr-spinner-ring {
    width: 44px;
    height: 44px;
    border: 4px solid var(--pr-border);
    border-top-color: var(--pr-primary);
    border-radius: 50%;
    animation: pr-spin .7s linear infinite;
}

@keyframes pr-spin {
    to { transform: rotate(360deg); }
}

/* ── Paginação ────────────────────────────────────────────────────────────── */
.pr-pagination-ajax {
    margin-top: 1.75rem;
    text-align: center;
}

.pr-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.pr-page-info {
    font-size: .8rem;
    color: var(--pr-muted);
    margin: .5rem 0 0;
}

/* Botões Anterior / Próximo — apenas ícone */
.pr-btn-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--pr-primary);
    background: #fff;
    border: 2px solid var(--pr-primary);
    border-radius: 7px;
    cursor: pointer;
    transition: background var(--pr-transition), color var(--pr-transition), transform var(--pr-transition);
    flex-shrink: 0;
}

.pr-btn-page:not(.pr-btn-disabled):hover {
    background: var(--pr-primary);
    color: #fff;
    transform: translateY(-1px);
}

.pr-btn-page svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.pr-btn-disabled {
    opacity: .4;
    cursor: default;
    pointer-events: none;
}

/* Números de página */
.pr-page-numbers {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pr-num-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--pr-text);
    background: #fff;
    border: 1.5px solid var(--pr-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--pr-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pr-num-btn:hover {
    border-color: var(--pr-primary);
    color: var(--pr-primary);
    background: #eef3f8;
}

.pr-num-active {
    background: var(--pr-primary);
    border-color: var(--pr-primary);
    color: #fff !important;
    pointer-events: none;
}

.pr-ellipsis {
    color: var(--pr-muted);
    padding: 0 .2rem;
    font-size: .9rem;
    line-height: 36px;
    display: inline-flex;
    align-items: center;
}

/* ── Erro ────────────────────────────────────────────────────────────────── */
.pr-error {
    color: #b91c1c;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.pr-btn-retry {
    background: #fef2f2;
    border: 1.5px solid #fca5a5;
    color: #b91c1c;
    padding: .3rem .8rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: background var(--pr-transition);
}

.pr-btn-retry:hover {
    background: #fee2e2;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media ( max-width: 480px ) {
    .pr-num-btn {
        min-width: 30px;
        height: 30px;
        font-size: .78rem;
    }
    .pr-btn-page {
        width: 30px;
        height: 30px;
    }
    .pr-pagination-inner {
        gap: .35rem;
    }
}
