/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */

:root {
  /* Branch accent colours */
  --color-furlong:  #2C4B6E;
  --color-oneill:   #3D5A47;
  --color-fanning:  #8B4A35;
  --color-keane:    #7A5C2E;

  /* Site palette */
  --color-bg:       #F8F5F0;
  --color-text:     #1A1A1A;
  --color-border:   #E0D8CE;
  --color-nav-bg:   #FFFFFF;
  --color-muted:    #6B6560;
  --color-surface:  #FFFFFF;

  /* Typography */
  --font-heading:   'Playfair Display', Georgia, serif;
  --font-body:      'Source Serif 4', Georgia, serif;
  --font-ui:        'Inter', system-ui, sans-serif;

  /* Layout */
  --nav-height:     64px;
  --max-width:      960px;
  --max-width-wide: 1200px;
  --page-padding:   1.5rem;
}


/* ============================================================
   RESET
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.75;
}

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.375rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.375rem); }
h4 { font-size: 1rem; }

p { max-width: 72ch; }

small, .meta {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
}


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

.site-main {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 4rem;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
}

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

.container--wide {
  max-width: var(--max-width-wide);
  margin: 0 auto;
}


/* ============================================================
   NAV TOGGLE (CSS-only hamburger — checkbox trick)
   ============================================================ */

.nav-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}


/* ============================================================
   NAVIGATION
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--page-padding);
}

/* Site title / logo */
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.nav-logo:hover {
  opacity: 0.8;
}

/* Spacer pushes links to the right */
.nav-spacer {
  flex: 1;
}

/* Nav links list */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav-links a,
.nav-links summary {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0.625rem;
  border-radius: 4px;
  transition: background 0.15s;
  cursor: pointer;
  list-style: none;
}

.nav-links a:hover,
.nav-links summary:hover {
  background: var(--color-bg);
  opacity: 1;
}

/* Active page link */
.nav-links a[aria-current="page"] {
  color: var(--color-fanning);
}

/* Dropdown: Branches */
.nav-dropdown-item {
  position: relative;
}

.nav-dropdown-item details {
  position: static;
}

.nav-dropdown-item summary {
  user-select: none;
}

.nav-dropdown-item summary::after {
  content: ' ▾';
  font-size: 0.75em;
}

/* Remove default triangle on summary */
.nav-dropdown-item summary::-webkit-details-marker { display: none; }
.nav-dropdown-item summary::marker { display: none; }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 200;
  padding: 0.375rem 0;
}

.nav-dropdown-menu li a {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  text-decoration: none;
}

.nav-dropdown-menu li a:hover {
  background: var(--color-bg);
}

/* Branch colour accents in dropdown */
.nav-dropdown-menu li:nth-child(1) a { border-left: 3px solid var(--color-furlong); }
.nav-dropdown-menu li:nth-child(2) a { border-left: 3px solid var(--color-oneill); }
.nav-dropdown-menu li:nth-child(3) a { border-left: 3px solid var(--color-fanning); }
.nav-dropdown-menu li:nth-child(4) a { border-left: 3px solid var(--color-keane); }

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}


/* ============================================================
   BRANCH PAGES
   ============================================================ */

.branch-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.branch-title {
  margin-bottom: 1rem;
  color: var(--branch-color, var(--color-text));
}

.branch-intro {
  font-size: 1.0625rem;
  color: var(--color-muted);
  max-width: 62ch;
}

/* Generation sections */

.generation-section {
  margin-bottom: 3.5rem;
}

.generation-heading {
  font-size: 1.125rem;
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8125rem;
  color: var(--color-muted);
  border-left: 3px solid var(--branch-color, var(--color-border));
  padding-left: 0.875rem;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Person cards grid */

.person-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.person-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.person-card:hover {
  border-color: var(--branch-color, var(--color-border));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  opacity: 1;
}

.person-card__name {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--branch-color, var(--color-text));
  line-height: 1.25;
}

.person-card__relation {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-muted);
  font-style: italic;
}

.person-card__years {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-text);
  margin-top: 0.2rem;
}

.person-card__summary {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin-top: 0.5rem;
}

/* "Where the research ends" section */

.research-ends {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem 1.5rem 0.5rem;
}

.research-ends__intro {
  font-size: 0.9375rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
  max-width: 62ch;
}

.dead-end-entries {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dead-end-entry {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.dead-end-entry__name {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.dead-end-entry__status {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
}

.dead-end-entry__note {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin-top: 0.25rem;
}

/* Mobile adjustments for branch pages */

@media (max-width: 479px) {
  .person-cards {
    grid-template-columns: 1fr;
  }
}


/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem var(--page-padding);
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
}


/* ============================================================
   PERSON PAGES
   ============================================================ */

/* Breadcrumb */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--color-muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--color-text);
  opacity: 1;
}

.breadcrumb__sep {
  color: var(--color-border);
  padding: 0 0.125rem;
}

/* Branch badge */

.branch-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 1rem;
}

.branch-badge--furlong { background: var(--color-furlong); }
.branch-badge--oneill  { background: var(--color-oneill);  }
.branch-badge--fanning { background: var(--color-fanning); }
.branch-badge--keane   { background: var(--color-keane);   }

/* Person header */

.person-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.person-name {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin-bottom: 0.35rem;
}

.person-fullname {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 0.35rem;
}

.person-relation {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* Fact list (born/died/baptised) */

.fact-list {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 0.75rem 1rem;
}

.fact-list--compact {
  margin-top: 0.75rem;
}

.fact-row {
  display: contents;
}

.fact-label {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-muted);
  padding-top: 0.1rem;
}

.fact-value {
  font-size: 0.9375rem;
  line-height: 1.6;
}

.fact-note {
  font-style: italic;
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.fact-label-inline {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 0.4rem;
}

/* Person sections */

.person-section {
  margin-bottom: 2.25rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--color-border);
}

.person-section:last-of-type {
  border-bottom: none;
}

.person-section h2 {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.875rem;
}

.spouse-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.spouse-name a {
  color: var(--branch-color, var(--color-text));
}

/* Children list */

.children-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.children-list__item {
  font-size: 0.9375rem;
}

.children-list__item a {
  color: var(--branch-color, var(--color-text));
  font-weight: 500;
}

.children-list__meta {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin-left: 0.5rem;
}

/* Parents list */

.parents-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.parents-list li {
  font-size: 0.9375rem;
}

.parents-list a {
  color: var(--branch-color, var(--color-text));
  font-weight: 500;
}

/* Generic simple list (occupations, addresses, notable) */

.simple-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.simple-list li {
  font-size: 0.9375rem;
  padding-left: 1rem;
  position: relative;
}

.simple-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--color-muted);
}

/* Notable list */

.notable-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.notable-list li {
  font-size: 0.9375rem;
  padding-left: 1rem;
  position: relative;
  line-height: 1.55;
}

.notable-list li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--branch-color, var(--color-muted));
  font-weight: 700;
}

/* Narrative — Colm's original prose */

.person-narrative h2 {
  margin-bottom: 0.35rem !important;
}

.narrative-byline {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-style: italic;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  max-width: none;
}

.narrative-body {
  background: #faf8f5;
  border-left: 3px solid var(--branch-color, var(--color-border));
  border-radius: 0 6px 6px 0;
  padding: 1.75rem 2rem;
}

.narrative-prose {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--color-text);
  margin-bottom: 1.4rem;
}

/* Cert/record blocks — always visible */

.narrative-cert-block {
  margin: 0.25rem 0 1.75rem;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: #fff;
}

.narrative-cert-header {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  padding: 0.5rem 0.875rem 0.4rem;
  border-bottom: 1px solid var(--color-border);
  margin: 0;
}

/* Blockquotes — newspaper/article quotations */

.narrative-quote {
  margin: 1.25rem 0 1.5rem;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--color-accent, #8B4A35);
  background: color-mix(in srgb, var(--color-accent, #8B4A35) 5%, transparent);
  border-radius: 0 4px 4px 0;
}

.narrative-quote p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  font-style: italic;
  color: var(--color-text);
  margin: 0;
  max-width: none;
}

.narrative-cert {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
}

.narrative-cert th {
  text-align: left;
  font-weight: 500;
  color: var(--color-muted);
  padding: 0.35rem 0.75rem 0.35rem 0.875rem;
  white-space: nowrap;
  width: 40%;
  vertical-align: top;
}

.narrative-cert td {
  padding: 0.35rem 0.875rem 0.35rem 0;
  color: var(--color-text);
  vertical-align: top;
}

.narrative-cert tr:not(:last-child) th,
.narrative-cert tr:not(:last-child) td {
  border-bottom: 1px solid var(--color-border);
}

.narrative-cert td[colspan="2"] {
  padding-left: 0.875rem;
  color: var(--color-muted);
  font-style: italic;
}

.narrative-body p { max-width: none; }



/* Research notes — differentiated styling */

.research-notes {
  background: var(--color-bg);
  border: 1px solid var(--color-border) !important;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border) !important;
}

.research-notes__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.research-notes__list li {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1.6;
  padding-left: 1rem;
  position: relative;
}

.research-notes__list li::before {
  content: '*';
  position: absolute;
  left: 0;
  color: var(--color-border);
}

/* Prev / Next navigation */

.person-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0 0;
  margin-top: 1rem;
  border-top: 1px solid var(--color-border);
  gap: 1rem;
}

.person-nav a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
  max-width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.person-nav a:hover {
  border-color: var(--branch-color, var(--color-text));
  color: var(--branch-color, var(--color-text));
  opacity: 1;
}

/* Person not found */

.person-not-found {
  padding: 3rem 0;
  text-align: center;
}

.person-not-found h1 {
  margin-bottom: 1rem;
}

.person-not-found a {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  margin-top: 1.5rem;
  display: inline-block;
}

/* Mobile adjustments for person pages */

@media (max-width: 600px) {
  .fact-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .fact-row {
    display: block;
    margin-bottom: 0.875rem;
  }

  .fact-label {
    display: block;
    margin-bottom: 0.15rem;
  }

  .person-nav a {
    font-size: 0.8125rem;
  }
}


/* ============================================================
   RESPONSIVE — MOBILE NAV
   Breakpoint: 768px
   ============================================================ */

@media (max-width: 767px) {

  .hamburger {
    display: flex;
  }

  .nav-logo {
    font-size: 0.9rem;
  }

  /* Nav links hidden by default on mobile */
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  }

  /* Show nav when checkbox is checked */
  .nav-toggle-input:checked ~ .site-header .nav-links {
    display: flex;
  }

  /* Hamburger → X when open */
  .nav-toggle-input:checked ~ .site-header .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav-toggle-input:checked ~ .site-header .hamburger span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle-input:checked ~ .site-header .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .nav-links li {
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a,
  .nav-links summary {
    padding: 0.875rem var(--page-padding);
    border-radius: 0;
    font-size: 1rem;
  }

  /* Dropdown on mobile: inline, not absolute */
  .nav-dropdown-item details[open] summary {
    color: var(--color-muted);
  }

  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0;
    background: var(--color-bg);
  }

  .nav-dropdown-menu li a {
    padding: 0.75rem var(--page-padding) 0.75rem calc(var(--page-padding) + 1rem);
    font-size: 0.9375rem;
  }

  /* Adjust main padding on mobile */
  .site-main {
    padding-top: calc(var(--nav-height) + 1.5rem);
    padding-left: 1rem;
    padding-right: 1rem;
  }
}


/* ============================================================
   RESPONSIVE — SMALL PHONES
   Breakpoint: 480px
   ============================================================ */

@media (max-width: 479px) {
  :root {
    --page-padding: 1rem;
  }

  .nav-logo {
    font-size: 0.8125rem;
  }
}


/* ============================================================
   RESPONSIVE — LARGE DESKTOP
   Breakpoint: 1200px+
   ============================================================ */

@media (min-width: 1200px) {
  .nav-inner {
    padding: 0 2rem;
  }
}


/* ============================================================
   HOME PAGE
   ============================================================ */

.site-main--home {
  padding-top: 0;
}


/* ── Hero ───────────────────────────────────────────────────── */

.home-hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 5rem var(--page-padding) 4rem;
  text-align: center;
}

.home-hero__eyebrow {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.home-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.home-hero__byline {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  color: var(--color-muted);
  margin-bottom: 2.5rem;
}

.home-hero__foreword {
  max-width: 600px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-muted);
  border-left: none;
  padding: 0;
}

.home-hero__foreword p {
  margin: 0;
}


/* ── Section headings ───────────────────────────────────────── */

.home-section-heading {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}


/* ── Pivot diagram ──────────────────────────────────────────── */

.home-pivot-section {
  padding: 4rem var(--page-padding);
  background: var(--color-bg);
}

.pivot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.pivot__row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Jenifer node */
.pivot__row--jenifer {
  margin-bottom: 0;
}

.pivot__node--jenifer {
  background: var(--color-text);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  padding: 0.625rem 2rem;
  border-radius: 4px;
}

/* Connector rows */
.pivot__row--connector {
  height: 2rem;
  position: relative;
  width: 100%;
  max-width: 800px;
}

.pivot__vline {
  width: 2px;
  height: 100%;
  background: var(--color-border);
  margin: 0 auto;
}

/* Parents row */
.pivot__row--parents {
  gap: 3rem;
  margin-bottom: 0;
  max-width: 800px;
}

.pivot__node--parent {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.625rem 1.25rem;
  text-align: center;
  min-width: 140px;
}

.pivot__node-name {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 700;
}

.pivot__node-role {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 0.125rem;
}

.pivot__node-branch {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  color: var(--color-muted);
  margin-top: 0.125rem;
}

/* Wide connector row (parents → grandparents) */
.pivot__row--wide {
  max-width: 900px;
  height: 2.5rem;
}

.pivot__hbar--left,
.pivot__hbar--right {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  width: 50%;
  padding: 0 1.5rem;
  height: 100%;
  position: relative;
}

.pivot__hbar--left::before,
.pivot__hbar--right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: var(--color-border);
}

.pivot__hbar--left::before {
  left: calc(25% + 0.5rem);
  right: calc(25% + 0.5rem);
}

.pivot__hbar--right::before {
  left: calc(25% + 0.5rem);
  right: calc(25% + 0.5rem);
}

.pivot__hbar--left .pivot__vline,
.pivot__hbar--right .pivot__vline {
  width: 2px;
  height: 100%;
  margin: 0;
}

/* Grandparent row */
.pivot__row--grandparents {
  gap: 1rem;
  max-width: 920px;
  flex-wrap: wrap;
  justify-content: center;
}

.pivot__row--grandparents .pivot__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  border-radius: 4px;
  padding: 0.75rem 1.25rem;
  min-width: 160px;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
  color: #fff;
}

.pivot__row--grandparents .pivot__node:hover {
  transform: translateY(-2px);
}

.pivot__row--grandparents .pivot__node-name {
  font-size: 0.9375rem;
  color: #fff;
}

.pivot__row--grandparents .pivot__node-branch {
  color: rgba(255,255,255,0.75);
}

.pivot__node--furlong { background: var(--color-furlong); }
.pivot__node--oneill  { background: var(--color-oneill);  }
.pivot__node--fanning { background: var(--color-fanning); }
.pivot__node--keane   { background: var(--color-keane);   }

.pivot__node--furlong:hover { border-color: var(--color-furlong); }
.pivot__node--oneill:hover  { border-color: var(--color-oneill);  }
.pivot__node--fanning:hover { border-color: var(--color-fanning); }
.pivot__node--keane:hover   { border-color: var(--color-keane);   }


/* ── Branch cards ───────────────────────────────────────────── */

.home-branches-section {
  padding: 4rem var(--page-padding);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.branch-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.branch-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 1.75rem;
  transition: box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.branch-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.branch-card--furlong::before { background: var(--color-furlong); }
.branch-card--oneill::before  { background: var(--color-oneill);  }
.branch-card--fanning::before { background: var(--color-fanning); }
.branch-card--keane::before   { background: var(--color-keane);   }

.branch-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.branch-card__label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.branch-card--furlong .branch-card__label { color: var(--color-furlong); }
.branch-card--oneill  .branch-card__label { color: var(--color-oneill);  }
.branch-card--fanning .branch-card__label { color: var(--color-fanning); }
.branch-card--keane   .branch-card__label { color: var(--color-keane);   }

.branch-card__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.branch-card__desc {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--color-muted);
  flex: 1;
  margin-bottom: 1.25rem;
}

.branch-card__arrow {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  align-self: flex-start;
}

.branch-card--furlong .branch-card__arrow { color: var(--color-furlong); }
.branch-card--oneill  .branch-card__arrow { color: var(--color-oneill);  }
.branch-card--fanning .branch-card__arrow { color: var(--color-fanning); }
.branch-card--keane   .branch-card__arrow { color: var(--color-keane);   }


/* ── CTA ────────────────────────────────────────────────────── */

.home-cta-section {
  padding: 4rem var(--page-padding);
  background: var(--color-bg);
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.home-cta__text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.home-cta__link {
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 2px;
  transition: opacity 0.15s;
}

.home-cta__link:hover {
  opacity: 0.6;
}


/* ── Home responsive ────────────────────────────────────────── */

@media (max-width: 767px) {
  .home-hero {
    padding: 3.5rem var(--page-padding) 3rem;
  }

  .branch-cards {
    grid-template-columns: 1fr;
  }

  .pivot__row--parents {
    gap: 1rem;
  }

  .pivot__node--parent {
    min-width: 120px;
    padding: 0.5rem 0.875rem;
  }

  .pivot__row--grandparents .pivot__node {
    min-width: 130px;
    padding: 0.625rem 1rem;
  }

  .pivot__row--grandparents {
    gap: 0.75rem;
  }
}

@media (max-width: 479px) {
  .pivot__row--parents {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }

  .pivot__row--grandparents {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


/* ============================================================
   ABOUT PAGE
   ============================================================ */

.about-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.about-header {
  margin-bottom: 2.5rem;
}

.about-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.about-section {
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--color-border);
}

.about-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.about-section h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.about-foreword p {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.about-foreword p:last-of-type {
  margin-bottom: 1.25rem;
}

.about-list {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  list-style: disc;
  padding-left: 1.5rem;
  margin: 1.25rem 0;
}

.about-list li {
  margin-bottom: 0.75rem;
}

.about-attribution {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--color-muted);
  margin-top: 2rem;
  margin-bottom: 0;
}

.about-sources-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.about-sources-list li {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

.about-source-url {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* About table */
.about-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.about-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.about-table th {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: left;
  padding: 0.625rem 1rem 0.625rem 0;
  border-bottom: 2px solid var(--color-border);
}

.about-table td {
  padding: 0.875rem 1rem 0.875rem 0;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: 1.5;
}

.about-table tbody tr:last-child td {
  border-bottom: none;
}

.about-branch-link {
  font-weight: 500;
  text-decoration: none;
}

.about-branch-link--furlong { color: var(--color-furlong); }
.about-branch-link--oneill  { color: var(--color-oneill);  }
.about-branch-link--fanning { color: var(--color-fanning); }
.about-branch-link--keane   { color: var(--color-keane);   }

.about-branch-link:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .about-article {
    padding: 2rem 0 4rem;
  }
}


/* ============================================================
   FAMILY TREE PAGE
   ============================================================ */

.site-main--tree {
  padding-top: 0;
  margin-top: var(--nav-height);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--nav-height) - 56px);
}

/* ── Controls bar ───────────────────────────────────────────── */

.tree-controls {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem var(--page-padding);
}

.tree-controls__inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tree-controls__label {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
  flex: 1;
  min-width: 200px;
}

.tree-controls__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tree-btn {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
}

.tree-btn:hover {
  background: var(--color-border);
}

/* ── Tree container ─────────────────────────────────────────── */

.tree-container {
  flex: 1;
  overflow: hidden;
  background: var(--color-bg);
  position: relative;
}

.tree-loading {
  padding: 3rem;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
}

.tree-svg {
  display: block;
  touch-action: none;
}

/* ── Links ──────────────────────────────────────────────────── */

.tree-link {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 1.5;
}

.tree-link--direct {
  stroke: #AAA;
  stroke-width: 2;
}

/* ── Nodes ──────────────────────────────────────────────────── */

.tree-node rect {
  stroke: none;
}

/* Jenifer — dark */
.tree-node--jenifer rect {
  fill: var(--color-text);
}

/* Brian / Mavis — bridge nodes, neutral dark */
.tree-node--bridge rect {
  fill: #4A4A4A;
}

/* Branch-coloured nodes */
.tree-node--furlong rect { fill: var(--color-furlong); }
.tree-node--oneill  rect { fill: var(--color-oneill);  }
.tree-node--fanning rect { fill: var(--color-fanning); }
.tree-node--keane   rect { fill: var(--color-keane);   }

/* Dead-end nodes */
.tree-node--dead-end rect {
  fill: var(--color-surface);
  stroke: var(--color-border);
  stroke-width: 1.5;
  stroke-dasharray: 4 2;
}

/* Collateral relatives (siblings of direct ancestors) — slightly faded */
.tree-node--collateral rect {
  opacity: 0.65;
}

.tree-node--collateral .tree-node__name,
.tree-node--collateral .tree-node__years {
  opacity: 0.85;
}

/* Hover state on clickable nodes */
.tree-node[style*="pointer"]:hover rect {
  opacity: 0.85;
}

.tree-node--collateral[style*="pointer"]:hover rect {
  opacity: 1;
}

/* ── Node text ──────────────────────────────────────────────── */

.tree-node__name {
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  fill: #fff;
}

.tree-node--dead-end .tree-node__name {
  fill: var(--color-text);
}

.tree-node__years {
  font-family: var(--font-ui);
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.75);
}

.tree-node--dead-end .tree-node__years {
  fill: var(--color-muted);
}

.tree-node__badge {
  font-family: var(--font-ui);
  font-size: 10px;
  fill: rgba(255, 255, 255, 0.55);
}

.tree-node--dead-end .tree-node__badge {
  fill: var(--color-muted);
}

/* ── Legend ─────────────────────────────────────────────────── */

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.875rem var(--page-padding);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  justify-content: center;
}

.tree-legend__item {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.tree-legend__item::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.tree-legend__item--furlong::before { background: var(--color-furlong); }
.tree-legend__item--oneill::before  { background: var(--color-oneill);  }
.tree-legend__item--fanning::before { background: var(--color-fanning); }
.tree-legend__item--keane::before   { background: var(--color-keane);   }
.tree-legend__item--dead-end::before {
  background: var(--color-surface);
  border: 1.5px dashed var(--color-border);
}

.tree-legend__item--collateral {
  opacity: 0.7;
}

.tree-legend__item--collateral::before {
  background: #6B6560;
  opacity: 0.6;
}

/* ── Tree responsive ────────────────────────────────────────── */

@media (max-width: 767px) {
  .tree-container {
    overflow-x: auto;
  }

  .tree-controls__label {
    font-size: 0.8125rem;
  }
}


/* ============================================================
   PHOTOS PAGE
   ============================================================ */

/* ── Empty state ─────────────────────────────────────────────── */

.photos-empty {
  max-width: 600px;
  padding: 3rem 0 5rem;
}

.photos-empty h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.5rem;
}

.photos-empty p {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.photos-empty__code {
  font-family: 'Courier New', monospace;
  font-size: 0.9375rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
}

/* ── Gallery header ─────────────────────────────────────────── */

.photos-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 2.5rem 0 1.5rem;
}

.photos-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
}

.photos-count {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--color-muted);
}

/* ── Filters ────────────────────────────────────────────────── */

.photos-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.photos-filter {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: var(--color-bg);
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.photos-filter:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.photos-filter--active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

.photos-filter--furlong.photos-filter--active { background: var(--color-furlong); border-color: var(--color-furlong); }
.photos-filter--oneill.photos-filter--active  { background: var(--color-oneill);  border-color: var(--color-oneill);  }
.photos-filter--fanning.photos-filter--active { background: var(--color-fanning); border-color: var(--color-fanning); }
.photos-filter--keane.photos-filter--active   { background: var(--color-keane);   border-color: var(--color-keane);   }

/* ── Photo grid ─────────────────────────────────────────────── */

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding-bottom: 4rem;
}

.photo-thumb {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.15s, transform 0.15s;
  padding: 0;
}

.photo-thumb:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.photo-thumb__img-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-border);
}

.photo-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-thumb__caption {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-text);
  padding: 0.625rem 0.75rem;
  line-height: 1.4;
}

/* ── Lightbox ───────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__inner {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox__img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lightbox__info {
  text-align: center;
  color: #fff;
}

.lightbox__caption {
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.lightbox__location {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.25rem;
}

.lightbox__persons {
  font-family: var(--font-ui);
  font-size: 0.875rem;
}

.lightbox__persons a {
  color: rgba(255,255,255,0.85);
}

.lightbox__close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
  padding: 0.5rem 1rem;
  line-height: 1;
}

.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__prev:hover,
.lightbox__next:hover { opacity: 1; }

/* ── Person page photos ─────────────────────────────────────── */

.person-photos {
  margin-bottom: 2rem;
}

.person-photos__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.person-photo {
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.person-photo__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.person-photo__caption {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  padding: 0.5rem 0.75rem 0.25rem;
  color: var(--color-text);
}

.person-photo__location {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  padding: 0 0.75rem 0.5rem;
  color: var(--color-muted);
}

@media (max-width: 479px) {
  .photos-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox__prev,
  .lightbox__next {
    font-size: 2rem;
    padding: 0.5rem;
  }
}


/* ============================================================
   LOCATIONS MAP PAGE
   ============================================================ */

.site-main--map {
  padding-top: 0;
  margin-top: var(--nav-height);
  display: flex;
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────── */

.map-sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.map-sidebar__inner {
  padding: 1.5rem 1.25rem;
}

.map-sidebar__title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.map-sidebar__desc {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1.5rem;
}

.map-legend__item {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  color: #fff;
}

.map-legend__item--furlong { background: var(--color-furlong); }
.map-legend__item--oneill  { background: var(--color-oneill);  }
.map-legend__item--fanning { background: var(--color-fanning); }
.map-legend__item--keane   { background: var(--color-keane);   }

/* ── Place list ─────────────────────────────────────────────── */

.map-place-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-place {
  border-bottom: 1px solid var(--color-border);
  padding: 0.625rem 0;
  transition: background 0.1s;
}

.map-place--active {
  background: var(--color-bg);
  margin: 0 -1.25rem;
  padding: 0.625rem 1.25rem;
}

.map-place__btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
  width: 100%;
}

.map-place__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.map-place__name {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.3;
}

.map-place__btn:hover .map-place__name {
  text-decoration: underline;
}

.map-place__persons {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-muted);
  margin: 0.25rem 0 0 1.375rem;
  line-height: 1.5;
}

.map-place__persons a {
  color: var(--color-muted);
  text-decoration: none;
}

.map-place__persons a:hover {
  text-decoration: underline;
  color: var(--color-text);
}

.map-place__more {
  font-size: 0.75rem;
}

/* ── Map canvas ─────────────────────────────────────────────── */

.map-canvas {
  flex: 1;
  min-width: 0;
}

/* ── Popup ──────────────────────────────────────────────────── */

.map-popup {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.5;
}

.map-popup__name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding-left: 0.625rem;
  border-left: 3px solid var(--color-border);
  line-height: 1.35;
}

.map-popup__notes {
  color: #555;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.map-popup__persons {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.map-popup__person {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.8125rem;
}

.map-popup__person:hover {
  text-decoration: underline;
}

/* ── Address map link (person pages) ────────────────────────── */

.address-map-link {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  margin-left: 0.5rem;
  color: var(--color-muted);
  text-decoration: none;
  white-space: nowrap;
}

.address-map-link:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* ── Map responsive ─────────────────────────────────────────── */

@media (max-width: 767px) {
  .site-main--map {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .map-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    max-height: 40vh;
  }

  .map-canvas {
    height: 55vh;
  }
}
