/* mod_my_leaders - ทำเนียบผู้บริหาร */

.my-ldr {
	--ldr-cols: 3;
	--ldr-photo: 150px;
	--ldr-lead: 200px;
	--ldr-ratio: 1 / 1;
	--ldr-fit: cover;
	--ldr-name-size: 17px;
	--ldr-stagger: 90ms;

	--ldr-accent: var(--my-primary, #1b5fa8);
	--ldr-card-bg: var(--my-card, #fff);
	--ldr-card-line: var(--my-line, #e5e7eb);
	--ldr-name: var(--my-dark, #13203a);
	--ldr-position: var(--ldr-accent);
	--ldr-position-bg: transparent;
	--ldr-muted: var(--my-muted, #6b7280);
}

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

/* ------------------------------------------------------------ the heading -- */
.my-ldr__head { color: var(--ldr-head, var(--my-dark, #13203a)); }
.my-ldr__head[class] { font-size: var(--ldr-head-size, 1.35rem); }

/* The template's bar steps aside when an icon has been chosen instead. */
.my-ldr__head.no-bar::before { display: none; }

.my-ldr__head-icon {
	color: var(--ldr-head-icon, var(--ldr-accent));
	font-size: .92em; line-height: 1;
}

/* ------------------------------------------------------------ the layouts -- */
.my-ldr__grid {
	display: grid; gap: 18px;
	grid-template-columns: repeat(var(--ldr-cols), minmax(0, 1fr));
}

.my-ldr__spotlight { display: flex; justify-content: center; margin-bottom: 20px; }
.my-ldr__spotlight .my-ldr__card { max-width: 420px; }

/* A single column of rows, photo beside the words. */
.my-ldr.style-list .my-ldr__grid { grid-template-columns: 1fr; gap: 12px; }
.my-ldr.style-list .my-ldr__card { flex-direction: row; align-items: center; text-align: start; gap: 14px; }
.my-ldr.style-list .my-ldr__photo { flex: 0 0 auto; width: min(var(--ldr-photo), 96px); }
.my-ldr.style-list .my-ldr__body { align-items: flex-start; }
.my-ldr.style-list .my-ldr__contact,
.my-ldr.style-list .my-ldr__social { justify-content: flex-start; }

/* One line across a wide position. */
.my-ldr.style-strip .my-ldr__grid {
	grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
	grid-template-columns: none;
}

/* ------------------------------------------------------------- the person -- */
.my-ldr__card {
	display: flex; flex-direction: column; align-items: center; gap: 12px;
	text-align: center; min-width: 0;
	padding: 4px;
	transition: transform .22s ease, box-shadow .22s ease;
}

.my-ldr.has-card .my-ldr__card {
	padding: 20px 16px;
	background: var(--ldr-card-bg);
	border: 1px solid var(--ldr-card-line);
	border-radius: var(--my-radius, 14px);
	box-shadow: var(--my-shadow, 0 2px 14px rgba(16, 40, 80, .08));
}

.my-ldr__link { display: block; text-decoration: none; max-width: 100%; }

/* --------------------------------------------------------------- the photo -- */
.my-ldr__photo {
	position: relative; display: block; overflow: hidden;
	width: var(--ldr-photo); max-width: 100%;
	aspect-ratio: var(--ldr-ratio);
	margin-inline: auto;
	background: #eef2f7;
	transition: transform .28s ease, box-shadow .28s ease, filter .28s ease;
}
.my-ldr__card.is-lead .my-ldr__photo { width: var(--ldr-lead); }

.my-ldr__photo img {
	display: block; width: 100%; height: 100%;
	object-fit: var(--ldr-fit); object-position: center top;
	transition: transform .35s ease, filter .35s ease;
}

.my-ldr__noimg {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%;
	color: #b6c2d2; font-size: 2rem;
}

/* The four shapes a portrait may take. */
.my-ldr.shape-circle .my-ldr__photo { border-radius: 50%; aspect-ratio: 1 / 1; }
.my-ldr.shape-round .my-ldr__photo { border-radius: var(--my-radius, 14px); }
.my-ldr.shape-square .my-ldr__photo { border-radius: 0; }
.my-ldr.shape-arch .my-ldr__photo { border-radius: 50% 50% 8px 8px / 30% 30% 6px 6px; }

/* ---------------------------------------------------------------- the ring -- */
.my-ldr.ring-soft .my-ldr__photo {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ldr-accent) 18%, transparent),
		0 6px 18px rgba(16, 40, 80, .16);
}
.my-ldr.ring-solid .my-ldr__photo { box-shadow: 0 0 0 3px var(--ldr-accent), 0 6px 18px rgba(16, 40, 80, .16); }
.my-ldr.ring-double .my-ldr__photo {
	box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ldr-accent), 0 6px 18px rgba(16, 40, 80, .16);
}
.my-ldr.ring-gold .my-ldr__photo {
	box-shadow: 0 0 0 3px #f3dc9a, 0 0 0 6px #c99a2e, 0 6px 20px rgba(80, 60, 10, .24);
}

/* A ring that shows it is alive, for the person at the top of the page. */
.my-ldr.rfx-pulse .my-ldr__photo { animation: ldr-pulse 3.2s ease-in-out infinite; }

@keyframes ldr-pulse {
	0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ldr-accent) 22%, transparent), 0 6px 18px rgba(16, 40, 80, .16); }
	50%      { box-shadow: 0 0 0 10px color-mix(in srgb, var(--ldr-accent) 6%, transparent), 0 6px 18px rgba(16, 40, 80, .16); }
}

/*
 * A turning ring is drawn as a conic gradient behind the picture, so it can
 * spin without the photograph spinning with it.
 */
.my-ldr.rfx-spin .my-ldr__photo { box-shadow: none; }
.my-ldr.rfx-spin .my-ldr__link,
.my-ldr.rfx-spin .my-ldr__card > .my-ldr__photo { position: relative; }
.my-ldr.rfx-spin .my-ldr__photo::before {
	content: ""; position: absolute; inset: -6px; z-index: -1;
	border-radius: inherit;
	background: conic-gradient(from 0deg, var(--ldr-accent), transparent 40%, var(--ldr-accent));
	animation: ldr-spin 6s linear infinite;
}
.my-ldr.rfx-spin .my-ldr__photo { isolation: isolate; }

@keyframes ldr-spin { to { transform: rotate(1turn); } }

/* ------------------------------------------------------- the photo filters -- */
.my-ldr.pfx-gray .my-ldr__photo img { filter: grayscale(1); }
.my-ldr.pfx-grayhover .my-ldr__photo img { filter: grayscale(1); }
.my-ldr.pfx-grayhover .my-ldr__card:hover .my-ldr__photo img { filter: grayscale(0); }
.my-ldr.pfx-warm .my-ldr__photo img { filter: sepia(.32) saturate(1.1); }
.my-ldr.pfx-bright .my-ldr__photo img { filter: brightness(1.06) contrast(1.04) saturate(1.08); }

/* -------------------------------------------------------- the hover effects -- */
.my-ldr.hover-lift .my-ldr__card:hover { transform: translateY(-6px); }
.my-ldr.hover-lift.has-card .my-ldr__card:hover { box-shadow: var(--my-shadow-lg, 0 14px 34px rgba(16, 40, 80, .18)); }

.my-ldr.hover-zoom .my-ldr__card:hover .my-ldr__photo img { transform: scale(1.09); }

.my-ldr.hover-glow .my-ldr__card:hover .my-ldr__photo {
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ldr-accent) 30%, transparent),
		0 0 26px color-mix(in srgb, var(--ldr-accent) 45%, transparent);
}

.my-ldr.hover-tilt .my-ldr__card { transform-style: preserve-3d; }
.my-ldr.hover-tilt .my-ldr__card:hover {
	transform: perspective(700px) rotateX(5deg) rotateY(-5deg) translateY(-4px);
}

.my-ldr.hover-frame .my-ldr__card:hover .my-ldr__photo {
	box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--ldr-accent), 0 8px 22px rgba(16, 40, 80, .2);
}

/* A band of light passing over the portrait. */
.my-ldr__shine {
	position: absolute; inset: 0; pointer-events: none;
	background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%);
	transform: translateX(-120%);
	opacity: 0;
}
.my-ldr.hover-shine .my-ldr__card:hover .my-ldr__shine {
	opacity: 1; animation: ldr-shine .85s ease;
}

@keyframes ldr-shine {
	from { transform: translateX(-120%); }
	to   { transform: translateX(120%); }
}

/* --------------------------------------------------------------- the words -- */
.my-ldr__body { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; width: 100%; }

.my-ldr__name {
	margin: 0; font-size: var(--ldr-name-size); line-height: 1.45; font-weight: 700;
	color: var(--ldr-name); overflow-wrap: anywhere;
}
.my-ldr__name a { color: inherit; text-decoration: none; }
.my-ldr__name a:hover { color: var(--ldr-accent); }

.my-ldr__card.is-lead .my-ldr__name { font-size: calc(var(--ldr-name-size) * 1.2); }

.my-ldr__position {
	margin: 2px 0 0; font-size: .86rem; font-weight: 600; line-height: 1.5;
	color: var(--ldr-position); overflow-wrap: anywhere;
}
/* When a background is chosen the position becomes a badge instead of a line. */
.my-ldr[style*="--ldr-position-bg"] .my-ldr__position {
	display: inline-block; padding: 3px 12px; border-radius: 999px;
	background: var(--ldr-position-bg);
}

.my-ldr__org { margin: 2px 0 0; font-size: .8rem; color: var(--ldr-muted); }
.my-ldr__note { margin: 4px 0 0; font-size: .78rem; color: var(--ldr-muted); line-height: 1.6; }

.my-ldr__contact {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px;
	margin-top: 8px; font-size: .8rem;
}
.my-ldr__bit {
	display: inline-flex; align-items: center; gap: 5px;
	color: var(--ldr-muted); text-decoration: none; overflow-wrap: anywhere;
}
.my-ldr__bit i { color: var(--ldr-accent); }
.my-ldr__bit:hover { color: var(--ldr-accent); }

.my-ldr__social { display: flex; justify-content: center; gap: 7px; margin-top: 9px; }

.my-ldr__soc {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 50%;
	color: #fff; font-size: .82rem; text-decoration: none;
	transition: transform .16s ease, filter .16s ease;
}
.my-ldr__soc.is-fb { background: #1877f2; }
.my-ldr__soc.is-line { background: #06c755; }
.my-ldr__soc:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.12); }

/* ------------------------------------------------------- arriving on screen -- */
/*
 * The cards come in one after another when the page loads. They are set with
 * animation-fill-mode: both, so a card whose turn has not come yet is already
 * hidden - and if the animation never runs at all, nothing is ever lost,
 * because the rule only applies where an entry effect was chosen.
 */
.my-ldr[class*="entry-"] .my-ldr__card {
	animation-duration: .66s;
	animation-fill-mode: both;
	animation-timing-function: cubic-bezier(.22, .68, .3, 1);
	animation-delay: calc(var(--i, 0) * var(--ldr-stagger));
}

.my-ldr.entry-fade .my-ldr__card { animation-name: ldr-fade; }
.my-ldr.entry-rise .my-ldr__card { animation-name: ldr-rise; }
.my-ldr.entry-zoom .my-ldr__card { animation-name: ldr-zoom; }
.my-ldr.entry-flip .my-ldr__card { animation-name: ldr-flip; }
.my-ldr.entry-slide .my-ldr__card { animation-name: ldr-slide; }
.my-ldr.entry-drop .my-ldr__card { animation-name: ldr-drop; }

@keyframes ldr-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes ldr-rise {
	from { opacity: 0; transform: translateY(26px); }
	to   { opacity: 1; transform: none; }
}
@keyframes ldr-zoom {
	from { opacity: 0; transform: scale(.86); }
	to   { opacity: 1; transform: none; }
}
@keyframes ldr-flip {
	from { opacity: 0; transform: perspective(800px) rotateY(-62deg); }
	to   { opacity: 1; transform: perspective(800px) rotateY(0); }
}
@keyframes ldr-slide {
	from { opacity: 0; transform: translateX(-32px); }
	to   { opacity: 1; transform: none; }
}
@keyframes ldr-drop {
	0%   { opacity: 0; transform: translateY(-34px); }
	70%  { opacity: 1; transform: translateY(6px); }
	100% { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 900px) {
	.my-ldr__grid { --ldr-cols: 2 !important; }
	.my-ldr.style-strip .my-ldr__grid {
		grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.my-ldr__grid { --ldr-cols: 1 !important; }
	.my-ldr.style-strip .my-ldr__grid { grid-template-columns: 1fr; }
	.my-ldr__card.is-lead .my-ldr__photo { width: min(var(--ldr-lead), 70vw); }
}

@media (prefers-reduced-motion: reduce) {
	.my-ldr *, .my-ldr *::before, .my-ldr *::after {
		animation: none !important;
		transition: none !important;
	}

	.my-ldr .my-ldr__card { opacity: 1 !important; transform: none !important; }
}

/*
 * The heading settings every Gov module shares. Written on the module's own
 * element only when an editor changed one, so an untouched module keeps the
 * look it always had.
 */
.my-ldr__head {
	font-weight: var(--my-head-weight, 700);
	font-style: var(--my-head-style, inherit);
	background: var(--my-head-bg, transparent);
	padding: var(--my-head-pad, 0);
	border-radius: var(--my-head-round, 0);
	width: var(--my-head-w, auto);
}
.my-ldr__head[class] { font-size: var(--my-head-size, var(--ldr-head-size, 1.35rem)); }
.my-ldr__head { color: var(--my-head-colour, var(--ldr-head, var(--my-dark, #13203a))); }
.my-ldr__head span { color: inherit; }
.my-ldr__head .my-heading__icon { color: var(--my-head-icon, var(--my-primary, #1b5fa8)); margin-inline-end: 8px; }