/* ============================================================
   ДОВІДНИК: оформление разделов книги и обложки
   Разметка: inc/book.php
   ============================================================ */
/* Колонка чтения стоит по центру вместе с заголовком страницы; полотно «Родоводу» остаётся во всю ширину */
.uk-article:has(.eb-bk):not(:has(.eb-polotno)) { max-width: 840px; margin-left: auto; margin-right: auto; }
.uk-article:has(.eb-bk-cover):not(:has(.eb-polotno)) { max-width: 900px; }
.eb-bk { max-width: 840px; margin-left: auto; margin-right: auto; width: 100%; display: flex; flex-direction: column; gap: 24px; }
.uk-article:has(.eb-polotno) .eb-bk { margin-left: 0; }
.eb-bk-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #5b6258; }
.eb-bk-crumbs a { color: #5b6258; }
.eb-bk-lead { margin: 0; font-size: 20px; line-height: 1.5; color: #141414; }
.eb-bk-toc { margin: 0; }
.eb-bk-text > :first-child { margin-top: 0; }
.eb-bk-text h2 { margin: 40px 0 12px; font-size: 28px; line-height: 1.2; scroll-margin-top: 90px; }
.eb-bk-text h3 { margin: 28px 0 8px; font-size: 21px; }
.eb-bk-text p, .eb-bk-text li { font-size: 17px; line-height: 1.6; }
.eb-bk-text ul, .eb-bk-text ol { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.eb-bk-text a, .eb-bk-by a, .eb-bk-sources a { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }
.eb-bk-table { overflow-x: auto; margin: 16px 0; }
.eb-bk-text table { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; border: 1px solid #d5d9cf; }
.eb-bk-text th, .eb-bk-text td { padding: 10px 14px; border-bottom: 1px solid #d5d9cf; text-align: left; vertical-align: top; }
.eb-bk-text th { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #5b6258; font-weight: 600; }
.eb-bk-text tr:last-child td { border-bottom: 0; }
.eb-bk-bridge { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; border: 1px solid #d5d9cf; border-radius: 20px; background: #fff; }
.eb-bk-bridge > span { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #5b6258; }
.eb-bk-bridge-list { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.eb-bk-bridge-list.eb-n1 { grid-template-columns: minmax(0, 1fr); }
.eb-bk-bridge-list.eb-n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.eb-bk-bridge a { box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 12px 18px; border-radius: 14px; background: #141414; color: #fff !important; text-decoration: none !important; font-weight: 600; font-size: 16px; line-height: 1.3; transition: background-color .15s; }
.eb-bk-bridge a::after { content: "→"; flex: 0 0 auto; font-weight: 400; transition: transform .15s; }
.eb-bk-bridge a:hover, .eb-bk-bridge a:focus-visible { background: #b01e2b; }
.eb-bk-bridge a:hover::after, .eb-bk-bridge a:focus-visible::after { transform: translateX(4px); }
@media (max-width: 699px) { .eb-bk-bridge-list, .eb-bk-bridge-list.eb-n3 { grid-template-columns: minmax(0, 1fr); } }
.eb-bk-sources summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.eb-bk-sources summary::-webkit-details-marker { display: none; }
.eb-bk-sources summary::after { content: "+"; margin-left: auto; font-size: 22px; line-height: 1; color: #b01e2b; }
.eb-bk-sources[open] summary::after { content: "−"; }
.eb-bk-sources h2 { margin: 0; font-size: 20px; }
.eb-bk-sources summary span { font-size: 14px; color: #5b6258; }
.eb-bk-sources ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.eb-bk-by { font-size: 14px; color: #5b6258; border-top: 1px solid #d5d9cf; padding-top: 16px; }
.eb-bk-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.eb-bk-nav a { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid #d5d9cf; border-radius: 16px; background: #fff; color: #141414; text-decoration: none; font-weight: 600; }
.eb-bk-nav a span { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: #5b6258; font-weight: 400; }
.eb-bk-next { text-align: right; }
.eb-bk-list { margin: 0; padding: 0; list-style: none; counter-reset: sec; display: flex; flex-direction: column; border-top: 1px solid #d5d9cf; }
.eb-bk-list li { counter-increment: sec; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 2px 8px; padding: 14px 0; border-bottom: 1px solid #d5d9cf; }
.eb-bk-list li::before { content: counter(sec); grid-row: span 2; color: #b01e2b; font-weight: 700; }
.eb-bk-list a { color: #141414; font-weight: 600; font-size: 18px; text-decoration: none; }
.eb-bk-list span { grid-column: 2; font-size: 15px; color: #5b6258; }
.eb-bk-cover { max-width: 900px; gap: 40px; }
.eb-bk-chapter { display: flex; flex-direction: column; gap: 10px; }
.eb-bk-chapter h2 { margin: 0; font-size: 28px; }
.eb-bk-chapter h2 a { color: #141414; text-decoration: none; }
.eb-bk-chapter p { margin: 0; color: #5b6258; }
@media (max-width: 639px) { .eb-bk-lead { font-size: 18px; } .eb-bk-text h2 { font-size: 24px; } }

/* Строку темы «Опублікував…» прячем: автор и дата сверки стоят в конце раздела */
.single-eb_book .uk-article-meta { display: none; }
.eb-bk-toc { display: flex; flex-wrap: wrap; gap: 8px; }
.eb-bk-toc a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px; border: 1px solid #d5d9cf; border-radius: 999px; background: #fff; color: #141414; font-size: 14px; text-decoration: none; }
.eb-bk-toc a:hover, .eb-bk-toc a:focus-visible { border-color: #141414; text-decoration: none; }
.eb-bk-nav a:hover, .eb-bk-nav a:focus-visible { border-color: #141414; text-decoration: none; }

/* Навигацию темы «Назад / Далі» заменяют ссылки на соседние разделы главы */
.single-eb_book .uk-pagination { display: none; }

/* Словарь */
.eb-slovnyk { margin: 0; gap: 0; border-top: 1px solid #d5d9cf; }
.eb-slovnyk > div { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid #d5d9cf; scroll-margin-top: 90px; }
.eb-slovnyk dt { font-weight: 700; font-size: 17px; }
.eb-slovnyk dd { margin: 0; font-size: 16px; line-height: 1.55; }
.eb-slovnyk a { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; white-space: nowrap; }
.eb-slovnyk > div:target { background: #fff; }
@media (max-width: 639px) { .eb-slovnyk > div { grid-template-columns: minmax(0, 1fr); } }

/* Иллюстрации */
.eb-bk-fig { margin: 24px 0; }
.eb-bk-fig img { display: block; width: 100%; height: auto; border-radius: 16px; background: #eceee7; }
.eb-bk-fig figcaption { margin-top: 8px; font-size: 14px; line-height: 1.45; color: #5b6258; }
/* Читайте також */
.eb-bk-related h2 { margin: 0 0 8px; font-size: 20px; }
.eb-bk-related ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid #d5d9cf; }
.eb-bk-related li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid #d5d9cf; }
.eb-bk-related a { color: #141414; font-weight: 600; font-size: 17px; text-decoration: none; }
.eb-bk-related span { font-size: 14px; color: #5b6258; }

/* Питання й відповіді */
.eb-bk .eb-faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.eb-bk .eb-faq { border: 1px solid #d5d9cf; border-radius: 14px; background: #fff; }
.eb-bk .eb-faq summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.eb-bk .eb-faq summary::-webkit-details-marker { display: none; }
.eb-bk .eb-faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: #b01e2b; flex: 0 0 auto; }
.eb-bk .eb-faq[open] summary::after { content: "−"; }
.eb-bk .eb-faq summary h3 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; }
.eb-bk .eb-faq-body { padding: 0 18px 16px; }
.eb-bk .eb-faq-body p { margin: 0; font-size: 16px; line-height: 1.55; }

/* Сорта каталога, названные в разделе (список строится из атласа) */
.eb-bk .eb-bk-strains { margin: 0 0 22px; padding: 14px 18px; border: 1px solid #d9dcd3; border-radius: 12px; background: #fff; }
.eb-bk .eb-bk-strains p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.eb-bk .eb-bk-strains p:last-child { margin-bottom: 0; }

/* Раздел открытых данных /dani/ */
.eb-dani-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.eb-dani-nums div { padding: 16px 18px; border: 1px solid #d9dcd3; border-radius: 12px; background: #fff; }
.eb-dani-nums b { display: block; font-size: 30px; line-height: 1.1; color: #b01e2b; }
.eb-dani-nums span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.4; color: #5b6258; }
.eb-dani-get { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.eb-dani-btn { display: inline-block; padding: 12px 22px; border-radius: 999px; background: #1d1f1c; color: #fff !important; font-weight: 600; text-decoration: none; }
.eb-dani-btn:hover, .eb-dani-btn:focus-visible { background: #b01e2b; text-decoration: none; }
.eb-dani-note { font-size: 14px; color: #5b6258; }
@media (max-width: 799px) { .eb-dani-nums { grid-template-columns: repeat(2, 1fr); } }

/* Строка «У родоводах каталогу» под описанием родителя */
.eb-bk .eb-bk-parent { margin: -6px 0 22px; padding-left: 14px; border-left: 3px solid #b01e2b; font-size: 15px; line-height: 1.6; color: #3a3d38; }

/* Список страниц, где упомянут сорт, семейство или сидбанк */
.eb-bk .eb-bk-mentions { columns: 2; column-gap: 28px; padding-left: 18px; }
.eb-bk .eb-bk-mentions li { break-inside: avoid; margin-bottom: 6px; }
@media (max-width: 799px) { .eb-bk .eb-bk-mentions { columns: 1; } }
