/* YUI 3.18.1 (build f7e7bcb) Copyright 2014 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:text-top}sub{vertical-align:text-bottom}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;font-size:100%}legend{color:#000}#yui3-css-stamp.cssreset{display:none}

/* Fonts ========================================== */

@font-face{
	font-family: Batch;
	src: url('../fonts/batch-icons-webfont.eot');
	src: url('../fonts/batch-icons-webfont.eot?#iefix') format('embedded-opentype'),
		 url('../fonts/batch-icons-webfont.woff') format('woff'),
		 url('../fonts/batch-icons-webfont.ttf') format('truetype'),
		 url('../fonts/batch-icons-webfont.svg#batchregular') format('svg');
	font-weight: normal;
	font-style: normal;
}
.batch {
	font-family: 'Batch';
	font-size: 18px;
	display: inline-block;
	font-style: normal;
}
.batch::before {
	content:attr(data-icon);
}


/* Basics ========================================= */

html { box-sizing:border-box; } /*  thanks again Paul:https://www.paulirish.com/2012/box-sizing-border-box-ftw/ */
*, *::before, *::after { box-sizing:inherit; }

html {
	font-size: 20px; /* goddamn setting base size is controversial - https://css-tricks.com/rem-global-em-local/ */
	line-height: 1.8;
	font-weight: 400;
	color: #333;
	padding: 0;
	/* https://www.smashingmagazine.com/2015/11/using-system-ui-fonts-practical-guide/ */
	font-family: -apple-system, BlinkMacSystemFont, "Droid Sans Mono",
		"Segoe UI", "Droid Sans", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
		"Helvetica Neue", sans-serif;
}


/* Basics ========================================= */

body {
	margin: 0;
	/* padding: 0.5rem 1.2rem; */
	/* padding: 2.5rem 2rem 1rem 2rem; */
	padding: 2.5rem 2rem;
	background-color: #ddd;

	display: flex;
	flex-direction: column;
	min-height: 100vh;
	align-items: center;

	letter-spacing: 0.05em;
}

a { color: inherit; text-decoration: none; }
a:hover { color: #7af; }
a:hover, input:hover, input:focus { outline: none; }

input {
	-webkit-appearance: none;
	-moz-appearance: none;
	padding: 0 0.2rem;
	margin: 0;
	background-color: transparent;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	border: none;
	text-overflow: ellipsis;
	min-width: 1rem;
}
input[type=radio] {
	display: none;
}
input[type=number],
input[type=text] {
	flex-grow: 1;
	border: 2px solid;
	height: 2.5rem;
	padding: 0 0.4rem 0 0.6rem;
	line-height: 2.3rem;
}
input[type=number] {
}
input[type=text] {
	width: 100%;
	padding-right: 1.6rem;
}


/* Shared ========================================= */

main,
#lifelines, .line, .diff, .cont, .diff span,
#timelines, #diffline, #diffline div, #diffline div span {
	background-color: inherit;
}
.batch,
.line .bar .age {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* #p1::before, #tline1 .bar, #line1 .bar { background-color: #364c5d; } */
/* #p2::before, #tline2 .bar, #line2 .bar { background-color: #6d354c; } */
/* #p1, #tline1, #line1 { color: #345; }
#p2, #tline2, #line2 { color: #634; }
#p1::before, #tline1 .bar, #line1 .bar { background-color: #345; }
#p2::before, #tline2 .bar, #line2 .bar { background-color: #634; } */
/* #p1, #tline1, #line1 { color: #18f; }
#p2, #tline2, #line2 { color: #3c7; }
#p1::before, #tline1 .bar, #line1 .bar { background-color: #18f; }
#p2::before, #tline2 .bar, #line2 .bar { background-color: #3c7; } */
/* #p1, #tline1, #line1 { color: #9c27b0; }
#p2, #tline2, #line2 { color: #3f51b5; }
#p1::before, #tline1 .bar, #line1 .bar { background-color: #9c27b0; }
#p2::before, #tline2 .bar, #line2 .bar { background-color: #3f51b5; } */
#p1, #tline1, #line1 { color: #7d1f41; }
/* #p2, #tline2, #line2 { color: #444194; } */
#p1::before, #tline1 .bar, #line1 .bar { background-color: #7d1f41; }
/* #p2::before, #tline2 .bar, #line2 .bar { background-color: #444194; } */



/* Structure ====================================== */

header, main, footer {
	max-width: 40rem;
	width: 100%;
}

header {
	margin: 1.8rem 0 0 0;
}

main {
	flex-grow: 1;
	/* padding: 2.5rem 0 0 0; */
}

footer {
	/* opacity: 0.5; */
	color: #999;
	padding: 2rem 0 0 0;
	font-size: 0.7rem;
	letter-spacing: 0.03em;
	line-height: 1.4;
}

#people {
	position: relative;
	/* padding: 2rem 0 0 0; */
}

.person {
	padding: 0;
	margin: 0 0 1rem -3px;
	position: relative;
	height: 2.5rem;
}

#lifelines {
	padding: 2rem 0;
}

#timelines {
	/* padding: 4rem 0 2rem 0; */
	padding: 2rem 0 1rem 0;
	margin: 0 1px; /* 1px left + right due to bar::before + bar::after offset */
}


/* Indicator below #people ======================== */

/* #people::before,
#people::after {
	content: '';
	display: block;
	position: absolute;
} */

/* Simple downward arrow */
/* #people::before {
	bottom: 0;
	width: 0;
	height: 0.75rem;
	border: 1px solid;
	border-top: none;
	left: 50%;
	margin-left: -1px;
}
#people::after {
	top: 100%;
	left: 50%;
	border: 0.5rem solid;
	border-bottom: none;
	border-left-color: transparent;
	border-right-color: transparent;
	border-left-width:  0.3rem;
	border-right-width: 0.3rem;
	margin-left:	   -0.3rem;
} */


/* Person > Mode toggles ========================= */

.person label {
	border: 2px solid transparent;
	display: inline-block;
	margin: 0;
	position: absolute;
	width: 2rem;
	height: 2rem;
	cursor: pointer;
	top: 0.25rem;
	left: 0.25rem;
	text-align: center;
	line-height: 1.8rem;
	border-radius: 1rem;
	padding-left: 0.075rem;

	color: #ddd;
	border-color: transparent;
}
.person label ~ label {
	left: 2.25rem;
}
.person input:checked + label {
	/* border-color: #333;
	background: #ddd;
	color: #333; */
	border-color: inherit;
	background: #ddd;
	color: inherit;
}
.person::before {
	content: '';
	display: block;
	position: absolute;
	width: 4.5rem;
	height: 2.5rem;
	border-radius: 2rem;
	background-color: #333;
}


/* Person > Tabs ================================= */

.tab {
	margin-left: 5rem;
	height: 100%;
	line-height: 2.5;
}
.tab.dates  { display: flex; }
.tab.search { display: block; }

.person[data-mode=dates] .tab.search,
.person[data-mode=search] .tab.dates { display: none; }


/* Tabs > Date Inputs ============================ */

.person.focus input,
.tab input:focus { background-color: #fff; }

.separator { padding: 0 0.3rem; }

.now {
	
	/* border: 2px solid;
	height: 100%;
	padding: 0 0.6rem;
	line-height: 2.2rem;
	margin-left: -2px;

	position: relative;
	overflow: hidden; */
	
	display: none;
}
/* .now::after {
	content: '';
	display: block;
	position: absolute;
	top: 50%;
	left: -25%;
	width: 150%;
	height: 0;
	border: 1px solid;
}
.now::after { transform: rotate(-45deg); }

.now:hover {
	color: inherit;
}
.now:hover::before,
.now:hover::after {
	display: none;
} */


/* Name Search > States ========================== */

.state {
	display: block;
	position: absolute;
	top: 1rem;
	right: 0.6rem;
	width: 0;
	height: 0;
	text-align: center;
	letter-spacing: 0;
	text-indent: 0.02rem;
	pointer-events: none;
	font-size: 0.75rem;
	line-height: 0.999rem;
}
.person[data-state='searching'] .state {
	top: 0.85rem;
    right: 0.7rem;
    width: 0.75rem;
    height: 0.75rem;
	border: 2px solid;
	border-radius: 50%;
	border-top-color: transparent;
}
.person[data-state='listed'] .state {
	right: 0.8rem;
/* 	border: 0.3rem solid transparent;
	border-bottom: none;
	border-top: 0.5rem solid #333;
 */	border: 0.3rem solid;
	border-bottom: none;
	border-top: 0.5rem solid;
	border-left-color: transparent;
	border-right-color: transparent;
}
.person[data-state='apierror'] .state,
.person[data-state='notfound'] .state {
	color: #eee;
	border-radius: 50%;
	top: 0.75rem;
	width: 1rem;
	height: 1rem;
}
.person[data-state='notfound'] .state {
	background-color: #333;
}
.person[data-state='notfound'] .state::after {
	content: '?';
}
.person[data-state='apierror'] .state::before {
	content: '';
	display: block;
	border: 0.6rem solid transparent;
	border-top: none;
	border-bottom-color: #333;
	border-bottom-width: 1.1rem;
	position: absolute;
	z-index: 1;
	top: -0.1rem;
	left: -0.1rem;
}
.person[data-state='apierror'] .state::after {
	content: '!';
	z-index: 2;
	position: relative;
	line-height: 1.5;
}


/* Name Search > Name Lists ====================== */

.list {
	background-color: #fff;
	display: block;
	position: relative;
	z-index: 10;
	border: 2px solid;
	margin: -2px 0 0 0;
	line-height: 1.8rem;
	max-width: 90%; /* 30rem */
	column-count: 2;
	display: none;
}
.person.focus .list {
	display: block;
	padding: 0.3rem 0;
}
.person[data-state=listed] {

}


/* Name Lists > Contents ========================= */

.list span {
	display: block;
	overflow: hidden;
}
.list a,
.list .msg {
	display: inline-block;
	float: left;
	padding: 0 0.4rem 0 0.6rem;
}
.list a {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: calc(100% - 1.4rem);
}
.list .msg {
	opacity: 0.5;
}

.outlink {
	display: block;
	width: 1rem;
	height: 1rem;
	opacity: 0.2;
	padding: 0;
	position: relative;
	margin: 0.4rem 0 0 0;
}
.outlink:hover {
	opacity: 1;
}
.outlink::before {
	content: '';
	position: absolute;
	top: 4px;
	right: 4px;
	border: 2px solid;
	border-left: none;
	border-bottom: none;
	width: 0.5rem;
	height: 0.5rem;
}
.outlink::after {
	content: '';
	display: block;
	width: 15px;
	border: 1px solid;
	position: absolute;
	top: 4px;
	right: 5px;
	transform: rotate(-45deg);
	transform-origin: 100% 1px;
}



/* Lines (Timelines & Lifelines) ================= */

.line {
	display: flex;
	position: relative;
	z-index: 3;
}
#lifelines .line {
	overflow: hidden;
	margin: 4px 0 0 0;
}


/* Lines > Bar =================================== */

.line .bar {
	position: relative;
	width: 100%;
	height: 1.8rem;
	background-color: #333;
}

/* * > Bar > * =================================== */

.age {
	color: #ddd;
	position: absolute;
	top: 0;
	right: 0;
	padding: 0 0.4rem;
}


/* Timelines > Bar > * =========================== */

.years {
	display: flex;
	position: absolute;
	width: 100%;
}
#tline1 .years { bottom: 100%; }
#tline2 .years { top: 100%; }
.years .born {
	flex-grow: 1;
}

.line.short .born::after { /* year display on short bars (<15% in JS) */
	content: '–';
	padding: 0 0.2rem;
}
.line.shortright .years { /* year display on far right-side bars (offset >85% in JS) */
	justify-content: flex-end;
}


/* Timelines > Bar Edges ========================= */

#tline1 .bar::before,
#tline1 .bar::after,
#tline2 .bar::before,
#tline2 .bar::after {
	content: '';
	display: block;
	position: absolute;
	border: 1px solid;
	height: 3.2rem;
}
#tline1 .bar::after,
#tline1 .bar::before { top: 0; }
#tline2 .bar::after,
#tline2 .bar::before { bottom: 0; }
#tline1 .bar::before { left: -1px; }
#tline1 .bar::after { right: -1px; }
#tline2 .bar::before { left: -1px; }
#tline2 .bar::after { right: -1px; }


/* Diff Lines (Timelines & Lifelines) ============ */

.diff {
	display: block;
	position: relative;
	overflow: hidden;
	width: 0;
	height: 1.8rem;
	text-align: center;
}
.diff span {
	position: relative;
	padding: 0 0.2rem;
}
.diff::after {
	border-left: 2px solid;
	width: 0;
	height: 50%;
	top: 25%;
	right: 0;
}


/* Lifelines > Bar > Diff Line =================== */

.line .diff {
	flex: 1;
}
.line .diff::after,
.line .diff::before {
	content: '';
	display: block;
	position: absolute;
}
.line .diff::before {
	border: 1px solid;
	width: 100%;
	height: 0;
	top: 50%;
	left: 0;
	margin-top: -1px;
}


/* Timelines > Diff Line ========================= */

#diffline {
	position: relative;
	display: flex;
	flex-direction: row;
	overflow: hidden;
}
#diffline .diff:last-child {
	flex-grow: 1;
}
#diffline .diff .cont::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 0;
	top: 50%;
	left: 0;
	border: 1px solid;
}


/* STATES: init ================================== */

body.init .years,
body.init .age,
body.init .diff .cont {
	display: none;
}
body.init .bar {
	width: 100% !important;
}
body.init .offset,
body.init .diff {
	width: 0 !important;
}


/* STATES: Timelines > Diff ====================== */

#diffline.separate #diff1 .cont,
#diffline.separate #diff3 .cont,
#diffline.contains #diff2 .cont,
#diffline.touching .diff .cont,
#diffline.matching .diff .cont,
#diffline.bornsame #diff1 .cont,
#diffline.bornsame #diff2 .cont,
#diffline.diedsame #diff2 .cont,
#diffline.diedsame #diff3 .cont {
	display: none;
}


/* Input Placeholders ============================ */

/* Placeholder - light grey */
/* input.empty::-webkit-datetime-edit { color: rgba(0,0,0,0.4); } */
/* input.empty { color: rgba(0,0,0,0.2); } */
/* ::-webkit-input-placeholder { color: rgba(0,0,0,0.4); } */
/* ::-moz-placeholder {		  color: rgba(0,0,0,0.4); opacity: 1; font: inherit; } */
/* :-ms-input-placeholder {	  color: rgba(0,0,0,0.4); } */
/* :-moz-placeholder {			  color: rgba(0,0,0,0.4); } */
input.empty::-webkit-datetime-edit { color: inherit; opacity: 0.4; }
input.empty { color: inherit; opacity: 0.4; }
::-webkit-input-placeholder { color: inherit; opacity: 0.4; }
::-moz-placeholder {		  color: inherit; opacity: 0.4; font: inherit; }
:-ms-input-placeholder {	  color: inherit; opacity: 0.4; }
:-moz-placeholder {			  color: inherit; opacity: 0.4; }
/* Placeholder FOCUS - clear */
:focus::-webkit-input-placeholder { color: transparent; }
:focus::-moz-placeholder {			color: transparent; }
:focus:-ms-input-placeholder {		color: transparent; }
:focus:-moz-placeholder {			color: transparent; }


/* Footer > * ==================================== */

footer p,
footer ul {
	/* margin: 0.75rem 0; */
	margin: 0;
}
/* footer p.inline,
footer ul.inline {
	display: inline-block;
} */
footer a {
	text-decoration: underline;
}
footer a:hover {
	color: #333;
}
footer ul {
	counter-reset: notenum;
}
footer li {
	display: inline;
	counter-increment: notenum;
	max-width: 26rem;
}
footer li::before {
	content: counter(notenum) '. ';
}
footer li.nonum {
	counter-increment: none;
	display: block;
	padding-right: 0.3rem;
}
footer li.nonum::before,
footer li.nonum a::after {
	content: '';
}
footer li.nonum a::after {
	display: inline-block;
	width: 0; height: 0;
	margin: 0 0 0 0.2rem;
	border: 0.2rem solid;
	border-width: 0.4rem 0.2rem 0 0.2rem;
	border-left-color: transparent;
	border-right-color: transparent;
	transform: rotate(-90deg);
}
footer ul#notes.show li.nonum a::after { transform: rotate(0deg); }
footer ul#notes li { display: none; }
footer ul#notes li.nonum { display: block; }
footer ul#notes.show li.nonum { color: #333; }
/* footer ul#notes.show li { display: initial; } */
footer ul#notes.show li { display: block; }
footer ul#notes.show li b { color: #333; font-weight: normal; }
footer ul#notes.show li::before { color: #333; }

/* Animations ==================================== */


.anim1 {
	-webkit-transition: all 100ms;
	   -moz-transition: all 100ms;
		-ms-transition: all 100ms;
		 -o-transition: all 100ms;
			transition: all 100ms;
}

.calculating::after,
.person[data-state='searching'] .state,
.spin {
	-webkit-animation:	spin 500ms infinite linear;
	-moz-animation:		spin 500ms infinite linear;
	animation:			spin 500ms infinite linear;
}
@-moz-keyframes spin { from {-moz-transform:rotate(0deg);} to {-moz-transform:rotate(360deg);} }
@-webkit-keyframes spin { from {-webkit-transform:rotate(0deg);} to {-webkit-transform:rotate(360deg);} }
@keyframes spin { from {transform:rotate(0deg);} to {transform:rotate(360deg);} }


/* Media Queries ================================= */

@media screen and (max-width:40rem),
	   screen and (max-height:30rem) {
	body {
		padding: 0 1rem;
	}
   	/* TODO: improve mobile layout and UX */
	header {
		margin: 0.5rem 0 0 0;
	}
	#people {
		padding: 1rem 0;
	}
	.person {
		margin: 0 0 0.5rem -3px;
	}
	#timelines {
		/* padding: 1.2rem 0 1rem 0; */
		padding: 1rem 0;
	}
	#lifelines {
		padding: 1.5rem 0;
	}
	#people::before,
	#people::after {
		display: none;
	}
	.list {
		column-count: 1;
	}
	footer {
		padding: 0;
	}
}

