/*
Theme Name: Chart Pattana Blocks
Theme URI: https://chartpattana.or.th
Author: Chart Pattana Digital Team
Description: Native WordPress block theme for Chart Pattana. Editable with the Site Editor without a page builder.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: chartpattana-block
*/

:root {
	--cp-shadow-sm: 0 8px 24px rgba(13, 50, 135, 0.08);
	--cp-shadow: 0 18px 44px rgba(13, 50, 135, 0.12);
	--cp-border: rgba(13, 50, 135, 0.12);
}

html {
	scroll-behavior: smooth;
}

body {
	overflow-x: hidden;
}

a {
	text-underline-offset: 0.18em;
}

.site-header {
	position: relative;
	z-index: 50;
	border-bottom: 1px solid var(--cp-border);
	box-shadow: 0 4px 18px rgba(13, 50, 135, 0.04);
}

.site-header__inner {
	min-height: 82px;
}

.site-header .wp-block-site-logo img {
	max-height: 58px;
	width: auto;
}

.site-header .wp-block-navigation-item__content {
	font-weight: 650;
	text-decoration: none;
}

.site-header .wp-block-navigation-item__content:hover,
.site-header .current-menu-item > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--gold);
}

.header-actions {
	white-space: nowrap;
}

.header-actions .wp-block-button__link {
	padding: 0.72rem 1rem;
}

.home-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(circle at 82% 22%, rgba(255, 168, 0, 0.20), transparent 28%),
		linear-gradient(115deg, #ffffff 0%, #fffdf7 58%, #fff7dc 100%);
}

.home-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: radial-gradient(rgba(255, 168, 0, 0.24) 1px, transparent 1px);
	background-size: 18px 18px;
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, black 58%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0%, black 58%, transparent 100%);
}

.home-hero > .wp-block-group__inner-container,
.home-hero .hero-layout {
	position: relative;
	z-index: 1;
}

.home-hero .hero-title {
	max-width: 700px;
	letter-spacing: -0.035em;
}

.home-hero .hero-lead {
	max-width: 650px;
}

.hero-eyebrow,
.section-kicker {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-weight: 750;
	color: var(--wp--preset--color--navy);
}

.hero-eyebrow::before,
.section-kicker::before {
	content: "";
	display: inline-block;
	width: 28px;
	height: 4px;
	border-radius: 99px;
	background: var(--wp--preset--color--gold);
}

.hero-art img {
	display: block;
	width: 100%;
	height: auto;
	filter: drop-shadow(0 28px 30px rgba(13, 50, 135, 0.13));
}

.section-heading-row {
	gap: 1.5rem;
}

.section-heading-row .wp-block-heading {
	margin-top: 0.3rem;
}

.news-query .wp-block-post-template,
.policy-query .wp-block-post-template {
	gap: clamp(1rem, 2vw, 1.5rem);
}

.news-card,
.policy-card,
.join-card {
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--cp-border);
	border-radius: 20px;
	background: #ffffff;
	box-shadow: var(--cp-shadow-sm);
	transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.news-card:hover,
.policy-card:hover,
.join-card:hover {
	transform: translateY(-4px);
	border-color: rgba(255, 168, 0, 0.55);
	box-shadow: var(--cp-shadow);
}

.news-card .wp-block-post-featured-image {
	margin: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wp--preset--color--cream);
}

.news-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.news-card:hover .wp-block-post-featured-image img {
	transform: scale(1.035);
}

.news-card__body {
	padding: 1.35rem 1.4rem 1.5rem;
}

.news-card .taxonomy-category a,
.post-chip {
	display: inline-flex;
	padding: 0.28rem 0.7rem;
	border-radius: 999px;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--navy);
	font-size: 0.78rem;
	font-weight: 800;
	text-decoration: none;
}

.policy-card {
	padding: 1.5rem;
	border-color: rgba(255, 168, 0, 0.4);
}

.policy-card::before {
	content: "";
	display: block;
	width: 46px;
	height: 6px;
	margin-bottom: 1.25rem;
	border-radius: 99px;
	background: var(--wp--preset--color--gold);
}

.join-band {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(circle at 8% 80%, rgba(255, 168, 0, 0.15), transparent 28%),
		linear-gradient(135deg, #fff7dc, #ffffff 55%, #fff3c5);
}

.join-band::after {
	content: "";
	position: absolute;
	right: -80px;
	bottom: -120px;
	width: 300px;
	height: 300px;
	border: 2px solid rgba(255, 168, 0, 0.24);
	border-radius: 50%;
}

.join-band > .wp-block-group__inner-container {
	position: relative;
	z-index: 1;
}

.join-card {
	padding: 1.5rem;
}

.join-card__icon {
	display: grid;
	place-items: center;
	width: 54px;
	height: 54px;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--navy);
	font-size: 1.45rem;
	font-weight: 850;
}

.site-footer {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, #ffc22f 0%, #ffa800 100%);
}

.site-footer::before {
	content: "";
	position: absolute;
	left: -120px;
	top: -160px;
	width: 360px;
	height: 360px;
	border: 1px solid rgba(255,255,255,0.4);
	border-radius: 50%;
}

.site-footer .wp-block-site-logo img {
	max-height: 72px;
	width: auto;
}

.site-footer a {
	color: var(--wp--preset--color--navy);
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

.footer-bottom {
	position: relative;
	z-index: 1;
}

.content-shell {
	min-height: 55vh;
}

.content-shell > *:not(.alignwide):not(.alignfull) {
	max-width: var(--wp--style--global--content-size);
	margin-left: auto;
	margin-right: auto;
}

.archive-grid .wp-block-post-template {
	gap: clamp(1rem, 2.4vw, 1.75rem);
}

.wp-block-post-navigation-link a,
.wp-block-query-pagination a,
.wp-block-query-pagination span {
	font-weight: 700;
}

@media (max-width: 980px) {
	.site-header__inner {
		min-height: 72px;
	}

	.site-header .header-actions {
		display: none;
	}

	.home-hero .hero-layout {
		grid-template-columns: 1fr !important;
	}

	.home-hero .hero-copy {
		padding-bottom: 0 !important;
	}

	.hero-art {
		max-width: 720px;
		margin-inline: auto;
	}
}

@media (max-width: 680px) {
	.site-header .wp-block-site-logo img {
		max-width: 132px;
	}

	.home-hero {
		text-align: left;
	}

	.home-hero .wp-block-buttons {
		align-items: stretch;
	}

	.home-hero .wp-block-button,
	.home-hero .wp-block-button__link {
		width: 100%;
	}

	.section-heading-row {
		align-items: flex-start !important;
		flex-direction: column;
	}

	.news-query .wp-block-post-template,
	.policy-query .wp-block-post-template {
		grid-template-columns: 1fr !important;
	}

	.site-footer .wp-block-columns {
		gap: 2rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
	}
}



/* Personnel profile detail layout */
.single-person main .wp-block-post-featured-image {
  width: min(100%, 620px) !important;
  max-width: 620px !important;
  margin: 1.5rem auto 2.25rem !important;
}

.single-person main .wp-block-post-featured-image img {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: 680px !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 24px;
  background: #f6f8fc;
  box-shadow: var(--cp-shadow-sm);
}

.single-person .person-profile-details {
  max-width: 820px;
  margin: 2rem auto 3rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--cp-border);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--cp-shadow-sm);
}

.single-person .person-profile-details h2 {
  margin-top: 0;
  color: #0d3287;
}

.single-person .person-profile-details h2:not(:first-child) {
  margin-top: 2rem;
}

.single-person .person-profile-details ul {
  margin-bottom: 0;
  padding-left: 1.4rem;
}

.single-person .person-profile-details li + li {
  margin-top: 0.65rem;
}

@media (max-width: 600px) {
  .single-person main .wp-block-post-featured-image {
    width: 100% !important;
    margin-block: 1rem 1.5rem !important;
  }

  .single-person main .wp-block-post-featured-image img,
  .single-person .person-profile-details {
    border-radius: 18px;
  }

  .single-person .person-profile-details {
    padding: 1.25rem;
  }
}
