/* Rodoslovlja Tanaha. Boje i fontovi sajta (shared.css); raspored iz odobrene skice.
   Lijevo glavna loza (osam poglavlja, račva Levi | Juda), u sredini jedno poglavlje kao stablo (glavna loza teče
   prema dolje, sporedne loze u okvirima), desno ploča s opisom. Na uskom zaslonu: poglavlja kao mreža gumba gore,
   ploča kao donji list. Bez JavaScripta vidljiva su sva poglavlja jedno ispod drugog i popis svih opisa. */
[hidden] { display: none !important; }
.rd {
  --bg: #f6f1e7; --paper: #fbf8f1; --ink: #2b2420; --muted: #6e625a; --rule: #ddd2c1; --soft: #efe8db;
  --main: #651829; --king: #c4923f; --sing: #846793; --line: #cdbfa8;
  width: min(1280px, calc(100% - 64px)); margin: 0 auto; padding: 40px 0 72px; color: var(--ink);
}
.rd * { box-sizing: border-box; }
.rd .eyebrow { margin: 0; font: 700 12px var(--sans); font-style: normal; letter-spacing: .14em; text-transform: uppercase; color: var(--main); }
.rd h1 { font: 500 clamp(32px, 4.6vw, 48px)/1.1 var(--serif); letter-spacing: -.02em; margin: 8px 0 10px; text-wrap: balance; }
.rd .lead { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 760px; }
.rd .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rd .nojs-note { display: none; font: 400 14px/1.5 var(--sans); color: var(--muted); margin: 0 0 16px; }
html:not(.js) .rd .nojs-note { display: block; }

.rd .bar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin: 22px 0 18px; font-family: var(--sans); }
.rd .search { position: relative; flex: 0 1 300px; min-width: 0; }
.rd .glab { display: block; font: 700 11.5px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rd .search .glab { margin-bottom: 4px; }
.rd .search input { width: 100%; min-height: 44px; font: 500 15px var(--sans); padding: 9px 12px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); color: var(--ink); }
.rd .search input:focus-visible { outline: 2px solid var(--main); outline-offset: 0; }
.rd .hits { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(43,36,32,.12); max-height: 320px; overflow: auto; }
.rd .hits button { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; gap: 12px; width: 100%; min-height: 40px; align-items: center; padding: 6px 12px; cursor: pointer; font: 400 14px var(--sans); }
.rd .hits button:hover, .rd .hits button:focus-visible { background: var(--soft); }
.rd .hits button:focus-visible { outline: 2px solid var(--main); outline-offset: -2px; }
.rd .hits small { color: var(--muted); font-size: 12.5px; }
.rd .hits .none { padding: 10px 12px; font: 400 14px var(--sans); color: var(--muted); }
.rd .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); }
.rd .legend span { display: inline-flex; align-items: center; gap: 6px; }
.rd .sw { width: 16px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); background: var(--paper); }
.rd .sw.m { background: var(--main); border-color: var(--main); }
.rd .sw.k { background: var(--king); border-color: var(--king); }
.rd .sw.s { background: var(--sing); border-color: var(--sing); }
.rd .sw.c { border-style: dashed; }
.rd .legend .arrow { color: var(--ink); }

.rd .layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 320px; gap: 24px; align-items: start; }

/* glavna loza */
.rd .rd-nav { position: sticky; top: 16px; font-family: var(--sans); }
.rd .rd-nav h2 { font: 700 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.rd .spine { display: grid; gap: 0; }
.rd .st { box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 22px 1fr; gap: 0 10px; align-items: start; align-content: start; padding: 0 0 12px; position: relative; color: var(--ink); text-decoration: none; }
.rd .st::before { content: ""; position: absolute; left: 10px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.rd .st.last::before { display: none; }
.rd .st .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--main); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--main); position: relative; z-index: 1; }
.rd .st b { font-size: 15px; font-weight: 700; line-height: 22px; }
.rd .st small { grid-column: 2; font-size: 12px; color: var(--muted); line-height: 1.35; }
.rd .st:hover b { color: var(--main); }
.rd .st[aria-current="true"] .dot { background: var(--main); color: #fff; }
.rd .st[aria-current="true"] b { color: var(--main); }
.rd .st:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; border-radius: 4px; }
.rd .fork { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; border-top: 2px solid var(--line); padding-top: 12px; margin-left: 10px; }
.rd .fork .st::before { display: none; }
.rd .fork .st { gap: 0 6px; margin-left: -10px; }
.rd .fork .col { display: grid; align-content: start; }
.rd .fork .col .st:not(.last)::before { display: block; }

/* poglavlje */
.rd .chart { background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 24px; min-width: 0; }
.js .rd .ch:not(.on) { display: none; }
html:not(.js) .rd .ch + .ch { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--rule); }
.rd .ch-head h2 { font: 500 28px/1.15 var(--serif); margin: 0 0 4px; text-wrap: balance; }
.rd .ch-refs { font: 700 13px var(--sans); color: var(--main); letter-spacing: .02em; }
.rd .ch-head p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 10px 0 0; max-width: 68ch; }
.rd .ch-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; font: 400 13px var(--sans); }
.rd .ch-stats span { background: var(--soft); border-radius: 999px; padding: 3px 10px; color: var(--ink); }
.rd .ch-map { margin: 12px 0 0; font: 400 14px var(--sans); }
.rd .ch-map a { color: var(--main); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.rd .ch-map a:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.rd .tree { margin-top: 24px; }
.rd .ch-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--rule); font-family: var(--sans); }
.rd .ch-foot a { color: var(--main); font-weight: 700; font-size: 14px; min-height: 32px; display: inline-flex; align-items: center; text-decoration: none; }
.rd .ch-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.rd .ch-foot a:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }

/* stablo */
/* Obični blokovi i flex, bez ugniježđenih gridova: stablo je duboko do 30 razina i grid bi se računao eksponencijalno. */
.rd .fam { display: block; min-width: 0; max-width: 100%; }
.rd .fam > * { min-width: 0; max-width: 100%; }
.rd .fam > .head, .rd .fam > .kids { width: fit-content; }
.rd .head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rd .plus { font: 400 13px var(--sans); color: var(--muted); }
.rd .conn { width: 2px; height: 14px; background: var(--line); margin-left: 18px; }
.rd .kids { display: grid; gap: 8px; margin: 6px 0 0 18px; padding: 6px 0 2px 14px; border-left: 2px solid var(--line); }
.rd .grp { display: grid; gap: 4px; min-width: 0; }
.rd .grp .glab { font-size: 11.5px; }
.rd .row { display: flex; flex-wrap: wrap; gap: 6px; }
.rd .branches { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0 4px 18px; width: calc(100% - 18px); }
.rd .branches > .box { flex: 1 1 260px; }
.rd .box { border: 1px solid var(--rule); border-radius: 8px; padding: 12px; background: var(--bg); min-width: 0; }
.rd .box .box { background: var(--paper); }
.rd .box .branches { flex-direction: column; flex-wrap: nowrap; }
.rd .spine-next { width: 100%; display: block; }

.rd .chip { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; border-radius: 6px; scroll-margin: 96px 0 120px;
  border: 1px solid var(--line); background: var(--paper); font: 500 14px/1.25 var(--sans); color: var(--ink); max-width: 100%; }
.rd .chip > span:not(.bd):not(.more) { min-width: 0; overflow-wrap: anywhere; }
.rd .chip svg { flex: none; width: 9px; height: 14px; fill: currentColor; opacity: .55; }
.rd .chip:hover { border-color: var(--ink); }
.rd .chip:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.rd .chip.m { background: var(--main); border-color: var(--main); color: #fff; font-weight: 700; }
.rd .chip.k { background: var(--king); border-color: var(--king); color: #2b2016; font-weight: 700; }
.rd .chip.m.k { box-shadow: inset 0 -3px 0 var(--king); }
.rd .chip.s { background: var(--sing); border-color: var(--sing); color: #fff; }
.rd .chip.conc { border-style: dashed; }
.rd .chip.m svg, .rd .chip.k svg, .rd .chip.s svg { opacity: .8; }
.rd .chip .more { font-size: 11px; font-weight: 700; opacity: .7; }
.rd .chip .bd { font-size: 11px; font-weight: 700; background: rgba(255,255,255,.22); border-radius: 999px; padding: 0 6px; }
.rd .chip:not(.m):not(.k):not(.s) .bd { background: var(--soft); }
.rd .chip.on { box-shadow: 0 0 0 3px var(--ink); }
.rd .chip.m.k.on { box-shadow: 0 0 0 3px var(--ink); }
.rd .chip.flash { animation: rd-fl 1.2s ease-out; }
@keyframes rd-fl { 0% { box-shadow: 0 0 0 6px rgba(101,24,41,.45); } 100% { box-shadow: 0 0 0 0 rgba(101,24,41,0); } }
@media (prefers-reduced-motion: reduce) { .rd .chip.flash { animation: none; } }

/* ploča */
.rd .panel { position: sticky; top: 16px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; padding: 20px; font-family: var(--sans); }
html:not(.js) .rd .panel { display: none; }
.rd .panel .kicker, .rd .rd-opis .kicker { font: 700 12px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--main); }
.rd .panel :is(h3, h4), .rd .rd-opis h4 { font: 500 25px/1.15 var(--serif); margin: 6px 0 2px; }
.rd .alt { font: 400 14px var(--sans); color: var(--muted); }
.rd .yrs { font: 700 14px var(--sans); color: var(--ink); margin-top: 8px; font-variant-numeric: tabular-nums; }
.rd .panel p, .rd .rd-opis p { font-size: 16px; line-height: 1.6; margin: 12px 0 0; }
.rd .panel dl, .rd .rd-opis dl { font: 400 14px var(--sans); margin: 14px 0 0; display: grid; gap: 10px; border-top: 1px solid var(--rule); padding-top: 12px; }
.rd .panel dt, .rd .rd-opis dt { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.rd .panel dd, .rd .rd-opis dd { margin: 3px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.rd .panel a, .rd .rd-opis a { color: var(--main); font-weight: 600; text-underline-offset: 3px; }
.rd .panel a:focus-visible, .rd .rd-opis a:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.rd .soon { color: var(--muted); }
.rd .panel .close { display: none; }
.rd .panel .empty { font: 400 14px/1.55 var(--sans); color: var(--muted); margin: 0; }

.rd .rd-all { margin-top: 36px; border-top: 1px solid var(--rule); padding-top: 18px; }
.rd .rd-all summary { cursor: pointer; font: 600 16px var(--sans); color: var(--main); min-height: 44px; display: flex; align-items: center; }
.rd .rd-all summary:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }
.rd .rd-all-h { font: 500 22px var(--serif); margin: 28px 0 6px; }
.rd .rd-opis { padding: 14px 0; border-bottom: 1px solid var(--rule); max-width: 760px; font-family: var(--sans); }
.rd .rd-opis h4 { font-size: 20px; }

/* Srednji zasloni: glavna loza i stablo, ploča kao donji list */
@media (max-width: 1100px) {
  .rd .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .rd .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; border-radius: 14px 14px 0 0; max-height: 55vh; overflow: auto; z-index: 20; box-shadow: 0 -8px 30px rgba(0,0,0,.18); padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .js .rd .panel:not([data-open]) { display: none; }
  .rd .panel .close { all: unset; box-sizing: border-box; position: absolute; top: 6px; right: 8px; cursor: pointer; min-height: 44px; display: flex; align-items: center; padding: 0 12px; font: 700 14px var(--sans); color: var(--muted); }
  .rd .panel .close:focus-visible { outline: 2px solid var(--main); }
  .rd .panel :is(h3) { padding-right: 72px; }
}
/* Mobitel */
@media (max-width: 760px) {
  .rd { width: calc(100% - 32px); padding: 28px 0 56px; }
  .rd .layout { grid-template-columns: minmax(0, 1fr); }
  .rd .rd-nav { position: static; }
  .rd .spine { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .rd .st, .rd .fork .st { display: block; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); margin: 0; min-height: 44px; }
  .rd .st::before, .rd .fork .col .st:not(.last)::before { display: none; }
  .rd .st .dot { display: none; }
  .rd .st b { line-height: 1.3; font-size: 14px; }
  .rd .st small { display: block; font-size: 11.5px; }
  .rd .st[aria-current="true"] { background: var(--main); border-color: var(--main); }
  .rd .st[aria-current="true"] b, .rd .st[aria-current="true"] small { color: #fff; }
  .rd .fork { display: contents; }
  .rd .fork .col { display: contents; }
  .rd .chart { padding: 14px; }
  .rd .ch-head h2 { font-size: 24px; }
  .rd .kids { margin-left: 10px; padding-left: 10px; }
  .rd .branches { margin-left: 0; width: 100%; flex-direction: column; flex-wrap: nowrap; }
  .rd .conn { margin-left: 12px; }
  .rd .box { padding: 10px; }
  .rd .chip { padding: 6px 10px 6px 7px; }
  .rd .panel { max-height: 60vh; }
  .rd .legend { font-size: 12px; }
}
/* Dodirni ciljevi na mobitelu i tabletu: najmanje 44 px (imena u stablu, poveznice ispod poglavlja, imena i stihovi u opisu) */
@media (max-width: 900px), (pointer: coarse) {
  .rd .chip { min-height: 44px; }
  .rd .ch-foot a { min-height: 44px; }
  .rd dd a { display: inline-block; padding: 12px 0; margin-block: -12px; }
}
