/* ======================================
   ROOT VARIABLES
====================================== */
:root {
    --color-primary: #0f1a2b;   /* deep navy */
    --color-accent: #8c6b3f;    /* muted gold */
    --color-bg: #f8f6f2;        /* parchment */
    --color-text: #1a1a1a;
    --color-muted: #6b6b6b;
    --max-width: 1200px;

    --font-serif: "Garamond", "Baskerville", serif;
    --font-sans: "Helvetica Neue", Arial, sans-serif;
}

/* ======================================
   RESET
====================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-serif);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
}

/* ======================================
   TYPOGRAPHY
====================================== */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    letter-spacing: 0.5px;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    margin: 3rem 0 1rem;
}

p {
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
}

.small-text {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.editorial h2 {
    margin-bottom: 1rem;
}

/* ======================================
   LAYOUT
====================================== */
.site-main {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.site-main p {
    max-width: 700px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem;
}

.section {
    margin: 5rem 0;
}

.closing {
    text-align: center;
}

.text-link {
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
    border-bottom: 1px solid var(--color-accent);
    padding-bottom: 2px;
}

/* ======================================
   SUBTLE PRESTIGE DETAILS
====================================== */
/* Elegant selection color */
::selection {
    background: var(--color-accent);
    color: #fff;
}

/* Links feel editorial, not “webby” */
a {
    color: inherit;
}

.intro .lead {
    font-size: 1.25rem;
    line-height: 1.7;
}

.center {
    text-align: center;
}

.prose {
    max-width: 720px;
    margin: 0 auto;
}

.prose p {
    font-size: 1.05rem;
}

.dropcap::first-letter {
    float: left;
    font-size: 3rem;
    line-height: 1;
    padding-right: 4px;
    font-family: var(--font-serif);
}

/* ======================================
   HEADER
====================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e2dc;
    padding: 1.5rem 0;
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

.crest {
    height: 64px;
}

.title-block {
    text-align: center;
}

/* Masthead Title */
.house-name {
    font-family: 'Playfair Display SC', serif;
    font-size: 2.4rem;          /* increased */
    letter-spacing: 2px;        /* key for prestige */
    text-transform: uppercase;
}

/* Motto refinement */
.motto {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-top: 0.4rem;
}

/* ======================================
   NAVIGATION
====================================== */
.nav {
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-sans);
}

.nav a {
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-text);
    position: relative;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.2s ease;
}

.nav a:hover::after {
    width: 100%;
}

/* ======================================
   HERO
====================================== */
.page-home .hero {
    padding-top: 8rem;
}

.hero {
    padding: 6rem 2rem;
    text-align: center;
    background: #fff;
}

.hero h1 {
    font-size: 3.5rem;
}

.hero-sub {
    font-family: var(--font-sans);
    color: var(--color-muted);
}

/* ======================================
   HERITAGE BREAK
====================================== */
.heritage-break {
    text-align: center;
    padding: 5rem 0 4rem;
    background: #fff;
}

.heritage-break .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.heritage-inner {
    max-width: 800px;
    margin: 0 auto;
}

.heritage-crest {
    display: block;
    margin: 0 auto 1.5rem;
    height: 90px;
}

.heritage-text {
    display: block;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #5c5c5c;
}

/* ======================================
   DIVIDER
====================================== */
.divider {
    width: 60px;
    height: 1px;
    background: var(--color-accent);
    margin: 2rem auto;
}

/* ======================================
   GRID (for archives, genealogy)
====================================== */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ======================================
   FEATURES
====================================== */
.features {
    margin-top: 2rem;
}

.feature-card {
    padding: 1.5rem 1rem;
    border-top: 1px solid #e5e2dc;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--color-muted);
}

.feature-link {
    display: inline-block;
    margin-top: 0.8rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-accent);
}

/* =========================
   CHARTER PAGE
========================= */

.page-charter {
    background: #f4f1ea;
}

/* Wrapper */
.charter-wrapper {
    padding: 4rem 0 6rem;
    display: flex;
    justify-content: center;
}

/* Paper */
.charter {
    background: #fdfaf3;
    max-width: 800px;
    padding: 4rem 3.5rem;
    border: 1px solid #e2ded6;

    /* subtle paper depth */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Header */
.charter-header {
    text-align: center;
    margin-bottom: 3rem;
}

.charter-crest {
    height: 70px;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.charter-header h2 {
    font-size: 1.8rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.charter-date {
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-muted);
}

/* Body */
.charter-body {
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: justify;
}

.charter-body p {
    margin-bottom: 1.5rem;
}

/* Drop cap refinement */
.page-charter .dropcap::first-letter {
    font-size: 3.5rem;
    padding-right: 10px;
}

/* Signature */
.charter-signature {
    margin-top: 4rem;
    text-align: center;
}

.signature-line {
    width: 200px;
    height: 1px;
    background: #444;
    margin: 0 auto 0.5rem;
}

.signature-name {
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.charter-principle {
    margin: 20px 0 25px 0;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #555;
    border-left: 3px solid #999;
    background: #f7f7f7;
}

.charter-mark {
    font-weight: bold;
    margin-right: 6px;
}

.charter-link {
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.charter-footer {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #777;
    text-align: center;
    font-style: italic;
}

/* =========================
   ARMORIAL SYSTEM
========================= */

.armorial-lineage{
    max-width:900px;
    margin:auto;
    padding:2rem 2rem;
}

.armorial-card{
    text-align:center;
    padding:2rem 0;
}

.armorial-visual img{
    max-height:400px;
}

.armorial-title h2{
    font-size:2rem;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-weight:500;
}

.armorial-dates{
    display:block;
    margin-top:1rem;
    opacity:.6;
    font-style:italic;
}

.armorial-blazon,
.armorial-crest{
    max-width:560px;
    margin:2rem auto;
    line-height:1.9;
}

.armorial-inscription{
    max-width:640px;
    margin:2.5rem auto 0;
    text-align:center;

    font-style:italic;
    font-size:.95rem;
    line-height:1.8;

    color:#d7c7a3;

    letter-spacing:.03em;
}

.armorial-inscription::before{
    content:"\2720";

    display:block;

    margin-bottom:1rem;

    font-size:.85rem;

    color:#b08d57;
}

.armorial-account{
    margin-top:2rem;
    text-align:center;
}

.armorial-account a{
    color:#c8a96b;

    font-size:.78rem;
    letter-spacing:.14em;
    text-transform:uppercase;

    text-decoration:none;

    border-bottom:1px solid rgba(200,169,107,.4);

    padding-bottom:.25rem;

    transition:all .25s ease;
}

.armorial-account a:hover{
    color:#e0c48a;
    border-color:#e0c48a;
}

.lineage-divider{
    width:1px;
    height:90px;
    background:linear-gradient(
        to bottom,
        transparent,
        rgba(212,175,55,.5),
        transparent
    );
    margin:3rem auto;
}

/* =========================
   ARMORIAL LINK
========================= */

.armorial-account{
    margin-top:2.5rem;
    text-align:center;
}

.armorial-account a{
    font-size:.78rem;
    letter-spacing:.12em;
    text-transform:uppercase;
    text-decoration:none;
    opacity:.72;
    border-bottom:1px solid rgba(212,175,55,.35);
    padding-bottom:.25rem;
    transition:opacity .25s ease;
}

.armorial-account a:hover{
    opacity:1;
}

/* =========================
   ARCHIVE LAYOUT
========================= */
.page-archives .grid {
    grid-template-columns: repeat(3, 1fr);
}

.archive-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.archive-sidebar {
    border-right: 1px solid #e5e2dc;
    padding-right: 1.5rem;
    font-family: var(--font-sans);
    position: sticky;
    top: 20px;              /* distance from top of viewport */
    height: calc(100vh - 40px);
    overflow: hidden;      /* prevent whole sidebar from scrolling */
    display: flex;
    flex-direction: column;
}

.archive-heading {
    flex-shrink: 0;        /* keeps header fixed */
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    color: var(--color-muted);
}

.archive-empty {
    padding: 60px 20px;
    text-align: center;
    color: #777;
    font-style: italic;
}

.archive-list {
    list-style: none;
    overflow-y: auto;      /* THIS creates scroll */
    flex-grow: 1;
    padding-right: 10px;   /* prevents scrollbar overlap */
    scroll-behavior: smooth;
}

.archive-list li {
    padding: 0.7rem 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.archive-list li.active {
    font-weight: 600;
}

.archive-list li:hover {
    opacity: 0.7;
}

.doc-title {
    display: block;
    font-size: 0.9rem;
    line-height: 1.4;
}

.doc-date {
    font-size: 0.7rem;
    letter-spacing: 1px;
    color: var(--color-muted);
}

.archive-viewer section {
    margin-bottom: 3rem;
}

.archive-viewer {
    max-width: 900px;
}

.archive-viewer > *:last-child {
    margin-bottom: 0;
}

.archive-viewer h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    color: var(--color-muted);
}

/* Larger separation between major sections */
.archive-meta,
.facsimile,
.transcription-columns {
    margin-bottom: 3rem;
}

/* Smaller spacing inside sections */
.transcription p {
    margin-bottom: 1rem;
}

.archive-meta {
    margin-bottom: 2.5rem;
}

.archive-meta h2 {
    font-family: var(--font-serif);
    font-weight: 500;          /* softer than bold */
    letter-spacing: 0.5px;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.object-id {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-left: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}


/* Improve metadata readability (keep your grid) */
.meta-grid div {
    line-height: 1.35;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem 1.5rem;
    font-size: 0.9rem;
}

.meta-grid span {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--color-muted);
    margin-right: 6px;
    font-variant: small-caps;
    letter-spacing: 1.5px;
}

.facsimile {
    background: #f7f3ea;
    border: 1px solid #ddd8cf;
    padding: 2rem;
    text-align: center;
    margin: 2.5rem 0;
}

.facsimile img {
    max-width: 100%;
    height: auto;
}

.facsimile figcaption {
    font-size: 0.75rem;
    color: var(--color-muted);
    margin-top: 0.75rem;
    text-align: center;
    line-height: 1.4;
}

.transcription h3,
.curatorial-note h3,
.provenance h3 {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.transcription {
    max-width: 700px;
}

.transcription h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.transcription p {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    line-height: 1.85;
    letter-spacing: 0.2px;
    margin-bottom: 1rem;
}

.transcription-block {
    max-width: 700px;
}

.transcription-block p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.transcription-block hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 1.5rem 0;
}

/* =========================
   TRANSCRIPTION COLUMNS
========================= */

.transcription-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    max-width: 900px;
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

.transcription-columns .transcription {
    margin-bottom: 0; /* prevent double spacing */
    max-width: none;
}

.transcription-columns .transcription:first-child {
    border-right: 1px solid #e5e2dc;
    padding-right: 1.25rem;
}

.note {
    font-size: 0.85rem;
    color: var(--color-muted);
    font-style: italic;
}

/* Curatorial + provenance text tone */
.curatorial-note p,
.provenance p {
    max-width: 700px;
    line-height: 1.7;
}

/* Sidebar hierarchy (adds "finding aid" feel) */
.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.manuscript-center {
    text-align: center;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    margin: 6px 0;
}

.manuscript-spacer {
    height: 24px;
}

.manuscript-section h2 {
    text-align: center;
    margin-bottom: 30px;
}

.manuscript-toc-item {
    display: flex;
    justify-content: space-between;
    margin: 6px 0;
    font-variant: small-caps;
}

.toc-label {
    min-width: 140px;
}

.toc-title {
    flex: 1;
    text-align: left;
}

.manuscript-quote {
    margin: 20px 60px;
    font-style: normal;
    line-height: 1.7;
}

.manuscript-footnotes {
    margin-top: 30px;
    padding-top: 10px;
    border-top: 1px solid #aaa;
    font-size: 0.9em;
    line-height: 1.4;
}

.footnote {
    margin: 6px 0;
}

.fn-number {
    vertical-align: super;
    font-size: 0.8em;
    margin-right: 6px;
}

.fn-ref {
    vertical-align: super;
    font-size: 0.7em;
}


/* =========================
   HISTORY LAYOUT
========================= */
.page-history .site-main {
    max-width: 900px;
}

.history {
    margin-top: 3rem;
}

.history-intro {
    margin-bottom: 4rem;
}

.history-section {
    margin-bottom: 4rem;
}

/* Timeline markers */
.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 3rem 0;
}

.timeline-marker span {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: 0.5rem;
}

.timeline-line {
    width: 1px;
    height: 40px;
    background: #d8d5cf;
    position: relative;
}

.timeline-line::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: -3px;
    width: 7px;
    height: 7px;
    background: var(--color-accent);
    border-radius: 50%;
}

.history-editorial {
    margin-top: 5rem;
}

/* =========================
   GENEALOGY LAYOUT
========================= */

.genealogy {
    margin-top: 3rem;
}

.genealogy-section {
    max-width: 700px;
    margin: 3rem auto;
}

.genealogy-section h2 {
    margin-bottom: 0.8rem;
}

.page-genealogy .genealogy-intro {
    max-width: 720px;
    text-align: left;
    margin: 2rem auto 3rem;
}

.genealogy-search {
    margin-bottom: 2rem;
    text-align: center;
}

.genealogy-search input {
    width: 300px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    font-family: var(--font-sans);
}

.person-focus {
    margin-bottom: 3rem;
    text-align: center;
}

.person-name {
    font-size: 1.6rem;
}

.person-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
}

.tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.generation {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.person-card {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    background: #fff;
    font-size: 0.9rem;
    min-width: 140px;
}

.person-card.primary {
    border: 1px solid var(--color-accent);
}

.parents {
    position: relative;
}

.parents::after {
    content: "";
    position: absolute;
    bottom: -20px;
    width: 2px;
    height: 20px;
    background: #ccc;
}

.subject::before {
    content: "";
    position: absolute;
    top: -20px;
    width: 2px;
    height: 20px;
    background: #ccc;
}

.genealogy-entry {
    text-align: center;
    margin: 2rem 0;
}

.genealogy-entry-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-accent);
}

/* subtle hover */
.genealogy-entry-link:hover {
    text-decoration: underline;
}

/* =========================
   GENEALOGY STATS (LEDGER)
========================= */

.genealogy-stats {
    max-width: 800px;
    margin: 4rem auto;
    text-align: center;
}

.stats-title {
    margin-bottom: 1.5rem;
}

/* Ledger rows */
.stats-ledger {
    border-top: 1px solid #e5e2dc;
    border-bottom: 1px solid #e5e2dc;
    padding: 1.5rem 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
}

/* Each stat */
.stat {
    width: 48%;
    text-align: center;
}

/* Value */
.stat-value {
    display: block;
    font-size: 1.2rem;
}

/* Label */
.stat-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-top: 0.2rem;
}

/* =========================
   GENEALOGY RECORD BLOCK
========================= */

.genealogy-record {
    max-width: 600px;
    margin: 3rem auto 0;
    border-top: 1px solid #e5e2dc;
    padding-top: 1rem;
}

/* Each line */
.record-line {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
}

/* Labels */
.record-line .label {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-muted);
}

/* Values */
.record-line .value {
    font-size: 0.9rem;
}

/* =========================
   SEARCH PAGE
========================= */

.page-search .site-main {
    max-width: 900px;
}

/* Header */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-meta {
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--color-muted);
}

/* Results container */
.search-results {
    max-width: 700px;
    margin: 0 auto;
}

/* Empty state */
.search-empty {
    text-align: center;
    color: var(--color-muted);
    margin-top: 2rem;
}

/* Result card */
.result-card {
    padding: 1.2rem 0;
    border-bottom: 1px solid #e5e2dc;
}

/* Name */
.result-name {
    font-size: 1.1rem;
}

/* Meta */
.result-meta {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.2rem;
}

/* Link */
.result-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-accent);
    text-decoration: none;
}

.result-link:hover {
    text-decoration: underline;
}

/* ==========================================
   GENEALOGY - SURNAME ARCHIVE INDEX
========================================== */

/* A–Z bar */
.archive-az {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 2rem 0;
}

.archive-az a {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-decoration: none;
    padding: 4px 6px;
    border: 1px solid #ddd;
    color: var(--color-muted);
}

/* Active letters */
.archive-az .az-active {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;

    padding: 4px 6px;
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* Hover */
.archive-az .az-active:hover {
    background: #eee;
}

/* Disabled letters */
.archive-az .az-disabled {
    font-family: var(--font-sans);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;

    padding: 4px 6px;
    color: #bbb;
    border: 1px solid transparent;

    cursor: default;
}

.az-count {
    font-size: 0.65rem;
    color: var(--color-muted);
    margin-left: 2px;
}

/* section highlight */
.letter-highlight {
    background: rgba(0,0,0,0.04);
    transition: background 0.6s ease;
}

/* Ledger container */
.surname-ledger {
    max-width: 900px;
    margin: 0 auto;
}

/* Each letter section */
.surname-group {
    margin-bottom: 2.5rem;
}

/* Letter heading */
.surname-letter {
    text-align: center;
    font-size: 1.4rem;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    color: var(--color-muted);
}

/* List */
.surname-list {
    list-style: none;
    padding: 0;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 20px;
}

/* Entries */
.surname-list li {
    text-align: center;
    padding: 4px 0;
}

/* Links */
.surname-list a {
    text-decoration: none;
    font-size: 0.9rem;
    color: var(--color-text);
}

.surname-list a:hover {
    color: var(--color-accent);
}

/* collapse lists */
/* collapse EVERYTHING inside the group */
.surname-group.collapsed .surname-letter,
.surname-group.collapsed .surname-list {
    display: none;
}

/* optional: subtle transition feel */
.surname-group {
    transition: background 0.3s ease;
}

/* highlight active section */
.surname-group.active {
    background: rgba(0,0,0,0.03);
}

/* ==========================================
   GENEALOGY - INDIVIDUAL INDEX (ARCHIVAL STYLE)
========================================== */

.genealogy-index {
    max-width: 700px;
    margin: 2rem auto;
}

/* List reset */
.genealogy-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Each entry */
.genealogy-links li {
    padding: 0.8rem 0;
    border-bottom: 1px solid #e5e2dc;
    text-align: center;
}

/* Link styling */
.genealogy-links a {
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    color: var(--color-text);
}

/* Hover = subtle, editorial */
.genealogy-links a:hover {
    color: var(--color-accent);
}

.family-index {
    list-style: none;
    padding: 0;
    columns: 2;              /* clean multi-column layout */
    column-gap: 40px;
}

.family-index li {
    margin: 4px 0;
}

.family-index a {
    text-decoration: none;
}

/* =========================
   FAMILY LAYOUT FIX
========================= */

.family-header {
    display: flex;
    align-items: flex-start;  /* prevents vertical distortion */
    gap: 25px;
    margin-bottom: 25px;
}

.family-coat {
    width: auto !important;
    height: auto !important;
    max-width: 250px;
    max-height: 250px;
    object-fit: contain;

    border: 4px solid #000;
    display: block;
    flex-shrink: 0;
}

.family-meta {
    flex: 1;
}

/* =========================
   SPACING FIX
========================= */

.family-section {
    margin-top: 30px;
}

.family-section h3 {
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.family-section p {
    margin-bottom: 14px;
    line-height: 1.65;
}

.family-list {
    margin-top: 10px;
    padding-left: 20px;
}

.family-list li {
    margin-bottom: 6px;
}

/* keep consistency with archive */
.archive-meta {
    margin-bottom: 25px;
}

/* ======================================
   FOOTER
====================================== */
.site-footer {
    border-top: 1px solid #e5e2dc;
    background: #fff;
    padding: 2rem 0;
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Link styling */
.footer-links a {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--color-muted);
}

/* Subtle hover */
.footer-links a:hover {
    color: var(--color-accent);
}

/* Bottom row */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Center links */
.footer-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    font-family: var(--font-sans);
}

.footer-right img {
    height: 20px;
    vertical-align: middle;
    text-align: right;
    margin-left: 8px;
}

.brand {
    letter-spacing: 1px;
}

/* =============================
    LEGAL PAGE
============================= */

.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.notice-back {
    margin-bottom: 15px;
}

.notice-btn {
    text-decoration: none;
    font-weight: bold;
    color: #c9a227;
}

.notice-section {
    margin-top: 25px;
}

.notice-section h2 {
    color: #c9a227;
    margin-bottom: 5px;
}

.legal-intro {
    text-align: center;
    margin-bottom: 20px;
}

@media print {

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .notice-back,
    .legal-actions,
    .sidebar,
    .top-nav,
    .banner {
        display: none !important;
    }

    .content-section {
        max-width: 100%;
        padding: 0;
    }

    .section-divider {
        background: #000;
    }

    a {
        color: #000;
        text-decoration: none;
    }

}

/* =========================
   LEGAL BAR (SINGLE ROW)
========================= */

.legal-bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 2rem;
}

/* Left */
.legal-left {
    justify-self: start;
}

/* Center */
.legal-center {
    justify-self: center;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--color-muted);
}

/* Right */
.legal-right {
    justify-self: end;
}

/* Keep buttons consistent */
.notice-btn {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
}

/* ==========================================
   ARCHIVAL SEARCH FORM
========================================== */

.form-wrapper {
    width: 520px;
    margin: 2.5rem auto;
    padding: 1.5rem;

    background: #fdfaf3;
    border: 1px solid #e2ded6;

    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inputs */
.form-wrapper input {
    flex: 1;
    height: 38px;
    padding: 0 8px;

    font-family: var(--font-serif);
    font-size: 0.95rem;

    border: 1px solid #d8d5cf;
    background: #fff;

    border-radius: 0;
}

/* Focus */
.form-wrapper input:focus {
    outline: none;
    border-color: #bdb8af;
}

/* Placeholder */
.form-wrapper input::placeholder {
    color: #999;
    font-style: italic;
}

/* Button */
.form-wrapper button {
    flex: 0 0 110px;
    height: 38px;

    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;

    color: #333;
    background: transparent;

    border: 1px solid #d8d5cf;
    border-radius: 0;

    cursor: pointer;
}

/* Hover */
.form-wrapper button:hover {
    background: #f3f0ea;
}

/* Active */
.form-wrapper button:active {
    background: #e9e6df;
}


/* =========================
   CONTACT PAGE
========================= */
.page-contact {
    background: #f4f1ea;
}

.contact-document {
    display: flex;
    justify-content: center;
    padding: 3rem 0 5rem;
}

.contact-paper {
    background: #fdfaf3;
    max-width: 700px;
    width: 100%;
    padding: 3rem 2.5rem;
    border: 1px solid #e2ded6;
    box-shadow: 0 8px 25px rgba(0,0,0,0.04);
}

.contact-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-header h1 {
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.contact-meta {
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-muted);
}

.contact-body {
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.contact-form {
    max-width: 900px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 1.2rem;
}

.form-row label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    color: var(--color-muted);
}

.form-row input,
.form-row textarea {
    width: 100%;
    border: 1px solid #ddd;
    padding: 0.5rem;
    font-family: var(--font-serif);
    font-size: 0.95rem;
}

/* Submit */
.form-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.contact-email {
    font-family: var(--font-sans);
    letter-spacing: 1px;
}

/* ==========================================
   NOBILITY INDEX MODULE
   (Stapleton Archival System)
========================================== */

/* Container */
.nobility-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Title */
.nobility-title {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 1px;
}

/* Intro */
.nobility-intro {
    font-size: 0.95rem;
    color: #444;
    margin-top: 10px;
}

/* ==========================================
   SEARCH
========================================== */
.nobility-search {
    margin: 20px 0;
}

.nobility-search input {
    width: 100%;
    padding: 8px;
    font-family: inherit;
    border: 1px solid #ccc;
}

/* ==========================================
   A-Z INDEX
========================================== */
.nobility-az {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 15px 0 25px;
}

.nobility-az a {
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 6px;
    border: 1px solid #ccc;
    color: #333;
}

.nobility-az a:hover {
    background: #ddd;
}

/* ==========================================
   REGIONS
========================================== */
.nobility-region h2 {
    font-size: 1.3rem;
    margin-top: 40px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    cursor: pointer;
}

.nobility-region-content {
    margin-top: 10px;
}

.nobility-region.collapsed .nobility-region-content {
    display: none;
}

/* ==========================================
   GRID
========================================== */
.nobility-grid {
    list-style: none;
    padding: 0;
    margin: 10px 0 30px;

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 6px 20px;
}

.nobility-grid li {
    display: block;
}

.nobility-grid a {
    text-decoration: none;
    color: #2a2a2a;
    font-size: 0.95rem;
}

.nobility-grid a:hover {
    text-decoration: underline;
}

/* ==========================================
   GENEALOGY PROFILE SYSTEM
========================================== */

:root{
    --paper:#f8f4ea;
    --paper-dark:#f2eadb;
    --ink:#2d2a26;
    --muted:#6f675a;
    --gold:#b08b57;
    --burgundy:#6d1f2b;
    --border:#d6c8ae;
    --shadow:0 8px 30px rgba(0,0,0,.08);
    --radius:18px;
}

/* ==========================================
   DARK PARCHMENT MODE
========================================== */

body.dark-mode{

    --paper:#2a241d;
    --paper-dark:#342d24;

    --ink:#e8dcc6;
    --muted:#b8aa92;

    --gold:#c8a36a;
    --burgundy:#c07a86;

    --border:#4d4336;

    --shadow:
        0 10px 30px rgba(0,0,0,.45);
}

/* ==========================================
   GLOBAL DARK BACKGROUND
========================================== */

body.dark-mode{
    background:
        radial-gradient(
            circle at top,
            #3a3127,
            #1f1a15 70%
        );

    color:var(--ink);
}

/* ==========================================
   CARD SYSTEM
========================================== */

body.dark-mode .profile-card,
body.dark-mode .content-card,
body.dark-mode .family-block,
body.dark-mode .sidebar-card{

    background:
        linear-gradient(
            to bottom,
            rgba(58,49,39,.96),
            rgba(42,36,29,.98)
        );

    border-color:var(--border);

    box-shadow:
        0 14px 38px rgba(0,0,0,.45),
        inset 0 1px 0 rgba(255,255,255,.03);
}

/* ==========================================
   TEXT
========================================== */

body.dark-mode p,
body.dark-mode li,
body.dark-mode div,
body.dark-mode .timeline-detail,
body.dark-mode .note-text{
    color:var(--ink);
}

/* ==========================================
   LINKS
========================================== */

body.dark-mode a{
    color:#d8b07a;
}

body.dark-mode a:hover{
    color:#f3d2a5;
}

/* ==========================================
   TIMELINE
========================================== */

body.dark-mode .timeline::before{
    background:
        linear-gradient(
            to bottom,
            rgba(200,163,106,.5),
            rgba(200,163,106,.14)
        );
}

body.dark-mode .timeline-row::before{
    background:var(--gold);
    border-color:var(--paper-dark);
}

/* ==========================================
   FACTS / SOURCE PANELS
========================================== */

body.dark-mode .source-entry,
body.dark-mode .repository-block{
    background:#332b22;
}

body.dark-mode .citation-block{
    background:rgba(255,255,255,.03);
}

/* ==========================================
   NOTES
========================================== */

body.dark-mode .note-text{
    border-left-color:rgba(200,163,106,.25);
}

/* ==========================================
   IMAGE CARDS
========================================== */

body.dark-mode .crest-card{
    background:
        radial-gradient(
            circle at top,
            rgba(90,76,60,.92),
            rgba(42,36,29,.98)
        );
}

body.dark-mode .portrait-card{
    background:#332b22;
}

/* ==========================================
   BUTTONS / COLLAPSIBLES
========================================== */

body.dark-mode .collapse-controls button{
    background:#3a3127;
    border-color:#5b4f40;
    color:var(--ink);
}

body.dark-mode .collapse-controls button:hover{
    background:#4a3f33;
}

/* ==========================================
   SUBTLE TYPOGRAPHIC REFINEMENTS
========================================== */

body.dark-mode .family-title{
    color:#d7b48a;
}

body.dark-mode .timeline span{
    color:#d2a56f;
}

body.dark-mode .lifespan,
body.dark-mode .aka,
body.dark-mode .change-record{
    color:#bda98b;
}

*{
    box-sizing:border-box;
}

body.genealogy-page{
    margin:0;
    font-family:'Source Serif 4', serif;
    color:var(--ink);
    line-height:1.8;
    background:#ece5d8;
}

/* ==========================================
   GLOBAL LAYOUT
========================================== */

.site-shell{
    width:min(1400px,94%);
    margin:auto;
    padding:40px 0 80px;
}

.profile-layout{
    display:grid;
    grid-template-columns:minmax(0,2fr) 300px;
    gap:40px;
    align-items:start;
}

.main-content{
    min-width:0;
}

/* ==========================================
   CARD SYSTEM
========================================== */

.profile-card,
.content-card,
.family-block,
.sidebar-card{
    background:var(--paper);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
}

/* ==========================================
   MAIN PROFILE CARD
========================================== */

.profile-card{
    padding:40px;
    margin-bottom:32px;
}

.profile-card h2{
    margin:0;
    font-family:'Cinzel', serif;
    font-size:clamp(1.2rem,2vw,1.7rem);
    font-weight:600;
    letter-spacing:.4px;
    line-height:1.2;
    color:var(--burgundy);
}

.lifespan{
    margin-top:10px;
    color:var(--muted);
    font-size:1.1rem;
}

.aka{
    margin-top:14px;
    color:var(--gold);
    font-style:italic;
    font-size:1.05rem;
}

/* ==========================================
   COMPACT HISTORICAL TIMELINE
========================================== */

.timeline{
    position:relative;
    margin-top:2rem;
    padding-left:2.2rem;
}

/* vertical line */

.timeline::before{
    content:"";
    position:absolute;
    top:0;
    left:10px;
    width:2px;
    height:100%;
    background:
        linear-gradient(
            to bottom,
            rgba(176,139,87,.45),
            rgba(176,139,87,.12)
        );
}

/* each generated GEDCOM row */

.timeline > div{
    position:relative;
    margin-bottom:.7rem;
    padding:.2rem 0 .2rem 1rem;
    line-height:1.65;
    color:#433b31;
}

/* timeline marker */

.timeline > div::before{
    content:"";
    position:absolute;
    left:-2.05rem;
    top:.6rem;
    width:10px;
    height:10px;
    border-radius:50%;
    background:var(--gold);
    border:2px solid var(--paper);
    box-shadow:
        0 0 0 1px rgba(176,139,87,.28);
}

/* event label */

.timeline span{
    display:inline-block;
    width:140px;
    margin-right:.75rem;
    color:var(--burgundy);
    font-size:.72rem;
    font-weight:700;
    font-variant:small-caps;
    letter-spacing:1.4px;
    opacity:.82;
    vertical-align:top;
}

/* citations */

.timeline sup{
    margin-left:.25rem;
}

/* tighter paragraph spacing */

.timeline br{
    line-height:1.25;
}

/* ==========================================
   SECTION CARDS
========================================== */

.content-card,
.family-block{
    position:relative;
    overflow:hidden;
    padding:32px;
    margin-bottom:32px;
}

.content-card p strong{
    color:var(--burgundy);
    letter-spacing:.5px;
}

.family-block::before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:100%;
    height:4px;
    background:
        linear-gradient(
            90deg,
            transparent,
            var(--gold),
            transparent
        );
}

.family-block + .family-block{
    margin-top:2.8rem;
}

/* ==========================================
   HEADERS
========================================== */

.family-header{
    margin-bottom:1.5rem;
    padding-bottom:1rem;
    border-bottom:1px solid rgba(176,139,87,.25);
}

.family-title{
    margin:0;
    font-family:'Cinzel', serif;
    font-size:1.28rem;
    font-weight:600;
    letter-spacing:1.2px;
    text-transform:uppercase;
    color:var(--burgundy);
    line-height:1.3;
}

/* ==========================================
   TEXT
========================================== */

p{
    margin:0 0 1.25rem;
}

a{
    color:var(--burgundy);
    text-decoration:none;
    transition:opacity .2s ease;
}

a:hover{
    opacity:.75;
}

/* ==========================================
   NOTES
========================================== */

.note-text{
    margin:1.25rem 0;
    padding-left:1rem;
    border-left:2px solid rgba(176,139,87,.22);
    color:#433b31;
    line-height:1.9;
    font-size:1.02rem;
}

.note-item{
    margin:.75rem 0;
}

.note-label{
    font-weight:700;
    color:var(--burgundy);
    letter-spacing:.4px;
}

/* ==========================================
   FAMILY BLOCKS
========================================== */

.family-spouse{
    margin-top:.5rem;
    font-size:1.1rem;
    font-weight:600;
}

.family-details{
    margin-top:1.5rem;
}

.family-events{
    list-style:none;
    margin:0;
    padding:0;
}

.family-events li{
    position:relative;
    padding-left:1.4rem;
    margin-bottom:.8rem;
}

.family-events li::before{
    content:"?";
    position:absolute;
    left:0;
    top:0;
    color:var(--gold);
    font-size:.85rem;
}

/* ==========================================
   CHILDREN
========================================== */

.family-children{
    margin-top:2rem;
}

.children-title{
    margin:0 0 1rem;
    font-family:'Cinzel', serif;
    color:var(--burgundy);
    font-size:1.15rem;
}

.children-list{
    margin:0;
    padding-left:1.4rem;
}

.child-item{
    margin-bottom:.5rem;
}

.no-children{
    margin-top:1rem;
    color:var(--muted);
    font-style:italic;
}

/* ==========================================
   COLLAPSIBLE PEDIGREE
========================================== */

.pedigree-card{
    overflow:hidden;
    margin-bottom:1.8rem;
}

/* summary */

.pedigree-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;

    cursor:pointer;

    user-select:none;
    list-style:none;
}

/* remove browser marker */

.pedigree-summary::-webkit-details-marker{
    display:none;
}

.pedigree-summary::marker{
    display:none;
}

/* toggle icon */

.pedigree-summary::after{
    content:"+";

    color:var(--gold);

    font-size:1.4rem;
    font-weight:700;
    line-height:1;
}

/* open state */

.pedigree-card[open] .pedigree-summary::after{
    content:"-";
}

/* pedigree body */

.pedigree-content{
    margin-top:1.2rem;

    font-size:.95rem;
    line-height:1.7;
}

/* generated pedigree links */

.pedigree-content a{
    color:var(--burgundy);
    text-decoration:none;
    font-weight:700;
}

/* generated lists */

.pedigree-content ul,
.pedigree-content ol{
    margin:0;
    padding-left:1.2rem;
}

.pedigree-content li{
    margin-bottom:.45rem;
}

.pedigree-content li::marker{
    color:var(--gold);
}

/* ==========================================
   SOURCES / CITATIONS
   ARCHIVAL COMPRESSED STYLE
========================================== */

/* main source wrapper */

.source-entry{
    margin:1rem 0;
    padding:.9rem 1.1rem;
    background:rgba(255,255,255,.24);
    border-left:3px solid rgba(176,139,87,.34);
    border-radius:0 10px 10px 0;
    line-height:1.65;
}

/* source titles */

.source-title{
    display:inline;
    margin:0;
    font-family:'Source Serif 4', serif;
    font-size:.98rem;
    font-weight:700;
    color:var(--burgundy);
}

/* body text */

.source-text,
.citation-description,
.citation-text{
    display:inline;
    margin:0;
    color:#433b31;
    line-height:1.65;
}

/* metadata */

.source-meta{
    margin:.2rem 0;
    font-size:.92rem;
    line-height:1.55;
}

.source-label{
    color:var(--burgundy);
    font-weight:700;
}

/* inline superscript citations */

.source-citation a{
    color:var(--gold);
    text-decoration:none;
    font-weight:700;
    font-size:.72em;
}

.source-citation a:hover{
    opacity:.75;
}

/* individual citation blocks */

.citation-block{
    margin:.8rem 0;
    padding:.5rem 0 .5rem .6rem;

    border:none;
    background:none;
    border-radius:0;

    font-size:.92rem;
    line-height:1.6;

    text-indent:0;
}

/* citation number */

.citation-number{
    display:inline;
    margin-right:.35rem;

    font-family:'Cinzel', serif;
    font-size:.82rem;
    font-weight:700;

    color:var(--burgundy);
}

/* repositories */

.repository-block{
    margin:.4rem 0 .4rem 1rem;
    padding:0;

    background:none;
    border:none;

    font-size:.9rem;
    line-height:1.55;
}

.repository-name{
    display:inline;
    margin-right:.35rem;

    font-weight:700;
    color:var(--burgundy);
}

/* change records */

.change-record{
    margin-top:.45rem;

    color:var(--muted);

    font-size:.82rem;
    line-height:1.45;
}

/* spacing between entries */

.citation-block + .citation-block{
    border-top:1px solid rgba(176,139,87,.10);
    padding-top:.9rem;
}

/* source notes */

.note-text{
    margin:.5rem 0;
    padding-left:.8rem;

    border-left:2px solid rgba(176,139,87,.18);

    font-size:.96rem;
    line-height:1.75;
}

/* ==========================================
   COLLAPSIBLE SOURCE SECTION
========================================== */

.sources-block{
    overflow:hidden;
}

/* clickable header */

.family-summary{
    display:flex;
    align-items:center;
    justify-content:space-between;

    cursor:pointer;
    user-select:none;
    list-style:none;
}

/* remove browser markers */

.family-summary::-webkit-details-marker{
    display:none;
}

.family-summary::marker{
    display:none;
}

/* plus/minus */

.family-summary::after{
    content:"+";

    color:var(--gold);

    font-size:1.4rem;
    font-weight:700;
    line-height:1;

    transition:transform .2s ease;
}

/* open state */

.sources-block[open] .family-summary::after{
    content:"-";
}

/* spacing */

.sources-block .family-details{
    margin-top:1.2rem;
}

/* hover */

.family-summary:hover{
    opacity:.92;
}

/* ==========================================
   SIDEBAR
========================================== */

.sidebar{
    position:sticky;
    top:30px;
    display:flex;
    flex-direction:column;
    gap:24px;
}

.sidebar-card{
    padding:22px;
    overflow:hidden;
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.sidebar-card:hover{
    transform:translateY(-4px);
}

.sidebar-card img{
    display:block;
    width:250px;
    max-width:100%;
    height:auto;
    margin:auto;
    object-fit:contain;
}

.crest-card{
    text-align:center;
    background:
        linear-gradient(
            to bottom,
            rgba(255,255,255,.75),
            rgba(240,232,217,.95)
        );
}

.crest-card img{
    display:block;
    width:250px;
    max-width:100%;
    height:auto;
    margin:auto;
    object-fit:contain;
    filter:
        drop-shadow(0 6px 10px rgba(0,0,0,.18));
}

.portrait-card{
    padding:14px;
    background:#f4efe4;
}

.portrait-card img{
    border-radius:12px;
    border:1px solid #cdbda1;
}

/* ==========================================
   MOBILE
========================================== */

@media(max-width:1000px){

    .profile-layout{
        grid-template-columns:1fr;
    }

    .sidebar{
        position:relative;
        top:auto;
    }

    .crest-card img{
        max-width:220px;
    }
}

@media(max-width:768px){

    .profile-card,
    .content-card,
    .family-block{
        padding:24px;
    }

    .facts-grid{
        grid-template-columns:1fr;
    }

    .family-title{
        font-size:1.25rem;
    }
}

/* ==========================================
   PRINT STYLESHEET
   INDIVIDUAL PROFILE PAGES
========================================== */

@media print{

    /* ---------- PAGE ---------- */

    @page{
        margin:.6in;
        size:auto;
    }

    html,
    body{
        background:#fff !important;
        color:#000 !important;

        font-family:'Source Serif 4', serif;
        font-size:11pt;
        line-height:1.45;
    }

    /* ---------- REMOVE SCREEN EFFECTS ---------- */

    *{
        box-shadow:none !important;
        text-shadow:none !important;
        filter:none !important;
        animation:none !important;
        transition:none !important;
    }

    /* ---------- LAYOUT ---------- */

    .site-shell{
        width:100%;
        max-width:none;
        padding:0;
        margin:0;
    }

    .profile-layout{
        display:block;
    }

    .main-content{
        width:100%;
        max-width:none;
    }

    /* ---------- SIDEBAR ---------- */

    .sidebar{
        position:static;
        display:block;
        margin:0 0 2rem 0;
    }

    .sidebar-card{
        break-inside:avoid;
        margin-bottom:1rem;
    }

    /* ---------- CARDS ---------- */

    .profile-card,
    .content-card,
    .family-block,
    .sidebar-card,
    .citation-block,
    .source-entry{

        background:#fff !important;

        border:1px solid #bbb !important;

        border-radius:0 !important;

        padding:1rem !important;

        margin-bottom:1rem !important;

        break-inside:avoid;
    }

    /* ---------- TYPOGRAPHY ---------- */

    .profile-card h2{
        font-size:22pt !important;
        color:#000 !important;
        letter-spacing:0;
    }

    .family-title,
    .pedigree-title{
        font-size:12pt !important;
        color:#000 !important;
        letter-spacing:1px;

        border-bottom:1px solid #ccc;
        padding-bottom:.3rem;
        margin-bottom:.7rem;
    }

    .lifespan,
    .aka,
    .change-record,
    .sidebar-caption{
        color:#444 !important;
    }

    /* ---------- LINKS ---------- */

    a,
    a:visited{
        color:#000 !important;
        text-decoration:none;
    }

    /* print URLs for citations only */

    .citation-block a[href]::after,
    .source-entry a[href]::after{
        content:" (" attr(href) ")";
        font-size:8pt;
        color:#666;
    }

    /* ---------- TIMELINE ---------- */

    .timeline{
        padding-left:1.4rem;
    }

    .timeline::before{
        background:#aaa !important;
    }

    .timeline-row{
        margin-bottom:.5rem;
    }

    .timeline-row::before{
        background:#777 !important;
        border:1px solid #777 !important;
    }

    .timeline span{
        width:120px;
        color:#000 !important;
        font-size:8.5pt;
    }

    /* ---------- COLLAPSIBLES ---------- */

    details{
        display:block !important;
    }

    details > *{
        display:block !important;
    }

    summary{
        list-style:none;
    }

    summary::after{
        display:none !important;
    }

    .family-details,
    .pedigree-content{
        display:block !important;
    }

    /* ---------- SOURCES ---------- */

    .sources-block{
        page-break-before:auto;
    }

    .citation-block{
        font-size:9pt;
        line-height:1.45;
    }

    .citation-number{
        color:#000 !important;
    }

    /* ---------- IMAGES ---------- */

    img{
        max-width:100% !important;
        page-break-inside:avoid;
    }

    .crest-card img{
        max-width:220px !important;
    }

    .portrait-card img{
        max-width:260px !important;
    }

    /* ---------- AVOID BAD PAGE BREAKS ---------- */

    h1,
    h2,
    h3,
    h4,
    .family-header,
    .timeline-row,
    .citation-block,
    .source-entry{
        page-break-after:avoid;
        break-after:avoid;
    }

    p,
    li{
        orphans:3;
        widows:3;
    }

    /* ---------- REMOVE UI CONTROLS ---------- */

    .dark-toggle,
    .collapse-controls,
    button,
    script{
        display:none !important;
    }

    /* ---------- INDEX CARD ---------- */

    .pedigree-index{
        display:none;
    }
}

