/*
 * "עוד כתבות" — the feed at the end of the article (includes/mi-feed.php, doc/mi-feed.md).
 * The cards are those of "אולי יעניין אותך" and take its styles (_maybe-interesting.css of
 * ttfc-css-compiler); here only the feed's own grid, title, label and button. Loaded only on
 * the articles that get the feed, so a site where it is off does not change.
 */

.mi-feed {
    max-width: var(--post-content-width, 750px);
    margin: 40px auto;
    padding: 0 20px;
}

/* As the last child of the article body, WordPress's layout rule (:last-child → margin-block-end: 0)
   would put the button against the footer. */
.entry-content.wp-block-post-content > .mi-feed:last-child {
    margin-bottom: 40px;
}

.mi-feed__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color-jhhd, #1B365D);
    text-align: center;
    margin: 0 0 30px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color-jhhd, #DE0100);
}

.mi-feed__title[hidden],
.mi-feed__more[hidden] {
    display: none;
}

.mi-feed__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px 20px;
    align-items: stretch;
}

.mi-feed__item {
    min-width: 0;
}

.mi-feed__item .maybe-interesting-card {
    height: 100%;
}

.mi-feed__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 3px;
    pointer-events: none;
}

.mi-feed__sentinel {
    height: 1px;
}

.mi-feed__status {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mi-feed.is-loading .mi-feed__sentinel {
    height: 48px;
    background: radial-gradient(circle, var(--primary-color-jhhd, #DE0100) 0 4px, transparent 5px) center / 24px 12px repeat-x;
    width: 72px;
    margin: 16px auto 0;
    opacity: 0.6;
}

.mi-feed__more {
    display: block;
    margin: 28px auto 0;
    padding: 12px 36px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: var(--primary-color-jhhd, #DE0100);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.mi-feed__more:hover {
    opacity: 0.9;
}

.mi-feed__more:focus-visible {
    outline: 3px solid var(--secondary-color-jhhd, #1B365D);
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .mi-feed {
        padding: 0;
        margin: 30px auto;
    }

    .mi-feed__title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .mi-feed__grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .mi-feed__more {
        width: 100%;
    }

    /* With side banners the article sits in .ttfc-post-content-wrapper (20px padding) and the
       feed comes after that wrapper, so it needs the same gutter itself. */
    .ttfc-post-content-with-sidebar-banner + .mi-feed {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .mi-feed__title {
        font-size: 20px;
    }
}
