/* Ryjik Blog UI — архив /blog/, шапка статьи, «Поделиться», «Читайте также», карточки в поиске.
   Токены совпадают с blog-post.css. Обложки без aspect-ratio (Android<84): padding-top box + absolute img;
   тема ставит img{height:auto!important} → перебиваем height:100%!important.
   Без flex-gap (Safari<14.1): отступы через margin. */
.ryjik-blog-ui,
.ryjik-blog-search {
    --rbu-accent: #f97316;
    --rbu-accent-hover: #ea580c;
    --rbu-accent-soft: #fff4ec;
    --rbu-text: #1f2937;
    --rbu-strong: #111827;
    --rbu-text2: #4b5563;
    --rbu-muted: #6b7280;
    --rbu-border: #e5e7eb;
    --rbu-bg-soft: #f9fafb;
    --rbu-r-img: 10px;
    --rbu-r-panel: 12px;
}

/* ---------- крошки (разметка темы .et-breadcrumbs) */
.ryjik-blog-ui .title-section { padding-bottom: 0; }
.ryjik-blog-ui .et-breadcrumbs {
    border-bottom: 0;
    margin-bottom: 0;
    padding: 18px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--rbu-muted);
    display: flex;
    align-items: center;
    min-width: 0;
}
.ryjik-blog-ui .et-breadcrumbs > * { margin-right: 10px; }
.ryjik-blog-ui .et-breadcrumbs > *:last-child { margin-right: 0; }
.ryjik-blog-ui .et-breadcrumbs a { color: var(--rbu-muted); }
.ryjik-blog-ui .et-breadcrumbs a:hover { color: var(--rbu-accent-hover); }
.ryjik-blog-ui .et-breadcrumbs .arrow { width: 5px; height: 5px; mask-size: 5px; -webkit-mask-size: 5px; opacity: .7; }
.ryjik-blog-ui .et-breadcrumbs > span:not(.arrow) {
    color: var(--rbu-text2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ---------- заголовок архива */
.ryjik-blog-ui.blog .title-section .title-section-title,
.ryjik-blog-ui.archive .title-section .title-section-title { margin-top: 28px; margin-bottom: 28px; }
.ryjik-blog-ui.blog .title-section h1,
.ryjik-blog-ui.archive .title-section h1 {
    font-size: 36px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--rbu-strong);
    margin: 0;
}
.rbu-empty { font-size: 16px; color: var(--rbu-muted); margin: 8px 0 72px; }
.rbu-empty a { color: var(--rbu-strong); text-decoration: underline; text-decoration-color: var(--rbu-accent); text-underline-offset: 3px; }
.rbu-section-h2 {
    margin: 32px 0 20px;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--rbu-strong);
}

/* ---------- мета-строка */
.rbu-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 13px;
    line-height: 1.3;
    color: var(--rbu-muted);
}
.rbu-meta > * + * { padding-left: 12px; margin-left: 12px; border-left: 1px solid var(--rbu-border); }

/* ---------- обложки: box без aspect-ratio */
.rbu-card-media,
.rbu-featured-media,
.rbu-post-hero-box {
    position: relative;
    overflow: hidden;
    border-radius: var(--rbu-r-img);
    background: var(--rbu-bg-soft);
    margin: 0;
}
.rbu-card-media { padding-top: 66.667%; margin-bottom: 14px; }
.rbu-featured-media { padding-top: 56.25%; }
.rbu-post-hero-box { padding-top: 56.25%; border-radius: var(--rbu-r-panel); }
.rbu-card-media img,
.rbu-featured-media img,
.rbu-post-hero-box img {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
    margin: 0;
}
.rbu-media-empty img {
    width: 120px !important;
    height: 39px !important;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    object-fit: contain;
    opacity: .45;
}

/* ---------- featured */
.rbu-featured {
    display: grid;
    grid-template-columns: 7fr 5fr;
    grid-column-gap: 36px;
    column-gap: 36px;
    align-items: center;
    background: var(--rbu-accent-soft);
    border-radius: var(--rbu-r-panel);
    padding: 20px 40px 20px 20px;
    margin: 0 0 48px;
    color: inherit;
    text-decoration: none;
}
.rbu-featured-title {
    margin: 0 0 14px;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.012em;
    color: var(--rbu-strong);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.rbu-featured-excerpt {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--rbu-text2);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rbu-featured .rbu-meta { color: var(--rbu-text2); }
.rbu-featured:hover .rbu-featured-title { color: var(--rbu-accent-hover); }

/* ---------- сетка и карточка */
.rbu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-gap: 40px 32px;
    gap: 40px 32px;
}
.rbu-card { min-width: 0; margin: 0; padding: 0; border: 0; }
.rbu-card-link { display: block; color: inherit; text-decoration: none; }
.rbu-card-title {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--rbu-strong);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.rbu-card-excerpt {
    margin: 0 0 12px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--rbu-text2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rbu-card-link:hover .rbu-card-title { color: var(--rbu-accent-hover); }
.rbu-card-link:focus-visible,
.rbu-featured:focus-visible { outline: 2px solid var(--rbu-accent); outline-offset: 3px; border-radius: 4px; }

/* ---------- пагинация */
.rbu-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin: 56px 0 72px;
    font-size: 15px;
}
.rbu-pg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    margin: 0 3px;
    border-radius: 8px;
    color: var(--rbu-text);
    font-weight: 500;
    text-decoration: none;
}
.rbu-pg svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.rbu-pg-lbl svg + span, .rbu-pg-lbl span + svg { margin-left: 6px; }
a.rbu-pg:hover { background: var(--rbu-bg-soft); color: var(--rbu-strong); }
.rbu-pg-cur { background: var(--rbu-strong); color: #fff; font-weight: 700; }
.rbu-pg.dots { min-width: 40px; padding: 0; color: var(--rbu-muted); }

/* ---------- статья */
.ryjik-blog-ui.single-post .title-section .et-breadcrumbs,
.ryjik-blog-ui.single-post .rbu-post-head { max-width: 760px; margin-left: auto; margin-right: auto; }
.ryjik-blog-ui.single-post .title-section .title-section-title { display: none; }
.rbu-post-head { padding: 0; }
/* dynamic-styles.css темы: h1.entry-title{display:var(--page-title-display)} (0,1,1) → нужна специфичность выше */
.rbu-post-head .rbu-post-title {
    display: block;
    margin: 22px 0 14px;
    font-size: 42px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.015em;
    color: var(--rbu-strong);
    text-align: left;
    text-wrap: balance;
}
.rbu-post-meta { font-size: 15px; margin-bottom: 28px; }
.rbu-post-hero { max-width: 860px; margin: 0 auto 36px; padding: 0; }
/* Тело: blog-post.css задаёт 17px на .post-content, но тема перебивает p → 14px. Возвращаем. */
.ryjik-blog-ui.single-post .post-content p { font-size: inherit; line-height: inherit; color: inherit; }
.ryjik-blog-ui.single-post .post-content .ryjik-lead { border-radius: var(--rbu-r-img); }
/* пустой блок темы под статьёй (тэги/шаринг) не рисуем */
.ryjik-blog-ui.single-post .post-bottom { display: none; }

/* «Поделиться»: круглые иконки */
.rbu-share {
    max-width: 760px;
    margin: 40px auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 14px;
    line-height: 1.5;
    color: var(--rbu-muted);
}
.rbu-share-label { margin-right: 14px; }
.rbu-share-list { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.rbu-share-list li { margin: 0 10px 0 0; padding: 0; }
.rbu-share-list li:before { display: none; }
.rbu-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid var(--rbu-border);
    color: var(--rbu-strong);
    transition: background .15s, color .15s, border-color .15s;
}
.rbu-share-btn svg { display: block; }
.rbu-share-btn:hover, .rbu-share-btn:focus-visible { color: #fff; border-color: transparent; }
.rbu-share-btn:focus-visible { outline: 2px solid var(--rbu-accent); outline-offset: 3px; }
.rbu-share-facebook:hover, .rbu-share-facebook:focus-visible { background: #1877F2; }
.rbu-share-telegram:hover, .rbu-share-telegram:focus-visible { background: #229ED9; }
.rbu-share-viber:hover,    .rbu-share-viber:focus-visible    { background: #7360F2; }
.rbu-share-whatsapp:hover, .rbu-share-whatsapp:focus-visible { background: #25D366; }
.rbu-tags { flex: 0 0 100%; margin-top: 12px; font-size: 13px; }
.rbu-tags a { color: var(--rbu-muted); margin-right: 10px; }

/* «Читайте также» */
.rbu-related {
    max-width: 860px;
    margin: 56px auto 72px;
    padding-top: 36px;
    border-top: 1px solid var(--rbu-border);
}
.rbu-related-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
}
.rbu-related-head h2 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--rbu-strong);
    padding: 0;
    border: 0;
}
.rbu-related-all {
    font-size: 15px;
    font-weight: 500;
    color: var(--rbu-strong);
    text-decoration: underline;
    text-decoration-color: var(--rbu-accent);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}
.rbu-related-all:hover { color: var(--rbu-accent-hover); }
.rbu-related .rbu-grid { grid-gap: 32px 28px; gap: 32px 28px; }
.rbu-related .rbu-card-title { font-size: 18px; }
.ryjik-blog-ui.single-post .post-comments-section:empty { display: none; }

/* ---------- поиск */
.ryjik-blog-search .rbu-search-posts { margin: 8px 0 40px; }

/* ---------- ≤1279: две колонки (на 1024 заголовки в 3 колонках режутся) */
@media (max-width: 1279px) {
    .rbu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rbu-related .rbu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rbu-related .rbu-card-title { font-size: 17px; }
}

/* ---------- планшет */
@media (max-width: 1023px) {
    .rbu-grid { grid-gap: 32px 24px; gap: 32px 24px; }
    .rbu-featured { grid-template-columns: 1fr 1fr; padding: 16px 24px 16px 16px; column-gap: 24px; grid-column-gap: 24px; }
    .rbu-featured-title { font-size: 24px; }
    .rbu-post-head .rbu-post-title { font-size: 36px; }
    .rbu-card-title { -webkit-line-clamp: 4; }
    .rbu-related .rbu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-gap: 24px 20px; gap: 24px 20px; }
    .rbu-related .rbu-card-title { font-size: 16px; -webkit-line-clamp: 4; }
}

/* ---------- мобильный */
@media (max-width: 767px) {
    .ryjik-blog-ui .et-breadcrumbs { padding-top: 14px; }
    .ryjik-blog-ui.blog .title-section .title-section-title,
    .ryjik-blog-ui.archive .title-section .title-section-title { margin-top: 20px; margin-bottom: 20px; }
    .ryjik-blog-ui.blog .title-section h1,
    .ryjik-blog-ui.archive .title-section h1 { font-size: 30px; }

    .rbu-featured { display: block; padding: 12px 12px 20px; margin-bottom: 28px; }
    .rbu-featured-media { margin-bottom: 16px; }
    .rbu-featured-body { padding: 0 4px; }
    .rbu-featured-title { font-size: 22px; margin-bottom: 10px; }
    .rbu-featured-excerpt { font-size: 15px; -webkit-line-clamp: 3; margin-bottom: 12px; }

    .rbu-grid, .rbu-related .rbu-grid { grid-template-columns: 1fr; grid-gap: 0; gap: 0; }
    .rbu-card + .rbu-card { border-top: 1px solid var(--rbu-border); }
    .rbu-card-link {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        grid-template-rows: auto auto;
        grid-column-gap: 14px;
        column-gap: 14px;
        grid-row-gap: 6px;
        row-gap: 6px;
        padding: 16px 0;
        align-content: start;
    }
    .rbu-card-media { grid-column: 1; grid-row: 1 / 3; padding-top: 75%; margin: 0; border-radius: 8px; }
    .rbu-media-empty img { width: 64px !important; height: 21px !important; }
    .rbu-card-title, .rbu-related .rbu-card-title { grid-column: 2; grid-row: 1; font-size: 16px; line-height: 1.35; -webkit-line-clamp: 5; margin: 0; }
    .rbu-card-excerpt { display: none; }
    .rbu-card-link .rbu-meta { grid-column: 2; grid-row: 2; }
    .rbu-meta { font-size: 13px; }
    .rbu-meta > * + * { padding-left: 10px; margin-left: 10px; }

    .rbu-pager { margin: 32px 0 48px; }
    .rbu-pg { margin: 0 2px; }
    .rbu-pg-lbl span { display: none; }
    .rbu-pg-lbl { min-width: 40px; padding: 0; }

    /* статья: крошки → только «‹ Блог» (остальное скрыто визуально, но остаётся в DOM для SR) */
    .ryjik-blog-ui.single-post .et-breadcrumbs > a:first-child,
    .ryjik-blog-ui.single-post .et-breadcrumbs > .arrow,
    .ryjik-blog-ui.single-post .et-breadcrumbs > span:not(.arrow) {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
    }
    .ryjik-blog-ui.single-post .et-breadcrumbs > a:nth-child(3) {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        margin: -12px 0;
        font-size: 14px;
        font-weight: 500;
        color: var(--rbu-text2);
    }
    .ryjik-blog-ui.single-post .et-breadcrumbs > a:nth-child(3)::before {
        content: "";
        width: 7px; height: 7px;
        border-left: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
        margin-right: 6px;
    }
    .rbu-post-head .rbu-post-title { font-size: 28px; line-height: 1.2; margin: 16px 0 12px; }
    .rbu-post-meta { font-size: 14px; margin-bottom: 20px; }
    .rbu-post-hero { margin-bottom: 24px; }
    .rbu-post-hero-box { border-radius: var(--rbu-r-img); }
    .rbu-share { margin-top: 28px; }
    .rbu-share-label { flex: 0 0 100%; margin: 0 0 10px; }
    .rbu-share-btn { width: 44px; height: 44px; }

    .rbu-related { margin: 36px 0 48px; padding-top: 28px; }
    .rbu-related-head h2 { font-size: 22px; }
    .rbu-related-head { margin-bottom: 4px; }
    .rbu-related-all { padding: 8px 0; }
}
