/* ============================================================
   РОДОВІД: орнамент сорта, блок на карточке, полотно каталога
   Разметка: inc/atlas.php
   ============================================================ */

/* ---------- Орнамент ---------- */
.eb-orn { display: block; width: 100%; height: auto; background-image: radial-gradient(circle, #d5d9cf 0.9px, transparent 1.1px); background-size: calc(100% / 15) calc(100% / 15); }
.eb-orn path, .eb-orn rect { fill: none; stroke-width: 0.3; stroke-linecap: round; }
.eb-orn .i { stroke: #141414; }
.eb-orn .t { stroke: #b01e2b; }

/* ---------- Блок «Родовід» на карточке ---------- */
.eb-atlas { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 40px; align-items: start; margin: 0 0 40px; padding: 32px; border: 1px solid #d5d9cf; border-radius: 20px; background: #fff; }
.eb-atlas-orn { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eb-orn-key { font-size: 14px; color: #5b6258; }
.eb-orn-key summary { cursor: pointer; color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }
.eb-orn-key ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.eb-orn-key b { color: #141414; font-weight: 600; }
.eb-atlas-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eb-atlas .eb-atlas-h { margin: 0; font-size: 26px; line-height: 1.2; }
.eb-atlas-lead, .eb-atlas-lines { margin: 0; }
.eb-kin { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid #b01e2b; display: flex; flex-direction: column; gap: 12px; }
.eb-kin li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.eb-kin-name { font-weight: 700; }
.eb-kin-note { font-size: 13px; color: #5b6258; }
.eb-kin-rel { flex-basis: 100%; font-size: 15px; color: #5b6258; }
.eb-kin a, .eb-atlas-more { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }
.eb-atlas-lines { font-size: 15px; color: #5b6258; }
.eb-atlas-more { align-self: flex-start; font-weight: 600; }
@media (max-width: 639px) {
    .eb-atlas { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px; }
    .eb-atlas-orn .eb-orn { max-width: 220px; margin-inline: auto; }
    .eb-atlas .eb-atlas-h { font-size: 22px; }
}

/* ---------- Полотно каталога ---------- */
.eb-rodovid { display: flex; flex-direction: column; gap: 16px; }
.eb-rv-lead { max-width: 68ch; margin: 0; font-size: 18px; }
.eb-rv-note { max-width: 68ch; margin: 0; font-size: 14px; color: #5b6258; }
.eb-pl-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.eb-pl-chip { height: 40px; padding: 0 16px; border: 1px solid #d5d9cf; border-radius: 999px; background: #fff; color: #141414; font: inherit; font-size: 15px; cursor: pointer; }
.eb-pl-chip small { color: #5b6258; }
.eb-pl-chip.is-on { background: #141414; border-color: #141414; color: #fff; }
.eb-pl-chip.is-on small { color: #d5d9cf; }
.eb-pl-caption { min-height: 24px; font-weight: 600; }

.eb-polotno { --rh: 16px; display: flex; gap: 10px; padding: 20px 16px; border: 1px solid #d5d9cf; border-radius: 20px; background: #fff; min-width: 0; }
.eb-pl-labels { flex: 0 0 auto; display: grid; grid-template-rows: repeat(12, var(--rh)); margin-top: 22px; font-size: 11px; line-height: var(--rh); color: #5b6258; text-align: right; white-space: nowrap; }
.eb-pl-cloth { flex: 1 1 auto; display: flex; gap: 6px; min-width: 0; }
.eb-pl-group { flex: var(--n) 1 0%; display: flex; flex-direction: column; min-width: 0; }
.eb-pl-group[hidden] { display: none; }
.eb-pl-bank { height: 22px; font-size: 11px; line-height: 22px; color: #5b6258; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-pl-threads { display: flex; flex: 1 1 auto; }
.eb-th { flex: 1 1 0; min-width: 3px; display: grid; grid-template-rows: repeat(12, var(--rh)); background-image: radial-gradient(circle, #d5d9cf 0.6px, transparent 0.8px); background-size: 100% var(--rh); text-decoration: none; }
.eb-th b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eb-th i { grid-row: var(--l); margin: 2px 0.5px; background: #b01e2b; }
.eb-th:hover, .eb-th:focus-visible, .eb-th:target { background-color: #eceee7; }
.eb-th:hover i, .eb-th:focus-visible i, .eb-th:target i { background: #141414; }

/* Телефон: полотно повёрнуто, сорта идут строками с названиями */
@media (max-width: 799px) {
    .eb-pl-caption { display: none; }
    .eb-polotno { --cw: 16px; display: block; padding: 0 12px 12px; }
    /* шапка полотна прилипает под фиксированной шапкой сайта (60px на телефоне) */
    .eb-pl-labels { position: sticky; top: 60px; z-index: 2; display: grid; grid-template-columns: repeat(12, var(--cw)); grid-template-rows: none; justify-content: end; margin: 0; padding: 10px 0 6px; background: #fff; border-bottom: 1px solid #d5d9cf; line-height: 1; text-align: left; }
    .eb-pl-labels span { writing-mode: vertical-rl; transform: rotate(180deg); justify-self: center; }
    .eb-pl-cloth { display: block; }
    .eb-pl-group { display: block; }
    .eb-pl-bank { height: auto; margin: 16px 0 4px; font-size: 13px; line-height: 1.3; font-weight: 700; color: #141414; }
    .eb-pl-threads { display: block; }
    .eb-th { display: grid; grid-template-columns: minmax(0, 1fr) repeat(12, var(--cw)); grid-template-rows: none; align-items: center; min-height: 28px; background-image: radial-gradient(circle, #d5d9cf 0.8px, transparent 1px); background-size: var(--cw) 100%; background-position: right center; background-repeat: repeat-x; background-clip: content-box; border-bottom: 1px solid #f0f1ec; color: #141414; }
    .eb-th { background-size: var(--cw) 100%; background-origin: border-box; background-image: linear-gradient(#fff, #fff), radial-gradient(circle, #d5d9cf 0.8px, transparent 1px); background-size: calc(100% - 12 * var(--cw)) 100%, var(--cw) 100%; background-position: left center, right center; background-repeat: no-repeat, repeat-x; }
    .eb-th b { position: static; width: auto; height: auto; clip-path: none; overflow: hidden; text-overflow: ellipsis; grid-column: 1; grid-row: 1; padding-right: 8px; font-size: 14px; font-weight: 500; }
    .eb-th i { grid-row: 1; grid-column: calc(var(--l) + 1); height: 14px; margin: 0 3px; }
    .eb-th:target { background-image: linear-gradient(#eceee7, #eceee7); }
}

/* Ссылка на методику в блоке карточки и строка об открытых данных под полотном */
.eb-atlas-how { font-weight: 400; font-size: 14px; }
.eb-pl-data { max-width: 760px; margin: 28px 0 0; font-size: 15px; color: #5b6258; }
.eb-pl-data a { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }

/* Орнаменты на странице «Родовід»: слева выбранный узор, справа стена со скроллом, под ними паспорт сорта */
.eb-ol { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.eb-ol-h { margin: 16px 0 0; font-size: 28px; line-height: 1.2; scroll-margin-top: 90px; }
.eb-ol-panel { --orn: 320px; display: grid; grid-template-columns: var(--orn) minmax(0, 1fr); grid-template-areas: "big pick" "head head" "info info"; gap: 16px 24px; padding: 20px; border: 1px solid #d5d9cf; border-radius: 20px; background: #fff; }
.eb-ol-big { grid-area: big; }
.eb-ol-big .eb-orn { width: var(--orn); height: var(--orn); }
.eb-ol-pick { grid-area: pick; display: flex; flex-direction: column; gap: 10px; min-width: 0; height: var(--orn); }
.eb-ol-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.eb-ol-tools input, .eb-ol-tools select { height: 40px; padding: 0 14px; border: 1px solid #d5d9cf; border-radius: 999px; background: #fff; color: #141414; font: inherit; font-size: 15px; min-width: 0; }
.eb-ol-tools input { flex: 1 1 160px; max-width: 280px; }
.eb-ol-count { font-size: 14px; color: #5b6258; }
.eb-ol-wall { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); align-content: start; gap: 4px; padding: 8px; border: 1px solid #d5d9cf; border-radius: 14px; background: #f7f8f5; }
.eb-ol-wall button { padding: 4px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; line-height: 0; }
.eb-ol-wall button:hover, .eb-ol-wall button:focus-visible { border-color: #5b6258; background: #fff; }
.eb-ol-wall button[aria-pressed="true"] { border-color: #b01e2b; background: #fff; box-shadow: 0 0 0 1px #b01e2b; }
.eb-ol-wall .eb-orn { background-image: none; }
.eb-ol-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding-top: 4px; border-top: 1px solid #d5d9cf; padding-top: 16px; }
.eb-ol-name { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700; color: #141414; }
.eb-ol-sub { margin: 4px 0 0; font-size: 14px; color: #b01e2b; font-weight: 600; letter-spacing: .02em; }
.eb-ol-go { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: #141414; color: #fff !important; font-weight: 600; font-size: 15px; text-decoration: none !important; transition: background-color .15s; }
.eb-ol-go:hover, .eb-ol-go:focus-visible { background: #b01e2b; }
.eb-ol-info { grid-area: info; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.eb-ol-pass { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
/* Поле паспорта: светлая плитка, подпись серой меткой, значение обычным начертанием; пустое значение приглушено */
.eb-ol-pass > div { min-width: 0; padding: 10px 14px 12px; border-radius: 12px; background: #f4f5f1; }
.eb-ol-pass dt { display: inline-block; margin: 0; padding: 2px 8px; border-radius: 6px; background: #999999; color: #fff; font-size: 10px; line-height: 1.4; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.eb-ol-pass dd { margin: 0; padding: 6px 0 0; min-width: 0; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; font-weight: 400; color: #141414; }
.eb-ol-pass dd.is-none { color: #8e9489; }
.eb-ol-pass dd[data-f="src"] { font-size: 14px; }
.eb-ol-pass a, .eb-ol-kin a { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }
.eb-ol-kin { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 15px; }
.eb-ol-kin > span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7d8479; font-weight: 600; }
.eb-ol-kin ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.eb-ol-kin li { padding: 5px 12px; border: 1px solid #d5d9cf; border-left: 3px solid #b01e2b; border-radius: 8px; background: #fff; font-weight: 600; }
.eb-ol-kin li small { font-weight: 400; }
.eb-ol-kin small { margin-left: 6px; font-size: 12px; color: #5b6258; }
@media (max-width: 799px) {
    /* телефон: выбранный узор с названием стоит прямо над стеной, паспорт идёт под ней */
    .eb-ol-h { font-size: 24px; }
    .eb-ol-panel { --orn: 116px; grid-template-columns: var(--orn) minmax(0, 1fr); grid-template-areas: "big head" "pick pick" "info info"; gap: 12px 14px; padding: 14px; }
    .eb-ol-head { border-top: 0; padding-top: 0; align-content: center; }
    .eb-ol-name { font-size: 19px; }
    .eb-ol-go { min-height: 38px; padding: 0 14px; font-size: 14px; }
    .eb-ol-pick { height: auto; }
    .eb-ol-wall { flex: none; height: 232px; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
    .eb-ol-tools select { flex: 1 1 130px; }
    .eb-ol-pass { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .eb-ol-pass dd { font-size: 15px; }
}

/* Вступ страницы «Родовід»: миссия и три принципа */
.eb-rv-eyebrow { display: block; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #b01e2b; font-weight: 600; }
.eb-rv-mission { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px 48px; padding: 32px; border: 1px solid #d5d9cf; border-radius: 20px; background: #fff; }
.eb-rv-slogan { margin: 12px 0 0; font-size: clamp(26px, 3.1vw, 40px); line-height: 1.15; font-weight: 700; color: #141414; letter-spacing: -.01em; }
.eb-rv-mission-text { display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.6; }
.eb-rv-mission-text p { margin: 0; }
.eb-rv-mission a, .eb-rv-rules a, .eb-rv-text a { color: #141414; text-decoration: underline; text-decoration-color: #b01e2b; text-underline-offset: 3px; }
.eb-rv-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.eb-rv-rules > div { padding: 20px 22px; border: 1px solid #d5d9cf; border-top: 3px solid #b01e2b; border-radius: 16px; background: #fff; }
.eb-rv-rules h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.3; }
.eb-rv-rules p { margin: 0; font-size: 15px; line-height: 1.55; color: #3a3d38; }
.eb-rv-rules a { display: inline-block; margin-top: 6px; font-weight: 600; }
.eb-rv-text { max-width: 78ch; margin: 0; font-size: 16px; line-height: 1.6; color: #3a3d38; }
.eb-rv-more { margin-top: 24px; }
@media (max-width: 799px) {
    .eb-rv-mission { grid-template-columns: minmax(0, 1fr); padding: 20px; }
    .eb-rv-mission-text { font-size: 16px; }
    .eb-rv-rules { grid-template-columns: minmax(0, 1fr); }
}
