/* genealogico.es · gráficos de las guías */
:root { --ge-tinta: #2b2620; --ge-verde: #2f5d50; --ge-verde2: #e3ece6; --ge-terra: #a8482a; --ge-oro: #c8963e; --ge-papel: #f7f1e6; --ge-linea: #d8ccb6; --ge-suave: #6b6257; }

/* ficha */
.ge-ficha { background: var(--ge-papel); border: 1px solid var(--ge-linea); border-left: 5px solid var(--ge-verde); border-radius: 10px; padding: 18px 22px; margin: 26px 0; }
.ge-ficha-t { font: 700 13px/1 system-ui, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--ge-verde); margin: 0 0 12px; }
.ge-ficha dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 26px; }
.ge-ficha dl > div { border-bottom: 1px dashed var(--ge-linea); padding-bottom: 8px; }
.ge-ficha dt { font: 600 12.5px/1.3 system-ui, sans-serif; color: var(--ge-suave); text-transform: uppercase; letter-spacing: .04em; }
.ge-ficha dd { margin: 3px 0 0; font-size: 16px; line-height: 1.4; color: var(--ge-tinta); }

/* árbol */
.ge-arbol { position: relative; width: min(1240px, 96vw) !important; max-width: none !important; left: 50%; transform: translateX(-50%); margin: 34px 0; border: 1px solid var(--ge-linea); border-radius: 12px; background: #fffdf8; background-image: radial-gradient(var(--ge-linea) .8px, transparent .8px); background-size: 18px 18px; overflow: hidden; }
.ge-arbol figcaption { text-align: left !important; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 14px 18px 4px; font: 700 17px/1.3 Georgia, 'Times New Roman', serif; color: var(--ge-tinta); }
.ge-arbol-n { font: 600 12.5px/1 system-ui, sans-serif; color: var(--ge-verde); background: var(--ge-verde2); padding: 5px 9px; border-radius: 99px; white-space: nowrap; }
.ge-arbol-bar { display: flex; gap: 6px; padding: 6px 18px 0; flex-wrap: wrap; }
.ge-arbol-bar button { text-transform: none !important; letter-spacing: 0 !important; box-shadow: none !important; font: 600 13px/1 system-ui, sans-serif; border: 1px solid var(--ge-linea); background: #fff; color: var(--ge-tinta); border-radius: 6px; padding: 7px 11px; cursor: pointer; }
.ge-arbol-bar button:hover { border-color: var(--ge-verde); color: var(--ge-verde); }
.ge-arbol-v { overflow: auto; cursor: grab; scrollbar-width: thin; padding: 18px 10px 26px; max-height: 78vh; overscroll-behavior: contain; }
.ge-arbol-v.ge-mueve { cursor: grabbing; user-select: none; }
.ge-arbol-v:focus-visible { outline: 2px solid var(--ge-verde); outline-offset: -2px; }
.ge-arbol-ay { font: 13px/1.4 system-ui, sans-serif; color: var(--ge-suave); margin: 0; padding: 0 18px 14px; }
.ge-t { --z: 1; zoom: var(--z); width: max-content; margin: 0 auto !important; padding: 0 !important; }
.ge-t, .ge-t ul { display: flex; justify-content: center; list-style: none !important; margin: 0; padding: 22px 0 0; position: relative; }
.ge-t li { list-style: none !important; margin: 0 !important; padding: 22px 4px 0; position: relative; display: flex; flex-direction: column; align-items: center; }
.ge-t > li { padding-top: 0; }
.ge-t li::before, .ge-t li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 2px solid var(--ge-oro); }
.ge-t li::after { right: auto; left: 50%; border-left: 2px solid var(--ge-oro); }
.ge-t li:only-child::before, .ge-t li:only-child::after { display: none; }
.ge-t li:only-child { padding-top: 22px; }
.ge-t li:only-child::after { display: block; border-top: 0; width: 0; }
.ge-t > li:only-child { padding-top: 0; }
.ge-t > li:only-child::after { display: none; }
.ge-t li:first-child::before, .ge-t li:last-child::after { border: 0 none; }
.ge-t li:last-child::before { border-right: 2px solid var(--ge-oro); border-radius: 0 7px 0 0; }
.ge-t li:first-child::after { border-radius: 7px 0 0 0; }
.ge-t ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 2px solid var(--ge-oro); }
.ge-caja { position: relative; display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--ge-verde); border-radius: 10px; padding: 8px 10px; box-shadow: 0 3px 0 var(--ge-verde2); max-width: 340px; z-index: 1; }
.ge-pareja { border-color: var(--ge-terra); box-shadow: 0 3px 0 #f1ddd3; }
.ge-union { border-style: dashed; border-color: var(--ge-terra); background: #fff8f4; box-shadow: none; padding: 6px 10px; }
.ge-p { display: flex; flex-direction: column; text-align: center; min-width: 84px; max-width: 138px; }
.ge-p b { font: 700 14.5px/1.25 Georgia, 'Times New Roman', serif; color: var(--ge-tinta); }
.ge-p small { font: 12px/1.3 system-ui, sans-serif; color: var(--ge-suave); }
.ge-p .ge-d { color: var(--ge-verde); font-weight: 600; margin-top: 2px; }
.ge-u { font-size: 18px; color: var(--ge-terra); line-height: 1; }
.ge-tg { min-height: 0 !important; line-height: 1 !important; box-shadow: none !important; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ge-verde); background: #fff; cursor: pointer; padding: 0; z-index: 2; }
.ge-tg::after { content: "−"; display: block; font: 700 14px/15px system-ui, sans-serif; color: var(--ge-verde); }
.ge-cerrado > .ge-caja .ge-tg::after { content: "+"; }
.ge-cerrado > .ge-caja .ge-tg { background: var(--ge-verde); }
.ge-cerrado > .ge-caja .ge-tg::after { color: #fff; }
.ge-cerrado > ul { display: none; }

/* cronología */
.ge-crono { list-style: none !important; margin: 30px 0 !important; padding: 0 0 0 4px !important; position: relative; }
.ge-crono::before { content: ""; position: absolute; left: 81px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--ge-oro), var(--ge-verde)); }
.ge-crono li { display: grid; grid-template-columns: 58px 1fr; gap: 40px; margin: 0 0 14px !important; position: relative; opacity: 1; }
.ge-crono li::before { content: ""; position: absolute; left: 72px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--ge-verde); }
.ge-crono-a { font: 700 16px/1.6 Georgia, serif; color: var(--ge-terra); text-align: right; }
.ge-crono p { margin: 0 !important; line-height: 1.55; }
.ge-js .ge-crono li { opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.ge-js .ge-crono li.ge-ve { opacity: 1; transform: none; }

/* barras */
.ge-barras { margin: 30px 0; padding: 18px 20px; border: 1px solid var(--ge-linea); border-radius: 12px; background: #fff; }
.ge-barras figcaption, .ge-tabla figcaption { font: 700 17px/1.3 Georgia, serif; color: var(--ge-tinta); margin-bottom: 14px; }
.ge-b { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; gap: 12px; align-items: center; margin: 7px 0; font: 14.5px/1.3 system-ui, sans-serif; }
.ge-b-e { color: var(--ge-tinta); }
.ge-b-c { background: var(--ge-verde2); border-radius: 4px; height: 16px; overflow: hidden; }
.ge-b-v { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--ge-verde), #4f8a76); border-radius: 4px; }
.ge-js .ge-b-v { width: 0; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.ge-js .ge-ve .ge-b-v { width: var(--w); }
.ge-b-n { font-weight: 700; color: var(--ge-verde); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ge-nota { font: 13px/1.4 system-ui, sans-serif !important; color: var(--ge-suave); margin: 10px 0 0 !important; }

/* tablas */
.ge-tabla { margin: 30px 0; }
.ge-tabla-s { overflow-x: auto; border: 1px solid var(--ge-linea); border-radius: 10px; }
.ge-tabla table { width: 100%; border-collapse: collapse; margin: 0 !important; font: 15px/1.45 system-ui, sans-serif; background: #fff; }
.ge-tabla th { background: var(--ge-verde); color: #fff; text-align: left; padding: 10px 12px; font-weight: 600; white-space: nowrap; border: 0; }
.ge-tabla td { padding: 9px 12px; border: 0; border-top: 1px solid #efe7d8; vertical-align: top; }
.ge-tabla tbody tr:nth-child(even) td { background: #fcf8f1; }

@media (max-width: 640px) {
	.ge-ficha dl { grid-template-columns: 1fr; }
	.ge-crono::before { left: 65px; } .ge-crono li { grid-template-columns: 44px 1fr; gap: 38px; } .ge-crono li::before { left: 56px; } .ge-crono-a { font-size: 14px; }
	.ge-b { grid-template-columns: 1fr auto; } .ge-b-c { grid-column: 1 / -1; grid-row: 2; }
	.ge-arbol-v { max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) { .ge-js .ge-crono li, .ge-js .ge-b-v { transition: none; opacity: 1; transform: none; width: var(--w); } }

/* móvil: árbol en vertical, con sangrías, sin desplazamiento lateral */
@media (max-width: 700px) {
	.ge-arbol { width: auto !important; max-width: 100% !important; left: auto; transform: none; }
	.ge-arbol-bar button[data-z] { display: none; }
	.ge-arbol-v { overflow: visible; max-height: none; cursor: auto; padding: 12px 14px 18px; }
	.ge-t { zoom: 1 !important; width: auto; }
	.ge-t, .ge-t ul { display: block; padding: 0 !important; }
	.ge-t ul { margin: 0 0 0 12px !important; padding: 0 0 0 16px !important; border-left: 2px solid var(--ge-oro); }
	.ge-t li { display: block; padding: 10px 0 0 !important; }
	.ge-t li::after, .ge-t ul::before, .ge-t > li::before { display: none !important; }
	.ge-t ul > li::before { display: block !important; content: ""; position: absolute; left: -16px; right: auto; top: 30px; width: 14px; height: 0; border: 0 !important; border-top: 2px solid var(--ge-oro) !important; border-radius: 0 !important; }
	.ge-t ul > li:last-child { background: linear-gradient(#fffdf8, #fffdf8) no-repeat -18px 32px / 4px 100%; }
	.ge-caja { display: flex; flex-wrap: wrap; max-width: 100%; padding-right: 22px; }
	.ge-p { text-align: left; max-width: none; min-width: 0; }
	.ge-tg { left: auto; right: -10px; top: 50%; bottom: auto; transform: translateY(-50%); }
}
