/* ═══════════════════════════════════════════════════════════
   Related Posts Pro — ULTRA Creative Frontend v3
   Brand: #ae0000 · Dark · Magazine · Editorial Premium
═══════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

.rpp-wrap *,
.rpp-asc-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ════════════════════════════════════════
   SECTION TITLE
════════════════════════════════════════ */
.rpp-wrap,
.rpp-asc-wrap {
    font-family: 'Poppins', -apple-system, sans-serif;
    margin: 64px 0;
}

.rpp-title {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: #ae0000;
    margin: 0 0 32px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.rpp-title::before {
    content: '';
    width: 28px;
    height: 2px;
    background: #ae0000;
    border-radius: 2px;
    flex-shrink: 0;
}

.rpp-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(174, 0, 0, 0.25), transparent);
}

/* ════════════════════════════════════════
   CARD BASE — shared by both grid types
════════════════════════════════════════ */
.rpp-post {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.4s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.3s ease;
}

.rpp-post::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(174, 0, 0, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.rpp-post:hover {
    transform: translateY(-8px);
    box-shadow:
        0 0 0 1px rgba(174, 0, 0, 0.3),
        0 24px 64px rgba(174, 0, 0, 0.18),
        0 8px 24px rgba(0, 0, 0, 0.6);
    border-color: rgba(174, 0, 0, 0.3);
}

.rpp-post:hover::after {
    opacity: 1;
}

/* ── Thumbnail ── */
.rpp-thumb {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: block;
    text-decoration: none;
}

.rpp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.rpp-post:hover .rpp-thumb img {
    transform: scale(1.08);
}

/* Overlay gradient always visible (bottom fade) */
.rpp-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(13, 13, 13, 0.9) 0%,
            rgba(13, 13, 13, 0.2) 40%,
            transparent 70%);
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Red sweep on hover */
.rpp-thumb-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(174, 0, 0, 0.0);
    transition: background 0.35s ease;
}

.rpp-post:hover .rpp-thumb-overlay {
    background: rgba(174, 0, 0, 0.15);
}

/* Circle play/read icon */
.rpp-thumb-icon {
    width: 52px;
    height: 52px;
    background: #ae0000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transform: scale(0.4) rotate(-15deg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 0 0 rgba(174, 0, 0, 0.5);
}

.rpp-post:hover .rpp-thumb-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: rpp-heartbeat 1.8s ease infinite;
}

@keyframes rpp-heartbeat {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(174, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 0 16px rgba(174, 0, 0, 0);
    }
}

/* Number badge on thumb — top left */
.rpp-thumb-num {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #888;
    transition: all 0.3s ease;
}

.rpp-post:hover .rpp-thumb-num {
    background: #ae0000;
    border-color: #ae0000;
    color: #fff;
}

/* ── Category badge (on thumb, top right) ── */
.rpp-cat {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(174, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 100, 100, 0.3);
    border-radius: 6px;
    padding: 4px 10px;
    display: inline-block;
    transition: background 0.2s ease;
}

.rpp-post:hover .rpp-cat {
    background: #ae0000;
}

/* ── Info block ── */
.rpp-info {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* ── Title ── */
.rpp-post-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: -0.2px;
}

.rpp-post-title a {
    color: #fff !important;
    text-decoration: none;
    transition: color 0.25s ease;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rpp-post:hover .rpp-post-title a {
    color: #ae0000 !important;
}

/* ── Meta row ── */
.rpp-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11px;
    margin-top: auto;
}

.rpp-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #4a4a4a;
}

.rpp-meta .rpp-author {
    color: #888;
    font-weight: 600;
}

.rpp-meta .rpp-date {
    color: #4a4a4a;
}

.rpp-meta svg {
    opacity: 0.6;
}

/* ═════════════════════════════════════════
   READ MORE BUTTON — FULL FIX
═════════════════════════════════════════ */
.rpp-read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
    /* default state */
    background: rgba(174, 0, 0, 0.08);
    border: 1px solid rgba(174, 0, 0, 0.25);
    color: #ae0000 !important;
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.2s ease;
}

.rpp-read-more svg {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    color: inherit;
}

/* HOVER — full red fill, WHITE text, arrow shoots right */
.rpp-read-more:hover {
    background: #ae0000 !important;
    border-color: #ae0000 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(174, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.rpp-read-more:hover svg {
    transform: translateX(5px);
    color: #ffffff;
}

/* ════════════════════════════════════════
   GRID LAYOUT (rpp-wrap)
════════════════════════════════════════ */
.rpp-grid .rpp-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.rpp-grid .rpp-thumb {
    aspect-ratio: 3/2;
}

/* ════════════════════════════════════════
   AUTHOR SHORTCODE (rpp-asc-wrap)
════════════════════════════════════════ */

/* ── Author Header ── */
.rpp-asc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 16px;
    flex-wrap: wrap;
}

.rpp-asc-header .rpp-title {
    margin: 0;
    flex-grow: 1;
}

.rpp-asc-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Avatar with spinning red ring */
.rpp-asc-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    width: 64px;
    height: 64px;
}

.rpp-asc-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 2px;
    left: 2px;
    border: 2px solid #1a1a1a;
    z-index: 1;
}

.rpp-asc-avatar-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(#ae0000 0deg, #ae0000 120deg, transparent 120deg, transparent 180deg, rgba(174, 0, 0, 0.3) 180deg, rgba(174, 0, 0, 0.3) 300deg, transparent 300deg);
    animation: rpp-ring-spin 3s linear infinite;
    border-radius: 50%;
}

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

.rpp-asc-header-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rpp-asc-title {
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ae0000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rpp-asc-title::before {
    content: '';
    width: 20px;
    height: 2px;
    background: #ae0000;
    border-radius: 2px;
}

.rpp-asc-author-name {
    font-size: 22px;
    font-weight: 900;
    color: #f2f2f2;
    letter-spacing: -0.8px;
    line-height: 1.1;
}

/* Page counter pill */
.rpp-asc-counter {
    display: flex;
    align-items: baseline;
    gap: 3px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 16px;
}

.rpp-asc-page-current {
    font-size: 22px;
    font-weight: 900;
    color: #ae0000;
    line-height: 1;
}

.rpp-asc-page-sep {
    font-size: 14px;
    color: #2a2a2a;
    font-weight: 300;
    margin: 0 2px;
}

.rpp-asc-page-total {
    font-size: 13px;
    color: #444;
    font-weight: 600;
}

/* Divider with animated glow */
.rpp-asc-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.04);
    margin: 20px 0 30px;
    position: relative;
    overflow: hidden;
}

.rpp-asc-divider span {
    position: absolute;
    top: 0;
    left: -100%;
    height: 100%;
    width: 60%;
    background: linear-gradient(to right, transparent, #ae0000, transparent);
    animation: rpp-slide 3s ease infinite;
}

@keyframes rpp-slide {
    0% {
        left: -60%;
    }

    100% {
        left: 110%;
    }
}

/* ── ASC Posts Grid ── */
.rpp-asc-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* ASC cards: taller thumb */
.rpp-asc-wrap .rpp-thumb {
    aspect-ratio: 3/2;
}

/* ── Card entrance animation ── */
.rpp-post-anim {
    opacity: 0;
    transform: translateY(30px);
}

/* ════════════════════════════════════════
   PAGINATION — ultra creative
════════════════════════════════════════ */
.rpp-asc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 44px;
    flex-wrap: wrap;
    overflow: hidden;
}

/* Prev / Next */
.rpp-pgn-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #555;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.rpp-pgn-btn:not(:disabled):hover {
    background: rgba(174, 0, 0, 0.1);
    border-color: rgba(174, 0, 0, 0.35);
    color: #ae0000;
    transform: translateY(-1px);
}

.rpp-pgn-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* Number dots */
.rpp-pgn-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rpp-pgn-dot {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #444;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    overflow: hidden;
}

.rpp-pgn-dot span {
    position: relative;
    z-index: 1;
    transition: color 0.25s ease;
}

.rpp-pgn-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #ae0000;
    transform: scale(0);
    border-radius: 9px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rpp-pgn-dot:not(.active):hover {
    border-color: rgba(174, 0, 0, 0.35);
    color: #ae0000;
}

.rpp-pgn-dot.active {
    border-color: #ae0000;
    box-shadow: 0 0 20px rgba(174, 0, 0, 0.35), 0 4px 12px rgba(174, 0, 0, 0.2);
}

.rpp-pgn-dot.active span {
    color: #fff;
}

.rpp-pgn-dot.active::before {
    transform: scale(1);
}

/* ════════════════════════════════════════
   LIGHT THEME
════════════════════════════════════════ */
.rpp-light .rpp-post {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.rpp-light .rpp-post:hover {
    box-shadow: 0 0 0 1px rgba(174, 0, 0, 0.25), 0 20px 50px rgba(174, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rpp-light .rpp-post-title a {
    color: #111;
}

.rpp-light .rpp-post:hover .rpp-post-title a {
    color: #ae0000;
}

.rpp-light .rpp-info {
    background: #fff;
}

.rpp-light .rpp-meta .rpp-author {
    color: #444;
}

.rpp-light .rpp-meta .rpp-date {
    color: #aaa;
}

.rpp-light .rpp-asc-author-name {
    color: #111;
}

.rpp-light .rpp-thumb::before {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.85) 0%, transparent 60%);
}

.rpp-light .rpp-pgn-btn {
    border-color: rgba(0, 0, 0, 0.1);
    color: #888;
    background: rgba(0, 0, 0, 0.02);
}

.rpp-light .rpp-pgn-dot {
    border-color: rgba(0, 0, 0, 0.08);
    color: #aaa;
    background: rgba(0, 0, 0, 0.02);
}

.rpp-light .rpp-asc-counter {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.03);
}

.rpp-light .rpp-asc-page-total {
    color: #aaa;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
    .rpp-asc-posts {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .rpp-grid .rpp-posts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .rpp-asc-posts {
        grid-template-columns: 1fr !important;
    }

    .rpp-grid .rpp-posts {
        grid-template-columns: 1fr;
    }

    .rpp-asc-author-name {
        font-size: 18px;
    }

    .rpp-pgn-dot {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .rpp-pgn-btn {
        padding: 9px 14px;
        font-size: 10px;
    }

    .rpp-asc-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ── Multiple category badges ── */
.rpp-thumb .rpp-cat+.rpp-cat {
    top: auto;
    /* stack vertically on thumb */
}

/* When multiple cats on thumb, use flex column top-right */
.rpp-thumb {
    /* cats are absolutely positioned; allow stacking */
}

/* Re-position multiple cats as a flex column */
.rpp-cats-wrap {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.rpp-cats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.rpp-cat-inline {
    position: static !important;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ae0000;
    background: rgba(174, 0, 0, 0.1);
    border: 1px solid rgba(174, 0, 0, 0.22);
    border-radius: 4px;
    padding: 3px 9px;
    display: inline-block;
}