/* ---------------------------------------------------------
   GLOBAL SITE STYLES (safe defaults)
   --------------------------------------------------------- */

.top-bar {
    background: #003366;
    color: white;
}

.top-bar-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-title-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.login-status {
    white-space: nowrap;
    font-size: 14px;
}

/* Crest logo */
.logo-crest {
    width: 36px;
    height: 40px;
    border-radius: 8px 8px 14px 14px;
    background: #1b4b72;
    border: 2px solid #ffffffaa;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px #002244;
}

.crest-letter {
    font-family: "Georgia", serif;
    font-size: 20px;
    font-weight: bold;
    color: #e0f2f1;
    line-height: 1;
}




/* Full-width top bar */
.top-bar {
    background: #003366;
    padding: 10px 0;
    color: white;
    width: 100%;
    border-bottom: 3px solid #002244; /* divider line */
    margin-bottom: 20px; /* spacing below bar */
}

/* Center the contents of the top bar */
.top-bar-inner {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Prevent logout button from wrapping off-screen */
.login-status {
    white-space: nowrap;
}

/* Buttons */

.logout-btn, .login-btn {
    margin-left: 10px;
    padding: 4px 10px;
    border: 2px solid white;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
}

.logout-btn:hover, .login-btn:hover {
    background: rgba(255,255,255,0.2);
}

.btn-primary {
    display: inline-block;
    padding: 8px 14px;
    background: #0055aa;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    margin-bottom: 15px;
}

.btn-primary:hover {
    background: #2277cc;
}




/* Main container */
.container {
    width: 90%;
    max-width: 900px;
    margin: 20px auto;
}

.people-list {
    list-style: none;
    padding: 0;
}

.people-list li {
    background: #f8faff;
    border: 1px solid #ccd5ee;
    padding: 8px 12px;
    border-radius: 6px;
    margin: 6px 0;
}

.top-bar {
    background: #003366;
    padding: 10px 0;
    color: white;
    width: 100%;
    border-bottom: 3px solid #002244; /* new line */
    margin-bottom: 20px; /* spacing below bar */
}


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #fafafa;
    color: #333;
}

.container {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

h1, h2, h3 {
    font-weight: 600;
    color: #222;
}

a {
    color: #003366;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Generic person box used on person.php */
.person-box {
    background: #f0f4ff;
    border: 1px solid #ccd5ee;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

/* ---------------------------------------------------------
   FAMILY TREE VIEW — FULLY SCOPED, DOES NOT AFFECT SITE
   --------------------------------------------------------- */

.tree-view {
    margin-top: 40px;
    overflow-x: auto;
    padding-bottom: 40px;
}

/* Flip the whole tree so ancestors appear at the top */
.tree-view .tree {
    transform: rotate(180deg);
}

/* Flip each box back so text is readable */
.tree-view .tree-person-box {
    transform: rotate(180deg);
}

/* Tree container */
.tree-view .tree,
.tree-view .tree ul {
    padding-top: 20px;
    position: relative;
    display: flex;
    justify-content: center;
}

.tree-view .tree ul {
    padding-left: 0;
}

.tree-view .tree li {
    list-style-type: none;
    text-align: center;
    position: relative;
    padding: 20px 5px 0 5px;
}

/* Lines connecting nodes */
.tree-view .tree li::before,
.tree-view .tree li::after {
    content: '';
    position: absolute;
    top: 0;
    width: 50%;
    height: 20px;
    border-top: 1px solid #999;
}

.tree-view .tree li::before {
    left: 0;
    border-right: 1px solid #999;
}

.tree-view .tree li::after {
    right: 0;
    border-left: 1px solid #999;
}

/* Remove lines for only-child nodes */
.tree-view .tree li:only-child::before,
.tree-view .tree li:only-child::after {
    display: none;
}

/* Remove left line for first child */
.tree-view .tree li:first-child::before {
    border: none;
}

/* Remove right line for last child */
.tree-view .tree li:last-child::after {
    border: none;
}

/* Vertical line down to children */
.tree-view .tree li > ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    border-left: 1px solid #999;
    width: 0;
    height: 20px;
}

/* Person box styling JUST for the tree */
.tree-view .tree-person-box {
    display: inline-block;
    padding: 8px 12px;
    background: #e8f0fe;
    border: 1px solid #bcd;
    border-radius: 6px;
    font-weight: bold;
    color: #003366;
    min-width: 140px;
    margin: 0 auto;
}

.error-box {
    background: #ffe0e0;
    border: 1px solid #cc0000;
    padding: 12px;
    margin: 20px auto;
    border-radius: 6px;
    color: #900;
    font-weight: bold;
    text-align: center;
    max-width: 400px;
}

.form-box {
    background: #f8faff;
    border: 1px solid #ccd5ee;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    margin: 20px auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-box input[type="text"],
.form-box input[type="password"] {
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    width: 100%;
}

.form-box button {
    padding: 10px;
    background: #003366;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

