/* ==============================================================
 * Related Items section — "You might also like"
 * Lazy-loaded card list at the bottom of every edit-advanced page.
 * ============================================================== */

.related-items-section {
    margin-top: 32px;
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-indigo-light .related-items-section {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.related-items-header {
    margin-bottom: 16px;
}

.related-items-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-items-title > i {
    color: #818cf8;
}

/* Grid 3 cols desktop, scroll horizontal mobile */
.related-items-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .related-items-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Card */
.related-item-card {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
    min-height: 100px;
}

.theme-indigo-light .related-item-card {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

.related-item-card:hover {
    transform: translateY(-2px);
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.4);
    text-decoration: none !important;
    color: inherit;
}

.theme-indigo-light .related-item-card:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Cover */
.related-item-cover {
    flex: 0 0 64px;
    width: 64px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.theme-indigo-light .related-item-cover {
    background: #f1f5f9;
}

.related-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-item-cover-placeholder {
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 184, 0.6);
    font-size: 1.4rem;
}

/* Info column */
.related-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.related-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    /* clamp 2 linhas */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-item-year {
    font-size: 0.75rem;
    opacity: 0.7;
    color: inherit;
}

/* Skeleton state (visible until JS swaps in real data) */
.related-item-skeleton .related-item-cover,
.related-item-name-skeleton,
.related-item-meta-skeleton {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.05) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    animation: relatedItemsShimmer 1.5s infinite;
    border-radius: 4px;
}

.theme-indigo-light .related-item-skeleton .related-item-cover,
.theme-indigo-light .related-item-name-skeleton,
.theme-indigo-light .related-item-meta-skeleton {
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.04) 25%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
}

.related-item-name-skeleton {
    height: 14px;
    width: 80%;
}

.related-item-meta-skeleton {
    height: 10px;
    width: 50%;
}

@keyframes relatedItemsShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
