/* Style-sheet for www.electoralcalculus.co.uk 
   (C)2011 Martin Baxter
   
   Electoral Calculus recommends: "CSS The Missing Manual" by
   David Sawyer McFarland (O'Reilly, 2009) as a great introduction to CSS
*/ 


/* PRIMARY STYLE DEFNS */
body {
	font: 12px Arial, Helvetica, sans-serif;
	margin: 0;
	margin-bottom: 10px;
}
h1 {
	text-align: center;
	margin-bottom: 30px;
}
h2 { margin-top: 25px; }
h4.dateline {	/* style for dateline below H1 */
	text-align: center;
	font-size: 12px;
	margin-top: -25px;
	margin-bottom: 30px;
}

li {
	margin-top: 3px;
	margin-bottom: 3px;
}

.small  {font-size: 90%}

A:link, A:visited { color: blue; }
A:hover, A:active { color: red; }
A[name]:hover { color: black; }	/* suppress hover for name anchors */


/* GENERAL COLOURS */
.con {background-color: #99CCFF;}
.lab {background-color: #FF99CC;}
.lib {background-color: #FFFF99;}
.nat {background-color: #CCFFCC;}
.min {background-color: #EBC678;}
.oth {background-color: #FFFFFF;}
.nil {background-color: white; }
.maj {font-weight: bold;}

.con2 {background-color: #CCE5FF;}
.lab2 {background-color: #FFCCE5;}
.lib2 {background-color: #FFFFCC;}
.nat2 {background-color: #E5FFE5;}
.min2 {background-color: #F5E4C2;}

.con0 {background-color: #4499FF;}
.lab0 {background-color: #FF4499;}
.lib0 {background-color: #FFFF44;}
.nat0 {background-color: #99FF99;}
.min0 {background-color: #c0a040;}

.noire .lib {background-color: #849CFF;}  /* DUP in Northern Ireland */
.noire .lib2 {background-color: #ADBDFF;}  /* DUP in Northern Ireland */
.noire .lib0{background-color: #5B7AFF;}  /* DUP in Northern Ireland */

.theme { background-color: #ecdef1; }
.verystrong { color: red; font-weight: bold; }
.smallgrey { color: #606060; font-size: 10px; }

.seat {
	color: #800080;
	font-size: 20px;
	font-weight: bold;
}


/* TABLE DEFNS */
table { border-collapse: collapse; border-spacing: 0; }
td, th { 
	padding: 2px 5px 3px 5px;
}
td, caption {
	font-weight: normal;
	text-align: left;
	vertical-align: top;
}
th {
	font-weight: bold;
	text-align: center;
	vertical-align: middle;
}
table caption {
	caption-side: bottom;
	padding-top: 5px;
}

table.open {
	border-collapse: separate;
	border-spacing: 2px;
}
table.open td { padding: 1px 4px 1px 4px; }
table.center td { text-align: center; }
table.middle td { vertical-align: middle; }
table.blockcenter { margin: 0 auto; }
td.tdleft { text-align: left; }


/* DIV COLUMNS */ 
div.halfcolumn { 
	width: 45%;
	min-width: 300px;
	float: left;
	margin-right: 20px;
	margin-bottom: 10px;
}
div.thirdcolumn {
	width: 30%;
	min-width: 200px;
	float: left;
	margin-right: 20px;
}
div .quartercolumn {
	width: 23%;
	min-width: 150px;
	float: left;
	margin-right: 10px;
}
div.rightside {
	float: right;
	margin-left: 20px;
	margin-right: 0;
}
div.center { text-align: center; }
div.displaybox {		/* Used for Scottish seat prediction */
	text-align: center;
	border: 2px solid #410463;
	padding: 10px;
	margin: 10px auto 10px auto;
	background-color: #e5d9ec;
}


/* BANNER */
#banner {
	position: absolute;
	left: 0px;
	top: 0px;
	margin: 0;
	padding: 0;
	background: url(HousesParliament.jpg) repeat-x left top;
	height: 128px;
	width: 100%;
}
#banner h1 {
	font: small-caps bold 54px "Palatino Linotype", "Baskerville", Times, Serif;
	line-height: 100%;
	text-align: left;
	position: absolute;
	left: 0px;
	top: 55px;
	width: 100%;
	padding: 0 0 8px 0;
	margin: 0;
	color: #410463; /* purple */
	background-color: rgb(229,217,236);	/* E5D9EC */
	background-color: rgba(229,217,236,0.85);
}
#banner span {
	padding-left: 60px;
}


/* MAIN */
#main {
	margin: 145px 15px 0 155px;
}


/* MENU */
#menu {
	position: absolute;
	left: 0;
	top: 138px;
	width: 110px;
	margin-left: 6px;
	font-size: 11px;
	color: #2b0342;
}

.menuclass ul {
	list-style-type: none;
	padding-left: 0;
	margin-left: 0;
}
.menuclass h2, .menuclass h3, .menuclass h4
{
	font-weight: bold;
	font-size: 100%;
	padding: 0;
	margin: 0;
}
.menuclass h2 {
	background-color: #ac98c1; /
}
.menuclass h3 {
	background-color: #e5d0ec; 
}
.menuclass h4 {
	background-color: white;
	color: black;
}
.menuclass li {
	background-color: #ecdef1; 
	margin-bottom: 4px;
}
.menuclass a {
	text-decoration: none;
	padding: 0 3px 0 3px;
	display: block;
}
.menuclass a:link,
.menuclass a:visited {
	color: #2b0342;
}
.menuclass a:hover,
.menuclass a:active {
	color: red;
	background-color: #92d050;
}


/* HOMEPAGE PREDICTION */
#homeblock {
	padding: 0;
	margin-right: 235px;
}
#homeblock div {
	border: 1px solid #666;
	padding: 10px;
	margin: 0;
	margin-bottom: 15px;
	overflow: hidden;
}
#homeblock h2
{
	text-align: center;
	margin-top: 5px;
}

#sidebar {
	width: 200px;
	position: absolute;
	top: 62px;
	right: 5px;
	padding: 0;
	margin: 0;
}
#sidebar div {
	border: 1px solid #666;
	background-color: #ecdef1;
	padding: 10px;
	margin: 0;
	margin-bottom: 10px;
}
#sidebar h2
{
	text-align: left;
	font-size: 16px;
	color: white;
	background-color: #401050;
	display: block;
	padding: 5px 10px 0 10px;
	margin: -10px -10px 8px -10px;
	border-bottom: 4px solid grey;
}


/* BATTLEMAP */
#battlemap {
	font-size: 90%;
}
#battlemap td {
	padding: 2px 3px 2px 3px;
}
#battlemap td.con,
#battlemap td.lab,
#battlemap td.lib {
	font-weight: bold;	/* Show majority results in bold */
}


/* POLLS */
#polls {
	width: 100%;
	position: relative;
}
#polls #pollsmain {
	margin-right: 175px;
	overflow: hidden;
}
#polls #rightbar {
	width: 160px;
	position: absolute;
	padding-left: 15px;
	right: 0;
	top: 0;
	background-color: white;
}


/* CONLISTS */
#conlist ul {
	list-style-type: none;
	padding-left: 0;
	margin-left: 0;
}
#conlist li {
	padding: 0;
	margin-bottom: 2px;
}
#conlist li a {
	padding: 0 3px 1px 3px;
	text-decoration: none;
	display: block;
}
#conlist li a:hover, 
#conlist li a:active {
	color: red;
	background-color: #92d050;
}
.conlistseat
{
	position: relative;
}
.conlistseat div.toplink {
	position: absolute;
	bottom: 0px;
	right: 50px;
}
.conlistseat .gainbox {
	position: absolute;
	top: 20px;
	right: 50px;
	padding: 5px;
	border: 1px solid #666;
}


/* DYNAMIC MAP */
#map  td { 
	margin: 0;
	padding: 0;
}
#header {
	margin-bottom: 10px;
}


/* BARCHART */
table.barchart {
	border-collapse: collapse;
	border-spacing: 0;
}
table.barchart th { text-align: left; }	/* "Chance of winning" text */
table.barchart td {
	padding: 2px 3px 2px 5px;
	vertical-align: middle;
}
table.barchart table { font-size: 80%; }
table.barchart table td {	/* Applies to subcell with IMG tag */
	padding: 0;
	border: 1px solid #666;
}
table.barchart table td + td {	/* Applies to subcell with prob % */
	padding: 1px 3px 1px 5px;
	border: none;
}


/* for bdy_[reg]_summary.html and bdy_[reg]_wards.html */
table.newsummary {
	border-collapse: separate;
	border-spacing: 3px;
}
.newsummary div {
	margin: 0 -5px -3px -5px;
	padding: 0 5px 3px 5px;
}
table.newward {
	font-size: 90%;
}

/* For ShowHide button on Boundary Calculation pages */
button.ShowHide {
	font-weight: bold;
}
div.ShowHide_Show {
	display: block;
}
div.ShowHide_Hide {
	display: none;
}
h2.newseat {
	background-color: #ecdef1;
	padding: 5px 0 5px 3px;
}

/* STANDALONE PAGE (No Menubar) */
body.standalone {
	margin: 15px;
}


/* Some specials for particular pages */
.greyout { color: gray; }							/* timeline maps */
.conslookup { color: #c0c0c0; font-size: 40px; }		/* newseatlookup_dummy */
.headline { font-size: 16px; font-weight: bold; }	/* trackrecord */
.puregreen { background-color: #00FF00;}				/* trackrecord_10errors */
.purered { background-color: #FF0000;}				/* trackrecord_10errors */
.lightgrey { background-color:#E8DFEA;}				/* PVSCBill_analysis2 */
.seatbox {											/* bdy06_method */
	border: 1px solid #666;
	padding: 0 5px 0 5px;
	width: 325px;
}


/* ======= MOBILE BROWSERS =========  */
.mobileonly {
	display: none;
}

@media screen and (max-device-width: 976px) {
	body {
		background-color: white;
		-webkit-text-size-adjust: none;
		font-size: 12pt;
	}
	h1 {
		padding: 5px 0 5px 0px;
		margin-bottom: 5px;
	}
	h4.dateline {
		margin-top: 0px;
		margin-bottom: 10px;
	}
	div.halfcolumn, div.thirdcolumn, div.quartercolumn {
		width: 100%;
		margin: 0;
		float: none;
	}
	.mobileonly {
		display: block;
	}
	/* Banner for Mobiles */
	#banner {
		position: static;
		height: auto;
		width: auto;
		background: none;
		background-color: #E5D9EC;
		border: 2px solid #410463;
		margin: 3px;
		margin-bottom: 10px;
	}
	#banner h1 {
		position: static;
		width: auto;
		font-size: 32px;
		padding: 5px 0 4px 6px;
	}
	#banner span {
		padding: 0px;
	}
	/* Menu for Mobiles */
	#menu {
		position: static;
		font-size: 100%;
		width: auto;
		margin: 30px 6px 10px 6px;
	}
	#menuhead {
		text-transform: uppercase;
		border: 2px solid #222;
		font-size: 140%;
		color: white;
		margin-bottom: 0;
	}
	#topmenu {
		position: static;
		margin-left: 3px;
	}
	#topmenu ul {
		display: inline;
		padding: 0;
		margin: 0;
	}
	#topmenu li {
		display: inline;
		border: 1px solid #666;
		margin-right: 6px;
	}
	#topmenu a {
		display: inline;
	}
	/* MainPage for Mobiles */
	#main {
		margin: 0px 3px 5px 3px;
	}
	/* HomePage for Mobiles */
	#homeblock {
		margin: 0;
	}
	#homeblock div {
		overflow: visible;
	}
	#sidebar {
		position: static;
		width: auto;
	}
	
	/* Dynamic map for Mobiles */
	#map { font-size: 11px; }
	
	/* Conlist for Mobiles */
	.conlistseat .gainbox {
		top: 54px;
		right: 10px;
		padding: 3px;
	}
}

