html { overflow-y: scroll; }
body { box-sizing: border-box; font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; max-width: 1100px; margin: 0 auto; padding: 1rem 1.25rem 3rem; color: #222; background: #fff; line-height: 1.5; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: #1e73be; text-decoration: none; }
a:hover, a:focus { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1 { font-size: 1.3rem; margin-bottom: 0.5rem; color: #1e73be; }
h2 { font-size: 1.05rem; font-weight: 600; margin-top: 1.5rem; border-bottom: 1px solid #ddd; padding-bottom: 0.25rem; }
dl.relations { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 1rem 0; }
dl.relations dt { font-weight: 400; color: #555; }
dl.relations dd { margin: 0; }
ul.child-list { list-style: none; padding: 0; margin: 0; }
ul.child-list li { margin-bottom: 0.15rem; }
.note { color: #1e73be; font-style: italic; margin: 0.25rem 0; }
.comment-text { color: #555; font-size: 0.82rem; margin: 0.15rem 0 0.6rem; white-space: pre-line; }
.comment-text.indent { margin-left: 1.5rem; }
.comment-collapse { margin: 0.15rem 0 0.6rem; }
.comment-collapse summary { cursor: pointer; color: #1e73be; font-size: 0.82rem; }
.comment-collapse .comment-text { margin-top: 0.3rem; }
.photo-placeholder { float: right; margin: 0 0 0.75rem 1.25rem; width: 180px; height: 220px; background: #f0f0f0; border: 1px dashed #ccc; display: flex; align-items: center; justify-content: center; color: #888; font-size: 0.85rem; }
.entity-photo { width: 180px; height: 220px; object-fit: cover; border: 1px solid #ccc; cursor: zoom-in; display: block; }
.photo-wrap { position: relative; float: right; margin: 0 0 0.75rem 1.25rem; }
.photo-count-badge { position: absolute; bottom: 0.25rem; right: 0.25rem; background: rgba(0,0,0,0.65); color: #fff; font-size: 0.7rem; padding: 0.05rem 0.35rem; border-radius: 8px; font-family: -apple-system, "Segoe UI", sans-serif; pointer-events: none; }
.photo-caption { width: 180px; color: #555; font-size: 0.82rem; margin: 0.3rem 0 0; }
.photo-nav { display: none; position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.45); color: #fff; border: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; font-size: 1.15rem; line-height: 1; cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.photo-wrap:hover .photo-nav { display: flex; }
.photo-nav:hover { background: rgba(0,0,0,0.7); }
.photo-nav-prev { left: 0.35rem; }
.photo-nav-next { right: 0.35rem; }
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(20, 15, 10, 0.9); z-index: 1000; align-items: center; justify-content: center; }
.lightbox-overlay.open { display: flex; }
.lightbox-image { max-width: 90vw; max-height: 85vh; box-shadow: 0 4px 24px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 1rem; right: 1.2rem; background: none; border: none; color: #fff; font-size: 2.2rem; line-height: 1; cursor: pointer; }
.lightbox-prev, .lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.15); border: none; color: #fff; font-size: 2.2rem; line-height: 1; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover, .lightbox-close:hover { background: rgba(255,255,255,0.3); }
.lightbox-counter { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); color: #eee; font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.9rem; }
body.lightbox-locked { overflow: hidden; }
sup a { text-decoration: none; }
ol.footnotes { padding-left: 1.4rem; font-style: italic; font-size: 0.82rem; color: #555; }
.site-header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid #ddd; padding: 0.6rem 0; margin: 0 0 1.5rem; }
.site-footer { margin-top: 2.5rem; padding-top: 0.75rem; border-top: 1px solid #ddd; text-align: center; font-size: 0.8rem; }
.site-footer a { color: #595959; }
.site-footer a.contact-email-link { color: #1e73be; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; font-family: -apple-system, "Segoe UI", sans-serif; font-size: 0.85rem; }
.surname-list { display: flex; flex-wrap: wrap; gap: 0.2rem 1.5rem; list-style: none; padding: 0; margin: 0.5rem 0 1rem; }
.surname-list small { color: #888; }
.person-list { list-style: none; padding: 0; margin: 1rem 0; column-width: 260px; column-gap: 2rem; }
.person-list li { break-inside: avoid; margin-bottom: 0.2rem; }
details.ancestors { margin-top: 1.2rem; }
details.ancestors summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; padding-bottom: 0.25rem; border-bottom: 1px solid #ddd; }
ul.ancestor-tree { list-style: none; margin: 0.3rem 0 0.3rem 0.6rem; padding: 0 0 0 1rem; border-left: 1px dashed #ccc; }
ul.ancestor-tree.ancestor-tree-root { margin-left: 0; border-left: none; padding-left: 0; }
ul.ancestor-tree li { padding: 0.15rem 0; }
ul.ancestor-tree a { color: inherit; }
.ancestor-level-0 { color: #222; font-weight: 600; }
.ancestor-level-1 { color: #1e73be; }
.ancestor-level-2 { color: #008000; }
.ancestor-level-3 { color: #de2159; }
.ancestor-level-4 { color: #b35400; }
.ancestor-level-5 { color: #027c89; }
.ancestor-dates { color: #777; font-size: 0.85em; }
.ancestor-depth-picker { margin: 0.4rem 0 0.8rem; font-size: 0.85rem; color: #555; }
.ancestor-depth-picker button { font-family: inherit; font-size: 0.85rem; border: 1px solid #ccc; background: #fff; color: #1e73be; padding: 0.1rem 0.5rem; margin-left: 0.25rem; border-radius: 3px; cursor: pointer; }
.ancestor-depth-picker button.active { background: #1e73be; color: #fff; border-color: #1e73be; }
.search-form { display: flex; gap: 0.5rem; max-width: 560px; }
.search-input { flex: 1; padding: 0.45rem 0.7rem; font-family: inherit; font-size: 1rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #222; }
.search-button { padding: 0.45rem 1rem; font-family: inherit; font-size: 1rem; border: 1px solid #1e73be; border-radius: 4px; background: #1e73be; color: #fff; cursor: pointer; }
.search-button:hover { background: #155a94; }
.search-comments-toggle { display: block; margin: 0.6rem 0 0; font-size: 0.85rem; color: #555; cursor: pointer; }
ul.search-results { list-style: none; padding: 0; margin: 1.2rem 0; }
li.search-group-heading { font-weight: 600; margin-top: 1.2rem; padding-bottom: 0.25rem; border-bottom: 1px solid #ddd; color: #555; }
li.search-group-heading:first-child { margin-top: 0; }
ul.search-group { list-style: none; padding: 0; margin: 0; }
ul.search-group li { padding: 0.3rem 0; border-bottom: 1px solid #eee; }
.search-type { color: #999; font-size: 0.85em; }
.search-empty { color: #999; font-style: italic; padding: 0.3rem 0; }
.home-title { text-align: center; }
.home-intro { margin: 0 0 1.5rem; color: #444; }
.home-divider { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }
.home-stats-columns { display: grid; grid-template-columns: max-content max-content; gap: 1rem 4rem; }
dl.home-stats { max-width: none; margin: 0; }
@media (max-width: 500px) {
  .home-stats-columns { grid-template-columns: max-content; }
}
.home-top-block { margin-top: 1.3rem; }
.home-top-block h2 { margin-bottom: 0.4rem; }
.home-top-block p { margin: 0; }
.place-description { white-space: pre-line; }

@media (max-width: 600px) {
  h1 { font-size: 1.05rem; }
}
