/*
 * Mourning welcome page for the WordPress front page (page ID 1952).
 * Every selector is scoped to this page so the school home page is unaffected.
 */

body.page-id-1952 {
	--mourning-black: #080808;
	--mourning-charcoal: #151515;
	--mourning-silver: #c8c8c8;
	--mourning-platinum: #eeeeec;
	--mourning-forest: #173b2e;
	--mourning-forest-light: #2f624c;
	--mourning-cream: #f7f5ec;
	--mourning-line: rgba(255, 255, 255, 0.2);
	--mourning-white: #f4f4f4;
	min-height: 100vh;
	min-height: 100svh;
	margin: 0;
	overflow-x: hidden;
	background:
		radial-gradient(circle at 50% -16%, rgba(255, 255, 255, 0.88) 0, rgba(244, 247, 241, 0.4) 34%, transparent 62%),
		repeating-linear-gradient(135deg, rgba(29, 70, 52, 0.022) 0 1px, transparent 1px 8px),
		linear-gradient(155deg, #edf2ea 0%, #d0dccd 48%, #afc0ae 100%) !important;
	background-attachment: fixed !important;
	color: var(--mourning-white);
	font-family: "Line", "Leelawadee UI", Tahoma, sans-serif !important;
}

body.page-id-1952::before {
	position: fixed;
	z-index: 0;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(24, 65, 47, 0.1), transparent 20%, transparent 80%, rgba(24, 65, 47, 0.1)),
		radial-gradient(ellipse at center, transparent 48%, rgba(31, 69, 51, 0.12) 100%);
	content: "";
	pointer-events: none;
}

body.page-id-1952 *,
body.page-id-1952 *::before,
body.page-id-1952 *::after {
	box-sizing: border-box;
}

body.page-id-1952 #page,
body.page-id-1952 .site-canvas,
body.page-id-1952 .site-content {
	position: relative;
	z-index: 1;
	width: 100%;
	min-height: 100vh;
	min-height: 100svh;
	margin: 0;
	background: transparent !important;
}

body.page-id-1952 .site-content {
	display: flex;
	padding: clamp(22px, 4vh, 48px) 0;
	align-items: center;
	justify-content: center;
}

body.page-id-1952 .site-content > .container {
	width: min(1500px, calc(100% - 64px)) !important;
	max-width: none !important;
	margin: 0 auto !important;
	padding: 0 !important;
}

body.page-id-1952 #primary,
body.page-id-1952 #main,
body.page-id-1952 article,
body.page-id-1952 .entry-content,
body.page-id-1952 #pl-1952 {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}

/* The official memorial artwork already contains the full heading and message. */
body.page-id-1952 .entry-header {
	display: none !important;
}

/* Remove the former outer card and every generated row background. */
body.page-id-1952 article,
body.page-id-1952 article::before,
body.page-id-1952 #pg-1952-0,
body.page-id-1952 #pg-1952-0 > .panel-row-style,
body.page-id-1952 #pgc-1952-0-0,
body.page-id-1952 #panel-1952-0-0-0,
body.page-id-1952 #panel-1952-0-0-0 .so-widget-sow-image,
body.page-id-1952 #panel-1952-0-0-0 .sow-image-container {
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

body.page-id-1952 article::before {
	display: none !important;
	content: none !important;
}

/*
 * Match the row width to the artwork's 3000:1575 aspect ratio. This keeps
 * the link hit area exactly on the visible image when viewport height limits it.
 */
body.page-id-1952 #pg-1952-0 {
	width: min(100%, calc((100svh - 210px) * 1.904762)) !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

body.page-id-1952 #panel-1952-0-0-0 .sow-image-container,
body.page-id-1952 #panel-1952-0-0-0 .sow-image-container a {
	display: flex !important;
	align-items: center;
	justify-content: center;
}

body.page-id-1952 #panel-1952-0-0-0 .sow-image-container a {
	width: 100% !important;
	cursor: pointer !important;
	outline-offset: 5px;
	pointer-events: auto !important;
}

body.page-id-1952 #panel-1952-0-0-0 img {
	display: block;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	max-height: calc(100svh - 210px);
	margin: 0 auto !important;
	border: 0;
	border-radius: 0;
	box-shadow: 0 24px 64px rgba(27, 59, 44, 0.28);
	filter: grayscale(1);
	object-fit: contain;
	pointer-events: auto;
}

/* Keep only the middle button column and remove unused generated rows. */
body.page-id-1952 #pg-1952-1 {
	display: flex !important;
	width: 100%;
	margin: clamp(20px, 3vh, 30px) 0 0 !important;
	padding: 0 !important;
	align-items: center;
	justify-content: center;
}

body.page-id-1952 #pgc-1952-1-0,
body.page-id-1952 #pgc-1952-1-2,
body.page-id-1952 #pg-1952-2,
body.page-id-1952 #pg-1952-3 {
	display: none !important;
}

body.page-id-1952 #pgc-1952-1-1,
body.page-id-1952 #panel-1952-1-1-0,
body.page-id-1952 #panel-1952-1-1-0 > div,
body.page-id-1952 .ow-button-base {
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

body.page-id-1952 .ow-button-base a {
	position: relative;
	display: inline-flex !important;
	min-width: 230px;
	min-height: 52px;
	overflow: hidden;
	padding: 12px 28px !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: linear-gradient(145deg, var(--mourning-forest-light) 0%, var(--mourning-forest) 54%, #0f2b21 100%) !important;
	border: 1px solid #789784 !important;
	border-radius: 3px !important;
	box-shadow:
		0 12px 30px rgba(25, 63, 45, 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
	color: var(--mourning-white) !important;
	font-size: 17px !important;
	font-weight: 500 !important;
	line-height: 1.4 !important;
	letter-spacing: 0.01em;
	text-shadow: none !important;
	transition:
		border-color 220ms ease,
		box-shadow 220ms ease,
		color 220ms ease,
		transform 220ms ease;
}

body.page-id-1952 .ow-button-base a::before {
	position: absolute;
	inset: 0;
	background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.22) 48%, transparent 72%);
	content: "";
	pointer-events: none;
	transform: translateX(-130%);
	transition: transform 520ms ease;
}

body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:hover,
body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:focus {
	background: linear-gradient(145deg, #fffef9 0%, #e8eee5 54%, #cbd9cb 100%) !important;
	border-color: #ffffff !important;
	box-shadow:
		0 16px 38px rgba(24, 64, 45, 0.34),
		inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
	color: var(--mourning-forest) !important;
	transform: translateY(-2px);
}

body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:hover > span,
body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:hover .sow-icon-fontawesome,
body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:focus > span,
body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:focus .sow-icon-fontawesome {
	color: var(--mourning-forest) !important;
}

body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:hover::before,
body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:focus::before {
	transform: translateX(130%);
}

body.page-id-1952 .so-widget-sow-button .ow-button-base a.ow-button-hover:active {
	background: linear-gradient(145deg, #e5ebe2 0%, #c3d2c3 100%) !important;
	border-color: #ffffff !important;
	box-shadow:
		0 7px 18px rgba(24, 64, 45, 0.28),
		inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
	color: var(--mourning-forest) !important;
	transform: translateY(0);
}

body.page-id-1952 .ow-button-base a:focus-visible,
body.page-id-1952 #panel-1952-0-0-0 a:focus-visible {
	outline: 2px solid var(--mourning-white);
	outline-offset: 5px;
}

body.page-id-1952 #pl-1952::after {
	display: block;
	margin-top: clamp(18px, 2.5vh, 28px);
	color: #53675c;
	content: "โรงเรียนชุมแพศึกษา  •  CHUMPHAESUKSA SCHOOL";
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.08em;
	line-height: 1.5;
	text-align: center;
}

/* iPad portrait and landscape */
@media (max-width: 1199px) {
	body.page-id-1952 .site-content {
		padding: 24px 0;
	}

	body.page-id-1952 .site-content > .container {
		width: calc(100% - 32px) !important;
	}

	body.page-id-1952 #panel-1952-0-0-0 img {
		max-height: calc(100svh - 190px);
	}

	body.page-id-1952 #pg-1952-0 {
		width: min(100%, calc((100svh - 190px) * 1.904762)) !important;
	}
}

/* Smartphone portrait */
@media (max-width: 599px) {
	body.page-id-1952 .site-content {
		padding: 16px 0 20px;
		align-items: flex-start;
	}

	body.page-id-1952 .site-content > .container {
		width: calc(100% - 24px) !important;
	}

	body.page-id-1952 #panel-1952-0-0-0 img {
		width: 100% !important;
		max-height: none;
		box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
	}

	body.page-id-1952 #pg-1952-1 {
		margin-top: 20px !important;
	}

	body.page-id-1952 #pgc-1952-1-1,
	body.page-id-1952 #panel-1952-1-1-0,
	body.page-id-1952 #panel-1952-1-1-0 > div,
	body.page-id-1952 .ow-button-base {
		width: 100% !important;
	}

	body.page-id-1952 .ow-button-base a {
		width: 100% !important;
		min-width: 0;
		min-height: 50px;
		font-size: 16px !important;
	}

	body.page-id-1952 #pl-1952::after {
		margin-top: 18px;
		font-size: 10px;
		letter-spacing: 0.035em;
	}
}

/* Tablets and phones in a short landscape viewport */
@media (max-height: 540px) and (min-width: 560px) {
	body.page-id-1952 .site-content {
		padding: 14px 0;
		align-items: flex-start;
	}

	body.page-id-1952 .site-content > .container {
		width: calc(100% - 28px) !important;
	}

	body.page-id-1952 #panel-1952-0-0-0 img {
		max-height: calc(100svh - 142px);
	}

	body.page-id-1952 #pg-1952-0 {
		width: min(100%, calc((100svh - 142px) * 1.904762)) !important;
	}

	body.page-id-1952 #pg-1952-1 {
		margin-top: 14px !important;
	}

	body.page-id-1952 .ow-button-base a {
		min-height: 44px;
		padding-top: 8px !important;
		padding-bottom: 8px !important;
		font-size: 15px !important;
	}

	body.page-id-1952 #pl-1952::after {
		margin-top: 10px;
		font-size: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.page-id-1952 *,
	body.page-id-1952 *::before,
	body.page-id-1952 *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}
