/* Generic HTML elements  */

* {
  box-sizing: border-box;
}

body {
  font-family: Poppins, Verdana, sans-serif;
  font-weight: 300;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-weight: 500;
}

b, strong {
  font-weight: 600;
}

#page_title h1 {
    font-size: 1.625em;
    text-align: left;
		margin-top: 30px;
}

main select, main input {
    padding: 4px;
    margin: 4px 0;
}

main ul {
    margin-bottom: 2em;
    padding-left: 20px;
}

main ul a {
    font-weight: 600;
    color: #0274ad;
    transition: color .5s;
}

main ul a:hover {
    color: #0c4c85;;
}

main ul ::marker {
    color: #a6d5ed;
}


table.gist th, table.gist td, table.alignments th, table.alignments td {
    border: 1px solid #fff;
    padding: 4px 8px;
}

table.gist strong, table.alignments strong {
    font-weight: 600;
}

table.gist th, table.alignments th {
    background: #a6d5ed;
    font-weight: 600;
    letter-spacing: 1px;
}

table.gist td, table.alignments td {
    background: #f4f4f4;
    font-weight: 400;
}

table.gist tr:nth-child(odd) td, table.alignments tr:nth-child(odd) td, #div-wordentry-text-results table.alignments tr:nth-child(4n+4) td {
    background: #e4f6ff;
}

table.alignments tr:empty {
    border: 4px solid red;
}

table.gist tr td:first-child {
    font-weight: 500;
}

main textarea {
    max-width: 100%;
}

button {
    font-size: 1.125em;
    margin: 14px 0 0 0;
    border: none;
    font-family: Poppins, Verdana, sans-serif;
}

button:disabled, input[type="button"]:disabled {
    opacity: 0.75;
}

button:disabled:hover, input[type="button"]:disabled:hover {
    background: #0274ad;
}

main button {
	margin: 20px 0;
}

/* Page header */

#header {
  width: 100%;
  position: relative;
	padding: 14px;
  margin-bottom: 0;
	background: url(../imgs/header-back.jpg) no-repeat center 55%;
	background-size: 800px;
}

main {
	flex: 1;
}

#header_inner, #main_nav_menu, #page_title, main {
  width: 100%;
  max-width: 1000px;
  padding: 0 14px;
  margin: 0 auto;
}

#header_inner { 
  position: relative;
  padding: 20px 0;
	max-width: 800px;
}

#header_title {
  font-size: 32px;
	line-height: 22px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  display: block;
  text-align: center;
}

#header_title span {
	display: inline-block;
	height: 22px;
	color: transparent;
	margin: .25em 0;
	overflow: hidden;
	background-image: url(../imgs/site-title-text.png);
	background-repeat: no-repeat;
	background-size: auto 22px;
}

#header_title span:first-child {
	width: 196px;
	background-position: 5px top;
}

#header_title span:nth-child(2) {
	width: 74px;
	background-position: -195px top;
}

#header_title span:nth-child(3) {
	width: 66px;
	background-position: -273px top;
}

#header_title span:nth-child(4) {
	width: 58px;
	background-position: -341px top;
}

#header_title span:nth-child(5) {
	width: 158px;
	background-position: -403px top;
}

#header_title span:nth-child(6) {
	width: 163.2px;
	background-position: -567px top;
}

/* Page footer */

#footer {
    width: 100%;
    background: #e4f6ff;
    text-align: center;
    padding: 40px 20px;
    margin-top: 80px;
}

#sponsors {
    text-align: center;
    padding: 20px;
}

#sponsors a {
    display: inline-block;
    vertical-align: middle;
    width: 140px;
    height: 120px;
    margin: 0 20px;
}

#sponsors a img {
    width: 140px;
    height: 120px;
    object-fit: contain;
}

/* Navigation menu */

#main_nav {
  position: relative;
  height: 45px;
  background: #0274ad;
}

#main_nav_menu {
  display: none;
  position: relative;
  top: 45px;
  width: 100%;
  padding: 0;
  background: #0274ad;
}

#main_nav_menu > li {
  display: block;
  width: 100%;
  list-style: none;
}

#main_nav_menu > li > a {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  margin: 0;
}

#main_nav_menu > li:hover {
  background: #0c4c85;;
}

.drop-menu-toggle.active, .drop-menu-toggle.active:hover {
  background: #0c4c85;;
  box-shadow: 0 0px 6px rgba(0, 0, 0, 0.5);
}

#other_tools {
  position: relative;
}

#main_nav a, button, input[type="button"], .drop-menu-toggle {
  display: inline-block;
  color: #fff;
  font-weight: 500;
  font-size: 1em;
  text-decoration: none;
  text-align: center;
  background: #0274ad;
  padding: 10px 14px;
  letter-spacing: 1px;
  margin: 0 4px;
}

#main_nav a, .drop-menu-toggle {
  padding: 10px 6px;
}

.menu-toggle {
  position: absolute;
  top: 7px;
  left: 10px;
  display: block;
  width: 34px;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
}

.menu-toggle:hover {
  background: none;
}

.menu-toggle > span {
  position: relative;
  float: left;
  display: block;
  width: 34px;
  height: 4px;
  margin: 3px 0;
  background: #fff;
  border-radius: 4px;
  opacity: 1;
  transition: 0.3s;
}

.menu-toggle.active > span:first-child {
  transform: rotate(45deg);
  margin-top: 14px;
}

.menu-toggle.active > span:last-child {
  transform: rotate(-45deg);
  margin-top: -17px;
}

.menu-toggle.active > span:nth-child(2) {
  opacity: 0;
}

.drop-menu-toggle {
  width: 100%;
  text-align: left;
  position: relative;
  padding: 10px 30px 10px 14px;
  cursor: pointer;
  margin: 0;
}

.drop-menu-toggle:after {
  display: block;
  position: absolute;
  content: " ";
  top: 50%;
  right: 10px;
  margin-top: -9px;
  width: 8px;
  height: 8px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
  transition: .15s;
}

.drop-menu-toggle.active:after {
  margin-top: -4px;
  transform: rotate(-135deg);
}

#main_nav a:hover, button:hover, input[type="button"]:hover, .drop-menu-toggle:hover {
  background: #0c4c85;;
}

.drop-menu {
  display: none;
  top: 100%;
  right: 0;
  width: 100%;
  text-align: left;
  padding: 0;
  margin: 0;
  list-style: none;
  background: #0c4c85;;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.75);
}

#main_nav .drop-menu a {
	display: block;
  text-align: left;
  text-indent: -20px;
  margin: 0 0 0 20px;
  padding-left: 24px;
  background: none;
}

#main_nav .drop-menu li:hover {
  background: #04335c;
}

/* Misc elements shared by all apps */

#div-results, #div-error, #div-message {
  margin-top: 32px;
}

#div-results {
  margin-bottom: 32px;
}

/* Winbox customization */

.winbox {
    position: fixed;
		display: flex;
		flex-direction: column;
    padding: 0;
		padding-bottom: 10px;
    background: #fff;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.6);
    border: none;
		opacity: 1;
}

.wb-header {
    position: relative;
		height: auto;
    background: #027DBB;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    z-index: 10;
		overflow: visible;
}

.wb-icon {
	position: absolute;
	top: 0;
	right: 0;
}

.wb-title {
    margin: 0;
		font-family: Poppins, Verdana, sans-serif;
		font-size: 1.5em;
		font-weight: 500;
		padding: 34px 14px 18px 10px;
}

.wb-body {
		position: static;
		contain: initial;
    margin-top: 0;
    padding: 5px 10px 20px 10px;
		overflow-y: scroll;
}

.winbox:after {
    width: 100%;
    height: 9px;
    position: absolute;
    left: 0;
    bottom: 0;
    content: " ";
    display: block;
    background: #a6d5ed;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.65);
    border-top: 1px solid #9e9e9e;
    border: none;
}

/* Info icon */

.div-info.inline {
	display: inline-block;
	line-height: 30px;
	vertical-align: middle;
	margin: 0 10px 8px 10px;
}

.div-info a {
	display: block;
	width: 30px;
	height: 30px;
	color: transparent;
	font-size: 0;
	margin-top: 6px;
	background: #027dbb url(../imgs/info.png) no-repeat center;
	background-size: 24px;
	border-radius: 30px;
	overflow: hidden;
}

/* Floating dialog class used by different apps */

.div-floating-dlg {
    position: fixed;
    top: 40px;
    right: 5vw;
    width: 600px;
    max-width: 90vw;
    padding: 0;
		padding-bottom: 10px;
    background: #fff;
    box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.6);
    border: none;
		opacity: 1;
}

.div-floating-dlg-titlebar {
    position: relative;
    padding: 27px 10px 17px 10px;
    background: #a6d5ed;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
    z-index: 10;
}

.div-floating-dlg-titlebar h2 {
    margin: 0;
}

.div-floating-dlg .div-floating-dlg-contents {
    margin-top: 0;
    padding: 5px 5px 20px 5px;
}

.div-floating-dlg:after {
    width: 100%;
    height: 9px;
    position: absolute;
    left: 0;
    bottom: 0;
    content: " ";
    display: block;
    background: #a6d5ed;
    box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.65);
    border-top: 1px solid #9e9e9e;
    border: none;
}

.div-floating-dlg .div-floating-dlg-contents > * {
    min-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
}

.div-floating-dlg #div-choose-correction-main {
		padding-top: 20px;
}


/* Word Entry dialog */

#div-wordentry {
	flex-direction: column;
	height: 600px;
	max-height: calc(100vh - 60px);
}

#div-wordentry[style*="display: block;"] {
	display: flex !important;
}

#div-wordentry #div-wordentry-contents {
	overflow-y: scroll;
}

#div-wordentry #div-wordentry-iconizer, div#div-wordentry-iconized {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 8px;
    right: 8px;
    border-radius: 20px;
    z-index: 20;
    background-color: white;
    cursor: pointer;
}

#div-wordentry #div-wordentry-iconizer img, div#div-wordentry-iconized img {
    margin-left: -2px;
    margin-top: -2px;
    opacity: .7;
}

div#div-wordentry-iconized {
		position: fixed;
		display: none;
    top: auto;
    right: 10px;
    bottom: 10px;
		text-align: center;
    background: #a6d5ed;
    border: none;
}

/* Word Dictionary UI */

#txt-query-words {
    display: block;
    width: 100%;
}

/* Spell Checker UI */

.corrected-word {
    text-decoration: underline;
}

/* Morpheme Dictionary UI */

.morpheme-details {
  width: 800px;
  max-width: 100%;
  padding-top: 10px;
  border-top: 4px solid #a6d5ed;
}

.morpheme-details > div {
  background: #f4f4f4;
  padding: 4px 10px;
  margin: 10px 0 30px 0 !important;
}



/* jQuery UI configurations */

.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default, .ui-button, html .ui-button.ui-state-disabled:hover, html .ui-button.ui-state-disabled:active {
	background: #e4f6ff !important;
	border: 1px solid #e4f6ff !important;
}

.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active, a.ui-button:active, .ui-button:active, .ui-button.ui-state-active:hover {
	background: #0274ad !important;
	border: 1px solid #0274ad !important;
}

.ui-accordion .ui-accordion-header {
	margin: 5px 0 0 0 !important;
}

.ui-accordion .ui-accordion-content {
    padding: .5em 1em !important;
}

/* Responsive design */

@media screen and (min-width: 540px) {

  #header_title {
    font-size: 40px;
		line-height: 28px;
    font-weight: 500;
  }

	#header_title span {
		height: 28px;
		background-size: auto 28px;
	}

	#header_title span:first-child {
		width: 250px;
		background-position: 6px top;
	}

	#header_title span:nth-child(2) {
		width: 93px;
		background-position: -250px top;
	}

	#header_title span:nth-child(3) {
		width: 82px;
		background-position: -350px top;
	}

	#header_title span:nth-child(4) {
		width: 73px;
		background-position: -436px top;
	}

	#header_title span:nth-child(5) {
		width: 198px;
		background-position: -517px top;
	}

	#header_title span:nth-child(6) {
		width: 206px;
		background-position: -722px top;
	}
  
  .menu-toggle {
    display: none;
  }
  
  #main_nav_menu {
    top: 0;
    display: flex;
    justify-content: space-between;
  }
  
  #main_nav_menu > li {
    width: auto;
  }
	
	#main_nav_menu > li > a {
    padding: 10px 4px;
  }
  
  #main_nav_menu > li:hover {
    background: none;
  }
  
  #main_nav li ul li a {
    padding: 10px 14px;
  }
  
  #main_nav a, button, input[type="button"], .drop-menu-toggle {
    transition: background .5s;
  }
  
  .drop-menu-toggle {
		padding: 10px 24px 10px 4px;
  }
	
	.drop-menu-toggle:after {
		right: 8px;
	}
  
  .drop-menu-toggle.active, .drop-menu-toggle.active:hover {
    box-shadow: none;
    background: #0c4c85;;
  }
  
  .drop-menu {
		position: absolute;
    width: 260px;
    box-shadow: none;
  }
  
  #page_title h1 {
    font-size: 2em;
  }
  
  main ul {
    padding-left: 40px;
  }

}

@media screen and (min-width: 560px) {
	
	#main_nav_menu > li > a {
    padding: 10px 8px;
  }
  
  .drop-menu-toggle {
		padding: 10px 24px 10px 8px;
  }
	
}

@media screen and (min-width: 600px) {
	
	#main_nav_menu > li > a {
    padding: 10px 14px;
  }
  
  .drop-menu-toggle {
		padding: 10px 28px 10px 14px;
  }
	
	.drop-menu-toggle:after {
		right: 8px;
	}
}

@media screen and (min-width: 640px) {

  #main_nav_menu { 
    justify-content: flex-end;
  }
	
	#main_nav_menu > li > a {
		padding: 10px 14px;
	}
	
	.drop-menu-toggle {
		padding: 10px 30px 10px 14px;
	}

	.drop-menu-toggle:after {
		right: 10px;
	}
}

@media screen and (min-width: 800px) { 

  #header {
		padding: 30px 20px 70px 20px;
    background-size: 1000px;
		background-position: center 58%;
  }
	
	#page_title h1 {
		margin-top: 40px;
	}
	
	main button {
		margin: 30px 0;
	}
  
}

@media screen and (min-width: 860px) { 

  .div-floating-dlg {
        right: calc(50% - 400px);
  }
  
}

@media screen and (min-width: 1000px) { 

  #header {
    background-size: cover;
  }
  
}

@media screen and (min-width: 1260px) {

  .div-floating-dlg {
    right: calc(50% - 600px);
  }
  
}

@media screen and (min-width: 1200px) { 

  #header {
		background-color: #16214e;
    background-size: 1200px;
  }
	
	#header_inner {
		max-width: 1000px;
	}
	
	#header_title {
    font-size: 48px;
		line-height: 34px;
  }

	#header_title span {
		height: 34px;
		background-size: auto 34px;
	}

	#header_title span:first-child {
		width: 302px;
		background-position: 6px top;
	}

	#header_title span:nth-child(2) {
		width: 114px;
		background-position: -302px top;
	}

	#header_title span:nth-child(3) {
		width: 102px;
		background-position: -422px top;
	}

	#header_title span:nth-child(4) {
		width: 90px;
		background-position: -526px top;
	}

	#header_title span:nth-child(5) {
		width: 244px;
		background-position: -622px top;
	}

	#header_title span:nth-child(6) {
		width: 252px;
		background-position: -874px top;
	}
}