/**
 * MIPB — Related Tools Grid Styles
 *
 * Centralized styles for the "Explore Related Tools" section.
 * Uses .mrt- prefix (mipb related tools).
 *
 * Matches the original per-tool styling: 4-column grid, top accent
 * bar, simple icon, compact cards.
 *
 * @since 1.6.0
 */

/* ── Container ────────────────────────────────────────────────────────────── */

.mrt-related {
    max-width: 1120px;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    margin-top: 2.5rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* ── Title ────────────────────────────────────────────────────────────────── */

.mrt-related-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

/* ── Grid Container ───────────────────────────────────────────────────────── */

.mrt-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* ── Card: Base Styles ────────────────────────────────────────────────────── */

.mrt-related-card {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1rem;
    border: 1px solid #dde;
    border-top: 3px solid var(--card-accent, #7b1fa2);
    border-radius: 8px;
    text-decoration: none;
    background: #fff;
    color: inherit;
    min-height: 140px;
    transition: box-shadow .18s, transform .18s;
}

.mrt-related-card:hover,
.mrt-related-card:focus-visible {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mrt-related-card:focus-visible {
    outline: 2px solid var(--card-accent, #7b1fa2);
    outline-offset: 2px;
}

/* ── Icon ─────────────────────────────────────────────────────────────────── */

.mrt-related-icon {
    font-size: 2.25rem;
    flex-shrink: 0;
    line-height: 1;
    color: var(--card-accent, #7b1fa2);
}

.mrt-related-icon svg {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */

.mrt-related-body {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}

.mrt-related-name {
    font-size: .9rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    word-break: break-word;
}

.mrt-related-desc {
    font-size: .8rem;
    color: #555;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ── Responsive: Tablet (2 columns) ───────────────────────────────────────── */

@media (max-width: 1024px) {
    .mrt-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Responsive: Mobile (1 column) — also fix 100vw overflow ─────────────── */

@media (max-width: 768px) {
    .mrt-related {
        width: 100% !important;
        margin-left: 0 !important;
        transform: none !important;
    }
}

@media (max-width: 600px) {
    .mrt-related-grid {
        grid-template-columns: 1fr;
        gap: .75rem;
    }

    .mrt-related-card {
        min-height: auto;
        padding: .75rem .9rem;
    }

    .mrt-related-icon {
        font-size: 1.75rem;
    }

    .mrt-related-icon svg {
        width: 30px;
        height: 30px;
    }

    .mrt-related-name {
        font-size: .88rem;
    }

    .mrt-related-desc {
        font-size: .78rem;
    }
}

/* ── Accessibility: reduced motion ────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .mrt-related-card {
        transition: none;
    }

    .mrt-related-card:hover,
    .mrt-related-card:focus-visible {
        transform: none;
    }
}
