/*
 -----------------------------
 PVII Drop Menu Magic
 Essential Educational Staffing
 -----------------------------
 Strategy: work WITH the PVII JS, not against it.
 PVII JS enables the hamburger toggle when it detects
 .p7DMM-toolbar is visible on load. We reveal the
 toolbar at ALL screen sizes via a small media query
 override so the JS always initialises in hamburger mode.
 The menu open/close classes (opened / closed) are left
 entirely to the JS — we only control styling.
 -----------------------------
*/


/* =============================================
   UTILITY BAR — ไทย | ENG strip
   ============================================= */

.righttablecell {
	width: 100%;
	background-color: #f0f0f0;
	border-bottom: 1px solid #e0e0e0;
	display: flex !important;
	justify-content: flex-end;
	align-items: center;
	padding: 5px 24px;
	box-sizing: border-box;
	line-height: 1;
}

.righttablecell > div {
	display: inline-flex;
	align-items: center;
	gap: 0;
	padding: 0;
	margin: 0;
}

.righttablecell a {
	display: inline-block;
	color: #444444;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	line-height: 1;
	padding: 2px 5px;
	white-space: nowrap;
	transition: color 0.15s;
}

.righttablecell a:hover {
	color: #000000;
}

.righttablecell span {
	font-size: 12px;
	color: #aaaaaa;
	line-height: 1;
	padding: 0 2px;
}

/* Hide search bar */
.righttablecell form,
.righttablecell input,
.righttablecell button,
.righttablecell select {
	display: none !important;
}


/* =============================================
   HEADER — logo left, hamburger right
   ============================================= */

.toptable {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	max-width: 1300px;
	margin: 0 auto;
	padding: 0;
	box-sizing: border-box;
	background-color: #ffffff;
	position: relative; /* dropdown anchors here */
}

/* Logo cell — grows to fill space, logo stays left */
.lefttablecell {
	display: flex;
	justify-content: flex-start;
	align-items: center;
	flex: 1 1 auto;
	padding: 12px 24px;
	box-sizing: border-box;
}

.lefttablecell img,
.lefttablecell svg {
	max-width: 280px;
	width: auto;
	height: auto;
	display: block;
}

/* Nav wrapper — shrinks to just the toolbar button */
#p7DMM_1,
.p7DMM01,
.p7DMM01.p7dmm-centered,
.p7DMM01.p7dmm-centered.responsive,
.p7DMM01.p7dmm-centered.dmm01-pop {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 12px 24px 12px 0;
	box-sizing: border-box;
	position: static;
	flex: 0 0 auto;
}

.p7DMM01 {
	position: static;
}

.p7DMM01:after {
	content: "";
	clear: both;
	display: block;
	height: 0;
	line-height: 0;
	font-size: 0;
}


/* =============================================
   HIDE THE INLINE MENU — all screen sizes
   The menu is now only accessible via hamburger.
   PVII JS controls opened/closed classes on the ul.
   ============================================= */

.p7DMM01 ul {
	margin: 0;
	padding: 0;
	list-style: none;
	/* Hidden by default — PVII JS will add "opened" class */
	display: none;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: 0;
}

/* PVII JS adds class "opened" when hamburger is clicked */
.p7DMM01 ul.opened {
	display: block !important;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9999;
	background: #ffffff;
	border-top: 3px solid #bac405;
	box-shadow: 0 6px 20px rgba(0,0,0,0.12);
	text-align: left;
	max-height: 80vh;
	overflow-y: auto;
}

/* PVII JS adds class "closed" when hamburger closes */
.p7DMM01 ul.closed {
	display: none !important;
}

.p7DMM.responsive ul.closed {
	display: none !important;
}

.p7DMM01 ul li {
	list-style-type: none;
	float: none;
	padding: 0;
	margin: 0;
	display: block;
	width: 100%;
}

.p7DMM01 ul > li > a {
	color: #222222;
	font-size: 1em;
	padding: 14px 28px;
	text-decoration: none;
	display: block;
	white-space: nowrap;
	box-sizing: border-box;
	border-bottom: 1px solid #eeeeee;
	background: #ffffff;
}

.p7DMM01 ul > li > a:hover,
.p7DMM01 ul > li > a:focus,
.p7DMM01 ul > li > a.open {
	outline: none;
	color: #0060c0;
	background-color: #f5f8fc;
}

.p7DMM01 ul > li:last-child > a {
	border-bottom: none;
}

.p7DMM01 ul a.current_mark {
	color: #0060c0;
	font-weight: 600;
}

.p7DMM01 ul a.current_mark.closed,
.p7DMM01 ul a.current_mark:hover {
	color: #0060c0;
}


/* =============================================
   SUB MENUS
   ============================================= */

.p7dmm-sub-wrapper {
	position: relative;
	top: auto;
	left: auto;
	width: 100%;
	display: none;
	z-index: 9999;
}

.p7DMM01 ul ul {
	margin: 0;
	padding: 0;
	display: block;
	background: #f5f7fa;
}

.p7DMM01 ul ul li {
	padding: 0;
	display: block;
	float: none;
	margin: 0;
}

.p7DMM01 ul ul a {
	background-color: transparent;
	font-size: 0.9em;
	padding: 11px 48px;
	color: #555555;
	white-space: normal;
	border-bottom: 1px solid #ebebeb;
	box-shadow: none;
	display: block;
}

.p7DMM01 ul ul a:hover {
	background-color: #eaf0f8;
	color: #0060c0;
}

.p7DMM01 ul ul a.current_mark {
	color: #0060c0;
	font-weight: 500;
}


/* =============================================
   HAMBURGER TOOLBAR
   Key: must be visible (not display:none) at ALL
   screen sizes so PVII JS initialises toggle mode.
   ============================================= */

.p7DMM-toolbar {
	display: block !important;
	position: static;
	z-index: 1000;
	text-align: right;
	padding: 0;
	cursor: pointer;
	background: transparent !important;
	line-height: 1;
}

.p7DMM-toolbar img {
	border: none;
	padding: 0;
	opacity: 1;
	display: inline-block;
}

.p7DMM-toolbar a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #222222;
	text-decoration: none;
	background-color: transparent !important;
	border: none !important;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	padding: 8px 0;
	cursor: pointer;
}

.p7DMM-toolbar a:hover {
	color: #0060c0;
}

/* CSS hamburger — three lines drawn via box-shadow */
.p7DMM-toolbar a::before {
	content: "";
	display: inline-block;
	width: 26px;
	height: 2px;
	background: currentColor;
	box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor;
	flex-shrink: 0;
	vertical-align: middle;
}


/* =============================================
   SUPPRESS STRAY PIPE CHARACTER
   The | separator between ไทย and ENG can leak
   outside .righttablecell if HTML structure varies.
   ============================================= */

span.responsive {
	display: none !important;
}

/* Any bare pipe/separator span not inside righttablecell */
.p7DMM01 span,
.lefttablecell > span {
	display: none;
}


/* =============================================
   POP MENU MODE
   ============================================= */

.p7DMM01.dmm01-pop .p7dmm-sub-wrapper {
	text-align: left;
	padding: 0;
	width: 260px;
	left: auto;
	right: 0;
	position: absolute;
	display: none;
	z-index: 9999;
}

.p7DMM01.dmm01-pop ul ul {
	background-color: #ffffff;
	border-radius: 0 0 5px 5px;
	border: 1px solid #e0e0e0;
	border-top: none;
	box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}

.p7DMM01.dmm01-pop ul ul li {
	padding: 0;
	float: none;
	margin: 0;
}

.p7DMM01.dmm01-pop ul ul a {
	background-color: transparent;
	box-shadow: none;
	border-radius: 0;
	font-size: 0.88em;
	padding: 10px 20px;
	color: #444444;
	border: none;
	border-bottom: 1px solid #f0f0f0;
}

.p7DMM01.dmm01-pop ul ul li:last-child a {
	border-radius: 0 0 5px 5px;
	border-bottom: none;
}

.p7DMM01.dmm01-pop ul ul a:hover {
	background-color: #f0f5fb;
	color: #0060c0;
}

.p7DMM01.dmm01-pop ul ul a.current_mark {
	color: #0060c0;
	font-weight: 500;
}


/* =============================================
   VERTICAL MENU — kept for compatibility
   ============================================= */

.p7DMM01.dmm-vertical ul a.trig {
	background-image: url(img/p7dmm_east_black.gif);
	background-repeat: no-repeat;
	background-position: left center;
}

.p7DMM01.dmm-vertical ul a.open.trig {
	background-image: url(img/p7dmm_south_black.gif);
	background-repeat: no-repeat;
	background-position: left center;
}

.p7DMM01.dmm-vertical {
	background-color: transparent;
	box-shadow: none;
	border-bottom: none;
}

.p7DMM01.dmm-vertical ul,
.p7DMM01.dmm-vertical ul ul {
	display: block;
	padding: 0;
	margin: 0;
}

.p7DMM01.dmm-vertical ul ul {
	border-radius: 0 0 5px 5px;
	background-color: #f2f2f2;
}

.p7DMM01.dmm-vertical ul li,
.p7DMM01.dmm-vertical ul ul li {
	float: none;
	display: block;
	padding: 0;
	margin-right: 0 !important;
}

.p7DMM01.dmm-vertical ul li {
	margin-bottom: 8px;
}

.p7DMM01.dmm-vertical ul li:last-child {
	margin-bottom: 0;
}

.p7DMM01.dmm-vertical ul ul li {
	margin-bottom: 0;
}

.p7DMM01.dmm-vertical ul a {
	padding: 8px 18px;
}

.p7DMM01.dmm-vertical ul a.open {
	border-radius: 5px 5px 0 0;
}

.p7DMM01.dmm-vertical ul ul a {
	border-top: none;
	border-radius: 0;
	border-bottom: 1px solid rgba(0,0,0,0.10);
	border-left: 1px solid rgba(0,0,0,0.08);
	border-right: 1px solid rgba(0,0,0,0.08);
	background-color: transparent;
	font-size: .9em;
}

.p7DMM01.dmm-vertical ul ul li:last-child a {
	border-radius: 0 0 4px 4px;
}

.p7DMM01.dmm-vertical ul ul a:hover {
	background-color: #ddeaf5;
	color: #0060c0;
}

.p7DMM01.dmm-vertical .p7dmm-sub-wrapper {
	width: 100%;
	position: relative;
	padding: 0;
	margin: 0;
	top: 0;
}


/* =============================================
   RESPONSIVE — TABLET
   ============================================= */

@media only screen and (min-width: 701px) and (max-width: 1200px) {
	.lefttablecell img {
		max-width: 220px;
	}

	.lefttablecell {
		padding: 10px 18px;
	}

	#p7DMM_1,
	.p7DMM01,
	.p7DMM01.p7dmm-centered {
		padding: 10px 18px 10px 0;
	}

	.righttablecell {
		padding: 5px 18px;
	}
}


/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */

@media only screen and (max-width: 700px) {
	.toptable {
		flex-wrap: wrap;
	}

	.righttablecell {
		width: 100%;
		justify-content: center;
		order: -1;
	}

	.lefttablecell {
		padding: 10px 16px;
		flex: 1;
	}

	.lefttablecell img {
		max-width: 200px;
	}

	#p7DMM_1,
	.p7DMM01,
	.p7DMM01.p7dmm-centered {
		padding: 10px 16px 10px 0;
	}

	.p7DMM01.responsive {
		width: auto;
		padding: 10px 16px 10px 0;
		margin: 0;
	}

	.p7DMM01.responsive .p7dmm-sub-wrapper {
		width: 100%;
		position: relative;
		padding: 0;
		margin: 0;
		top: 0;
		box-shadow: none;
		border: none;
	}

	.p7DMM01.responsive ul li a {
		text-align: left;
		white-space: normal;
	}

	.p7DMM01.dmm01-pop .p7dmm-sub-wrapper {
		width: 100%;
		left: 0;
		right: 0;
	}

	.p7DMM01.responsive .lang-switcher,
	.p7DMM01.responsive .language-switcher,
	.p7DMM01.responsive form {
		display: none !important;
	}

	.p7DMM01.responsive .p7DMM-toolbar,
	.p7DMM01.dmm-vertical .p7DMM-toolbar {
		display: block !important;
		position: static;
	}
}


/* =============================================
   LANDSCAPE PHONES
   ============================================= */

@media only screen and (max-device-width: 480px) and (orientation: landscape) {
	.p7DMM01.responsive ul a {
		font-size: 1em;
		padding: 10px 24px;
	}

	.p7DMM01.responsive ul ul a {
		font-size: 0.9em;
		padding: 9px 40px;
	}
}