@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Lato:wght@400;700&display=swap');

:root {
    --demers-green: #4d6a5b;
    --demers-green-dark: #33473d;
    --demers-gold: #b08a4e;
    --demers-cream: #faf6ee;
    --demers-brown: #5c4a36;
}

html, body {
    font-family: 'Lato', sans-serif;
    background-color: var(--demers-cream);
    color: var(--demers-brown);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--demers-green-dark);
}

a {
    color: var(--demers-green);
}

.family-navbar {
    background-color: var(--demers-green-dark);
}

.family-navbar .navbar-brand {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--demers-cream) !important;
}

.family-navbar .nav-link {
    color: rgba(250, 246, 238, 0.85) !important;
}

.family-navbar .nav-link.active,
.family-navbar .nav-link:hover {
    color: #ffffff !important;
}

.hero {
    background: linear-gradient(180deg, rgba(77,106,91,0.08), transparent);
    border-radius: 0.5rem;
}

.card {
    border: 1px solid rgba(77,106,91,0.15);
}

.gallery-tabs .nav-link {
    color: var(--demers-brown);
    border: 1px solid transparent;
}

.gallery-tabs .nav-link.active {
    background-color: var(--demers-green);
    color: #fff;
}

/* Media cards */
.media-card-media {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
    cursor: pointer;
}

.media-card-media img,
.media-card-media video {
    object-fit: contain;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.lightbox-media {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 0.25rem;
}

.lightbox-close {
    margin-top: 0.75rem;
}

/* Person chip */
.person-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
    border-radius: 2rem;
    background: #fff;
    border: 1px solid rgba(77,106,91,0.2);
    color: var(--demers-brown);
}

.person-chip:hover {
    border-color: var(--demers-green);
}

.person-chip-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.person-chip-name {
    font-size: 0.95rem;
    line-height: 1.1;
}

.person-portrait {
    max-width: 280px;
}

/* Family tree — break out of the centered container so it can use the full window
   width, and act as a fixed-size 2D "canvas" viewport: the tree itself is never
   wrapped or shrunk (see grid-auto-columns below), and this box just scrolls/pans
   in whichever direction is needed to reveal the rest of it. */
.family-tree {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 70vh;
    min-height: 420px;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 2rem 1.5rem;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-rows: auto auto;
    align-content: start;
    justify-items: center;
}

.family-tree.dragging {
    cursor: grabbing;
}

.family-tree.dragging * {
    pointer-events: none;
}

/* Renders no box of its own: its couple/children divs become direct grid
   items of whichever grid contains it (.family-tree or a parent .tree-children).
   That lets every sibling's "couple" row share one grid row-track (and every
   sibling's "children" row share the next), so connector lines land at the
   same height even when one sibling has no spouse to display. */
.tree-branch {
    display: contents;
}

.tree-couple {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 0.5rem;
    border: 1px dashed rgba(77,106,91,0.3);
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.6);
    margin: 1rem 0.75rem;
}

.tree-and {
    color: var(--demers-gold);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
}

.tree-children {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-rows: auto auto;
    justify-items: center;
    column-gap: 1.5rem;
    margin-top: 1rem;
    border-top: 2px solid rgba(77,106,91,0.3);
    padding-top: 1rem;
}
