/* Basic page setup */

/* ==========================================================
   General Layout Section
   ========================================================== */

* {
    box-sizing: border-box;
}

:root {

    /* ======================================================
       Wallace Heraldic Palette
       ====================================================== */

    --wallace-blue:      #27476d;
    --wallace-burgundy:  #7b3f4a;
    --parchment:         #f7f5f0;
    --ivory:             #fffdf8;
    --stone:             #d8d4cc;
    --charcoal:          #2f2f2f;

    /* ======================================================
       Semantic Site Colors
       ====================================================== */

    --background: var(--parchment);
    --surface:    var(--ivory);
    --text:       var(--charcoal);
    --heading:    var(--wallace-blue);
    --accent:     var(--wallace-burgundy);
    --border:     var(--stone);
    --focus:      #9b4f5d;

}

body {
    margin: 0;
    font-family: Baskerville, "Libre Baskerville", Georgia, serif;
    font-size: 1.0625rem;
    line-height: 1.65;
    background-color: var(--background);
    color: var(--text);
}


/* Header */

header h1,
h1,
h2,
h3 {
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-weight: 600;
    color: var(--heading);
}

header {
    padding: 2rem 1.5rem;
    text-align: center;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

header h1 {
    margin: 0 0 1rem;
    font-size: 2.5rem;
    color: var(--heading);
    font-weight: 700;
    letter-spacing: 0.02em;
}


/* Navigation */

nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

nav a {
    color: var(--heading);
    text-decoration: none;
    font-weight: 600;
}

nav a:hover,
nav a:focus {
    text-decoration: underline;
}

nav a[aria-current="page"] {
    font-weight: bold;
    border-bottom: 2px solid var(--accent);
}

nav[aria-label="Main navigation"] {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: center;
    padding: 0.75rem 0;
}

nav[aria-label="Main navigation"] a {
    color: inherit;
    text-decoration: none;
    padding: 0.35rem 0;
}

nav[aria-label="Main navigation"] a:hover,
nav[aria-label="Main navigation"] a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 0.25rem;
}

nav[aria-label="Main navigation"] a[aria-current="page"] {
    font-weight: bold;
    border-bottom: 2px solid var(--accent);
}

/* Main content */

main {
    width: min(90%, 900px);
    margin: 0 auto;
    padding: 2rem 0;
}

section {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

section h2 {
    margin-top: 0;
    color: var(--heading);
}

.section-heading {
    margin-bottom: 1.25rem;
}

.section-heading h2 {
    margin-bottom: 0;
}

.eyebrow,
.highlight-type {
    margin: 0 0 0.35rem;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.text-link {
    color: var(--heading);
    font-weight: 700;
    text-underline-offset: 0.2em;
}

.text-link:hover,
.text-link:focus-visible {
    color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}


/* Footer */

footer {
    padding: 1.5rem;
    text-align: center;
    color: var(--text);
    border-top: 1px solid var(--border);
    opacity: 0.75;
}

/* ==========================================================
   Responsive Section
   ========================================================== */

/* Small screens */

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

    main {
        width: min(92%, 900px);
        padding: 1rem 0;
    }

    section {
        padding: 1rem;
    }
}

/* ==========================================================
   Hero Section
   ========================================================== */

.hero {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 4px solid var(--accent);
}

.hero h2 {
    margin-bottom: 1rem;
    font-size: clamp(2.2rem, 5vw, 3.25rem);
    line-height: 1.05;
}

.hero p {
    max-width: 700px;
    margin: 1rem auto;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* ==========================================================
   Home Page Sections
   ========================================================== */

.family-today-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.today-card {
    padding: 1.25rem;
    background-color: var(--background);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
}

.today-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1.45rem;
}

.today-card p {
    margin-top: 0;
}

/* ==========================================================
   Upcoming Events
   ========================================================== */

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

.event {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.event:last-child {
    border-bottom: 0;
}

.event-date {
    display: flex;
    min-width: 3.75rem;
    padding: 0.45rem;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    color: var(--surface);
    text-align: center;
    background-color: var(--heading);
    border-radius: 6px;
}

.event-month {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.event-day {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.event-details h4 {
    margin: 0 0 0.25rem;
    color: var(--heading);
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

.event-details p {
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

.events-placeholder {
    margin: 1rem 0 0;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ==========================================================
   Family Updates
   ========================================================== */

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

.family-update {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.family-update:last-child {
    border-bottom: 0;
}

.update-details time,
.update-label {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

.update-label {
    margin-top: 0;
}

.update-details h4 {
    margin: 0 0 0.25rem;
    color: var(--heading);
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.25;
}

.update-details p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.update-story-link {
    display: inline-block;
    margin-top: 0.65rem;
    color: var(--heading);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
}

.update-story-link span {
    font-weight: 400;
}

.update-story-link:hover,
.update-story-link:focus-visible {
    color: var(--accent);
}

.updates-placeholder {
    margin: 1rem 0 0;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
}

/* ==========================================================
   Family Calendar
   ========================================================== */

.calendar-hero {
    padding-block: clamp(2.25rem, 5vw, 3.5rem);
}

.calendar-list {
    display: grid;
    gap: 1rem;
}

.calendar-event {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
    background-color: var(--background);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
}

.calendar-date {
    display: flex;
    min-height: 6rem;
    padding: 0.65rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--surface);
    text-align: center;
    background-color: var(--heading);
    border-radius: 6px;
}

.calendar-weekday {
    margin-top: 0.2rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-transform: uppercase;
}

.calendar-event-details h3 {
    margin: 0 0 0.25rem;
    font-size: 1.55rem;
    line-height: 1.2;
}

.calendar-event-details p {
    margin: 0.5rem 0 0;
}

.calendar-event-details .calendar-time {
    margin-top: 0;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
}

.calendar-event-details .calendar-location {
    color: var(--text);
    font-size: 0.95rem;
    font-style: italic;
}

.calendar-note {
    border-top: 4px solid var(--heading);
}

.button-link,
.event-submission-form button {
    display: inline-block;
    padding: 0.75rem 1.1rem;
    color: var(--surface);
    font: 700 0.9rem/1.3 Arial, Helvetica, sans-serif;
    text-decoration: none;
    background-color: var(--heading);
    border: 2px solid var(--heading);
    border-radius: 5px;
    cursor: pointer;
}

.button-link:hover,
.button-link:focus-visible,
.event-submission-form button:hover,
.event-submission-form button:focus-visible {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ==========================================================
   Calendar event submission
   ========================================================== */

.event-submission-page {
    width: min(92%, 980px);
}

.event-form-introduction {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    border-top: 4px solid var(--accent);
}

.event-form-introduction h2 {
    margin-bottom: 0.5rem;
    font-size: clamp(2rem, 5vw, 3rem);
}

.event-form-introduction p:last-child {
    max-width: 650px;
    margin: 0 auto;
}

.event-submission-form section {
    margin-bottom: 1.25rem;
}

.event-submission-form .section-heading p:last-child {
    margin-top: 0.35rem;
}

.form-step {
    margin: 0 0 0.25rem;
    color: var(--accent);
    font: 700 0.78rem/1.4 Arial, Helvetica, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid-dates {
    align-items: end;
}

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

.form-field label,
.privacy-confirmation label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--heading);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.93rem;
    font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
    width: 100%;
    padding: 0.72rem 0.8rem;
    color: var(--text);
    font: inherit;
    line-height: 1.4;
    background: var(--surface);
    border: 1px solid #9c988f;
    border-radius: 4px;
}

.form-field textarea {
    resize: vertical;
}

.time-selects {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.time-selects select {
    min-width: 0;
}

.time-selects select:first-of-type {
    width: 5.2rem;
}

.time-selects select:nth-of-type(2) {
    width: 6.2rem;
}

.time-selects select:last-of-type {
    width: 7rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.form-field input:user-invalid,
.form-field textarea:user-invalid {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.optional,
.field-help,
.required-note {
    color: #5e5b55;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
}

.field-help {
    margin: 0.35rem 0 0;
}

.checkbox-field,
.privacy-confirmation {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}

.checkbox-field {
    padding-bottom: 0.85rem;
}

.checkbox-field input,
.privacy-confirmation input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.checkbox-field label,
.privacy-confirmation label {
    margin: 0;
}

.public-event-preview {
    margin: 1.5rem 0;
    padding: 1.35rem;
    background: var(--background);
    border-left: 4px solid var(--accent);
    border-radius: 4px;
}

.public-event-preview h3 {
    margin: 0.2rem 0 0.25rem;
    font-size: 1.55rem;
}

.public-event-preview p {
    margin: 0.45rem 0 0;
}

.public-event-preview .calendar-time {
    color: var(--accent);
    font: 700 0.88rem/1.4 Arial, Helvetica, sans-serif;
}

.privacy-confirmation {
    padding: 1rem;
    background: color-mix(in srgb, var(--heading) 7%, var(--surface));
    border: 1px solid var(--border);
    border-radius: 5px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.form-actions a {
    color: var(--heading);
    font-weight: 700;
}

.form-message {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 5px;
}

.form-message-success {
    background: #edf5ec;
    border: 1px solid #75946f;
}

.spam-check {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.approval-load-error {
    padding: 1rem;
}

[hidden] {
    display: none !important;
}

/* ==========================================================
   Calendar approvals prototype
   ========================================================== */

.approval-page {
    width: min(94%, 1180px);
}

.approval-heading {
    text-align: center;
    border-top: 4px solid var(--accent);
}

.approval-layout {
    display: grid;
    grid-template-columns: minmax(17rem, 0.8fr) minmax(0, 1.6fr);
    gap: 1.25rem;
    align-items: start;
}

.approval-layout > section {
    margin: 0;
}

.approval-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.approval-filter button {
    padding: 0.45rem 0.7rem;
    color: var(--heading);
    font: 700 0.78rem/1.3 Arial, Helvetica, sans-serif;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
}

.approval-filter button[aria-pressed="true"] {
    color: var(--surface);
    background: var(--heading);
    border-color: var(--heading);
}

.submission-card {
    display: grid;
    width: 100%;
    gap: 0.25rem;
    margin-bottom: 0.65rem;
    padding: 0.9rem;
    color: var(--text);
    text-align: left;
    background: var(--background);
    border: 1px solid var(--border);
    border-left: 4px solid var(--heading);
    border-radius: 4px;
    cursor: pointer;
}

.submission-card:hover,
.submission-card:focus-visible,
.submission-card[aria-current="true"] {
    border-color: var(--accent);
}

.submission-card strong {
    color: var(--heading);
    font-size: 1rem;
}

.submission-card span:not(.status-badge) {
    font: 0.78rem/1.35 Arial, Helvetica, sans-serif;
}

.status-badge {
    justify-self: start;
    padding: 0.2rem 0.5rem;
    font: 700 0.7rem/1.3 Arial, Helvetica, sans-serif;
    background: var(--stone);
    border-radius: 999px;
}

.status-approved { background: #dcebd8; color: #294d23; }
.status-returned { background: #fff0c9; color: #674d0a; }
.status-rejected { background: #f3dddd; color: #702d2d; }

.review-title-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.review-title-row h2 {
    margin-bottom: 0;
}

.submission-byline {
    margin-top: 0.35rem;
    color: #5e5b55;
    font: 0.8rem/1.4 Arial, Helvetica, sans-serif;
}

.approval-review fieldset {
    margin: 1.5rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.approval-review legend {
    padding: 0 0.4rem;
    color: var(--heading);
    font-family: "Cormorant Garamond", Baskerville, serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.privacy-review {
    padding: 0.85rem;
    font: 0.84rem/1.45 Arial, Helvetica, sans-serif;
    border-radius: 4px;
}

.privacy-clear { background: #edf5ec; border: 1px solid #75946f; }
.privacy-warning { background: #fff0c9; border: 1px solid #b68b28; }

.approval-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.approval-actions button {
    padding: 0.7rem 0.9rem;
    font: 700 0.82rem/1.3 Arial, Helvetica, sans-serif;
    border-radius: 4px;
    cursor: pointer;
}

.approve-button { color: white; background: #35602e; border: 2px solid #35602e; }
.return-button { color: #4d3906; background: #fff0c9; border: 2px solid #b68b28; }
.reject-button { color: #702d2d; background: white; border: 2px solid #9c4b4b; }

@media (max-width: 800px) {
    .approval-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .calendar-event {
        grid-template-columns: 4.75rem minmax(0, 1fr);
        gap: 0.85rem;
        padding: 1rem;
    }

    .calendar-date {
        min-height: 5.25rem;
        padding-inline: 0.35rem;
    }

    .calendar-event-details h3 {
        font-size: 1.3rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .checkbox-field {
        padding-bottom: 0;
    }
}

.featured-highlight {
    padding: clamp(2rem, 5vw, 3.5rem);
    border-color: color-mix(in srgb, var(--heading) 35%, var(--border));
}

.featured-highlight > .section-heading {
    text-align: center;
}

.featured-highlight > .section-heading h2 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.carousel-instructions {
    margin: 0 auto 1rem;
    text-align: center;
    font-size: 0.95rem;
}

.carousel {
    max-width: 760px;
    margin-inline: auto;
}

.carousel-slide {
    min-height: 17rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    background-color: var(--background);
    border-radius: 6px;
}

.carousel-slide[hidden] {
    display: none;
}

.carousel-slide h3 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    line-height: 1.15;
}

.carousel-slide p:not(.highlight-type) {
    max-width: 60ch;
}

.carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.carousel-button {
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    color: var(--surface);
    background-color: var(--heading);
    border: 2px solid var(--heading);
    border-radius: 4px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.carousel-button:hover {
    color: var(--heading);
    background-color: var(--surface);
}

.carousel-status {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
}

.carousel-fallback {
    margin-bottom: 0;
    text-align: center;
}

.archive-explorer {
    padding-block: 1.5rem;
}

.archive-explorer > .section-heading {
    text-align: center;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.archive-card {
    display: flex;
    min-height: 6.25rem;
    padding: 0.9rem 0.65rem;
    flex-direction: column;
    justify-content: center;
    color: var(--heading);
    text-align: center;
    text-decoration: none;
    background-color: var(--background);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.archive-card:hover,
.archive-card:focus-visible {
    border-color: var(--accent);
}

.archive-card span {
    font-weight: 700;
}

.archive-card small {
    margin-top: 0.25rem;
    color: var(--text);
    font-size: 0.75rem;
    line-height: 1.35;
}

.archive-entry {
    margin: 1rem 0 0;
    text-align: center;
}

@media (max-width: 760px) {
    .archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* ==========================================================
   Family Tree
   ========================================================== */

.tree-page {
    width: min(94%, 1100px);
}

.tree-hero {
    padding-block: clamp(2.25rem, 5vw, 3.5rem);
}

.tree-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin: 1rem 0;
    padding: 0.8rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.tree-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
}

.tree-swatch {
    width: 1.7rem;
    height: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.tree-private-swatch {
    background: var(--surface);
    border-style: dashed;
}

.tree-search {
    margin: 1.25rem 0;
    padding: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.tree-search label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--heading);
    font-weight: 700;
}

.tree-search-controls {
    display: flex;
    gap: 0.5rem;
}

.tree-search input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
}

.tree-search button {
    min-height: 44px;
    padding: 0.5rem 1rem;
    color: var(--surface);
    background: var(--heading);
    border: 2px solid var(--heading);
    border-radius: 4px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tree-search button:hover,
.tree-search button:focus-visible {
    color: var(--heading);
    background: var(--surface);
}

.tree-search-help,
.tree-search-results h3 {
    margin: 0.55rem 0 0;
}

.tree-search-help {
    font-size: 0.9rem;
}

.tree-search-results {
    margin: 1rem 0 1.5rem;
    padding: 1rem;
    border-left: 4px solid var(--accent);
    background: var(--surface);
}

.tree-search-results ul {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
}

.tree-search-results li + li {
    margin-top: 0.55rem;
}

.tree-search-context {
    display: block;
    font-size: 0.88rem;
}

.tree-search-limit {
    font-style: italic;
}

.tree-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tree-actions button {
    min-height: 44px;
    padding: 0.5rem 0.85rem;
    color: var(--surface);
    background: var(--heading);
    border: 2px solid var(--heading);
    border-radius: 4px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tree-actions button:hover {
    color: var(--heading);
    background: var(--surface);
}

.family-tree,
.family-tree ul {
    list-style: none;
    padding-left: 1.25rem;
}

.family-tree {
    padding-left: 0;
}

.family-tree ul {
    margin-left: 1rem;
    border-left: 2px solid var(--border);
}

.family-tree li {
    margin: 0.7rem 0;
}

.family-tree summary {
    cursor: pointer;
    list-style-position: outside;
}

.tree-person {
    display: inline-block;
    width: min(100%, 34rem);
    min-width: 18rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.tree-tone-blue {
    background: #edf5fc;
    border-color: #b8ccde;
}

.tree-tone-pink {
    background: #fbeff4;
    border-color: #d9bdc8;
}

.tree-tone-neutral {
    background: var(--surface);
}

.tree-private {
    border-style: dashed;
}

.tree-person strong {
    color: var(--heading);
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-size: 1.2rem;
}

.tree-person-link {
    color: var(--heading);
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-underline-offset: 0.2em;
}

.tree-person-link:hover,
.tree-person-link:focus-visible {
    color: var(--accent);
}

.tree-fact,
.tree-relationship {
    display: block;
}

.tree-fact {
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

.tree-relationship {
    margin: 0 0 0.2rem 0.25rem;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .tree-search-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .tree-person {
        min-width: 0;
        width: calc(100% - 1rem);
    }

    .family-tree ul {
        margin-left: 0.35rem;
        padding-left: 0.65rem;
    }
}

/* ==========================================================
   Genealogy Detail Pages
   ========================================================== */

.genealogy-detail-page {
    width: min(92%, 960px);
}

.genealogy-back-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1rem;
    padding: 0;
}

.genealogy-detail-hero {
    padding: clamp(2rem, 5vw, 3rem);
    border-top: 4px solid var(--accent);
}

.genealogy-detail-hero h2 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 5vw, 3rem);
}

.genealogy-fact,
.genealogy-note {
    margin: 0.35rem 0 0;
}

.genealogy-connections h2 {
    margin-bottom: 1rem;
}

.genealogy-person-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.genealogy-person-card {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.genealogy-person-card > .text-link,
.genealogy-person-card > span:not(.genealogy-role) {
    font-family: "Cormorant Garamond", Baskerville, Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}

.genealogy-role {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--accent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.genealogy-family-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.genealogy-family-connection {
    display: flex;
    gap: 0.65rem;
    flex-direction: column;
}

.genealogy-family-connection .genealogy-person-card {
    flex: 1;
}

.genealogy-sources {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.genealogy-sources h3 {
    margin: 1rem 0 0.35rem;
    font-size: 1.05rem;
}

.genealogy-source-list {
    margin: 0;
    padding-left: 1.5rem;
}

.genealogy-source-list li + li {
    margin-top: 0.55rem;
}

.genealogy-loading {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.genealogy-timeline {
    margin: 2rem 0 2.5rem;
}

.genealogy-biography {
    margin-top: 2rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.72);
}

.genealogy-biography h2,
.genealogy-biography h3 {
    margin-bottom: 0.6rem;
}

.genealogy-biography h3 {
    margin-top: 1.5rem;
}

.genealogy-biography-summary {
    color: color-mix(in srgb, var(--text) 72%, transparent);
    font-style: italic;
}

.genealogy-biography-paragraph {
    max-width: 72ch;
}

.genealogy-biography-figure {
    margin: 1.75rem 0;
}

.genealogy-biography-figure img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
}

.genealogy-biography-figure figcaption {
    margin-top: 0.5rem;
    color: color-mix(in srgb, var(--text) 72%, transparent);
    font-size: 0.88rem;
}

.genealogy-biography-sources {
    margin-top: 1.5rem;
}

.genealogy-biography-updated {
    margin-top: 1.5rem;
    color: color-mix(in srgb, var(--text) 65%, transparent);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.78rem;
}

.genealogy-biography-sources summary {
    cursor: pointer;
    font-weight: 700;
}

.genealogy-timeline-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.genealogy-timeline-source-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.2rem;
}

.genealogy-timeline-list {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.genealogy-timeline-event {
    padding: 0.2rem 0;
    line-height: 1.5;
}

.genealogy-timeline-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.4rem;
}

.genealogy-timeline-date {
    color: var(--heading);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.genealogy-timeline-action {
    color: var(--heading);
}

.genealogy-timeline-separator {
    color: var(--accent);
}

.genealogy-timeline-sources {
    margin: 0.15rem 0 0 1.25rem;
    padding-left: 1.25rem;
    font-size: 0.9rem;
}

.genealogy-timeline-sources[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .genealogy-person-grid,
    .genealogy-family-list {
        grid-template-columns: 1fr;
    }

    .genealogy-timeline-line {
        gap: 0 0.3rem;
    }
}

@media (max-width: 600px) {
    .family-today-grid {
        grid-template-columns: 1fr;
    }

    .carousel-slide {
        min-height: 20rem;
    }

    .carousel-controls {
        align-items: stretch;
    }

    .carousel-button {
        flex: 1;
    }

    .carousel-status {
        align-self: center;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
