/* Style-sheet for www.electoralcalculus.co.uk 
   (C)2011 Electoral Calculus Ltd
   
   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: 11pt Arial, Helvetica, sans-serif;
	margin: 0;
	margin-bottom: 10px;
    line-height: 140%;
}
h1 {
	text-align: center;
	margin-bottom: 20px;
    line-height: 130%;
}
h2 { margin-top: 25px; }
h4.dateline {	/* style for dateline below H1 */
	text-align: center;
	font-size: 11pt;
	margin-top: -15px;
	margin-bottom: 30px;
}

li {
	margin-top: 3px;
	margin-bottom: 3px;
}

P.equation { text-align: center; font-family: Times; font-size: 12pt; }
span.equation { font-family: Times; font-size: 12pt; }

.small  {font-size: 90%}

A { word-wrap: break-word; }
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, .uup {background-color: #99CCFF;}
.lab, .sdlp {background-color: #FF9999;}
.lib {background-color: #FFB266;}
.nat, .snp, .plaid, .sf {background-color: #FBFF99;}
.min {background-color: #E5CE89;}
.oth {background-color: #FFFFFF;}
.nil {background-color: white; }
.maj {font-weight: bold;}

.con2, .uup2 {background-color: #CCE5FF;}
.lab2, .sdlp2 {background-color: #FFCCCC;}
.lib2 {background-color: #FFCA99;}
.nat2, .snp2, .plaid2, .sf2 {background-color: #FCFFB2;}
.min2 {background-color: #F2E3B5;}

.con0, .uup0 {background-color: #4499FF;}
.lab0, .sdlp0 {background-color: #FF4444;}
.lib0 {background-color: #FF9932;}
.nat0, .snp0, .plaid0, .sf0 {background-color: #F8FF44;}
.min0 {background-color: #D8B13A;}

/* minor parties */
.ukip {background-color: #FF99FF;}
.ukip2 {background-color: #FFCCFF;}
.ukip0 {background-color: #FF44FF;}
.bnp {background-color: #FFFFFF;}
.bnp2 {background-color: #FFFFFF;}
.bnp0 {background-color: #FFFFFF;}
.green {background-color: #AAFF99;}
.green2 {background-color: #D6FFCE;}
.green0 {background-color: #63FF44;}

.noire .lib, .dup {background-color: #849CFF;}  /* DUP in Northern Ireland */
.noire .lib2, .dup2 {background-color: #ADBDFF;}  /* DUP in Northern Ireland */
.noire .lib0, .dup0 {background-color: #5B7AFF;}  /* DUP in Northern Ireland */

.theme { background-color: #ecdef1; }
.verystrong { color: red; font-weight: bold; }
.smallgrey { color: #606060; font-size: 11px; }

.seat {
	color: #800080;
	font-size: 20px;
	font-weight: bold;
}

/* KEY DATA COLOURS */
.economic1 { background-color: #ff3300;}
.economic2 { background-color: #ff8585;}
.economic3 { background-color: #ffc000;}
.economic4 { background-color: #00b0f0;}
.economic5 { background-color: #3366ff;}
.national1 { background-color: #00da00;}
.national2 { background-color: #a7ffa7;}
.national3 { background-color: #fcd5b4;}
.national4 { background-color: #bc8fdd;}
.national5 { background-color: #8a3cc4;}
.social1 { background-color: #ffc000;}
.social2 { background-color: #f0ce4b;}
.social3 { background-color: #d8e4bc;}
.social4 { background-color: #57c5db;}
.social5 { background-color: #00b0f0;}
.leaveshare1 { background-color: #ffff00;}
.leaveshare2 { background-color: #dbff8b;}
.leaveshare3 { background-color: #d7e4bc;}
.leaveshare4 { background-color: #93cddd;}
.leaveshare5 { background-color: #0070c0;}
.census1 { background-color: #ff3300;}
.census2 { background-color: #ff8585;}
.census3 { background-color: #ffc000;}
.census4 { background-color: #a7ffa7;}
.census5 { background-color: #00da00;}
.cluster_left { background-color: #ff0000;}
.cluster_prog { background-color: #ffc000;}
.cluster_trad { background-color: #ffa3a3;}
.cluster_nat { background-color: #7030a0;}
.cluster_cent { background-color: #ffff00;}
.cluster_kyc { background-color: #b7dee8;}
.cluster_right { background-color: #00b0f0;}



/* 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;
}
th.left { text-align: left; }
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.top td { vertical-align: top; }
table.blockcenter { margin: 0 auto; }
tr.bold td { font-weight: bold; }
tr.tdcenter td { text-align: center !important; }
td.tdleft { text-align: left; }
td.tdcenter { text-align: center; }
div.widetable { overflow-x: auto; }

TR.kctodd { background-color: #C7D42D; }    /* colours for key indicators */
TR.kcteven { background-color: #E5EAA7; }

TABLE.stripes TR:nth-child(odd) { background-color: #C7D42D; }
TABLE.stripes TR:nth-child(even) { background-color: #E5EAA7; }
TABLE.stripes TR:first-child { background-color: #ffffff; }

/* 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;
}

/* Masonry Brick effect. Two-columns or three-columns depending on screen width
   Used by new section home pages */
div.masonrycontainer {
    -moz-column-count: 4;
    -webkit-column-count: 4;
    column-count: 4;
    column-width: 250px;
}

div.masonrybrick {
    display: inline-block;
    width: 95%;
}

div.masonrybrick {
    border: 2px solid #410463;
    padding: 3px 5px 0px 5px;
    margin-bottom: 10px;
}
div.masonrybrick A { 
    font-size: 12pt;
    font-weight: bold;
    color: black;
    text-decoration: none;
}
div.masonrybrick LI A, div.masonrybrick A.normal {
    font-size: 11pt;
    font-weight: normal;
    color: blue;
}
div.masonrybrick A:hover { color: #67079E; text-decoration: underline; }
div.masonrybrick P:last-of-type { margin-bottom: 0; }
div.masonrybrick img { margin-bottom: 5px; }
div.masonrybrick h2 {
    text-align: left;
    font-size: 16px;
    color: black;
    background-color: #ecdef1;
    display: block;
    padding: 5px 10px 4px 10px;
    margin: -3px -5px 10px -5px; 
}


/* syntax <div class=captionleftright><span>LEFT CAPTION</span><span>RIGHT CAPTION</span><P>...   */
div.captionleftright { padding-top: 5px; padding-bottom: 15px;}
div.captionleftright span:first-of-type { float: left; }
div.captionleftright span:nth-of-type(2) { font-size: 90%; float: right; }
div.captionleftright + P { clear: both; }

div.captiontopbottom { padding-top: 5px; padding-bottom: 10px;}
div.captionleftright span:first-of-type { display: block; }
div.captiontopbottom span:nth-of-type(2) { display: block; font-size: 90%; padding-top: 5px; }
div.captiontopbottom + P { clear: both; }

/* IMAGES */
IMG.maxwidth {
    max-width: 100%;
}
IMG.left {
    float: left;
    margin: 10px 10px 0 0;
}
IMG.right {
    float: right;
    margin: 10px 0 0 10px;
}

/* BANNER */
#banner {
	position: absolute;
	left: 0px;
	top: 0px;
	margin: 0;
	padding: 0;
	background: url(westminster128.jpg) repeat-x left top;
	height: 128px;
	width: 100%;
}
#bannertext {
	line-height: 100%;
	text-align: left;
	position: absolute;
	left: 0px;
	top: 45px;
	width: 100%;
	height: 68px;
	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);
	/* padding-left: 60px; */
}
#topbanner  {
	font: small-caps bold 54px "Palatino Linotype", "Baskerville", Times, Serif;
	position: relative;
	left: 60px;
	top: -10px;
	width: 80%;
}
#botbanner {
	font: small-caps bold 20px "Palatino Linotype", "Baskerville", Times, Serif;
	position: relative;
	left: 60px;
	top: -25px;
	width: 80%;
}


/* MAIN */
#main {
	margin: 145px 15px 0 155px;
}


/* MENU */
#menu {
	position: absolute;
	left: 0;
	top: 138px;
	width: 110px;
	margin-left: 6px;
	font-size: 8pt;
	color: #2b0342;
    line-height: 130%;
}

.menuclass ul {
	list-style-type: none;
	padding-left: 0;
	margin-left: 0;
}

.menuclass li {
	background-color: #ecdef1; 
	margin-bottom: 4px;
    padding: 3px 0 3px 0;
}
.menuclass li.m2, .menuclass li.m3, .menuclass li.m4
{
    font-weight: bold;
	font-size: 100%;
}
.menuclass li.m2 {
	background-color: #ac98c1; /
}
.menuclass li.m3 {
	background-color: #e5d0ec; 
}
.menuclass li.m4 {
	background-color: white;
	color: black;
    padding-bottom: 0;
}
.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 > div p:last-child { margin-bottom: 0px; }
#homeblock h2
{
	text-align: left;
	font-size: 16px;
	color: black;
	background-color: #ecdef1;
	display: block;
	padding: 5px 10px 4px 10px;
	margin: -10px -10px 17px -10px;
	border-bottom: 2px solid #401050;
}

#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: 12px;
    font-size: 9pt;
    line-height: 130%;
}
#sidebar div p:last-child { margin-bottom: 0px; }

#sidebar h2
{
	text-align: left;
	font-size: 16px;
	color: white;
	background-color: #401050;
	display: block;
	padding: 2px 10px 2px 10px;
	margin: -10px -10px 8px -10px;
	border-bottom: 4px solid grey;
}
#sidebar div ul {
    margin: 0;
    padding: 0 0 0 12px;
}

#sidebar div ul  li {
    margin: 0;
}

/* 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 */
#dynamicmap {
    font-size: 13px;
    line-height: 120%;
}
#dynamicmap  td { 
	margin: 0;
	padding: 0;
}
#dynamicmap H1 {
	margin-bottom: 10px;
}

/* 3D PLOTS */
.c3d_displayarea {
    /* set display DIV to have position:relative, necessary for labelling */
    position: relative;
    width: 95%;
    height: 600px;
}
.c3d_objectlabel {
    padding: 0 0 10px 0;
}
.c3d_axislabel {
    font-size: 8pt;
}
.c3d_diaglabel {
    font-size: 10pt;
}


/* 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: 0px 3px 0px 5px;  /*  1px 3px 2px 5px;  */
	border: none;
}

/* BAR100 */
table.bargroup {
    border-spacing: 5px;
    border-collapse: separate;
}
table.bar100 { cell-padding : 0; }
table.bar100 TD { padding: 0; }
table.bar100 TD:first-of-type
{
    border: 1px solid #666;
    border-right: none;
}
table.bar100 TD:nth-of-type(2)
{
    border: 1px solid #666;
    border-left: none;
}
.eu_remain { background-color: #ffff66; }
.eu_leave { background-color: #3399ff; }
.lr_left { background-color: #FF9999; }
.lr_right { background-color: #99CCFF; }
.in_int { background-color: #AAFF99; }
.in_nat { background-color: #FF99FF; }


/* MAP-CANVAS */
#map-canvas { height: 450px; width: 95%}

/* OPEN SEAT MAP */
.ol-popup {
    position: absolute;
    background-color: white;
    -webkit-filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.2));
    padding: 5px 15px 5px 15px;
    border-radius: 10px;
    border: 1px solid #cccccc;
    bottom: 12px;
    left: -50px;
    min-width: 280px;
}
.ol-popup:after, .ol-popup:before {
    top: 100%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}
.ol-popup:after {
    border-top-color: white;
    border-width: 10px;
    left: 48px;
    margin-left: -10px;
}
.ol-popup:before {
    border-top-color: #cccccc;
    border-width: 11px;
    left: 48px;
    margin-left: -11px;
}
.ol-popup-closer {
    text-decoration: none;
    position: absolute;
    top: 2px;
    right: 8px;
}
.ol-popup-closer:after {
    content: "X";
}


/* 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;
}


/* ======= PRINTING =========  */
@media print {
	#menu { display: none; }
	#banner, #bannertext, #topbanner, #botbanner {
		position: static;
		height: auto;
		width: auto;
		text-align: center;
		background: none;
		color: black;
		background-color: white;
		padding: 0;
		margin: 0;
	}
	#main {
		margin: 0;
		padding: 0;
		width: auto;
	}
	#main a { text-decoration: none; }
	/* #main a:after { content: " (" attr(href) ") "; } */
	#homeblock h2 { border-bottom: 0; background-color: white; }
	#sidebar h2 { border-bottom: 0; background-color: white; }
	#sidebar div { background-color: white; }
	h1, h2, h3, h4, p, a, td, th, li, div {
		color: black !important;
		-webkit-print-color-adjust: exact;
	}
	#map-canvas { width:100%; max-width: none; }
}

/* ======= MOBILE BROWSERS =========  */
.mobileonly {
	display: none;
}
.notmobile {
	display: block;
}

@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: 0px;
	}
	h4.dateline {
		margin-top: -20px;
		margin-bottom: 15px;
	}
	div.halfcolumn, div.thirdcolumn, div.quartercolumn {
		width: 100%;
		margin: 0;
		float: none;
	}
	.mobileonly {
		display: block;
	}
	.notmobile {
		display: none;
	}
	/* Banner for Mobiles */
	#banner {
		position: static;
		height: auto;
		width: auto;
		background: none;
		background-color: #E5D9EC;
		border: 2px solid #410463;
		margin: 3px;
		margin-bottom: 10px;
	}
	#bannertext {
		position: static;
		width: auto;
		padding: 5px 0 4px 6px;
		height: 50px;
	}
	#topbanner {
		font-size: 32px;
		padding: 0px;
		left: 0px;
		width: 100%;
	}
	#botbanner {
		font-size: 18px;
		padding: 0px;
		left: 0px;
		top: -15px;
		width: 100%;
	}
	/* 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;
	}
    #sidebar div {
        font-size: 100%;
    }
	
	/* Dynamic map for Mobiles */
	#map { font-size: 11px; }
	
	/* Conlist for Mobiles */
	.conlistseat .gainbox {
		top: 54px;
		right: 10px;
		padding: 3px;
	}
	
	/* Polls page for Mobiles */
	#polls #pollsmain {
		margin-right: 0px;
		overflow: visible;
	}
	#polls #rightbar {
		width: 100%;
		position: static;
		padding-left: 0px;
	}
}
