/* Shared visual system for the active Genealogy screens. */
.genealogy-app {
  min-height: 100vh;
  background: #f4f7fc;
  color: #34445e;
}

.genealogy-app .container.theme-showcase,
.genealogy-app .container-fluid.theme-showcase,
.genealogy-app .genealogy-page-shell {
  max-width: 1560px;
  padding-top: 1.25rem;
  padding-bottom: 3rem;
}

.genealogy-app .jumbotron,
.genealogy-page-hero {
  position: relative;
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  overflow: hidden;
  color: #fff;
  background: linear-gradient(120deg, #183b70 0%, #3266ad 65%, #7296d1 100%);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(31, 63, 112, .16);
}

.genealogy-app .jumbotron h1,
.genealogy-page-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -.04em;
}

.genealogy-app .jumbotron p,
.genealogy-page-hero p {
  margin: .4rem 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: .95rem;
}

.genealogy-app .jumbotron font {
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
}

.genealogy-app blockquote {
  margin: 1rem 0;
  padding: 1.25rem;
  color: #fff;
  background: linear-gradient(120deg, #183b70 0%, #3266ad 65%, #7296d1 100%);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(31, 63, 112, .14);
}

.genealogy-app blockquote blockquote {
  margin: 0;
  padding: .5rem;
  background: transparent;
  box-shadow: none;
}

.genealogy-app blockquote font {
  color: #fff !important;
  font-family: inherit !important;
}

.genealogy-app blockquote p {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem) !important;
  font-weight: 700;
}

.genealogy-page-hero__eyebrow {
  display: block;
  margin-bottom: .4rem;
  color: rgba(255, 255, 255, .75);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.genealogy-page-panel {
  margin-bottom: 1.1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(35, 58, 99, .06);
}

.genealogy-app .page-header {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
}

.genealogy-app h2,
.genealogy-app h3,
.genealogy-app h4,
.genealogy-app h5 {
  color: #203c70;
  font-weight: 700;
  letter-spacing: -.02em;
}

.genealogy-app .form-control,
.genealogy-app input[type="text"],
.genealogy-app input[type="email"],
.genealogy-app input[type="password"],
.genealogy-app input[type="number"],
.genealogy-app input[type="date"],
.genealogy-app input[type="file"],
.genealogy-app select,
.genealogy-app textarea {
  max-width: 100%;
  min-height: 40px;
  margin-bottom: .6rem;
  padding: .45rem .7rem;
  color: #34445e;
  background-color: #fff;
  border: 1px solid #d5deeb;
  border-radius: 9px;
  box-shadow: none;
}

.genealogy-app textarea {
  min-height: 90px;
}

.genealogy-app .form-control:focus,
.genealogy-app input:focus,
.genealogy-app select:focus,
.genealogy-app textarea:focus {
  border-color: #7296d1;
  box-shadow: 0 0 0 .18rem rgba(71, 115, 196, .14);
  outline: 0;
}

.genealogy-app .btn {
  border-radius: 9px;
  font-weight: 600;
}

.genealogy-app input[type="submit"],
.genealogy-app input[type="button"] {
  min-height: 40px;
  padding: .45rem .9rem;
  color: #fff;
  background: #315da7;
  border: 1px solid #315da7;
  border-radius: 9px;
  font-weight: 600;
}

.genealogy-app input[type="submit"]:hover,
.genealogy-app input[type="button"]:hover {
  background: #244b8a;
}

.genealogy-app .table,
.genealogy-app table#table1 {
  width: 100%;
  max-width: 100%;
  margin-bottom: 1rem;
  color: #43516a;
  background: #fff;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e3eaf4;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(35, 58, 99, .06);
  overflow: hidden;
}

.genealogy-app .table th,
.genealogy-app .table td,
.genealogy-app table#table1 th,
.genealogy-app table#table1 td {
  padding: .55rem .65rem;
  border-color: #e7edf5;
  vertical-align: middle;
}

.genealogy-app table#table1 tr:nth-child(even) td {
  background: #f8faff;
}

.genealogy-app table:not(.tableCenter) {
  max-width: 100%;
}

.genealogy-app .select2-container--default .select2-selection--single {
  min-height: 40px;
  border: 1px solid #d5deeb;
  border-radius: 9px;
}

.genealogy-app .bg-light {
  background-color: transparent !important;
}

.genealogy-app a:not(.btn):not(.genealogy-sidebar__link) {
  color: #315da7;
}

.genealogy-app footer {
  margin-top: 1.5rem;
  padding: 1rem;
  color: #74829a;
  background: transparent;
  border-top: 1px solid #e3eaf4;
  font-size: .8rem;
}

.genealogy-page-shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: 1.25rem 15px 3rem;
}

.genealogy-page-grid {
  display: grid;
  /* Fixed, not minmax() — the side columns should never resize as the
     viewport changes; only the middle column absorbs extra/lost space. */
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.genealogy-page-grid > * {
  min-width: 0;
}

.genealogy-directory-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.genealogy-directory-layout > * {
  min-width: 0;
}

.genealogy-birthday-rail {
  width: 100%;
  min-width: 0;
}

/* justify-self/align-self only do anything inside an actual CSS grid
   parent, and margin-left: auto is meant to right-align this column
   within that grid track — scoped to the pages that really are grids.
   Pages that use a plain Bootstrap .row instead (search.html,
   person_detail.html, admin/add_person.html, admin/edit_person.html)
   never needed the grid alignment, but an earlier unscoped version of
   this rule's margin-left: auto !important still applied there too — a
   real value in a flex row — and shoved this column out of alignment
   with the sidebar on the left. */
.genealogy-page-grid > .genealogy-birthday-rail,
.genealogy-directory-layout > .genealogy-birthday-rail {
  margin-left: auto !important;
  justify-self: end;
  align-self: start;
}

.genealogy-app .genealogy-birthday-rail .genealogy-birthday-card {
  display: block;
  width: 100%;
}

/* Ported from _fam_includes/DisplayBD.php's own inline <style> block —
   never carried over when the markup was ported to _birthday_rail.html,
   so the birthday rail rendered as plain unstyled text instead of a
   card matching the sidebar/search columns either side of it. */
.genealogy-birthday-card {
  box-sizing: border-box;
  margin: 0 0 1rem;
  padding: 1rem .9rem;
  color: #26354e;
  background: linear-gradient(150deg, #fff 0%, #f4f7fc 100%);
  border: 1px solid #e1e8f2;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(31, 53, 88, .09);
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.genealogy-birthday-card__eyebrow {
  display: block;
  margin-bottom: .25rem;
  color: #73829a;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.genealogy-birthday-card h2 {
  margin: 0 0 .8rem;
  color: #203c70;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}
.genealogy-birthday-card__list {
  display: grid;
  gap: .45rem;
}
.genealogy-birthday-card__item {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .55rem .6rem;
  background: #fff;
  border: 1px solid #e9eef6;
  border-radius: 9px;
}
.genealogy-birthday-card__date {
  flex: 0 0 auto;
  min-width: 3.4rem;
  padding: .25rem .4rem;
  color: #315da7;
  background: #edf3ff;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.genealogy-birthday-card__name {
  min-width: 0;
  padding-top: .2rem;
  color: #43516a;
  font-size: 12px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.genealogy-birthday-card__empty {
  margin: 0;
  padding: .65rem;
  color: #74829a;
  background: #fff;
  border: 1px dashed #d8e0ec;
  border-radius: 9px;
  font-size: 12px;
}

/* "This month" rail: marks where today falls in the day-sorted list —
   a divider between the two entries either side of it if nobody's
   birthday is today, or a box around the whole group of people whose
   birthday IS today. */
.genealogy-birthday-card__today-divider {
  height: 0;
  margin: .15rem 0;
  border: none;
  border-top: 2px solid #d6394a;
}

.genealogy-birthday-card__today-group {
  display: grid;
  gap: .45rem;
  padding: .4rem;
  border: 2px solid #d6394a;
  border-radius: 10px;
}

.genealogy-app .genealogy-sidebar {
  max-width: none;
}

.genealogy-search-card,
.genealogy-results-card {
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.5rem);
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(35, 58, 99, .06);
}

.genealogy-search-card h2,
.genealogy-results-card h2 {
  margin: 0 0 .8rem;
  color: #203c70;
  font-size: 1.15rem;
}

/* .genealogy-content-card and its siblings below were only ever defined
   inside search.html's own <style> block, so every OTHER page that uses
   them (login, change_password, mfa_enable/disable, verify_2fa,
   verify_membership) rendered completely unstyled — no card background/
   border/shadow, no labels, a bare unstyled submit button. Moved here so
   every page gets them via _base.html's unconditional stylesheet link,
   found while giving the 403 "Forbidden" page this same card treatment
   (see genes/forbidden.html) and noticing it couldn't actually reuse
   these classes reliably from any page other than search.html itself. */
.genealogy-content-card {
  height: 100%;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(35, 58, 99, .07);
}
.genealogy-content-card__eyebrow {
  display: block;
  margin-bottom: .3rem;
  color: #73829a;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.genealogy-content-card h2 {
  margin: 0 0 .45rem;
  color: #203c70;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.025em;
}
.genealogy-content-card__intro {
  margin-bottom: 1.5rem;
  color: #74829a;
  font-size: .9rem;
}
.genealogy-search-label {
  display: block;
  margin-bottom: .45rem;
  color: #34445e;
  font-size: .82rem;
  font-weight: 650;
}
.genealogy-search-submit {
  min-height: 44px;
  margin-top: 1rem;
  padding-right: 1.25rem;
  padding-left: 1.25rem;
  border-radius: 9px;
  font-weight: 650;
}
.genealogy-search-note {
  margin: 1rem 0 0;
  color: #8290a4;
  font-size: .77rem;
}

.genealogy-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: .85rem;
}

.genealogy-record-card {
  min-width: 0;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 13px;
  box-shadow: 0 6px 18px rgba(35, 58, 99, .06);
}

.genealogy-record-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  color: #8290a4;
  font-size: .63rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.genealogy-record-card__number {
  padding: .2rem .45rem;
  color: #315da7;
  background: #edf3ff;
  border-radius: 999px;
  letter-spacing: 0;
}

.genealogy-record-card h2 {
  margin: .45rem 0 .7rem;
  color: #203c70;
  font-size: 1.05rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.genealogy-record-card h2 a {
  color: inherit;
  text-decoration: none;
}

.genealogy-record-card h2 a:hover {
  color: #315da7;
  text-decoration: underline;
}

.genealogy-record-card__details {
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem;
  margin: 0;
}

.genealogy-record-card__field {
  display: grid;
  grid-template-columns: minmax(6rem, 40%) minmax(0, 1fr);
  gap: .5rem;
  padding-top: .35rem;
  border-top: 1px solid #edf1f6;
  font-size: .73rem;
}

.genealogy-record-card__field dt {
  margin: 0;
  color: #8290a4;
  font-weight: 500;
}

.genealogy-record-card__field dd {
  min-width: 0;
  margin: 0;
  color: #43516a;
  overflow-wrap: anywhere;
}

.genealogy-app .tree-output {
  min-width: 0;
  padding: 1rem;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e3eaf4;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(35, 58, 99, .06);
}

.genealogy-app .tree-output,
.genealogy-app .tree-output * {
  line-height: 1.6;
}

.genealogy-app .tree-output .thumbnail img {
  max-width: 90px;
  max-height: 110px;
  object-fit: cover;
  border-radius: 8px;
}

.genealogy-tree-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.genealogy-tree-layout > * {
  min-width: 0;
}

.genealogy-tree-nav,
.genealogy-tree-layout .genealogy-birthday-rail {
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  justify-self: stretch;
}

.genealogy-tree-content {
  min-width: 0;
  width: 100%;
}

.genealogy-tree-content .tree-output {
  width: 100%;
  min-height: 260px;
}

@media (max-width: 991.98px) {
  .genealogy-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .genealogy-page-grid > :first-child {
    grid-column: 1 / -1;
  }
  .genealogy-directory-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .genealogy-directory-layout > :first-child {
    grid-column: 1 / -1;
  }
  .genealogy-directory-layout > .genealogy-birthday-rail {
    grid-column: 2;
  }
  .genealogy-tree-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .genealogy-tree-nav {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .genealogy-app .container.theme-showcase,
  .genealogy-app .container-fluid.theme-showcase,
  .genealogy-page-shell {
    padding-top: .75rem;
  }
  .genealogy-app .jumbotron,
  .genealogy-page-hero {
    border-radius: 14px;
  }
  .genealogy-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .genealogy-directory-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .genealogy-directory-layout > .genealogy-birthday-rail {
    grid-column: 1;
  }
  .genealogy-tree-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .genealogy-tree-nav,
  .genealogy-tree-layout .genealogy-birthday-rail {
    grid-column: 1;
  }
}

/* "Show"/"Hide" toggle on every password field (see genes/_base.html,
   which wraps every input[type=password] in .genealogy-password-wrap
   and inserts this button automatically — nothing per-page to add). */
.genealogy-password-wrap {
  position: relative;
}

.genealogy-password-wrap input[type="password"],
.genealogy-password-wrap input[type="text"] {
  padding-right: 3.6rem;
}

.genealogy-password-toggle {
  position: absolute;
  top: 50%;
  right: .4rem;
  transform: translateY(-50%);
  padding: .2rem .55rem;
  background: transparent;
  border: none;
  border-radius: .4rem;
  color: #5475b7;
  font-size: .76rem;
  font-weight: 650;
  cursor: pointer;
}

.genealogy-password-toggle:hover,
.genealogy-password-toggle:focus {
  color: #174ea6;
  background: #edf2fb;
  outline: none;
}