/* Earth5th Related Cards 1.0.1 — scoped to this plugin, no external assets. */
.e5rc {
    --e5rc-ink: #0f172a;
    --e5rc-blue: #155eef;
    --e5rc-line: #e2e8f0;
    clear: both;
    margin: 24px 0 12px;
    padding: 0;
    border: 0;
    color: var(--e5rc-ink);
    font-family: inherit;
}
.e5rc, .e5rc * { box-sizing: border-box; }
/* Protect only this component from site-wide section/heading/list spacing. */
.entry-content section.e5rc[data-earth5th-related="1"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    margin: 24px 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
}
/* Hide only a trailing separator directly touching this component. No ad/spacer rules. */
.entry-content hr:has(+ section.e5rc[data-earth5th-related="1"]) {
    display: none !important;
}
.e5rc h2.e5rc__heading {
    margin: 0 0 18px !important;
    padding: 0 !important;
    border: 0 !important;
    color: var(--e5rc-ink);
    font-family: inherit;
    font-size: 24px !important;
    font-weight: 700;
    line-height: 1.6 !important;
    text-transform: none;
    letter-spacing: normal;
}
.e5rc ul.e5rc__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.e5rc li.e5rc__item {
    display: block;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.e5rc a.e5rc__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--e5rc-line);
    border-radius: 14px;
    background: #fff;
    color: var(--e5rc-ink);
    text-decoration: none;
    box-shadow: 0 4px 14px rgb(15 23 42 / 4%);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.e5rc a.e5rc__link:hover {
    border-color: #97b6ff;
    color: var(--e5rc-ink);
    text-decoration: none;
    box-shadow: 0 6px 18px rgb(15 23 42 / 9%);
}
.e5rc a.e5rc__link:focus-visible {
    outline: 3px solid var(--e5rc-blue);
    outline-offset: 3px;
}
/* Underline rules from article CSS must not split up an entire card visually. */
.entry-content .e5rc a.e5rc__link,
.entry-content .e5rc a.e5rc__link:hover,
.entry-content .e5rc a.e5rc__link:visited,
.entry-content .e5rc a.e5rc__link * {
    text-decoration: none !important;
}
.e5rc .e5rc__media {
    display: block;
    width: 100%;
    aspect-ratio: 1200 / 628;
    overflow: hidden;
    background: #edf3ff;
}
.e5rc img.e5rc__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0 !important;
    object-fit: cover;
}
.e5rc .e5rc__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--e5rc-ink);
    font: 700 21px/1.3 system-ui, sans-serif;
}
.e5rc .e5rc__placeholder span { color: var(--e5rc-blue); }
.e5rc .e5rc__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 16px;
}
.e5rc .e5rc__title {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--e5rc-ink);
    font-family: inherit;
    font-size: 17px;
    font-weight: 650;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.e5rc .e5rc__cta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    margin-top: auto;
    color: var(--e5rc-blue);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
}
@media (max-width: 680px) {
    .entry-content section.e5rc[data-earth5th-related="1"] {
        margin: 22px 0 8px !important;
    }
    .e5rc h2.e5rc__heading { font-size: 22px !important; margin-bottom: 16px !important; }
    .e5rc ul.e5rc__grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .entry-content .e5rc a.e5rc__link {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 14px;
    }
    .e5rc .e5rc__media {
        width: 100% !important;
        aspect-ratio: 1200 / 628;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    .e5rc .e5rc__body { padding: 16px !important; gap: 14px; }
    .e5rc .e5rc__title {
        font-size: 17px !important;
        font-weight: 650;
        line-height: 1.7 !important;
        letter-spacing: normal;
    }
    .e5rc .e5rc__cta {
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 8px;
        background: var(--e5rc-blue);
        color: #fff !important;
        font-size: 14px;
        line-height: 1.5;
    }
}
@media (prefers-reduced-motion: reduce) {
    .e5rc a.e5rc__link { transition: none; }
}
