/* ============================================================
   FONTAINE FAMILY SITE — SHARED STYLES (PUBLIC PAGES)
   Used by: index.php, familylist.php, familytree.php, member.php, history.php, gallery.php, timeline.php
   Includes the shared header.php site chrome (nav bar / hamburger menu).
   ============================================================ */

:root {
    --primary: #1e3a8a;
    --secondary: #334155;
    --accent: #3b82f6;
    --rip: #dc2626;
    --bg: #f8fafc;
    --card-border: #e2e8f0;
    --spine: #cbd5e1;
}

/* ---- Base reset (shared across all public pages) ---- */
html {
    scrollbar-gutter: stable;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--secondary);
    background: var(--bg);
}

/* timeline.php uses a slightly different page background */
body.pg-timeline {
    background: #ebf0f4;
}

/* familylist.php uses a sticky-footer flex layout */
body.pg-familylist {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-footer {
    flex: 0 0 auto;
    margin: 0 !important;
}

/* ============================================================
   HEADER (header.php) — shared nav bar
   ============================================================ */

.site-header {
    width: 100%;
    background: var(--secondary, #334155);
    color: white;
    padding: 12px 0;
    margin: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
}

.header-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo img {
    display: block;
    width: auto;
    height: 65px;
    filter: brightness(0) invert(1);
    transition: height 0.2s ease;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Dropdown (Family) */
.nav-dropdown {
    position: relative;
    padding: 12px 0;
}

.dropdown-toggle {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
}

.dropdown-arrow {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    padding: 6px 0;
    background: var(--secondary, #334155);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
}

.dropdown-menu .nav-link {
    padding: 10px 18px;
}

.dropdown-menu .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    opacity: 1;
}

.nav-dropdown.open .dropdown-menu {
    display: block;
}

@media screen and (min-width: 1025px) and (hover: hover) {
    .nav-dropdown:hover .dropdown-menu {
        display: block;
    }
}

.logout-link {
    color: #fda4af;
    gap: 5px;
    margin-left: 10px;
}

.lock-link {
    color: rgba(255, 255, 255, 0.65);
    margin-left: 10px;
}

.hamburger-toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.hamburger-toggle .material-icons {
    font-size: 32px;
    line-height: 1;
}

@media screen and (max-width: 1024px) {
    .site-header {
        padding: 10px 0;
    }

    .header-container {
        padding: 0 16px;
    }

    .header-logo img {
        height: 56px;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 0;
        background: var(--secondary, #334155);
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
        box-sizing: border-box;
    }

    .nav-menu.active {
        display: flex;
    }

    .hamburger-toggle {
        display: flex;
    }

    .nav-link {
        width: 100%;
        min-height: 48px;
        padding: 12px 20px;
        box-sizing: border-box;
        justify-content: center;
        font-size: 1rem;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.08);
        opacity: 1;
    }

    .logout-link,
    .lock-link {
        margin-left: 0;
    }

    .nav-dropdown {
        width: 100%;
        padding: 0;
    }

    .dropdown-toggle {
        width: 100%;
        gap: 4px;
    }

    .dropdown-toggle:hover {
        background: rgba(255, 255, 255, 0.08);
        opacity: 1;
    }

    .dropdown-menu {
        position: static;
        transform: none;
        min-width: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.15);
    }

    .dropdown-menu .nav-link {
        padding: 12px 20px;
    }
}

@media screen and (max-width: 480px) {
    .header-container {
        padding: 0 12px;
    }

    .header-logo img {
        height: 50px;
    }

    .hamburger-toggle {
        width: 44px;
        height: 44px;
    }

    .hamburger-toggle .material-icons {
        font-size: 30px;
    }
}

/* ============================================================
   FOOTER (footer.php) — shared "last updated" bar
   (footer.php itself only has inline styles; nothing to add here)
   ============================================================ */

/* Optional footer info block (shown on the homepage) */
.footer-info {
    background: #ffffff;
    border-top: 1px solid var(--card-border);
    padding: 60px 20px;
}

.footer-info-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.footer-about {
    flex: 1 1 50%;
    margin: 0;
    line-height: 1.7;
    color: #334155;
}

.footer-links {
    flex: 1 1 50%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 40px;
}

.footer-links a {
    color: #334155;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent);
}

@media screen and (max-width: 800px) {
    .footer-info {
        padding: 40px 20px;
    }

    .footer-info-inner {
        flex-direction: column;
        gap: 30px;
    }

    .footer-links {
        width: 100%;
    }
}

/* ============================================================
   FAMILYLIST.PHP
   ============================================================ */

.pg-familylist .container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    flex: 1 0 auto;
}

.pg-familylist .header h1 {
    margin: 0;
    font-size: 2rem;
}

.pg-familylist .search-container {
    position: sticky;
    top: 10px;
    z-index: 100;
    margin-bottom: 20px;
    text-align: center;
}

.pg-familylist .search-container>div {
    max-width: 500px;
    margin: 0 auto;
}

.pg-familylist #familySearch {
    width: 100%;
    padding: 14px 45px 14px 20px;
    font-size: 1rem;
    border: 2px solid var(--card-border);
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.pg-familylist #familySearch:focus {
    border-color: var(--accent);
}

.pg-familylist .gen-section {
    background: white;
    margin-bottom: 15px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.pg-familylist .gen-header {
    background: #f1f5f9;
    color: var(--primary);
    padding: 18px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.pg-familylist .gen-header::after {
    content: '＋';
    font-size: 1.2rem;
    transition: 0.3s;
}

.pg-familylist .gen-section.open .gen-header::after {
    content: '－';
    transform: rotate(180deg);
}

.pg-familylist .gen-content {
    display: none;
    padding: 10px 25px;
}

.pg-familylist .gen-section.open .gen-content {
    display: block;
}

.pg-familylist .person-item {
    padding: 15px 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pg-familylist .person-item:hover {
    color: var(--accent);
}

.pg-familylist .person-item:last-child {
    border-bottom: none;
}

.pg-familylist .name-box {
    display: flex;
    flex-direction: column;
}

.pg-familylist .name {
    font-weight: 600;
    font-size: 1.05rem;
}

.pg-familylist .parent-info {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 3px;
}

.pg-familylist .date-box {
    text-align: right;
    font-size: 0.85rem;
    color: #94a3b8;
}

.pg-familylist .rip-tag {
    color: var(--rip);
    font-weight: bold;
    font-size: 0.7rem;
    margin-left: 6px;
}

.pg-familylist .hidden {
    display: none !important;
}

.pg-familylist .back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.pg-familylist .back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

@keyframes pulse-highlight {
    0% {
        background-color: var(--bg);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        transform: scale(1);
    }

    30% {
        background-color: var(--bg);
        transform: scale(1.02);
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        background-color: white;
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.pg-familylist .search-focus {
    animation: pulse-highlight 2s ease-out forwards;
    border: 0px solid var(--secondary) !important;
    z-index: 10;
    position: relative;
}

/* ============================================================
   FAMILYTREE.PHP
   ============================================================ */

body.pg-familytree {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f4f2f1;
}

.pg-familytree .tree-page {
    flex: 1 0 auto;
    width: 100%;
}

.pg-familytree .tree-status {
    text-align: center;
    color: #64748b;
    padding: 60px 20px;
}

/* ---- Hero ---- */
.pg-familytree .tree-hero {
    background: white;
    text-align: center;
    padding: 40px 20px 44px;
}

.pg-familytree .hero-photo {
    width: 170px;
    height: 170px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-familytree .hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-familytree .hero-photo .material-icons {
    font-size: 90px;
    color: #64748b;
}

.pg-familytree .hero-name {
    margin: 0 0 10px;
    font-family: serif;
    font-size: 3rem;
    line-height: 1.1;
    color: #0f172a;
}

.pg-familytree .hero-date {
    color: #0f172a;
    margin-bottom: 26px;
}

.pg-familytree .hero-bio {
    width: fit-content;
    max-width: min(800px, 100%);
    margin: 0 auto 26px;
    text-align: left;
    line-height: 1.8;
    color: #64748b;
}

.pg-familytree .hero-bio[hidden] {
    display: none;
}

.pg-familytree .hero-bio p {
    margin: 0 0 14px;
    white-space: pre-line;
}

.pg-familytree .view-detail {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #0f172a;
    font-weight: 600;
    text-decoration: none;
}

.pg-familytree .view-detail .material-icons {
    font-size: 16px;
}

.pg-familytree .yellow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 18px 34px;
    background: #f7d508;
    color: #0f172a;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.pg-familytree .yellow-btn:hover {
    filter: brightness(0.95);
}

.pg-familytree .yellow-btn .material-icons {
    font-size: 16px;
}

/* ---- Zoom buttons ---- */
.pg-familytree .tree-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 30px 20px 0;
}

.pg-familytree .tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 15px 22px;
    background: white;
    color: #0f172a;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pg-familytree .tool-btn.dark {
    background: #000;
    color: white;
}

.pg-familytree .tool-btn .material-icons {
    font-size: 20px;
}

/* ---- Tree area ---- */
.pg-familytree .tree-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 20px 80px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

/* the tree is moved by dragging (or swiping), so the horizontal scroll bar is hidden */
.pg-familytree .tree-viewport {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.pg-familytree .tree-viewport::-webkit-scrollbar {
    display: none;
}

.pg-familytree .tree-viewport.dragging {
    cursor: grabbing;
}

.pg-familytree .tree-canvas {
    width: max-content;
    min-width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.pg-familytree .t-column {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pg-familytree .t-node {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pg-familytree .stem {
    display: block;
    width: 2px;
    height: 18px;
    background: var(--spine);
}

/* The line below the heart matches the 48px above it, so the heart sits midway between the two cards */
.pg-familytree .heart + .stem {
    height: 48px;
}

.pg-familytree .share-btn,
.pg-familytree .heart {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0f172a;
    text-decoration: none;
}

.pg-familytree .share-btn {
    background: #c6e2f4;
    transition: transform 0.15s ease;
}

.pg-familytree .share-btn:hover {
    transform: scale(1.15);
}

.pg-familytree .heart {
    background: #f3cdc0;
}

.pg-familytree .share-btn .material-icons,
.pg-familytree .heart .material-icons {
    font-size: 15px;
}

/* ---- Person card ---- */
.pg-familytree .tree-card {
    width: 170px;
    padding: 18px 12px 20px;
    background: white;
    border-top: 3px solid #d7dde3;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease;
}

.pg-familytree .tree-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.pg-familytree .tree-card.male {
    border-top-color: #c6e2f4;
}

.pg-familytree .tree-card.female {
    border-top-color: #f3cdc0;
}

.pg-familytree .tree-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.pg-familytree .tree-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.pg-familytree .tree-photo .material-icons {
    font-size: 56px;
    color: #64748b;
}

.pg-familytree .tree-card-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.35;
    color: #0f172a;
}

.pg-familytree .tree-card-dates {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #94a3b8;
}

.pg-familytree .tree-card-rip {
    margin-top: 6px;
    color: var(--rip);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* ---- Children row with connectors ---- */
.pg-familytree .kids {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 24px 0 0;
    list-style: none;
    position: relative;
}

.pg-familytree .kids::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    height: 24px;
    border-left: 2px solid var(--spine);
}

.pg-familytree .kids li {
    position: relative;
    padding: 24px 14px 0;
}

.pg-familytree .kids li::before,
.pg-familytree .kids li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 24px;
    border-top: 2px solid var(--spine);
}

.pg-familytree .kids li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--spine);
}

.pg-familytree .kids li:only-child::before {
    display: none;
}

.pg-familytree .kids li:only-child::after {
    left: 50%;
    width: 0;
    border-top: 0 !important;
    border-left: 2px solid var(--spine) !important;
    border-radius: 0 !important;
}

.pg-familytree .kids li:first-child::before,
.pg-familytree .kids li:last-child::after {
    border: 0 none;
}

.pg-familytree .kids li:last-child::before {
    border-right: 2px solid var(--spine);
    border-radius: 0 6px 0 0;
}

.pg-familytree .kids li:first-child::after {
    border-radius: 6px 0 0 0;
}

/* Cards in a row are the same height (leaf = a child with nothing below it) */
.pg-familytree .kids li.leaf,
.pg-familytree .kids li.branch {
    display: flex;
    flex-direction: column;
}

.pg-familytree .kids li.leaf > .t-node,
.pg-familytree .kids li.branch > .kids {
    flex: 1;
}

.pg-familytree .kids li.leaf > .t-node > .tree-card {
    flex: 1;
}

/* The fork under a partner: the lines run from the centre of her card */
.pg-familytree .kids.split > li.branch:first-child::after {
    width: var(--reach, 50%);
}

/* Dashed line: leaves the right side of the partner's card, runs across, then drops to her other children */
.pg-familytree .kids.split > li.half-branch:last-child::before {
    top: calc(var(--dy, 24px) * -1);
    right: 50%;
    width: var(--dx, 50%);
    height: 0;
    border: 0 none;
    border-top: 2px dashed var(--spine);
    border-radius: 0;
}

.pg-familytree .kids.split > li.half-branch:last-child::after {
    top: calc(var(--dy, 24px) * -1);
    left: 50%;
    width: 0;
    height: calc(var(--dy, 24px) + 24px);
    border: 0 none;
    border-left: 2px dashed var(--spine);
    border-radius: 0;
}

/* Descendants: a person with partners beside them, and a button to fold their children */
.pg-familytree .couple-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pg-familytree .mini-heart {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f3cdc0;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pg-familytree .mini-heart .material-icons {
    font-size: 13px;
}

.pg-familytree .tree-card.small {
    width: 130px;
    padding: 12px 8px 14px;
}

.pg-familytree .tree-card.small .tree-photo {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.pg-familytree .tree-card.small .tree-photo .material-icons {
    font-size: 36px;
}

.pg-familytree .tree-card.small .tree-card-name {
    font-size: 0.8rem;
}

.pg-familytree .tree-card.small .tree-card-dates {
    font-size: 0.75rem;
    margin-top: 5px;
}

/* Half-siblings: their own branch with dashed lines */
.pg-familytree .kids li.half-branch::before,
.pg-familytree .kids li.half-branch::after,
.pg-familytree .kids li.half-branch li::before,
.pg-familytree .kids li.half-branch li::after {
    border-top-style: dashed;
}

.pg-familytree .kids li.half-branch::after,
.pg-familytree .kids li.half-branch li::after {
    border-left-style: dashed;
}

.pg-familytree .kids li.half-branch:last-child::before,
.pg-familytree .kids li.half-branch li:last-child::before {
    border-right-style: dashed;
}

.pg-familytree .half-branch .kids::before {
    border-left-style: dashed;
}

.pg-familytree .half-branch .stem {
    width: 0;
    background: none;
    border-left: 2px dashed var(--spine);
}

.pg-familytree .tree-card-tag {
    margin-top: 6px;
    padding: 2px 8px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

@media screen and (max-width: 800px) {
    .pg-familytree .hero-name {
        font-size: 2.2rem;
    }

    .pg-familytree .tool-btn {
        padding: 12px 14px;
    }

    .pg-familytree .tree-toolbar {
        padding: 20px 12px 0;
    }
}

/* ============================================================
   MEMBER.PHP — individual family member page
   ============================================================ */

body.pg-member {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pg-member .member-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 60px;
    flex: 1 0 auto;
}

.pg-member .back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.pg-member .back-link:hover {
    color: var(--accent);
}

.pg-member .back-link .material-icons {
    font-size: 20px;
}

.pg-member .member-layout {
    display: grid;
    grid-template-columns: minmax(240px, 380px) 1fr;
    gap: 50px;
    align-items: start;
}

.pg-member .member-photo {
    position: sticky;
    top: 20px;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-member .member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-member .member-photo .material-icons {
    font-size: 120px;
    color: #64748b;
}

.pg-member .member-name {
    margin: 0 0 6px;
    font-family: serif;
    font-size: 2.8rem;
    line-height: 1.1;
    color: #0f172a;
}

.pg-member .member-aka {
    color: #64748b;
    font-size: 1.15rem;
    margin-bottom: 18px;
}

.pg-member .meta-row {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.pg-member .meta-row .label {
    color: #64748b;
    min-width: 110px;
}

.pg-member .meta-row .value {
    color: #0f172a;
    font-weight: 500;
}

.pg-member .member-bio {
    margin: 22px 0 0;
    line-height: 1.8;
    color: #64748b;
    white-space: pre-line;
}

.pg-member .member-bio.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pg-member .show-more {
    background: none;
    border: none;
    padding: 0;
    margin-top: 6px;
    font: inherit;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.pg-member .btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.pg-member .member-bio[hidden] {
    display: none;
}

.pg-member .tree-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pg-member .tree-btn:hover {
    background: var(--primary);
}

.pg-member .tree-btn .material-icons {
    font-size: 20px;
}

.pg-member .bio-btn {
    background: white;
    color: var(--secondary);
    border: 1px solid var(--card-border);
}

.pg-member .bio-btn:hover {
    background: #f1f5f9;
}

.pg-member .member-section {
    margin-top: 40px;
    padding-top: 36px;
    border-top: 1px solid var(--card-border);
}

.pg-member .member-section h2 {
    margin: 0 0 22px;
    font-family: serif;
    font-size: 1.9rem;
    color: #0f172a;
}

.pg-member .info-row {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 9px 0;
    font-size: 0.95rem;
}

.pg-member .info-row .label {
    flex: 0 0 150px;
    color: #64748b;
}

.pg-member .info-row .value {
    color: #0f172a;
    font-weight: 500;
}

.pg-member .info-row .value.muted {
    color: #64748b;
    font-weight: 400;
}

.pg-member .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pg-member .chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px 6px 6px;
    background: white;
    border: 1px solid var(--card-border);
    border-radius: 50px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: box-shadow 0.2s ease, color 0.2s ease;
}

.pg-member a.chip:hover {
    color: #0f172a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pg-member .chip.no-avatar {
    padding: 12px 18px;
}

.pg-member .chip-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
}

.pg-member .chip-avatar .photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-member .chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-member .chip-avatar .photo .material-icons {
    font-size: 24px;
    color: #64748b;
}

.pg-member .gender-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.85rem;
    line-height: 1;
}

.pg-member .gender-badge.male {
    background: #dbeafe;
    color: #1d4ed8;
}

.pg-member .gender-badge.female {
    background: #fce7f3;
    color: #be185d;
}

.pg-member .chip-avatar .gender-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    border: 2px solid white;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
}

.pg-member .member-status {
    text-align: center;
    padding: 80px 20px;
    color: #64748b;
}

@media screen and (max-width: 800px) {
    .pg-member .member-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .pg-member .member-photo {
        position: static;
        max-width: 320px;
        margin: 0 auto;
    }

    .pg-member .member-name {
        font-size: 2.1rem;
    }

    .pg-member .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .pg-member .info-row .label {
        flex: none;
    }
}

/* ============================================================
   HISTORY.PHP
   ============================================================ */

.pg-history .gallery-container {
    max-width: 1200px;
    margin: 40px auto 100px;
    padding: 0 20px;
    box-sizing: border-box;
}

.pg-history .history-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('../img/history-bg.jpg') center/cover no-repeat;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
}

.pg-history .history-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    margin: 0;
}

.pg-history .story-container {
    max-width: 800px;
    margin: -60px auto 100px;
    background: white;
    padding: 80px 100px;
    box-sizing: border-box;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 10;
}

.pg-history .story-content {
    font-family: 'serif';
    font-size: 1.25rem;
    color: #334155;
}

.pg-history .story-content p:first-of-type::first-letter {
    float: left;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1;
    padding-right: 15px;
    color: var(--primary);
    font-weight: 700;
}

.pg-history h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary);
    margin-top: 50px;
    border-bottom: 2px solid var(--sepia);
    padding-bottom: 10px;
}

.pg-history .history-img {
    margin: 40px -150px;
    text-align: center;
}

.pg-history .history-img img {
    width: 100%;
    max-width: 1100px;
    border: 10px solid white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    filter: sepia(20%);
}

.pg-history .caption {
    font-style: italic;
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
}

.pg-history .fact-box {
    background: var(--sepia);
    padding: 30px;
    border-left: 5px solid var(--primary);
    margin: 40px 0;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

@media (max-width: 1100px) {
    .pg-history .story-container {
        padding: 40px;
        margin: 20px auto;
        width: 90%;
    }

    .pg-history .history-img {
        margin: 30px 0;
    }

    .pg-history .history-hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .pg-history .story-container {
        padding: 24px;
    }

    .pg-history .story-content {
        font-size: 1.1rem;
        overflow-wrap: break-word;
    }
}

/* ============================================================
   GALLERY.PHP
   ============================================================ */

.pg-gallery .gallery-container {
    max-width: 1200px;
    margin: 60px auto 100px;
    padding: 0 20px;
    box-sizing: border-box;
}

.pg-gallery .gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.pg-gallery .gallery-header h1 {
    font-family: serif;
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.pg-gallery .photo-grid {
    column-count: 4;
    column-gap: 20px;
}

.pg-gallery .photo-item {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 1px solid var(--card-border);
}

.pg-gallery .photo-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.pg-gallery .photo-item img {
    width: 100%;
    display: block;
}

.pg-gallery .photo-info {
    padding: 15px;
    text-align: center;
}

.pg-gallery .photo-name {
    font-weight: 700;
    font-size: 0.95rem;
    display: block;
    color: var(--primary);
}

.pg-gallery .photo-meta {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
}

.pg-gallery .photo-caption {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #475569;
    margin-top: 6px;
}

.pg-gallery .lightbox {
    flex-direction: column;
    gap: 14px;
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.pg-gallery .lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border: 5px solid white;
    border-radius: 4px;
}

.pg-gallery .lightbox-caption {
    max-width: min(90%, 800px);
    color: white;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

.pg-gallery .lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

@media (max-width: 900px) {
    .pg-gallery .photo-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .pg-gallery .photo-grid {
        column-count: 1;
    }
}

.pg-gallery .gallery-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('../img/gallery-bg.jpg') center/cover no-repeat;
    height: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    width: 100%;
}

.pg-gallery .gallery-hero h1 {
    font-family: serif;
    font-size: 4rem;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.pg-gallery .gallery-hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8) !important;
    max-width: 700px;
    margin: 10px auto 0 !important;
    font-weight: 400;
}

.pg-gallery header {
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .pg-gallery .gallery-hero {
        height: 250px;
    }

    .pg-gallery .gallery-hero h1 {
        font-size: 2.5rem;
    }
}

/* ============================================================
   INDEX.PHP (HOME)
   ============================================================ */

.pg-home .hero {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)),
        url('../img/hero-bg.jpg') center/cover no-repeat;
    color: white;
    padding: 100px 20px;
    text-align: center;
}

.pg-home .hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -1px;
}

.pg-home .hero-search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 30px auto 0;
}

.pg-home #heroSearch {
    width: 100%;
    box-sizing: border-box;
    padding: 20px 25px;
    border-radius: 50px;
    border: none;
    font-size: 1.2rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    outline: none;
}

.pg-home .nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: -40px auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.pg-home .nav-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--secondary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--card-border);
}

.pg-home .nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.pg-home .nav-card .material-icons {
    font-size: 40px;
    color: #2F65B9;
    margin-bottom: 10px;
}

.pg-home .nav-card h3 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pg-home .section-title-container {
    max-width: 1100px;
    margin: 60px auto 20px;
    padding: 0 20px 0 25px;
}

.pg-home .anniversary-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.pg-home .ani-card {
    background: white;
    width: 220px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    text-align: center;
    padding-bottom: 20px;
    transition: transform 0.3s;
}

.pg-home .ani-card:hover {
    transform: translateY(-5px);
}

.pg-home .ani-img-wrapper {
    width: 100%;
    height: 220px;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

.pg-home .ani-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: 0.5s;
}

.pg-home .ani-card:hover img {
    filter: grayscale(0%);
}

.pg-home .cal-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: white;
    width: 50px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    overflow: hidden;
    text-align: center;
}

.pg-home .cal-month {
    background: #2F65B9;
    color: white;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 3px 0;
    text-transform: uppercase;
}

.pg-home .cal-day {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    padding: 5px 0;
}

.pg-home .ani-name {
    display: block;
    font-family: serif;
    font-weight: 900;
    font-size: 1.1rem;
    margin-top: 15px;
    color: #1e293b;
}

.pg-home .ani-years {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 5px;
}

/* ============================================================
   TIMELINE.PHP
   ============================================================ */

.pg-timeline .controls-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.pg-timeline .search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.pg-timeline #timelineSearch {
    width: 100%;
    padding: 14px 45px 14px 20px;
    border-radius: 50px;
    border: 2px solid var(--spine);
    font-size: 1rem;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.pg-timeline #timelineSearch:focus {
    border-color: var(--accent);
}

.pg-timeline .filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.pg-timeline .filter-btn {
    background: white;
    color: var(--secondary);
    border: 2px solid var(--spine);
    padding: 10px 22px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.70rem;
    transition: 0.3s;
    text-transform: uppercase;
}

.pg-timeline .filter-btn.active {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.pg-timeline .timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 40px auto;
    min-height: 200px;
    padding: 20px;
    box-sizing: border-box;
}

.pg-timeline .timeline-container::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--spine);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
    z-index: 1;
}

.pg-timeline .event {
    position: relative;
    width: 100%;
    margin-bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.pg-timeline .event::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: var(--secondary);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.pg-timeline .right {
    flex-direction: row;
}

.pg-timeline .left {
    flex-direction: row-reverse;
}

.pg-timeline .content {
    width: 38%;
    height: 70px;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 100px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 5;
    transition: transform 0.3s ease;
}

.pg-timeline .content {
    cursor: pointer;
}

.pg-timeline .content:hover {
    transform: scale(1.02);
}

.pg-timeline .right .content {
    flex-direction: row;
    padding: 0 20px 0 0;
}

.pg-timeline .left .content {
    flex-direction: row-reverse;
    padding: 0 0 0 20px;
    text-align: right;
}

.pg-timeline .person-img {
    width: 85px;
    height: 85px;
    background: #d1d5db;
    border-radius: 50%;
    border: 4px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    z-index: 6;
    overflow: hidden;
    margin-left: -15px;
    margin-right: -15px;
}

.pg-timeline .person-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-timeline .text-group {
    flex-grow: 1;
    padding: 0 25px;
    overflow: hidden;
}

.pg-timeline .event-text {
    font-size: 1rem;
    color: #111;
    font-weight: 500;
}

.pg-timeline .event-text b {
    font-weight: 700;
    color: var(--primary);
}

.pg-timeline .event-text span {
    font-style: italic;
    color: #64748b;
    font-size: 0.85rem;
    display: block;
}

.pg-timeline .connector {
    width: 12%;
    height: 2px;
    background: var(--spine);
}

.pg-timeline .date-pill {
    width: 38%;
    display: flex;
}

.pg-timeline .right .date-pill {
    justify-content: flex-end;
}

.pg-timeline .left .date-pill {
    justify-content: flex-start;
}

.pg-timeline .date-label {
    background: var(--secondary);
    padding: 6px 18px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.pg-timeline .back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 999;
}

.pg-timeline .back-to-top.show {
    opacity: 1;
    pointer-events: auto;
}

.pg-timeline .event-text .mobile-date {
    display: none;
}

@media screen and (max-width: 750px) {
    .pg-timeline .timeline-container::after {
        left: 25px;
    }

    .pg-timeline .event {
        flex-direction: column !important;
        align-items: flex-start;
        padding-left: 60px;
        margin-bottom: 50px;
        box-sizing: border-box;
    }

    .pg-timeline .event::after {
        left: 25px;
    }

    .pg-timeline .content {
        width: 100% !important;
        flex-direction: row !important;
        height: auto;
        padding: 0 2px 0 0 !important;
        border-radius: 20px;
        text-align: left !important;
    }

    .pg-timeline .person-img {
        width: 65px;
        height: 65px;
    }

    .pg-timeline .date-pill,
    .pg-timeline .connector {
        display: none;
    }

    .pg-timeline .mobile-date {
        display: inline !important;
        font-style: normal;
        font-weight: 600;
        color: var(--secondary);
    }

    .pg-timeline .mobile-date::before {
        content: "· ";
        font-weight: 400;
    }
}