/* ============================================================
   LJ Related Posts — Frontend Stylesheet
   Version: 1.0.0 | LJ TechHub
   ============================================================ */

/* ── Base ─────────────────────────────────────────────────── */
.ljrp-wrap { width: 100%; }

.ljrp-no-posts {
    color: #9CA3AF;
    font-style: italic;
    padding: 12px 0;
}

/* ── Section header ───────────────────────────────────────── */
.ljrp-section-header {
    border-bottom: 2px solid #E5E7EB;
    margin-bottom: 22px;
    padding-bottom: 8px;
    position: relative;
}

.ljrp-section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    display: inline-block;
    position: relative;
}

/* Red accent bar under title text */
.ljrp-section-title::after {
    content: '';
    display: block;
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 36px;
    height: 3px;
    background: #EF4444;
    border-radius: 2px;
}

/* ── Grid ─────────────────────────────────────────────────── */
.ljrp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── Card ─────────────────────────────────────────────────── */
.ljrp-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

/* Side layout (left / right image) */
.ljrp-card-side {
    flex-direction: row;
}

.ljrp-img-pos-left  .ljrp-card-side .ljrp-img-wrap { order: 0; }
.ljrp-img-pos-right .ljrp-card-side .ljrp-img-wrap { order: 2; }

.ljrp-card-side .ljrp-img-wrap { flex: 0 0 38%; }
.ljrp-card-side .ljrp-content  { flex: 1; min-width: 0; }

/* ── Image wrap ───────────────────────────────────────────── */
.ljrp-img-wrap {
    position: relative;
    overflow: hidden;
}

.ljrp-img-wrap img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.ljrp-no-thumb {
    width: 100%;
    height: 200px;
    display: block;
    background: #F3F4F6;
}

/* ── Content ──────────────────────────────────────────────── */
.ljrp-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ── Category badge ───────────────────────────────────────── */
.ljrp-cat-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.ljrp-cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.ljrp-cat-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #374151;
    line-height: 1;
}

/* Pill style */
.ljrp-cat-style-pill .ljrp-cat-label {
    padding: 3px 10px;
    border-radius: 50px;
    color: #fff;
    font-size: 10px;
    letter-spacing: 0.08em;
}

/* ── Title ────────────────────────────────────────────────── */
.ljrp-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.ljrp-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.25s ease;
    display: inline;
}

/* ── Excerpt ──────────────────────────────────────────────── */
.ljrp-excerpt {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 10px;
    line-height: 1.65;
}

/* ── Meta (author / date) ─────────────────────────────────── */
.ljrp-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 8px;
}

.ljrp-author {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #6B7280;
}

.ljrp-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.ljrp-date {
    font-size: 12px;
    color: #9CA3AF;
}

/* ============================================================
   CARD HOVER EFFECTS  (7 effets)
   ============================================================ */

/* 1. Lift ─────────────────────────────────────────────────── */
.ljrp-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ljrp-hover-lift:hover {
    transform: translateY(-7px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.13);
}

/* 2. Zoom Image ───────────────────────────────────────────── */
.ljrp-hover-zoom-img:hover .ljrp-img-wrap img {
    transform: scale(1.1);
}

/* 3. Overlay sombre ───────────────────────────────────────── */
.ljrp-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 1;
}
.ljrp-hover-overlay:hover .ljrp-overlay {
    opacity: 1;
}

/* 4. Slide Reveal ─────────────────────────────────────────── */
.ljrp-hover-slide-reveal .ljrp-excerpt {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    transition: max-height 0.45s ease, opacity 0.35s ease, margin 0.35s ease;
}
.ljrp-hover-slide-reveal:hover .ljrp-excerpt {
    max-height: 120px;
    opacity: 1;
    margin-bottom: 10px;
}

/* 5. Glow (couleur via JS inline) ─────────────────────────── */
.ljrp-hover-glow {
    transition: box-shadow 0.35s ease;
}
/* Fallback if no custom color set */
.ljrp-hover-glow:hover {
    box-shadow: 0 0 18px 4px rgba(59, 130, 246, 0.4), 0 0 40px 10px rgba(59, 130, 246, 0.12);
}

/* 6. Press (scale-down) ───────────────────────────────────── */
.ljrp-hover-scale-down {
    transition: transform 0.2s ease;
}
.ljrp-hover-scale-down:hover {
    transform: scale(0.97);
}

/* 7. Bordure colorée ──────────────────────────────────────── */
.ljrp-hover-fade-border {
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.ljrp-hover-fade-border:hover {
    border-color: #EF4444; /* overridden by Elementor selector */
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   TITLE HOVER EFFECTS  (5 effets)
   ============================================================ */

/* 1. Underline simple ─────────────────────────────────────── */
.ljrp-title-hover-underline a {
    text-decoration: none;
}
.ljrp-title-hover-underline a:hover {
    text-decoration: underline;
}

/* 2. Underline glissant ───────────────────────────────────── */
.ljrp-title-hover-underline-slide a {
    position: relative;
    text-decoration: none;
}
.ljrp-title-hover-underline-slide a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #EF4444;
    border-radius: 1px;
    transition: width 0.35s ease;
}
.ljrp-title-hover-underline-slide a:hover::after {
    width: 100%;
}

/* 3. Color-shift ──────────────────────────────────────────── */
.ljrp-title-hover-color-shift a {
    transition: color 0.25s ease;
}
/* hover color handled by Elementor selector */

/* 4. Highlight ────────────────────────────────────────────── */
.ljrp-title-hover-highlight a {
    background-image: linear-gradient(to right, transparent 50%, #FEF08A 50%);
    background-size: 200% 1.2em;
    background-position: 0% center;
    background-repeat: no-repeat;
    transition: background-position 0.45s ease, color 0.3s ease;
    padding: 0 2px;
    border-radius: 2px;
    text-decoration: none;
}
.ljrp-title-hover-highlight a:hover {
    background-position: -100% center;
    color: #111827 !important;
}

/* 5. Scale ────────────────────────────────────────────────── */
.ljrp-title-hover-scale a {
    display: inline-block;
    transition: transform 0.25s ease, color 0.25s ease;
    transform-origin: left center;
    text-decoration: none;
}
.ljrp-title-hover-scale a:hover {
    transform: scale(1.04);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .ljrp-grid[style*="repeat(5"] {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 1024px) {
    .ljrp-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .ljrp-card-side {
        flex-direction: column;
    }
    .ljrp-card-side .ljrp-img-wrap {
        flex: none;
        width: 100%;
    }
}

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