/* The app is one fixed screen: its own areas scroll, the page never does. (On a phone, a page taller than the visible screen - the browser's
   address bar takes some - could be dragged, which pushed the header off the top and the bottom buttons up.) */
html, body {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	/* hidden still lets the browser scroll the page by itself (focusing a control near the bottom, such as a switch behind the bottom bar,
	   shifts the whole app up): clip forbids any scrolling at all */
	overflow: clip;
	overscroll-behavior: none;
}

body {
	color: #333;
	margin: 0;
	padding: 0px;
	box-sizing: border-box;
	/* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; */
	font-family: 'Outfit', 'Roboto', 'Lato', sans-serif;
}

a {
	/* color: rgb(0,100,200); */
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:visited {
	/* color: rgb(0,80,160); */
}

label {
	display: block;
}

input, button, select, textarea {
	font-family: inherit;
	font-size: inherit;
	-webkit-padding: 0.4em 0;
	padding: 0.4em;
	margin: 0 0 0.5em 0;
	box-sizing: border-box;
	border: 0px solid #ccc;
	border-radius: 2px;
}

input:disabled {
	color: #ccc;
}

button {
	color: #333;
	background-color: #f4f4f4;
	outline: none;
}

button:disabled {
	color: #999;
}

button:not(:disabled):active {
	background-color: #ddd;
}

button:focus {
	border-color: #666;
}

.container {
	padding: 0px 0px 1em 0px;
	width: 100%;
	/* height: 800px;
	max-height: 800px; */
	/* overflow-y: auto; */
	/* max-height: calc(100vh - 0px); */
	/* overflow-y: auto; */
	display: flex;
	flex-direction: column;
	height: calc(100vh - 78px);	/* 114 if there are bottom-row buttons*/
	height: calc(100dvh - 78px);	/* the visible height on a phone */
}

/* For light mode */
.container #title {
	font-size: 1.125rem; /* text-lg */
	font-weight: 600; /* font-normal */
	color: #374151; /* text-gray-700 */
	text-align: left;
}

/* For dark mode, you'll need to use a media query or a class-based approach depending on your setup */
/* @media (prefers-color-scheme: dark) {
	.container #title {
			color: #4b5563; */
			/* dark:text-slate-300 */
	/* }
} */
.dark .container #title {
	color: #cbd5e1 ; /* Adjusted to apply when .dark class is present */
}

/* div[role="alert"] is for flowbite-svelete Toast component */
div[role="alert"] {
	z-index: 100;
	background-color: #f1f5f9;
}

.dark div[role="alert"] {
	color: #cbd5e1;
	background-color: #4b5563; /*4b5563 #374151;#1F2937; */
}

main {
	text-align: center;
	padding: 0px 0px 0px 0px;
	max-width: 100%;
	margin: 0 auto;
	background-color: #f1f5f9;
	height: 100vh;
	height: 100dvh;
	/* flex: 1; */
	overflow-y: hidden;	/* this helps to remove the weird tiny vertical scrollbar that appears over the whole app! */
	overflow-y: clip;
}

.dark main {
	background-color: #374151;
	/* --tw-bg-opacity: 1;
  background-color: rgb(2 6 23 / var(--tw-bg-opacity)) */
}

.active-page-title {
	text-align: left;
}

/* --- phones and tablets --- */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; padding-top: env(safe-area-inset-top); }
/* the tree: fingers pan and pinch it, long-press must not select text or open the browser's menu */
#svg { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  /* 16px stops iOS from zooming the page when a field is focused */
  input, select, textarea { font-size: 16px !important; }
}

/* the connected view, zoomed far out: names that cannot be read anyway are left out, then only the first word of each (FamilyTree.svelte) */
#svg.zoom-far .name-label { display: none; }
#svg.zoom-mid .name-label tspan:not(:first-child) { display: none; }

/* a person's Notes (formatted text): the page's reset removes list bullets, heading sizes and link colours, so they are put back for notes only */
.note-html p { margin: 0 0 0.6em; }
.note-html h3 { font-size: 1.1em; font-weight: 700; margin: 0.6em 0 0.3em; }
.note-html h4 { font-size: 1em; font-weight: 700; margin: 0.5em 0 0.25em; }
.note-html ul { list-style: disc; padding-inline-start: 1.4em; margin: 0 0 0.6em; }
.note-html ol { list-style: decimal; padding-inline-start: 1.4em; margin: 0 0 0.6em; }
.note-html li { margin: 0.1em 0; }
.note-html blockquote { border-inline-start: 3px solid rgb(148 163 184); padding-inline-start: 0.8em; margin: 0 0 0.6em; font-style: italic; opacity: 0.9; }
.note-html a { color: #38bdf8; text-decoration: underline; }
.note-html hr { border: 0; border-top: 1px solid rgb(148 163 184); margin: 0.8em 0; }
.note-html > :last-child { margin-bottom: 0; }

.popper .note-html a { color: #075985; }

/* a long note in the information card shows its start, fading out; "Read all" opens it in full (NotesReader.svelte) */
.popper .note-clip { max-height: 9.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.notes-reader a { color: #0369a1; }
.dark .notes-reader a { color: #38bdf8; }

/* the words a search found, marked where the information card shows them (notes and details) */
.search-mark { background: #fde047; color: #111827; border-radius: 2px; padding: 0 1px; font-weight: 600; }
.search-mark-current { background: #f97316; color: #fff; outline: 2px solid #fdba74; }
