/* ============================================================
   Yomi – news feed

   Every selected visual value is a variable. The defaults below
   must match yomi_get_design_fields() in PHP; values from
   Our plugins → Yomi → Design are printed after this file and win.
   The articles keep the look the news feed had in Mariko.
   ============================================================ */
.yomi {
    --yomi-filter-color: #111111;
    --yomi-filter-background: #ffffff;
    --yomi-filter-border-width: 1px;
    --yomi-filter-radius: 999px;
    --yomi-filter-font-size: 12px;

    --yomi-columns: 3;
    --yomi-columns-tablet: 2;
    --yomi-columns-mobile: 1;
    --yomi-gap: 20px;
    --yomi-title-size: 22px;
    --yomi-title-color: #000000;
    --yomi-text-size: 16px;
    --yomi-text-color: #000000;
    --yomi-date-size: 13px;
    --yomi-date-color: #8f8f8f;

    /* Room for Avada's sticky header when a link scrolls to the feed */
    scroll-margin-top: 120px;
}

/* ============================================================
   Filter buttons – outlined pills with text only, filled with the
   colour on hover and when active. On tablet and mobile they fill a
   grid's columns.
   ============================================================ */
.yomi-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* As wide as the text, not stretched to fill the row: in the full
   content width that left the buttons mostly empty. About 34px high
   on desktop; mobile raises them to a 44px touch target. */
.yomi-filter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 9px 20px;
    border: var(--yomi-filter-border-width) solid var(--yomi-filter-color);
    border-radius: var(--yomi-filter-radius);
    background: var(--yomi-filter-background);
    box-shadow: none;
    color: var(--yomi-filter-color);
    font-family: "Source Sans 3", sans-serif;
    font-size: var(--yomi-filter-font-size);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-align: center;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.yomi-filter:hover,
.yomi-filter:focus-visible,
.yomi-filter.is-active {
    border-color: var(--yomi-filter-color);
    background: var(--yomi-filter-color);
    color: var(--yomi-filter-background);
}

.yomi-filter:focus {
    outline: none;
}

.yomi-filter:focus-visible {
    outline: 2px solid var(--yomi-filter-color);
    outline-offset: 2px;
}

/* ============================================================
   Articles
   ============================================================ */
.yomi-results {
    transition: opacity 0.2s ease-in-out;
}

.yomi.is-loading .yomi-results {
    opacity: 0.4;
}

.yomi-grid {
    display: grid;
    grid-template-columns: repeat(var(--yomi-columns), minmax(0, 1fr));
    gap: var(--yomi-gap);
    margin-top: 20px;
}

.yomi-post {
    position: relative;
    overflow: hidden;
    text-align: left;
}

.yomi-post__image {
    display: block;
    overflow: hidden;
}

.yomi-post__image img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 1s, transform 1s;
}

.yomi-post__image:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

.yomi-post__title {
    margin: 10px 0;
    color: var(--yomi-title-color);
    font-family: "Source Sans 3", sans-serif;
    font-size: var(--yomi-title-size);
    font-weight: 700;
    line-height: 1.2;
}

.yomi-post__title a,
.yomi-post__title a:hover {
    color: inherit;
}

.yomi-post__title a {
    text-decoration: none;
}

.yomi-post__title a:hover {
    text-decoration: underline;
}

.yomi-post__date {
    margin-bottom: 8px;
    color: var(--yomi-date-color);
    font-family: "Source Sans 3", sans-serif;
    font-size: var(--yomi-date-size);
    font-weight: 400;
    line-height: 1.4;
}

.yomi-post__excerpt {
    color: var(--yomi-text-color);
    font-size: var(--yomi-text-size);
    line-height: 1.3;
}

.yomi-empty,
.yomi-error {
    margin: 20px 0 0;
}

.yomi-error[hidden],
.yomi-messages[hidden] {
    display: none;
}

/* Shown only to editors, when the shortcode names tags that do not exist */
.yomi-notice {
    margin: 0 0 16px;
    padding: 10px 14px;
    border-left: 4px solid #d63638;
    background: #fcf0f1;
    font-size: 14px;
}

/* Read out by screen readers, not shown */
.yomi-status {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Load more – looks like a filter button (same colours, border,
   radius and text, from the same variables), with more vertical
   padding and a plus before the text: the plus says "add", so it
   leads, as in "+ Load more".
   ============================================================ */
.yomi-more {
    margin-top: 24px;
    text-align: right;
}

.yomi-more[hidden] {
    display: none;
}

.yomi-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    margin: 0;
    padding: 13px 24px;
    border: var(--yomi-filter-border-width) solid var(--yomi-filter-color);
    border-radius: var(--yomi-filter-radius);
    background: var(--yomi-filter-background);
    box-shadow: none;
    color: var(--yomi-filter-color);
    font-family: "Source Sans 3", sans-serif;
    font-size: var(--yomi-filter-font-size);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.yomi-button:hover,
.yomi-button:focus-visible {
    border-color: var(--yomi-filter-color);
    background: var(--yomi-filter-color);
    color: var(--yomi-filter-background);
}

.yomi-button:focus {
    outline: none;
}

.yomi-button:focus-visible {
    outline: 2px solid var(--yomi-filter-color);
    outline-offset: 2px;
}

.yomi-button:disabled {
    cursor: progress;
}

/* Font Awesome, which comes with Avada */
.yomi-button__icon {
    font-size: 0.9em;
    line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
    .yomi-filter,
    .yomi-results,
    .yomi-post__image img,
    .yomi-button {
        transition-duration: 0s;
        transition-delay: 0s;
    }
}

/* ============================================================
   Tablet and mobile
   ============================================================ */
@media screen and (max-width: 1024px) {
    .yomi-filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .yomi-grid {
        grid-template-columns: repeat(var(--yomi-columns-tablet), minmax(0, 1fr));
    }
}

@media screen and (max-width: 768px) {
    .yomi-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .yomi-filter,
    .yomi-button {
        min-height: 44px;
    }
    .yomi-grid {
        grid-template-columns: repeat(var(--yomi-columns-mobile), minmax(0, 1fr));
    }
}
