/* ==========================================================================
   AI SEO NEGARNOVIN — Related Posts block
   Dark mode support + centered 3-column grid + responsive.
   ========================================================================== */

.aiseo-nv-related {
    margin: 3rem 0;
    padding: 1.5rem 0;
    border-top: 2px solid #e2e8f0;
}
.aiseo-nv-related-title {
    font-size: 1.25rem;
    margin: 0 0 1.25rem;
    color: #1e293b;
    font-weight: 700;
    text-align: center;
}
.aiseo-nv-related-grid {
    /* Center 3 cards by default */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    max-width: 900px;
    margin: 0 auto;
}
.aiseo-nv-related-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.aiseo-nv-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .1);
    border-color: #0ea5e9;
}
.aiseo-nv-related-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
}
.aiseo-nv-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.aiseo-nv-related-content {
    padding: .85rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.aiseo-nv-related-card-title {
    font-size: .95rem;
    line-height: 1.45;
    margin: 0;
    color: #0f172a;
    font-weight: 600;
}
.aiseo-nv-related-date {
    font-size: .75rem;
    color: #94a3b8;
}

/* Auto-linked internal links — subtle styling. */
a.aiseo-nv-ilink {
    color: #0284c7;
    text-decoration: underline;
    text-decoration-color: rgba(2, 132, 199, .3);
    text-underline-offset: 2px;
    transition: text-decoration-color .15s;
}
a.aiseo-nv-ilink:hover {
    text-decoration-color: #0284c7;
}

/* RTL adjustments */
html[dir="rtl"] .aiseo-nv-related-card {
    text-align: right;
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    .aiseo-nv-related {
        border-top-color: #334155;
    }
    .aiseo-nv-related-title {
        color: #e2e8f0;
    }
    .aiseo-nv-related-card {
        background: #1e293b;
        border-color: #334155;
    }
    .aiseo-nv-related-card:hover {
        box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
        border-color: #38bdf8;
    }
    .aiseo-nv-related-thumb {
        background: #0f172a;
    }
    .aiseo-nv-related-card-title {
        color: #e2e8f0;
    }
    .aiseo-nv-related-date {
        color: #64748b;
    }
    a.aiseo-nv-ilink {
        color: #38bdf8;
        text-decoration-color: rgba(56, 189, 248, .3);
    }
    a.aiseo-nv-ilink:hover {
        text-decoration-color: #38bdf8;
    }
}

/* Manual dark mode via body class */
body.dark .aiseo-nv-related,
body[data-theme="dark"] .aiseo-nv-related,
.aiseo-dark .aiseo-nv-related {
    border-top-color: #334155;
}
body.dark .aiseo-nv-related-title,
body[data-theme="dark"] .aiseo-nv-related-title,
.aiseo-dark .aiseo-nv-related-title {
    color: #e2e8f0;
}
body.dark .aiseo-nv-related-card,
body[data-theme="dark"] .aiseo-nv-related-card,
.aiseo-dark .aiseo-nv-related-card {
    background: #1e293b;
    border-color: #334155;
}
body.dark .aiseo-nv-related-card-title,
body[data-theme="dark"] .aiseo-nv-related-card-title,
.aiseo-dark .aiseo-nv-related-card-title {
    color: #e2e8f0;
}

/* Responsive */
@media (max-width: 768px) {
    .aiseo-nv-related-grid {
        grid-template-columns: 1fr 1fr;
        gap: .75rem;
    }
    .aiseo-nv-related-card-title {
        font-size: .85rem;
    }
}
@media (max-width: 480px) {
    .aiseo-nv-related-grid {
        grid-template-columns: 1fr;
    }
}
