/*
 * Base layout for thairoads-block. Written for this theme to replace the Divi layout primitives
 * that the ported child CSS (legacy-child.css) builds on. Geometry measured on the old site:
 * 1080px rows, 5.5% gutters, 156px header, 54px section padding.
 */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; line-height: 1.7em; font-weight: 500; -webkit-font-smoothing: antialiased; }
p { padding-bottom: 1em; margin: 0; }
p:last-of-type { padding-bottom: 0; }
h1, h2, h3, h4, h5, h6 { color: #333; padding-bottom: 10px; line-height: 1em; font-weight: 500; margin: 0; }
a { text-decoration: none; }
img { max-width: 100%; height: auto; }
ul { list-style: disc; padding: 0 0 23px 1em; line-height: 26px; margin: 0; }
ol { list-style: decimal; padding: 0 0 23px 1em; line-height: 26px; margin: 0; }
strong, b { font-weight: bold; }
table { border-collapse: collapse; }
.clearfix::after { content: ""; display: table; clear: both; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.alignleft { float: left; } .alignright { float: right; }

.wp-site-blocks { padding: 0 !important; }
.wp-site-blocks > * { margin-block-start: 0 !important; }
.thairoads-header-part, .thairoads-footer-part { margin: 0 !important; }

.container { width: 80%; max-width: 1080px; margin: 0 auto; position: relative; }

/* ---------------- header */
#main-header { position: relative; z-index: 99; width: 100%; height: 156px; background-color: transparent; }
#main-header .container { height: 156px; }
.logo_container { position: absolute; top: 0; left: 0; height: 100px; width: 100%; }
.logo_helper { display: inline-block; height: 100%; vertical-align: middle; width: 0; }
#logo { display: inline-block; vertical-align: middle; max-height: 39px; width: auto; margin-left: 5px; margin-top: -19px; }
#et-top-navigation { position: absolute; top: 100px; left: 0; width: 100%; height: 56px; }
#top-menu-nav { float: left; }
#top-menu { list-style: none; margin: 0; padding: 0; line-height: 0; }
#top-menu li { list-style: none; position: relative; }
#top-menu > li { display: inline-block; }
#top-menu > li > a { display: block; color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }
#top-menu .menu-item-has-children > a:first-child::after { content: ""; position: absolute; }
#top-menu .sub-menu { display: none; position: absolute; top: 100%; left: 0; z-index: 9999; width: 240px; padding: 20px 0; margin: 0; background: #fff; border-top: 3px solid #2ea3f2; box-shadow: 0 2px 5px rgba(0,0,0,.1); line-height: 1.3; text-align: left; }
#top-menu li:hover > .sub-menu, #top-menu li:focus-within > .sub-menu { display: block; }
#top-menu .sub-menu li { display: block; padding: 0 20px; height: auto; line-height: 1.3; margin: 0; border: 0; float: none; }
#top-menu .sub-menu li a { display: block; padding: 6px 20px; width: 200px; font-size: 18px; color: #0060b6; }
#top-menu .sub-menu li a:hover { background: rgba(0,0,0,.03); opacity: .7; }
.thairoads-menu-toggle { display: none; }

/* language selector: same markup as WPML lang_sel_click; the child theme showed both languages side by side */
#lang_sel_click { position: absolute; right: 0; top: 18px; font-size: 17px; line-height: 23px; z-index: 100; }
#lang_sel_click ul { list-style: none; margin: 0; padding: 0; }
#lang_sel_click a { text-decoration: none; }
#lang_sel_click li ul { float: left; }

/* ---------------- content */
#main-content { background: #fff; }
#main-content .container { padding-top: 58px; }
.et_right_sidebar #main-content .container::before { content: ""; position: absolute; top: 0; right: 20.875%; height: 100%; width: 1px; background: #e2e2e2; margin-right: -30px; }
.thairoads-page #main-content, main#main-content { padding: 0; }
#left-area { width: 79.125%; padding-bottom: 23px; float: left; padding-right: 5.5%; }
#sidebar { float: right; width: 20.875%; padding-left: 30px; }
#content-area { overflow: hidden; }
.et_pb_post { margin-bottom: 60px; word-wrap: break-word; }
.et_post_meta_wrapper h1 { padding-bottom: 10px; }
.post-meta { font-size: 14px; margin-bottom: 6px; padding-bottom: 0; color: #666; }
.et_featured_image { max-width: 100%; height: auto; margin: 15px 0 0; }
.single .et_post_meta_wrapper { padding-top: 6px; }
.entry-content table { width: 100%; border: 1px solid #eee; margin: 0 0 15px; text-align: left; }
.entry-content td, .entry-content th { padding: 6px 24px; border-top: 1px solid #eee; }
.pagination { margin: 20px 0; }
.pagination a { font-size: 18px; }
.not_found .entry h1 { padding-bottom: 10px; }
/* Divi post gallery: 3 × 216px thumbnails, 58px gaps, 32px left offset in a 795px column */
.et_post_gallery { list-style: none; padding: 0 !important; margin-bottom: 20px; display: flex; flex-wrap: wrap; }
.et_post_gallery .et_gallery_item { width: 28.3%; margin: 0 7.4% 7.4% 0; padding: 0; }
.et_post_gallery .et_gallery_item:nth-child(3n) { margin-right: 0; }
.et_post_gallery img { display: block; width: 100%; height: auto; }

/* sidebar widgets */
.et_pb_widget { margin-bottom: 30px; float: none; width: 100%; }
.et_pb_widget h4.widgettitle { font-size: 24px; padding-bottom: 10px; }
.et_pb_widget ul { list-style: none; padding: 0; margin: 0; line-height: inherit; }
.et_pb_widget ul li { margin-bottom: .5em; }
.et_pb_widget a { color: #666; }
.et_pb_widget a:hover { color: #2ea3f2; }
.et_pb_widget_area_left { border-right: 1px solid rgba(0,0,0,.1); padding-right: 30px; }
.et_pb_widget_area_right { border-left: 1px solid rgba(0,0,0,.1); padding-left: 30px; }

/* ---------------- footer */
#main-footer { background-color: #0060b6; padding-top: 40px; }
#footer-widgets { padding: 6% 0 0; }
#footer-widgets .footer-widget { float: left; color: #fff; margin-bottom: 5.5%; }
.et_pb_footer_columns_3_4__1_4 #footer-widgets .footer-widget:nth-child(1) { width: 73.625%; margin-right: 5.5%; }
.et_pb_footer_columns_3_4__1_4 #footer-widgets .footer-widget:nth-child(2) { width: 20.875%; margin-right: 0; }
#footer-widgets .footer-widget a { color: #fff; }
#footer-widgets ul { list-style: none; padding: 0; margin: 0; }
#footer-widgets .fwidget { margin-bottom: 0; }

/* ---------------- responsive */
@media (max-width: 980px) {
	.container { width: 90%; }
	#left-area, #sidebar { width: 100%; float: none; padding: 0; }
	.et_right_sidebar #main-content .container::before { display: none; }
	#top-menu-nav { float: none; }
	.thairoads-menu-toggle { display: block; position: absolute; right: 0; top: 10px; width: 40px; height: 34px; background: transparent; border: 0; cursor: pointer; }
	.thairoads-menu-toggle::before { content: "\2630"; color: #fff; font-size: 26px; line-height: 34px; }
	#top-menu { display: none; position: absolute; top: 56px; left: 0; right: 0; background: #fff; border-top: 3px solid #2ea3f2; line-height: 1.5; z-index: 999; }
	#top-menu.is-open { display: block; }
	#top-menu > li { display: block; height: auto !important; line-height: 1.5 !important; margin: 0 !important; border: 0 !important; float: none !important; }
	#top-menu > li > a { color: #0060b6 !important; padding: 8px 5% !important; background: none !important; }
	#top-menu .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 5%; width: auto; }
	#lang_sel_click { right: 50px; }
	.et_pb_footer_columns_3_4__1_4 #footer-widgets .footer-widget:nth-child(n) { width: 100%; margin-right: 0; float: none; }
}

/* Divi: links inside headings take the heading colour (post and Content Views titles are dark, not link-blue). */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: inherit; }
