/*
 * Bangkok Audit Theme. Mobile first: the base rules are for phones and `min-width` queries add larger screens.
 * Sizes and colours match the site as it was built with the page builder (measured at 390, 768 and 1440 px).
 */

@font-face {
	font-family: "Maledpan";
	src: url("../fonts/maledpan-light-webfont.woff2") format("woff2"), url("../fonts/maledpan-light-webfont.woff") format("woff");
	font-weight: 200;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maledpan";
	src: url("../fonts/maledpan-regular-webfont.woff2") format("woff2"), url("../fonts/maledpan-regular-webfont.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Maledpan";
	src: url("../fonts/maledpan-bold-webfont.woff2") format("woff2"), url("../fonts/maledpan-bold-webfont.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--ba-blue: #069;
	--ba-blue-dark: #004d73;
	--ba-teal: #00c1c4;
	--ba-bg: #e4e4e4;
	--ba-text: #333;
	--ba-text-soft: #444;
	--ba-muted: #767676;
	--ba-text-on-bg: #666;
	--ba-share-facebook: #1372ed;
	--ba-share-line: #008a18;
	--ba-tile-text: #254655;
	--ba-container: 1120px;
	--ba-gutter: 10px;
	--ba-header-height: 66px;
}

@media (min-width: 1025px) {
	:root {
		--ba-header-height: 80px;
	}
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: #fff;
	color: var(--ba-text);
	font-family: Maledpan, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img,
iframe,
video,
embed {
	max-width: 100%;
}

img {
	height: auto;
}

a {
	color: var(--ba-blue);
}

p {
	margin: 0 0 14.4px;
}

ul,
ol {
	margin: 0 0 14.4px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 14.4px;
	font-weight: 500;
	line-height: 1.2;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100;
	width: auto;
	height: auto;
	margin: 0;
	padding: 12px 20px;
	clip: auto;
	background: #fff;
	color: var(--ba-blue);
}

.container {
	width: min(var(--ba-container), 100% - 2 * var(--ba-gutter));
	margin-inline: auto;
}

.section {
	padding-block: 0 30px;
}

.button,
.wp-block-button__link {
	display: inline-block;
	padding: 20px 40px;
	border: 0;
	border-radius: 3px;
	background: var(--ba-blue);
	color: #fff;
	font-family: inherit;
	font-size: 18px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.button:hover,
.button:focus-visible,
.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	background: var(--ba-blue-dark);
	color: #fff;
}

.box {
	padding: 30px;
	background: #fff;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* ---------- Header ---------- */

.site-header {
	position: relative;
	z-index: 20;
	background: #fff;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: min(var(--ba-container), 100% - 2 * var(--ba-gutter));
	min-height: var(--ba-header-height);
	margin-inline: auto;
}

.site-logo {
	display: block;
	color: var(--ba-blue);
	text-decoration: none;
}

.site-logo__image {
	display: block;
	width: 100px;
	height: auto;
}

.nav-toggle {
	position: relative;
	width: 33px;
	height: 33px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ba-blue);
	cursor: pointer;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
	position: absolute;
	left: 5px;
	width: 22px;
	height: 3px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle__icon {
	top: 15px;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
	content: "";
	left: 0;
}

.nav-toggle__icon::before {
	top: -8px;
}

.nav-toggle__icon::after {
	top: 8px;
}

.site-header.is-nav-open .nav-toggle__icon {
	background: transparent;
}

.site-header.is-nav-open .nav-toggle__icon::before {
	top: 0;
	transform: rotate(45deg);
}

.site-header.is-nav-open .nav-toggle__icon::after {
	top: 0;
	transform: rotate(-45deg);
}

/* The menu opens under the header on phones and tablets. */
.primary-nav {
	position: absolute;
	top: 100%;
	right: 0;
	left: 0;
	display: none;
	border-top: 4px solid var(--ba-blue-dark);
	background: #fff;
	box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.site-header.is-nav-open .primary-nav {
	display: block;
}

.primary-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav__list li {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0;
}

.primary-nav__list a {
	display: flex;
	flex: 1 1 auto;
	align-items: center;
	min-height: 40px;
	padding: 10px 20px;
	color: var(--ba-blue);
	font-size: 18px;
	line-height: 20px;
	text-decoration: none;
}

.primary-nav__list .current-menu-item > a {
	background: var(--ba-blue);
	color: #fff;
}

.primary-nav__list .wpml-ls-flag {
	display: block;
	width: 18px;
	height: 12px;
}

.submenu-toggle {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--ba-blue);
	cursor: pointer;
}

.submenu-toggle::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: 0 auto 4px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.2s ease;
}

.menu-item-has-children.is-open > .submenu-toggle::before {
	transform: rotate(225deg);
}

.primary-nav__list .sub-menu {
	display: none;
	flex: 0 0 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav__list .is-open > .sub-menu {
	display: block;
}

.primary-nav__list .sub-menu a {
	padding-left: 40px;
	font-size: 16px;
}

@media (min-width: 1025px) {
	.nav-toggle {
		display: none;
	}

	.primary-nav {
		position: static;
		display: block;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.primary-nav__list {
		display: flex;
		align-items: stretch;
	}

	.primary-nav__list a {
		min-height: 0;
		padding: 30px 15px;
		font-size: 19px;
	}

	.primary-nav__list .current-menu-item > a {
		background: transparent;
		color: var(--ba-blue);
	}

	.primary-nav__list .menu-item-has-children > a {
		padding-right: 0;
	}

	.primary-nav__list .wpml-ls-item {
		margin-top: 5px;
	}

	.submenu-toggle {
		flex: 0 0 30px;
		width: 30px;
		height: 80px;
	}

	.primary-nav__list .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 30;
		min-width: 240px;
		background: #fff;
		box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
	}

	.primary-nav__list li:hover > .sub-menu,
	.primary-nav__list li:focus-within > .sub-menu,
	.primary-nav__list .is-open > .sub-menu {
		display: block;
	}

	.primary-nav__list .sub-menu a {
		padding: 12px 20px;
		font-size: 17px;
	}

	.primary-nav__list .sub-menu a:hover,
	.primary-nav__list .sub-menu a:focus-visible {
		background: var(--ba-blue);
		color: #fff;
	}
}

/* ---------- Main area ---------- */

.site-main {
	padding-bottom: 30px;
	background: var(--ba-bg);
}

.title-bar {
	margin-bottom: 30px;
	background: var(--ba-blue);
	color: #fff;
}

.title-bar__inner {
	width: min(var(--ba-container), 100% - 2 * var(--ba-gutter));
	margin-inline: auto;
	padding-block: 20px;
}

.title-bar__title {
	margin: 0;
	color: inherit;
	font-size: 29px;
	font-weight: 400;
	line-height: 1;
}

/* Blocks of a page sit in the 1120 px column, except the ones that are full width. */
.entry-content > * {
	width: min(var(--ba-container), 100% - 2 * var(--ba-gutter));
	margin-inline: auto;
}

.entry-content > .alignfull {
	width: auto;
	max-width: none;
}

.entry-content > * + * {
	margin-top: 30px;
}

:where(.entry-content) h2 {
	margin-top: 50px;
	margin-bottom: 40px;
	color: var(--ba-blue);
	font-size: 39px;
	font-weight: 400;
	line-height: 1;
}

/* The heading rules above use :where() so that a block's own heading (a card title, a tile label) is not restyled by them. */

/* The thin rule above a section heading, as on the current site; the text stays where it was. */
.entry-content h2.ba-section-title {
	margin-top: 39px;
	padding-top: 10px;
	border-top: 1px solid var(--ba-blue);
}

:where(.entry-content) h2 span {
	color: var(--ba-muted);
	font-size: 75%;
	font-weight: 500;
}

.entry-content h2 + * {
	margin-top: 0;
}

:where(.entry-content) h3 {
	color: var(--ba-blue);
	font-size: 29px;
	line-height: 1;
}

.entry-content > .wp-block-buttons {
	margin-top: 20px;
}

.entry-content > .ba-services {
	margin-top: 0;
}

.entry-content > .ba-banner {
	margin-bottom: 30px;
}

.entry-content > .ba-banner--tall {
	margin-bottom: 0;
}

.entry-content > .ba-banner + * {
	margin-top: 0;
}

.entry-content > .ba-banner--tall + .is-style-ba-box {
	margin-top: -40px;
}

.wp-block-group.is-style-ba-box {
	position: relative;
	padding: 30px;
	background: #fff;
	box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.wp-block-group.is-style-ba-box > :last-child {
	margin-bottom: 0;
}

.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

.wp-block-columns {
	display: flex;
	flex-direction: column;
	gap: 30px;
}

.wp-block-column {
	min-width: 0;
}

@media (min-width: 768px) {
	.wp-block-columns {
		flex-direction: row;
		gap: 40px;
	}

	.wp-block-column {
		flex: 1 1 0;
	}
}

.entry-content--post {
	margin-block: 30px;
}

.entry-content--post iframe,
.entry-content--post embed,
.entry-content--post object {
	width: 100%;
}

.entry-back {
	margin: 30px 0 0;
}

.entry-back .button {
	padding: 12px 28px;
	font-size: 16px;
}

.ba-share {
	margin-top: 20px;
}

.no-results {
	margin: 0;
	padding: 30px;
	background: #fff;
}

.post-list {
	margin: 0;
	padding: 30px;
	background: #fff;
}

.pagination {
	margin-top: 30px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pagination .page-numbers {
	display: inline-block;
	min-width: 40px;
	padding: 10px 14px;
	background: #fff;
	color: var(--ba-blue);
	text-align: center;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--ba-blue);
	color: #fff;
}

/* ---------- Footer ---------- */

.site-footer {
	background: #fff;
}

.site-footer__main {
	padding-block: 30px;
}

.site-footer__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	width: min(var(--ba-container), 100% - 2 * var(--ba-gutter));
	margin-inline: auto;
}

.site-footer__logo {
	display: block;
	width: 140px;
	height: auto;
}

.site-footer__company {
	margin: 0 0 14px;
	color: var(--ba-blue);
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
}

.site-footer__address {
	margin: 0;
	color: var(--ba-text-soft);
}

/* iOS Safari data detectors wrap phone, e-mail and address text in links; keep footer contact text unlined. */
.site-footer__company a,
.site-footer__address a,
.site-footer a[x-apple-data-detectors] {
	color: inherit;
	text-decoration: none;
	border: 0;
}

.site-footer__company a:focus-visible,
.site-footer__address a:focus-visible,
.site-footer a[x-apple-data-detectors]:focus-visible {
	outline: 2px solid var(--ba-blue);
	outline-offset: 2px;
}

/* A Thai word that bangkok_audit_keep_words() marked is not cut at the end of a line. */
.keep-together {
	white-space: nowrap;
}

.footer-menu__title {
	margin: 0 0 20px;
	color: var(--ba-blue);
	font-size: 29px;
	font-weight: 500;
	line-height: 1;
}

.footer-menu__list {
	margin: 0;
	padding: 0;
	border-bottom: 1px dotted var(--ba-text-soft);
	list-style: none;
}

.footer-menu__list li {
	margin: 0;
	border-top: 1px dotted var(--ba-text-soft);
}

.footer-menu__list a {
	display: block;
	padding: 13px 20px;
	color: var(--ba-text-soft);
	line-height: 20px;
	text-decoration: none;
}

.footer-menu__list a:hover,
.footer-menu__list a:focus-visible {
	color: var(--ba-blue);
}

.site-footer__bar {
	padding-block: 11px;
	background: var(--ba-blue);
	color: #fff;
}

.site-footer__copyright {
	margin: 0;
	font-size: 15px;
	line-height: 22px;
}

@media (min-width: 768px) {
	.site-footer__inner {
		grid-template-columns: 2fr 1fr;
		gap: 20px;
	}

	.site-footer__company {
		font-size: 32px;
	}

	.footer-menu {
		padding-right: 40px;
	}
}

@media (min-width: 1025px) {
	.site-footer__inner {
		grid-template-columns: 1fr 379px;
	}
}

/* A PDF viewer from the file block: as wide as the text and as tall as the screen allows. The saved block carries a fixed
   600px height in its markup, hence !important. */
.entry-content .wp-block-file__embed {
	display: block;
	width: 100%;
	min-height: 420px;
	height: 70vh !important;
}

@media (min-width: 768px) {
	.entry-content .wp-block-file__embed {
		height: min(80vh, 900px) !important;
	}
}
