/* =============================================================================
   Seeker Family site — theme
   Palette + type taken from the existing family tree site
   (https://www.seekertech.net/familytree/style.css + login.php) and the
   Seeker Family Library (fonts: Playfair Display / IM Fell English).
   ============================================================================= */
@font-face { font-family: "Playfair Display"; src: url("../fonts/PlayfairDisplay-Variable.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("../fonts/PlayfairDisplay-Italic-Variable.woff2") format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/IMFellEnglish-Regular.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "IM Fell English"; src: url("../fonts/IMFellEnglish-Italic.woff2") format("woff2"); font-style: italic; font-display: swap; }

:root {
  /* from familytree/style.css :root */
  --ft-paper-light: #120c10;
  --ft-paper-medium: #1c1218;
  --ft-paper-dark: #2a1c24;
  --ft-ink: #f4ead4;
  --ft-ink-brown: #e6d3a1;
  --ft-ink-faded: #b7a48a;
  --ft-gold: #c9a227;
  --ft-burgundy: #8b1e2d;
  --ft-burgundy-dark: #5c121c;   /* login.php button hover */
  --ft-sapphire: #1e4d8c;
  --ft-silver: #c5ccd6;
  --ft-night: #100c0a;           /* login.php body */
  --ft-line: #3a2a22;            /* login.php disclaimer border */

  --font-body: Georgia, "Times New Roman", Times, serif;
  --font-head: "Playfair Display", Georgia, serif;
  --font-ornate: "IM Fell English", Georgia, serif;
  --radius: 4px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--ft-paper-light);
  color: var(--ft-ink);
  line-height: 1.65;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--ft-gold); }
a:hover { color: var(--ft-ink-brown); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ft-ink-brown); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .5rem; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin: 1.5rem 0 .75rem; }
h3 { font-size: 1.15rem; margin-bottom: .5rem; }
p { margin-bottom: .85rem; }
.muted { color: var(--ft-ink-faded); }
.small { font-size: .88rem; }
.ornate { font-family: var(--font-ornate); font-style: italic; color: var(--ft-gold); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 50px; }

/* ── Tags ─────────────────────────────────────────────────────────────── */
.tag { display: inline-block; font: 700 .68rem/1 var(--font-body); letter-spacing: .12em; padding: 4px 7px; border-radius: 2px; vertical-align: middle; }
.tag-living { background: #1f3d2a; color: #cfe8d4; }
.tag-pending { background: #6b4e12; color: #fff3cf; }
.tag-approved { background: #1f3d2a; color: #cfe8d4; }
.tag-denied, .tag-disabled { background: var(--ft-burgundy-dark); color: var(--ft-ink); }
.badge { display: inline-block; min-width: 1.4em; padding: 1px 6px; border-radius: 999px; background: var(--ft-burgundy); color: #fff; font-size: .75rem; text-align: center; border: 1px solid var(--ft-gold); }

/* ── Header / nav ───────────────────────────────────────────────────────── */
.site-header { background: linear-gradient(to bottom, var(--ft-paper-medium), var(--ft-paper-light)); border-bottom: 3px solid var(--ft-gold); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 78px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 44px; height: auto; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.brand-name { display: block; font-family: var(--font-head); font-size: 1.3rem; color: var(--ft-ink-brown); font-weight: 700; line-height: 1.1; }
.brand-motto { display: block; font-family: var(--font-ornate); font-style: italic; color: var(--ft-gold); font-size: .9rem; }
.site-nav { display: flex; align-items: center; gap: 6px 12px; flex: 1; justify-content: flex-end; flex-wrap: wrap; }
.nav-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-family { padding-left: 10px; border-left: 1px solid var(--ft-line); }
.site-nav a:not(.btn) { color: var(--ft-ink); text-decoration: none; padding: 6px 7px; border-radius: 2px; font-size: .93rem; letter-spacing: .02em; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover { color: var(--ft-gold); }
.site-nav a.active:not(.btn) { color: var(--ft-gold); border-bottom-color: var(--ft-gold); }
.nav-user { color: var(--ft-ink-faded); font-size: .88rem; padding: 0 6px; font-style: italic; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--ft-gold); border-radius: 2px; width: 44px; height: 40px; cursor: pointer; padding: 9px 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--ft-gold); margin: 4px 0; }

@media (max-width: 1100px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ft-paper-medium); border-bottom: 3px solid var(--ft-gold); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; gap: 6px; }
  .site-nav.open { display: flex; }
  .nav-group { flex-direction: column; align-items: stretch; }
  .nav-family { border-left: 0; padding-left: 0; border-top: 1px solid var(--ft-line); padding-top: 8px; }
  .nav-account { border-top: 1px solid var(--ft-line); padding-top: 10px; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .site-nav a:not(.btn) { padding: 10px 6px; }
  .header-inner { position: relative; }
}

/* ── Buttons / forms (ft-btn style from the tree site) ──────────────────── */
.btn { display: inline-block; padding: 12px 24px; background: var(--ft-burgundy); color: var(--ft-ink); text-decoration: none; border: 1px solid var(--ft-gold); border-radius: 2px; font: 1rem var(--font-body); letter-spacing: .06em; cursor: pointer; transition: all .25s ease; }
.btn:hover { background: var(--ft-paper-light); color: var(--ft-gold); transform: translateY(-1px); }
.btn-small { padding: 7px 14px; font-size: .88rem; }
.btn-ghost { background: transparent; }
.btn-gold { background: var(--ft-gold); color: var(--ft-night); font-weight: 700; }
.btn-gold:hover { background: var(--ft-night); color: var(--ft-gold); }
.btn-danger { background: var(--ft-burgundy-dark); }
.btn-blue { background: var(--ft-sapphire); border-color: var(--ft-silver); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
label { display: block; color: var(--ft-ink-brown); font-size: .95rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 12px 14px; background: var(--ft-night); color: var(--ft-ink);
  border: 1px solid var(--ft-gold); border-radius: 2px; font: 1rem var(--font-body);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ft-ink-brown); box-shadow: 0 0 0 3px rgba(201,162,39,.25); }
textarea { min-height: 110px; resize: vertical; }
.hint { color: var(--ft-ink-faded); font-size: .85rem; margin-top: 4px; }
.form-narrow { max-width: 480px; margin: 0 auto; }

/* ── Cards / layout ─────────────────────────────────────────────────────── */
.card { background: var(--ft-paper-medium); border: 1px solid var(--ft-line); border-radius: var(--radius); padding: 26px; margin-bottom: 22px; box-shadow: var(--shadow); }
.card-gold { border: 1px solid var(--ft-gold); }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2x { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid-2x { grid-template-columns: 1fr; } }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--ft-line); padding-bottom: 12px; }
.page-head p { margin: 0; }
.divider { text-align: center; color: var(--ft-gold); letter-spacing: .6em; margin: 26px 0; font-size: .9rem; }
.notice { border-left: 4px solid var(--ft-gold); background: rgba(201,162,39,.07); padding: 12px 16px; margin: 14px 0; border-radius: 0 var(--radius) var(--radius) 0; font-size: .93rem; }
.notice-info { border-left-color: var(--ft-sapphire); background: rgba(30,77,140,.15); }
.notice-warn { border-left-color: var(--ft-burgundy); background: rgba(139,30,45,.15); }
.flash { padding: 12px 16px; border-radius: 2px; margin-bottom: 18px; border: 1px solid var(--ft-gold); background: rgba(201,162,39,.1); }
.flash-error { border-color: #d35; background: rgba(211,51,85,.12); }
.flash-success { border-color: #5a9; background: rgba(90,170,150,.12); }

/* ── Home hero ──────────────────────────────────────────────────────────── */
.hero { position: relative; display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; padding: 40px; border: 1px solid var(--ft-gold); border-radius: 2px; overflow: hidden;
  background: linear-gradient(rgba(16,12,10,.86), rgba(16,12,10,.92)), url("../img/library-bg.jpg") center/cover no-repeat; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero .lead { font-size: 1.15rem; color: var(--ft-ink); max-width: 36em; }
.hero-crest { text-align: center; }
.hero-crest img { max-height: 430px; width: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.6)); }
.hero .motto { font-family: var(--font-ornate); font-style: italic; color: var(--ft-gold); font-size: 1.5rem; margin-bottom: .6rem; }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; padding: 26px 20px; text-align: center; } .hero-crest { order: -1; } .hero-crest img { max-height: 260px; } .hero .btn-row { justify-content: center; } }
.feature { text-align: center; padding: 24px 18px; }
.feature .icon { font-size: 2rem; color: var(--ft-gold); display: block; margin-bottom: 6px; }
.feature .lock { font-size: .75rem; letter-spacing: .12em; color: var(--ft-ink-faded); text-transform: uppercase; }

/* ── Auth pages ─────────────────────────────────────────────────────────── */
.auth-card { max-width: 520px; margin: 10px auto; text-align: center; background: #140e12; border: 1px solid var(--ft-gold); border-radius: 2px; padding: 40px 34px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.auth-card form { text-align: left; }
.auth-card .crest { width: 150px; margin-bottom: 8px; }
.auth-card .welcome-text { font-family: var(--font-ornate); color: var(--ft-gold); font-size: 1.35rem; font-style: italic; margin-bottom: 14px; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ft-line); vertical-align: top; }
th { color: var(--ft-gold); font-weight: normal; letter-spacing: .06em; font-size: .82rem; text-transform: uppercase; }
tr:hover td { background: rgba(255,255,255,.02); }
.diff-old { color: #e2a3ab; text-decoration: line-through; }
.diff-new { color: #b9e2c4; }
.rolled-back td { opacity: .5; }

/* ── Family tree ────────────────────────────────────────────────────────── */
.ft-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 22px; }
.ft-stat { background: var(--ft-paper-medium); border: 2px solid var(--ft-sapphire); border-radius: 8px; padding: 18px; text-align: center; }
.ft-stat b { display: block; font-size: 2.2rem; color: var(--ft-ink-brown); font-family: var(--font-head); }
.ft-stat span { color: var(--ft-ink-faded); }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search-form input { flex: 1; min-width: 220px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.letters a { padding: 4px 9px; border: 1px solid var(--ft-line); border-radius: 2px; text-decoration: none; font-size: .9rem; }
.letters a.active, .letters a:hover { border-color: var(--ft-gold); background: rgba(201,162,39,.12); }
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.person-card { display: block; background: var(--ft-paper-medium); border-left: 4px solid var(--ft-burgundy); padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: var(--ft-ink); transition: transform .15s, background .15s; }
.person-card:hover { transform: translateY(-2px); background: var(--ft-paper-dark); color: var(--ft-ink); }
.person-card.sex-m { border-left-color: var(--ft-sapphire); }
.person-card.sex-f { border-left-color: var(--ft-burgundy); }
.person-card strong { display: block; font-family: var(--font-head); color: var(--ft-ink-brown); font-size: 1.08rem; }
.person-card .dates { color: var(--ft-ink-faded); font-size: .88rem; }
.person-link { text-decoration: none; border-bottom: 1px dotted currentColor; }
.person-header { background: var(--ft-paper-medium); border: 2px solid var(--ft-gold); border-radius: 8px; padding: 26px; text-align: center; margin-bottom: 22px; }
.person-header .dates { font-size: 1.2rem; color: var(--ft-ink-faded); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--ft-gold); font-size: .9rem; }
.facts dd { margin: 0; }
.info-box { background: var(--ft-paper-medium); border: 2px solid var(--ft-sapphire); border-radius: var(--radius); padding: 18px 20px; }
.info-box h3 { border-bottom: 2px solid var(--ft-gold); padding-bottom: 8px; margin-bottom: 12px; }
.info-box ul { list-style: none; }
.info-box li { padding: 5px 0; border-bottom: 1px dashed var(--ft-line); }
.info-box li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 14px; border: 1px solid var(--ft-line); text-decoration: none; border-radius: 2px; }
.tabs a.active { border-color: var(--ft-gold); background: var(--ft-burgundy); color: var(--ft-ink); }

/* Ancestor (pedigree) chart: columns = generations */
.pedigree-scroll { overflow-x: auto; padding-bottom: 10px; }
.pedigree { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 0 26px; padding: 6px 2px 12px; min-width: 760px; }
.ped-head { padding-bottom: 0; }
.ped-head h4 { font-family: var(--font-body); font-weight: normal; color: var(--ft-gold); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; text-align: center; border-bottom: 1px solid var(--ft-line); padding-bottom: 6px; }
.ped-col { display: flex; flex-direction: column; justify-content: space-around; gap: 10px; min-width: 170px; }
.node { position: relative; display: block; background: var(--ft-paper-medium); border: 1px solid var(--ft-line); border-left: 4px solid var(--ft-burgundy); border-radius: var(--radius); padding: 8px 10px; text-decoration: none; color: var(--ft-ink); font-size: .9rem; min-height: 54px; }
.node.sex-m { border-left-color: var(--ft-sapphire); }
.node strong { display: block; color: var(--ft-ink-brown); font-family: var(--font-head); font-size: .98rem; line-height: 1.2; }
.node small { color: var(--ft-ink-faded); }
.node.focus { border-color: var(--ft-gold); box-shadow: 0 0 0 2px rgba(201,162,39,.35); }
.node.empty { opacity: .45; border-style: dashed; }
.ped-col:not(:first-child) .node::before { content: ""; position: absolute; left: -27px; top: 50%; width: 23px; border-top: 1px solid var(--ft-gold); }
a.node:hover { background: var(--ft-paper-dark); color: var(--ft-ink); }

/* Descendant tree: classic CSS org-chart */
.desc-tree { overflow-x: auto; padding: 10px 0 20px; }
.desc-tree ul { padding-top: 22px; position: relative; display: flex; justify-content: center; list-style: none; }
.desc-tree > ul { padding-top: 0; }
.desc-tree li { position: relative; padding: 22px 6px 0; text-align: center; }
.desc-tree li::before, .desc-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 22px; border-top: 1px solid var(--ft-gold); }
.desc-tree li::after { right: auto; left: 50%; border-left: 1px solid var(--ft-gold); }
.desc-tree li:only-child::before, .desc-tree li:only-child::after { display: none; }
.desc-tree li:only-child { padding-top: 0; }
.desc-tree li:first-child::before, .desc-tree li:last-child::after { border: 0 none; }
.desc-tree li:last-child::before { border-right: 1px solid var(--ft-gold); }
.desc-tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1px solid var(--ft-gold); }
.desc-tree > ul > li { padding-top: 0; }
.desc-tree .couple { display: inline-flex; gap: 4px; align-items: stretch; }
.desc-tree .node { display: inline-block; min-width: 130px; max-width: 170px; text-align: left; }
.desc-tree .amp { align-self: center; color: var(--ft-gold); font-family: var(--font-ornate); }

/* ── Pictures / lightbox ────────────────────────────────────────────────── */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.album { display: block; text-decoration: none; background: var(--ft-paper-medium); border: 1px solid var(--ft-line); border-radius: var(--radius); overflow: hidden; color: var(--ft-ink); }
.album:hover { border-color: var(--ft-gold); color: var(--ft-ink); }
.album img { display: block; width: 100%; aspect-ratio: 13/9; object-fit: cover; }
.album div { padding: 10px 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-grid a { display: block; border: 1px solid var(--ft-line); border-radius: var(--radius); overflow: hidden; }
.photo-grid a:hover { border-color: var(--ft-gold); }
.photo-grid img { display: block; width: 100%; aspect-ratio: 13/9; object-fit: cover; }
.lightbox { position: fixed; inset: 0; background: rgba(8,5,4,.94); z-index: 20000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox figure { max-width: min(1000px, 92vw); text-align: center; }
.lightbox img { width: min(900px, 88vw); max-height: 78vh; object-fit: contain; border: 1px solid var(--ft-gold); }
.lightbox figcaption { margin-top: 10px; color: var(--ft-ink-brown); font-family: var(--font-ornate); font-size: 1.15rem; }
.lightbox button { position: absolute; background: rgba(0,0,0,.4); color: var(--ft-gold); border: 1px solid var(--ft-gold); width: 48px; height: 48px; font-size: 1.8rem; line-height: 1; cursor: pointer; border-radius: 2px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ── Files ──────────────────────────────────────────────────────────────── */
.file-icon { display: inline-block; width: 30px; height: 36px; border: 1px solid var(--ft-gold); border-radius: 2px 8px 2px 2px; font-size: .6rem; text-align: center; line-height: 36px; color: var(--ft-gold); margin-right: 8px; vertical-align: middle; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 2px solid var(--ft-gold); background: var(--ft-night); color: var(--ft-ink-faded); padding: 26px 0; font-size: .9rem; }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; }
.footer-crest { display: flex; gap: 12px; align-items: center; }
.footer-name { font-family: var(--font-head); color: var(--ft-ink-brown); letter-spacing: .05em; }
.footer-motto { font-family: var(--font-ornate); font-style: italic; color: var(--ft-gold); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.footer-links a { color: var(--ft-ink-faded); text-decoration: none; }
.footer-links a:hover { color: var(--ft-gold); }
.footer-note { text-align: right; font-size: .8rem; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr; text-align: center; } .footer-crest { justify-content: center; } .footer-note { text-align: center; } }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ── v1.0.0 additions ───────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 34px 20px; }
.empty-state .icon { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.empty-state h2 { margin-top: 0; }
.person-photo { display: block; margin: 0 auto 12px; max-width: 180px; max-height: 220px; width: auto; height: auto; border: 2px solid var(--ft-gold); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,.5); object-fit: cover; }
.chapel-card h2 { margin-top: 12px; }
.chapel-img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: cover; border: 1px solid var(--ft-gold); border-radius: var(--radius); }
.chapel-father { display: flex; gap: 18px; align-items: flex-start; }
.chapel-father img { width: 130px; height: auto; flex-shrink: 0; border: 1px solid var(--ft-gold); border-radius: var(--radius); }
@media (max-width: 560px) { .chapel-father { flex-direction: column; align-items: center; text-align: center; } .chapel-father .btn-row { justify-content: center; } }
/* Role badges (admin page) */
.tag-role-admin { background: var(--ft-burgundy); color: #fff3cf; border: 1px solid var(--ft-gold); }
.tag-role-moderator { background: var(--ft-sapphire, #1e4d8c); color: #e3ecfa; }
.tag-role-member { background: rgba(201,162,39,.18); color: inherit; }
.role-form { display: inline-flex; gap: 6px; align-items: center; }
