/*
 * Responsive layer. The archived design is a fixed 1018px/1040px desktop layout; every rule
 * here is inside a max-width query, so screens 1040px and wider show the original pixel for
 * pixel. Below that the same design becomes fluid (tablet) and stacks (phone).
 */

/* ------------------------------------------------------------------ tablet and below */
@media (max-width: 1039px) {
	html,
	body {
		overflow-x: hidden;
	}
	#header,
	#slider,
	#mainphoto,
	#footer {
		width: auto;
		max-width: 1018px;
	}
	#nav {
		width: auto;
		max-width: 1040px;
	}
	#header {
		height: auto;
		min-height: 134px;
		position: relative;
	}
	#leaf {
		top: 20px;
		width: 180px;
		height: 152px;
		background-size: contain;
		right: 0;
		pointer-events: none;
	}
	#headertext {
		font-size: 20px;
		line-height: 22px;
		padding-left: 12px;
		padding-right: 12px;
	}
	.searchbox input.text {
		width: 60%;
	}
	#hnav2 td[width="290"] {
		display: none;
	}
	#hnav2 td {
		width: auto;
	}

	/* Content images and wide tables scale down instead of overflowing. */
	#slider img,
	#mainphoto img,
	.content_cell img {
		max-width: 100%;
		height: auto !important;
	}
	#slider table,
	.content_cell table {
		max-width: 100%;
	}

	/* The leaf would cover the menu once the bar is narrower than the original 1040px. */
	#leaf {
		display: none;
	}

	/* Home: menu and slider side by side, the green column below them. */
	.adrc-layout-home #slider > table,
	.adrc-layout-home #slider > table > tbody {
		display: block;
		width: 100% !important;
	}
	.adrc-layout-home #slider > table > tbody > tr {
		display: flex;
		flex-wrap: wrap;
	}
	.adrc-layout-home #slider > table > tbody > tr > td {
		display: block;
		box-sizing: border-box;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(1) {
		flex: 0 0 190px;
		width: 190px !important;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(2) {
		flex: 1 1 0;
		min-width: 0;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(3) {
		flex: 0 0 100%;
		width: 100% !important;
		padding-top: 25px;
		padding-bottom: 20px;
	}
	/* The green column's list table: bullet + text rows, phone numbers on one line. */
	#announce table,
	#announce tbody {
		display: block;
		width: 100% !important;
	}
	#announce tr {
		display: flex;
		align-items: flex-start;
	}
	#announce td {
		display: block;
		width: auto !important;
	}
	#announce td:first-child:not(:only-child) {
		flex: 0 0 22px;
	}
	/* Tagline band: room for the text when it wraps. */
	.adrc-layout-home #nav p {
		line-height: 1.3;
	}
	.adrc-layout-home .flexslider {
		width: auto;
		max-width: 100%;
		margin-bottom: 0;
	}
	.adrc-layout-home .flexslider .slides > li {
		width: 100% !important;
	}
	.adrc-layout-home .flexslider .slides img {
		width: 100%;
		height: auto !important;
	}

	/* Home: the three boxes share the row. */
	#mainphoto > table > tbody > tr > td {
		width: 33.333% !important;
	}
	#photo {
		float: none;
		width: auto;
		margin: 15px 10px;
	}
	#photo img {
		width: 100%;
		height: auto !important;
	}
	#mainphoto::after {
		content: "";
		display: table;
		clear: both;
	}

	/* 2014 CMS pages */
	.main_table,
	.adrc-cms-row {
		max-width: 100%;
	}
	.header_cell .header_content_inner {
		margin-left: 200px;
	}
	.header_cell .header_content .header_nav LI {
		width: auto;
		min-width: 110px;
	}
	.header_cell .header_content .header_box {
		white-space: normal;
		font-size: 20px;
		padding: 8px 20px;
	}
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 767px) {
	/* Header: logo, tagline and search stacked; text-size controls on the right. */
	#header table,
	#header tbody,
	#header tr,
	#header td {
		display: block;
		width: 100% !important;
		height: auto !important;
		box-sizing: border-box;
	}
	#header td {
		text-align: center;
		padding: 6px 10px !important;
	}
	#header td:first-child img {
		margin-left: 0 !important;
		padding-left: 0 !important;
		max-width: 70%;
		height: auto !important;
	}
	#header td:last-child {
		position: static !important;
		padding-top: 0 !important;
	}
	#sizecontroldiv table,
	#sizecontroldiv tbody,
	#sizecontroldiv tr {
		display: table;
		width: auto !important;
		margin: 0 auto;
	}
	#sizecontroldiv td {
		display: table-cell !important;
		width: auto !important;
		padding: 0 4px !important;
	}
	#headertext {
		display: inline-block;
		font-size: 18px;
		line-height: 22px;
		margin-bottom: 8px;
	}
	.searchbox {
		margin: 0 auto;
	}
	.searchbox input.text {
		width: 65%;
	}
	#leaf {
		display: none;
	}

	/* Top menu: the cells wrap into a two-column grid. */
	#hnav2,
	#hnav2 tbody,
	#hnav2 tr {
		display: block;
		width: 100%;
	}
	#hnav2 tr {
		display: flex;
		flex-wrap: wrap;
	}
	#hnav2 td {
		display: block;
		flex: 1 1 50%;
		box-sizing: border-box;
		border-left: 0 !important;
		border-bottom: 1px solid #FFF;
	}
	#hnav2 td:empty,
	#hnav2 td[width="290"],
	.adrc-layout-home #hnav2 td.adrc-home-cell {
		display: none;
	}
	#hnav2 a:link,
	#hnav2 a:visited,
	#hnav2 a:active {
		border-right: 0;
	}
	#hnav2 td:nth-child(odd) a {
		border-right: 1px solid #FFF;
	}

	/* Inner pages: menu above the content. */
	#slider.e-con {
		flex-direction: column;
		--flex-direction: column;
	}
	#slider > .adrc-menu-cell,
	#slider > .adrc-content-cell {
		flex: 0 0 auto;
		width: auto;
	}
	#slider > .adrc-content-cell {
		padding: 20px 16px;
	}
	#snav2 tbody {
		display: flex;
		flex-wrap: wrap;
	}
	#snav2 tr {
		display: block;
		flex: 1 1 50%;
	}
	#snav2 td {
		display: block;
	}
	#snav2 a:link,
	#snav2 a:visited {
		padding: 14px 12px 13px 16px;
		border-right: 1px solid #FFF;
	}
	#innerphoto {
		float: none;
		padding-left: 0;
		text-align: center;
		margin-bottom: 15px;
	}
	#innerphoto br {
		display: none;
	}
	#innerphoto img {
		display: inline-block;
		width: 47% !important;
		height: auto !important;
		padding: 0 !important;
		margin: 0 1% 8px;
		vertical-align: top;
	}
	.adrc-content-cell img[style*="float"],
	.adrc-content-cell img[align] {
		float: none !important;
		display: block;
		margin: 10px auto !important;
	}
	.adrc-content-cell input[type="text"],
	.adrc-content-cell textarea {
		width: 100% !important;
		box-sizing: border-box;
	}

	/* Home: menu, slider, green column and the three boxes stacked. */
	.adrc-layout-home #slider > table,
	.adrc-layout-home #slider > table > tbody,
	.adrc-layout-home #slider > table > tbody > tr,
	.adrc-layout-home #slider > table > tbody > tr > td {
		display: block;
		width: 100% !important;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(n) {
		flex: 0 0 auto;
		width: 100% !important;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:first-child {
		order: 2;
	}
	.adrc-layout-home #slider > table > tbody > tr {
		display: flex;
		flex-direction: column;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(2) {
		order: 1;
	}
	.adrc-layout-home #slider > table > tbody > tr > td:nth-child(3) {
		order: 3;
	}
	#announce {
		padding: 20px 16px !important;
		box-sizing: border-box;
	}
	.adrc-layout-home #nav p {
		font-size: 15px !important;
		line-height: 20px;
		padding-left: 10px;
		padding-right: 10px;
	}
	#mainphoto > table,
	#mainphoto > table > tbody,
	#mainphoto > table > tbody > tr,
	#mainphoto > table > tbody > tr > td {
		display: block;
		width: 100% !important;
	}
	#photo {
		float: none;
		width: auto;
		max-width: 300px;
		margin: 15px auto;
	}

	/* Footer cells stacked and centred. */
	#footer table,
	#footer tbody,
	#footer tr,
	#footer td {
		display: block;
		width: 100% !important;
		height: auto !important;
		text-align: center !important;
		box-sizing: border-box;
	}
	#footer td {
		padding: 6px 12px;
	}
	#footer td:empty,
	#footer td[width="36"],
	#footer td[width="30"] {
		display: none;
	}

	/* 2014 CMS pages */
	body.adrc-layout-cms {
		margin: 0;
		padding: 0;
	}
	.top_cell .top_content,
	.top_cell .top_content tbody,
	.top_cell .top_content tr {
		display: block;
		width: auto;
	}
	.top_cell .top_content tr {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-end;
	}
	.top_cell .top_content .top_phone {
		width: 100%;
		font-size: 20px;
	}
	.top_cell .top_content .top_date {
		flex: 1 1 auto;
		padding-left: 10px;
	}
	.header_cell .header_content {
		height: auto;
		min-height: 110px;
		background-size: 220px auto;
	}
	.header_cell .header_content_inner {
		float: none;
		height: auto;
		margin: 0;
		padding-top: 120px;
		background: none;
	}
	.header_cell .header_content .header_nav {
		float: none;
	}
	.header_cell .header_content .header_nav UL {
		display: flex;
		flex-wrap: wrap;
		padding: 0;
	}
	.header_cell .header_content .header_nav LI {
		flex: 1 1 45%;
		width: auto;
	}
	.header_cell .header_content .header_box {
		float: none;
		display: block;
		margin: 5px 0 10px 5px;
	}
	.adrc-cms-row.e-con {
		flex-direction: column;
		--flex-direction: column;
	}
	.adrc-cms-row > .adrc-cms-nav,
	.adrc-cms-row > .adrc-cms-content {
		flex: 0 0 auto;
		width: auto;
	}
	.content_cell .content_wrap {
		margin: 10px 12px;
	}
	#bottom TABLE.footer,
	#bottom TABLE.footer tbody,
	#bottom TABLE.footer tr,
	#bottom TABLE.footer td {
		display: block;
		width: auto;
		height: auto;
		text-align: center !important;
	}
	#bottom {
		height: auto;
		padding: 10px 0;
		background-size: cover;
	}
	#bottom TABLE.footer {
		margin: 0 auto;
		height: auto;
	}
	#bottom TABLE.footer TD.url A,
	#bottom TABLE.footer TD.phone {
		font-size: 18px;
	}
}
