/* Genealogy explorer. Uses the site's design tokens (CSS variables emitted by site.css) so it
   matches the rest of the site; kept as its own file because explorer.js builds markup. */
#gx {
  --gx-rule: var(--color-rule);
  --gx-muted: var(--color-muted-2);
}

/* search band */
.gx-search { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.gx-search input[type="search"] { flex: 1 1 20rem; min-width: 0; }
.gx-search input[type="search"], .gx-search select {
  min-height: 52px; border: 1px solid rgb(242 235 220 / 0.3); border-radius: 2px; background: var(--color-lough-deep);
  color: var(--color-parchment); padding: 0 1rem; font: 1rem var(--font-sans);
}
.gx-search input::placeholder { color: var(--color-sage); }
.gx-search input:focus, .gx-search select:focus { outline: 2px solid var(--color-gold); outline-offset: 0; }
.gx-check { display: inline-flex; gap: 0.45rem; align-items: center; color: var(--color-mist); font-size: 0.95rem; min-height: 44px; }
.gx-check input { accent-color: var(--color-gold); width: 1.1rem; height: 1.1rem; }

.gx-live { position: absolute; left: 0; right: 0; top: 0.5rem; z-index: 30; background: var(--color-card);
  border: 1px solid var(--gx-rule); box-shadow: 0 18px 40px rgb(11 30 26 / 0.35); max-height: 26rem; overflow: auto; }
.gx-live ul { list-style: none; margin: 0; padding: 0.25rem 0; }
.gx-live li a { display: block; padding: 0.6rem 1rem; color: var(--color-ink); text-decoration: none; }
.gx-live li a strong { font-family: var(--font-display); font-size: 1.25rem; color: var(--color-lough); }
.gx-live li a:hover, .gx-live li a:focus { background: var(--color-parchment-2); }
.gx-live .gx-muted { padding: 0.75rem 1rem; margin: 0; }
.gx-live .gx-tag { margin-left: 0.5rem; }
.gx-meta { display: block; font-size: 0.8rem; color: var(--gx-muted); }

/* content */
#gx-main.gx-loading { opacity: 0.5; transition: opacity 0.15s; }
.gx-muted { color: var(--gx-muted); }
.gx-en { color: var(--gx-muted); font-style: italic; font-weight: 400; }
.gx-title { font: 600 clamp(2.6rem, 5vw, 4rem)/1 var(--font-display); color: var(--color-lough); margin: 0 0 0.35rem; }
.gx-subtitle { font: italic 1.5rem var(--font-display); color: var(--color-muted); margin: 0 0 0.9rem; }
.gx-prose { max-width: 48rem; margin-bottom: 2rem; font-size: 1.125rem; line-height: 1.7; color: var(--color-muted); }
.gx-prose p { margin: 0 0 1em; }
.gx-section { margin: 2.5rem 0; }
.gx-section h2 { font: 600 0.8rem var(--font-sans); letter-spacing: 0.26em; text-transform: uppercase; color: var(--color-gold-ink);
  border-bottom: 1px solid var(--gx-rule); padding-bottom: 0.6rem; margin: 0 0 1rem; }
.gx-cols { display: grid; gap: 0 3rem; }
@media (min-width: 768px) { .gx-cols { grid-template-columns: 1fr 1fr; } }

a.gx-person { color: var(--color-lough); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--color-gold); }
a.gx-person:hover { color: var(--color-burgundy); }
.gx-list { margin: 0; padding-left: 1.25rem; }
.gx-list li { margin: 0.4rem 0; }
.gx-inline { list-style: none; margin: 0; padding: 0; }
.gx-inline li { margin: 0.25rem 0; }

.gx-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.75rem 0; }
.gx-tag { display: inline-block; font: 600 0.72rem var(--font-sans); letter-spacing: 0.1em; text-transform: uppercase;
  padding: 0.3rem 0.6rem; background: var(--color-parchment-2); color: var(--color-lough); }
.gx-tag-gold { background: var(--color-gold); color: var(--color-night); }
/* the senior and junior lines (design system: tree-senior, tree-junior) */
.gx-tag-line { background: #2F6B5D; color: var(--color-parchment); }
.gx-tag-junior { background: #9A4A2E; }
.gx-tag-dna { background: var(--color-burgundy); color: var(--color-parchment); cursor: help; }
.gx-note { font-size: 0.9rem; color: var(--gx-muted); border-left: 2px solid var(--color-gold); padding-left: 0.75rem; }

.gx-facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; }
.gx-facts dt { font: 600 0.8rem/1.9 var(--font-sans); color: var(--gx-muted); }
.gx-facts dd { margin: 0; }

/* line of descent */
.gx-line { font-size: 0.95rem; margin-bottom: 1.5rem; }
.gx-label { font: 600 0.72rem var(--font-sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gx-muted); margin-right: 0.5rem; }
.gx-line details summary { cursor: pointer; display: inline; }
.gx-crumbs { display: inline; list-style: none; margin: 0; padding: 0; }
.gx-crumbs li { display: inline; }
.gx-crumbs li + li::before { content: " › "; color: var(--color-gold); }
.gx-line details[open] + .gx-crumbs-short { display: none; }
.gx-crumbs-short::before { content: "… › "; color: var(--color-gold); }

/* descendants tree */
.gx-tree ul { list-style: none; margin: 0; padding-left: 1.2rem; border-left: 1px solid var(--gx-rule); }
.gx-tree > ul { padding-left: 0; border-left: 0; }
.gx-tree li { margin: 0.3rem 0; }
.gx-toggle { font: 600 0.8rem var(--font-sans); width: 1.6rem; height: 1.6rem; border: 1px solid var(--gx-rule); border-radius: 2px;
  background: var(--color-card); color: var(--color-lough); cursor: pointer; margin-right: 0.4rem; line-height: 1; }
.gx-toggle:hover { border-color: var(--color-gold); }
.gx-toggle[disabled] { visibility: hidden; }
.gx-count { font-size: 0.78rem; color: var(--gx-muted); margin-left: 0.3rem; }

/* sources */
.gx-sources { list-style: none; margin: 0; padding: 0; }
.gx-sources li { border-bottom: 1px solid var(--gx-rule); padding: 0.7rem 0; }
.gx-sources summary { cursor: pointer; }
.gx-sources blockquote { margin: 0.6rem 0 0.25rem; padding: 0.75rem 1rem; background: var(--color-card);
  border-left: 2px solid var(--color-gold); font: 1.15rem/1.5 var(--font-display); }
.gx-cta { background: var(--color-lough); color: var(--color-mist); padding: 1.5rem 1.75rem; }
.gx-cta p { margin: 0 0 0.9rem; }
.gx-cta p:last-child { margin-bottom: 0; }
.gx-cta a:not(.btn-gold) { color: var(--color-gold-light); }
.gx-staff { background: var(--color-card); padding: 1rem 1.25rem; border: 1px dashed var(--color-stone); }

/* annals reader */
.gx-decades { display: grid; grid-template-columns: 5rem 1fr; gap: 0.6rem 1rem; margin: 0; }
.gx-decades dt { font-family: var(--font-display); font-size: 1.25rem; color: var(--color-lough); }
.gx-decades dd { margin: 0; }
.gx-yearnav { display: flex; justify-content: space-between; gap: 1rem; margin: 0.5rem 0 1rem; font-size: 1.05rem; }
.gx-annal blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 3px solid var(--gx-rule); line-height: 1.65; }
.gx-decades .gx-inline { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }

/* chiefs of Fermanagh */
.gx-section h2 a { color: inherit; text-decoration: none; }
.gx-section h2 a:hover { text-decoration: underline; }
.gx-succession { list-style: none; margin: 2rem 0; padding: 0 0 0 1.5rem; border-left: 2px solid var(--color-gold); max-width: 48rem; }
.gx-succession li { position: relative; margin: 0 0 1.75rem; }
.gx-succession li::before { content: ""; position: absolute; left: calc(-1.5rem - 6px); top: 0.45rem; width: 10px; height: 10px;
  border-radius: 50%; background: var(--color-gold); }
.gx-succession li.gx-overlap::before { background: var(--color-card); border: 2px solid var(--color-gold); width: 6px; height: 6px; }
.gx-succession p { margin: 0.15rem 0; }
.gx-years { font: 600 0.8rem var(--font-sans); letter-spacing: 0.12em; color: var(--color-gold-ink); }
.gx-chief { font: 600 1.6rem/1.2 var(--font-display); margin: 0.1rem 0 0.2rem; }
.gx-chiefno { color: var(--color-gold-ink); }

/* Geinealaighe Fearmanach paragraph numbers (#63) */
.gx-gf { font-size: 0.95rem; margin: 0.2rem 0 0.8rem; }
.gx-gf abbr { text-decoration: none; font-weight: 600; }
.gx-gf a, .gx-gf-refs a { color: var(--color-gold-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--color-gold) 60%, transparent); text-underline-offset: 2px; }
.gx-gf a:hover, .gx-gf-refs a:hover { color: var(--color-gold-ink-hover); }
.gx-gf-para { margin: 0 0 1.2rem; }
.gx-gf-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.gx-gf-form label { font-weight: 600; }
.gx-gf-form input { min-height: 44px; width: 9rem; border: 1px solid var(--color-rule); border-radius: 2px; background: var(--color-card);
  padding: 0 0.75rem; font: 1rem var(--font-sans); color: var(--color-ink); }
.gx-gf-form input:focus { outline: 2px solid var(--color-gold); border-color: var(--color-gold); }
.gx-gf-form .btn-lough { min-height: 44px; padding: 0 1rem; font-size: 0.95rem; border: 0; cursor: pointer; }
.gx-gf-more { margin: -0.4rem 0 0.8rem; font-size: 0.95rem; }
.gx-gf-more summary { cursor: pointer; color: var(--color-gold-ink); min-height: 32px; }
.gx-gf-more p { margin: 0.3rem 0 0; line-height: 1.7; }
