/* Match the Timeline palette and masthead rhythm without changing content or explorers. */
@media screen {
  body.genealogy-page, body.boundaries-page {
    background: #f5f0e6;
    color: #263431;
    color-scheme: light;
  }
  .genealogy-site-header, .b-site-header { background: #111b1e; border-color: rgba(201,163,90,.25); }
  .genealogy-site-header .site-title, .b-site-header .site-title { color: #e1c797; }
  .genealogy-site-header .site-nav, .b-site-header .site-nav { color: #eee4d1; }
  .genealogy-site-header .site-nav a, .b-site-header .site-nav a { color: #e4dac7; }
  .genealogy-site-header, .b-site-header {
    min-height: 0; position: sticky; padding: 1rem clamp(1rem,4vw,3rem);
    gap: 1.5rem; align-items: center;
  }
  .genealogy-site-header .site-title, .b-site-header .site-title { font-size: .95rem; }
  .genealogy-site-header .site-nav, .b-site-header .site-nav { gap: clamp(.75rem,2vw,1.6rem); }
  :is(.genealogy-site-header,.b-site-header) .site-nav :is(a,summary) { font-size: .85rem; }
  :is(.genealogy-site-header,.b-site-header) .site-nav .nav-dropdown-menu a { font-size: .72rem; }

  .genealogy-hero, .b-hero {
    background: radial-gradient(ellipse at 85% 10%,#3e5149 0,transparent 55%),#202d30;
    color: #f7f0e3; border-bottom: 4px solid #ac8354;
  }
  .genealogy-hero-inner, .b-hero-grid {
    width: min(1320px,calc(100% - 5rem)); margin-inline: auto; padding: 4.5rem 0 4rem;
  }
  .b-hero-grid { grid-template-columns: minmax(0,1fr) 270px; gap: 5rem; }
  .genealogy-overline, .boundaries-page .b-hero .section-kicker {
    font: .68rem/1.6 Arial,Helvetica,sans-serif; letter-spacing: .18em;
    text-transform: uppercase; color: #ddbe8e; margin: 0 0 .8rem;
  }
  .genealogy-overline-rule { background: #ddbe8e; }
  .genealogy-hero h1, .boundaries-page .b-hero h1 {
    font-size: clamp(3.5rem,6.7vw,6.6rem); font-weight: 400;
    line-height: .96; letter-spacing: -.055em; margin: 1.6rem 0;
  }
  .genealogy-hero h1 em, .b-hero h1 em {
    display: inline-block; font-size: .66em; line-height: 1.18;
    margin-top: .25em; font-weight: 400; color: #e3c99f;
  }
  .genealogy-hero-inner > p, .b-hero-copy {
    max-width: 39rem; color: #d6ddd4; font-size: 1.08rem; line-height: 1.8; margin: 0;
  }
  .genealogy-hero-inner > .genealogy-lead, .b-subtitle { font-size: 1.5rem; line-height: 1.6; margin: 1.3rem 0 .6rem; color: #f7f0e3; }
  .genealogy-hero-foot { margin-top: 2rem; padding-top: 1rem; color: #becbbf; border-color: #7d897b; }
  .b-primary-link {
    font: .8rem/1.6 Arial,Helvetica,sans-serif; padding: .8rem 0; margin-top: 2rem;
    color: #f1dfbc; border-color: #bbab8d;
  }
  .b-hero-note {
    align-self: auto; display: flex; border-left: 1px solid #7d897b;
    border-top: 0; padding: 1.2rem 0 1.2rem 2.8rem;
  }
  .b-hero-note .b-small-label { color: #ddbf8f; font-size: .65rem; letter-spacing: .15em; }
  .b-hero-question { color: #f1e6d0; font-size: 1.5rem; line-height: 1.45; margin: 1rem 0 1.5rem; }
  .b-hero-stats { border-color: #7d897b; }
  .b-hero-stats strong { color: #f1e6d0; }
  .b-hero-stats span, .b-hero-note-foot { color: #becbbf; }
  .b-hero-note-foot { display: block; }
  .genealogy-page .control-heading h3 { color: #263431; }

  /* Light reading surfaces and the necessary text contrast on Boundaries. */
  body.boundaries-page {
    --b-line: #d2cabb; --b-muted: #5c675f; --b-panel: #ece6d9;
    --cream: #263431; --paper: #263431; --gold: #806447; --gold-soft: #725535;
  }
  .boundaries-page p { color: inherit; }
  .b-skip { background: #fffdf6; color: #263431; }
  .boundaries-page :is(a,button,input,select,summary):focus-visible { outline-color: #9a6441; }
  .b-site-header, .b-hero {
    --cream: #f7f0e3; --paper: #f1e6d0; --gold-soft: #e3c99f;
    --gold: #bbab8d; --b-muted: #d6ddd4; --b-line: #7d897b;
  }
  .boundaries-page .b-hero-copy { color: #d6ddd4; }
  .boundaries-page .b-subtitle { color: #f7f0e3; }
  .boundaries-page .b-hero-question { color: #f1e6d0; }
  .boundaries-page .b-hero-note-foot { color: #becbbf; }
  .b-section-nav { background: #e9e2d4; border-color: #cfc5b4; top: 3.5rem; }
  .b-section-nav a { color: #263431; }
  .b-theme-card, .b-theme-card:nth-child(3n+2), .b-voice { background: #ece6d9; border-color: #d2cabb; }
  .b-theme-card:hover, .b-button:hover:not(:disabled) { background: #e3dfd0; }
  .b-selected-theme, .b-filters { background: #e9e3d6; }
  .b-filters input, .b-filters select, .b-source-filters input, .b-source-filters select {
    background: #fffdf6; color: #293b34; border-color: #a8b0a3;
  }
  .b-filters input::placeholder, .b-source-filters input::placeholder { color: #687267; }
  .b-account { background: #fcf9f2; }
  .b-account:nth-child(even) { background: #f2ede3; }
  /* Stripe the visible results, not their original positions in the full index. */
  @supports selector(:nth-child(even of :not([hidden]))) {
    .b-account:nth-child(even) { background: #fcf9f2; }
    .b-account:nth-child(even of :not([hidden])) { background: #f2ede3; }
  }
  .b-account > summary:hover, .b-account[open] > summary { background: #e8e2d4; }
  .b-account-body { background: #fcf9f2; }
  .b-record-note, .b-novel { background: #eae5d7; border-color: #d2cabb; }
  .b-bibliography li { border-color: #d2cabb; }
  .b-bibliography li:target { background: #e4e7d3; }
  .b-voice-context { border-color: #d2cabb; }
  .boundaries-page :is(.b-theme-card p,.b-account-summary,.b-significance p,.b-record-note p,
    .b-knowledge strong,.b-account-sources li,.b-rule-grid p,.b-novel-columns p,
    .b-method-content p,.b-bibliography li p) { color: #46534a; }
  .boundaries-page :is(.b-tags a,.b-voice .b-small-label,.b-voice p:not(.b-small-label),.b-voice-context) { color: #5c675f; }
  .boundaries-page .featured-sources {
    --fs-text: #263431; --fs-muted: #5c675f; --fs-accent: #725535;
    --fs-line: #d2cabb; --fs-panel: #ece6d9; --fs-art: #e3ddce;
  }
}
@media screen and (min-width:1450px) {
  .genealogy-hero-inner, .b-hero-grid { width: min(1400px,calc(100% - 6rem)); }
}
@media screen and (max-width:1000px) {
  .genealogy-hero-inner, .b-hero-grid { width: calc(100% - 3rem); }
  .b-hero-grid { grid-template-columns: minmax(0,1fr) 210px; gap: 2rem; }
  .b-hero-note { padding-left: 1.8rem; }
}
@media screen and (max-width:900px) {
  .genealogy-site-header, .b-site-header { flex-direction: column; align-items: flex-start; }
  .b-section-nav { position: relative; top: 0; }
}
@media screen and (max-width:700px) {
  .genealogy-hero-inner, .b-hero-grid { width: calc(100% - 2rem); padding: 3rem 0 2.4rem; }
  .genealogy-hero h1, .boundaries-page .b-hero h1 { font-size: 3.6rem; }
  .genealogy-hero-inner > p, .b-hero-copy { font-size: 1rem; }
  .genealogy-hero-inner > .genealogy-lead, .b-subtitle { font-size: 1.3rem; }
  .b-hero-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .b-hero-note { border-left: 0; border-top: 1px solid #748374; padding: 1.2rem 0 0; }
  .b-hero-note .b-small-label { margin: 0 0 .8rem; }
  .b-hero-question { font-size: 1.3rem; }
  .b-hero-stats { border-top: 1px solid #7d897b; padding-top: 1.3rem; }
  .b-primary-link { font-size: .7rem; }
}
@media screen and (max-width:560px) {
  :is(.genealogy-site-header,.b-site-header) .site-nav :is(a,summary) { font-size: .76rem; }
  :is(.genealogy-site-header,.b-site-header) .site-nav .nav-dropdown-menu a { font-size: .68rem; }
  :is(.b-site-header,.genealogy-site-header) .nav-dropdown { position: static; }
  :is(.b-site-header,.genealogy-site-header) .nav-dropdown::before { display: none; }
  :is(.b-site-header,.genealogy-site-header) .nav-dropdown-menu {
    left: 1rem; right: 1rem; top: 100%; width: auto; min-width: 0; transform: none !important;
  }
  :is(.b-site-header,.genealogy-site-header) .nav-dropdown-menu a { white-space: normal; }
}

/* A consistent masthead layout on the three historical research pages. */
@media screen {
  .timeline-page:not(.rules-page) .t-hero-grid, .boundaries-page .b-hero-grid { display: block; position:relative; }
  .history-hero-topline { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:.65rem 2rem; }
  .history-hero-topline > :first-child { margin:0; }
  .history-hero-period {
    position:absolute; top:4.5rem; right:0;
    display:flex; flex-direction:column; align-items:flex-start;
    min-width:12rem; margin:0; padding:.1rem 0 .1rem 2rem;
    border-left:1px solid #7d897b; color:#f1e6d0;
    white-space:nowrap;
  }
  .history-hero-period-label { font:.65rem/1.6 Arial,Helvetica,sans-serif; letter-spacing:.15em; text-transform:uppercase; color:#ddbf8f; margin-bottom:.5rem; }
  .history-hero-year { font:400 4rem/1.05 Georgia,"Times New Roman",serif; letter-spacing:-.04em; }
  .history-hero-dash { font:400 2.2rem/1 Georgia,"Times New Roman",serif; color:#9da897; margin:.15rem 0; }
  .genealogy-page .genealogy-hero h1,
  .timeline-page:not(.rules-page) .t-hero h1,
  .boundaries-page .b-hero h1 { max-width:min(59rem,calc(100% - 13rem)); }
  .history-hero-foot { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:.7rem 2rem; width:100%; max-width:none; margin-top:2.8rem; padding-top:1rem; border-top:1px solid rgba(232,211,177,.3); color:#c1c7c5; font:.65rem/1.8 Arial,Helvetica,sans-serif; text-transform:uppercase; letter-spacing:.12em; }
  .history-hero-foot > :first-child { flex:1 1 28rem; }
  .history-hero-foot > :last-child { margin-left:auto; text-align:right; }
  .history-hero-foot a { color:#e3c99f; text-decoration:none; text-underline-offset:.2rem; }
  .history-hero-foot a:hover { color:#fff7e6; text-decoration:underline; }
  .timeline-page:not(.rules-page) .t-hero h1, .boundaries-page .b-hero h1 { font-size:clamp(3.5rem,6.7vw,6.6rem); font-weight:400; line-height:.96; letter-spacing:-.055em; margin:1.6rem 0; }
  .timeline-page:not(.rules-page) .t-hero h1 em, .boundaries-page .b-hero h1 em { display:inline-block; font-size:.66em; line-height:1.18; margin:.25em 0 0; font-weight:400; color:#e3c99f; }
  .timeline-page:not(.rules-page) .t-lead, .boundaries-page .b-subtitle { display:block; margin:1.3rem 0 .6rem; max-width:41rem; color:#f7f0e3; font-size:1.5rem; line-height:1.6; }
  .timeline-page:not(.rules-page) .t-hero-copy, .boundaries-page .b-hero-copy { max-width:39rem; color:#d6ddd4; font-size:1.08rem; line-height:1.8; margin:0; }
  .timeline-page:not(.rules-page) .t-hero-grid { padding:4.5rem 0 4rem; }
  .history-hero-actions { display:flex; gap:1.4rem; justify-content:flex-end; flex-wrap:wrap; }
  .boundaries-page .b-hero-foot strong { font:inherit; font-weight:700; color:#f1e6d0; }
  .boundaries-page .b-primary-link { display:inline-flex; margin:0; padding:0; gap:.5rem; border:0; color:#e3c99f; font:inherit; letter-spacing:inherit; text-transform:uppercase; }
}
@media screen and (max-width:700px) {
  .timeline-page:not(.rules-page) .t-hero-grid { padding:3rem 0 2.4rem; }
  .history-hero-period { position:static; align-self:flex-end; min-width:9.5rem; margin-left:auto; padding:.1rem 0 .1rem 1rem; }
  .history-hero-year { font-size:2.7rem; }
  .history-hero-dash { font-size:1.7rem; }
  .genealogy-page .genealogy-hero h1,
  .timeline-page:not(.rules-page) .t-hero h1,
  .boundaries-page .b-hero h1 { max-width:none; }
  .history-hero-foot { margin-top:2rem; font-size:.61rem; gap:.7rem 1rem; }
  .history-hero-foot > :first-child { flex-basis:100%; }
  .timeline-page:not(.rules-page) .t-hero h1, .boundaries-page .b-hero h1 { font-size:3.6rem; }
  .timeline-page:not(.rules-page) .t-lead, .boundaries-page .b-subtitle { font-size:1.3rem; }
  .timeline-page:not(.rules-page) .t-hero-copy, .boundaries-page .b-hero-copy { font-size:1rem; }
}
@media print { .history-hero-period, .history-hero-foot { color:#333; border-color:#aaa; } }

/* Rules shares the Genealogy masthead rhythm, without a date range. */
@media screen {
  .rules-page .t-hero-grid { display:block; position:relative; padding:4.5rem 0 4rem; }
  .rules-page .history-hero-region-name { display:block; font:400 3.2rem/1.08 Georgia,"Times New Roman",serif; letter-spacing:-.04em; color:#f1e6d0; }
  .rules-page .t-hero h1 { max-width:min(59rem,calc(100% - 13rem)); font-size:clamp(3.5rem,6.7vw,6.6rem); font-weight:400; line-height:.96; letter-spacing:-.055em; margin:1.6rem 0; }
  /* Undo the legacy Timeline rule that suppresses title line breaks. */
  body.timeline-page.rules-page .t-hero h1 br { display:inline; }
  .rules-page .t-hero h1 em { display:inline-block; font-size:.66em; line-height:1.18; margin:.25em 0 0; font-weight:400; color:#e3c99f; }
  .rules-page .t-lead { display:block; margin:1.3rem 0 .6rem; max-width:41rem; color:#f7f0e3; font-size:1.5rem; line-height:1.6; }
  .rules-page .t-hero-copy { max-width:39rem; color:#d6ddd4; font-size:1.08rem; line-height:1.8; margin:0; }
}
@media screen and (max-width:1000px) and (min-width:701px) {
  .history-hero-period { min-width:10rem; padding-left:1.25rem; }
  .history-hero-year { font-size:3.2rem; }
  .history-hero-dash { font-size:1.9rem; }
  .rules-page .history-hero-region-name { font-size:2.8rem; }
}
@media screen and (max-width:700px) {
  .rules-page .t-hero-grid { padding:3rem 0 2.4rem; }
  .rules-page .history-hero-region-name { font-size:2.65rem; }
  .rules-page .t-hero h1 { max-width:none; font-size:3.6rem; }
  .rules-page .t-hero h1 em { font-size:.66em; }
  .rules-page .t-lead { font-size:1.3rem; }
  .rules-page .t-hero-copy { font-size:1rem; }
}
