/* index.html mit Baum */
/***********************/

html, body {
  margin: 0;
  height: 100%;
  touch-action: pan-x pan-y;
}

body {
  --main-size: 3fr;
  --sidebar-size: 1fr;
  --resizer-size: 10px;

  display: grid;
  font-family: sans-serif;
  overflow: hidden;
}


/* auch der Body darf während Resize nicht scrollen */
body.resizing {
    overscroll-behavior: contain;
}

/* =====================
   Querformat (Sidebar rechts)
   ===================== */
body.layout-horizontal {
    grid-template-columns: var(--main-size) var(--resizer-size) var(--sidebar-size);
    grid-template-rows: 1fr;
}

body.layout-horizontal .resizer {
    cursor: col-resize;
}

/* =====================
   Hochkant (Sidebar unten)
   ===================== */
body.layout-vertical {
    grid-template-columns: 1fr;
    grid-template-rows: var(--main-size) var(--resizer-size) var(--sidebar-size);
}

body.layout-vertical .resizer {
    cursor: row-resize;
}

svg {
  width: 100%;
  height: 100%;
  background: #f0f0f0;
}

rect.active {
stroke: red;
stroke-width: 8;
}

.viewport,
.viewport svg {
  touch-action: none;
}

aside {
  border-left: 1px solid #ccc;
  overflow: hidden;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Resize-Handle */
.resizer {
  cursor: col-resize;
  background: #ddd;
  touch-action: none;
  user-select: none;
}

.resizer:hover {
  background: #bbb;
}

/* Baum */
/********/

#unten {
  margin-top: auto;  /* Schiebt dieses Div ganz nach unten */
  background: #eee;
  padding: 8px;
}

@font-face {
  font-family: "Bricolage-Grotesque";
  src: url("fonts/BricolageGrotesque-VariableFont_opsz\,wdth\,wght.ttf")
    format("truetype");
  font-weight: 125 950;
  font-stretch: 75% 125%;
  font-style: normal;
}

@font-face {
  font-family: "Plus-Jakarta-Sans";
  src: url("fonts/PlusJakartaSans-VariableFont_wght.ttf")
    format("truetype");
  font-weight: 125 950;
  font-style: normal;
}

.geneanny {
  font-family: "Plus-Jakarta-Sans", sans-serif;
}

  /* Container mit festen Abmessungen und Scrollbalken */
.viewport {
  width: 100%;
  height: 100%;
  border: 1px solid #ccc;
  overflow: auto; /* erzeugt Scrollbalken wenn Inhalt größer ist */
  /*margin: 24px auto;*/
  position: relative;
  background: #fafafa;
  cursor: grab; /* Hinweis: ziehen möglich */
  user-select: none; /* verhindert Textauswahl beim Ziehen */
}
.viewport.dragging { cursor: grabbing; }
.content {
  width: 1200px; /* Basisgröße (wird mit scale multipliziert) */
  height: 800px;
  box-sizing: border-box;
}
/*
#tree-container {
  flex: 1;
  position: relative;
  overflow: scroll;
  background: #fff;
  width: 100%;
  height: 100%;
  overflow-y: scroll;
}*/
.person-box {
  padding: 6px 10px;
  border-radius: 4px;
  background: #ffffff;
  text-align: center;
  font-size: medium;
  width: calc(100% - 24px);
  height: calc(100% - 16px);
  cursor: pointer;
}
.person-box img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
}
.male {
  border: 2px solid blue;
  background-color:aliceblue;
}
.female {
  border: 2px solid hotpink;
  background-color:lavenderblush;
}
.unknown {
  border: 2px solid #333;  /* Default für unbekanntes Geschlecht */
  background-color: #fffbe6;  /* Default für unbekanntes Geschlecht */
}
.marriage-box{
  /*border: 1px solid #2d7a2d;*/
  padding: 3px 5px;
  /*background: #ffffff;*/
  text-align: center;
  font-size: small;
  width: calc(100% - 10px);
  height: calc(100% - 6px)
}
.svg {
  width: 100%;
  height: 100%;
  display: block;
}

.line-regular {
  stroke: black;
}

.line-direct {
  stroke: green;
  stroke-width: 4;
}

/* Randseiten */
/**************/

.personen {
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
}

.person {
  width: 300px;
  padding: 20px;

  /* Rahmen */
  border: 2px solid #333;  /* Default für unbekanntes Geschlecht */

  /* Hintergrund */
  background-color: #fffbe6;  /* Default für unbekanntes Geschlecht */

  /* Optional für Karten-Optik */
  border-radius: 8px;
  box-shadow: 2px 2px 8px rgba(0,0,0,0.2);

  font-family: Arial, sans-serif;
}

.person h3 {
	margin-top: 0;
}

.männlich {
	border: 2px solid blue;
	background-color: aliceblue;
}

.weiblich {
	border: 2px solid hotpink;
	background-color: lavenderblush;
}

.unbekannt {
  border: 2px solid #333;  /* Default für unbekanntes Geschlecht */
  background-color: #fffbe6;  /* Default für unbekanntes Geschlecht */
}


/* Navigation */

/* Screenreader-only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Navigation Style */
.nav-icons {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 1rem;
}

/* Icon Backgrounds */
.nav-icons a {
    display: inline-block;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
	opacity: 0.6;
}

/* Icons */
.icon-home {
    background-image: url('../icons/icon_home.svg');
}

.icon-tree {
    background-image: url('../icons/icon_stammbaum.svg');
}

/* Optional: Hover Effekt */
.nav-icons a:hover {
    opacity: 1;
}
