/* Contextual Related Posts - Modern Grid Redesign */
/* Injected via Visual Revolution V3 */

.crp_related {
    clear: both;
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Title Styling */
.crp_related h3,
.crp_related_widget h3 {
    font-family: 'Archivo', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: #f8fafc;
    /* V3 Light Text */
    border-left: 4px solid #3b82f6;
    /* V3 Accent */
    padding-left: 12px;
}

/* Grid Container */
.crp_related ul {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Force 4 columns on desktop */
    gap: 20px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Card Item */
.crp_related li {
    background: #1e293b;
    /* V3 Card Bg */
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    display: flex;
    flex-direction: column;
}

.crp_related li:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -5px rgba(0, 0, 0, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
    z-index: 2;
}

/* Link Wrapper */
.crp_related a {
    text-decoration: none !important;
    border: none !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Thumbnail */
.crp_related .crp_thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    /* Standard cinematic ratio */
    object-fit: cover;
    display: block;
    margin: 0;
    transition: transform 0.5s ease;
    border-radius: 8px 8px 0 0;
    /* Top rounding only */
}

.crp_related li:hover .crp_thumb {
    transform: scale(1.05);
}

/* Reset Figure (Crucial for eliminating gaps) */
.crp_related figure {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    display: block !important;
    width: 100% !important;
    /* Removed relative to avoid conflict, let 'a' handle anchor */
}

/* Force override of CRP inline styles */
.crp_related.crp-rounded-thumbs .crp_thumb {
    max-width: 100% !important;
    margin: 0 !important;
    display: block !important;
}

/* Title Text */
.crp_related .crp_title {
    display: flex !important;
    /* Flexbox plays nicer with Chrome */
    justify-content: center;
    align-items: center;
    width: 100% !important;
    height: auto !important;
    min-height: 40px;
    /* Ensure bar has height */
    padding: 8px 4px !important;
    font-size: 0.95rem !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.6) !important;
    /* Slightly darker for contrast */
    font-family: 'Space Grotesk', system-ui, sans-serif !important;
    font-weight: 700 !important;
    text-align: center !important;
    letter-spacing: 0.02em;

    /* Absolute Positioning */
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 50 !important;
    /* Very high */
    margin: 0 !important;

    /* Chrome Rendering Fixes */
    transform: translateZ(10px) !important;
    text-indent: 0 !important;
    white-space: normal !important;
    /* Allow wrap if flex needs it */
}

.crp_related li:hover .crp_title {
    color: #ffffff;
}

/* Tablet (2-3 cols) */
@media (max-width: 1024px) {
    .crp_related ul {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile (2 cols) */
@media (max-width: 640px) {
    .crp_related {
        margin-top: 30px;
    }

    .crp_related ul {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns is standard for mobile porn/tube sites */
        gap: 10px;
    }

    .crp_related .crp_title {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}