/*
 * Home - Blog.
 *
 * Read from cp-all-designer/index.html:488-660, css/app.css:2093-2420,
 * 2575-2625, 3100-3139 and js/main.js:1128-1300 (the card main.js draws).
 *
 * Drawn at 1440 (app.css:113): a fixed measure carries across unchanged.
 * Colour, type, padding, the sizes and the corner arrive from the Style tab
 * and are not repeated here.
 *
 * Left behind:
 * - `.ncard__meta` (app.css:2600-2602) — the source markup main.js reads from
 *   prints it; the card main.js draws into the rail does not.
 * - `.ncard__play` (2583-2598), `.news__pageinfo`, `.news__cats--flow` — not
 *   in this band.
 * - The leftover-height chain (2084-2157) and its `max-height: 100svh`, which
 *   shrink the picture to pin the band to exactly one screen: the standard
 *   gives a band the window's height as `min-height: 100vh` alone, so content
 *   that outgrows a short window takes the room it needs. The band takes a
 *   screen at least, and the picture keeps its ratio between 180 and 340.
 */

.custom-home-blog {
	position: relative;
	display: block;
	box-sizing: border-box;
	line-height: 1.6;                      /* app.css:174 — what the eyebrow, tags and days stand on */
}

.custom-home-blog .custom-home-blog__inner {
	box-sizing: border-box;
	margin: 0 auto;
	max-width: 1920px;                     /* the content cap, every band */
}

/* ------------------------------------------------------------------ */
/* The head                                                            */
/* ------------------------------------------------------------------ */

.custom-home-blog .custom-home-blog__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 34px;                             /* clamp(22, 2.4*14.4, 40) = 34.56 → nearest even */
	margin-bottom: 22px;                   /* clamp(16, 1.5*14.4, 22) */
}

.custom-home-blog .custom-home-blog__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 22px;
	font-size: 12px;
	font-weight: 600;
	/* app.css:190 measures 1.15px; every px value here is even. */
	letter-spacing: 2px;
	text-transform: uppercase;
}

.custom-home-blog .custom-home-blog__title {
	margin: 0;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0;
}

.custom-home-blog .custom-home-blog__title em {
	position: relative;
	display: inline-block;
	font-style: normal;                    /* app.css:255-260: upright, a step larger than its line */
	font-weight: 700;
	font-size: 108%;  
}

.custom-home-blog .custom-home-blog__title em::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 4px;
	height: 8px;
	border-radius: 4px;
	background: currentColor;
	opacity: 0.18;
}

/* ------------------------------------------------------------------ */
/* The presses                                                         */
/* ------------------------------------------------------------------ */

.custom-home-blog .custom-home-blog__lead {
	display: block;
	margin-bottom: 0;                      /* app.css:2188's 20px stands above the steps instead */
}

.custom-home-blog .custom-home-blog__presses {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 28px;                             /* clamp(16, 2*14.4, 28) */
	margin-bottom: 26px;                   /* clamp(18, 2*14.4, 26) */
}

.custom-home-blog .custom-home-blog__presses-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 1 1 auto;
}

.custom-home-blog .custom-home-blog__press {
	--custom-press-ground: var(--custom-home-blog-press-ground, #E8F4FB);
	--custom-press-edge: var(--custom-home-blog-press-edge, rgba(22, 65, 140, 0.14));
	--custom-press-ink: var(--custom-home-blog-press-ink, #16418C);
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	border-width: 2px;                     /* app.css:2223 measures 1px */
	border-style: solid;
	border-radius: 16px;
	text-align: left;
	font-family: inherit;
	cursor: pointer;
	transition: background-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            border-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            box-shadow 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
	--custom-press-shadow: none;
}

.custom-home-blog .custom-home-blog__press:hover {
	--custom-press-edge: #50A3D5;          /* app.css:2341 */
	--custom-press-shadow: 0 6px 18px -6px rgba(22, 65, 140, 0.14);
}

/* app.css:2342-2344 — the open one in its category's colour, or the section's */
.custom-home-blog .custom-home-blog__press.is-active {
	--custom-press-ground: var(--custom-card-tint, var(--custom-home-blog-press-open, #16418C));
	--custom-press-edge: var(--custom-card-tint, var(--custom-home-blog-press-open, #16418C));
	--custom-press-ink: #FFFFFF;
}

.custom-home-blog .custom-home-blog__press-text {
	font-weight: 600;
	line-height: 1.35;
	color: inherit;
}

/* ---- the button beside them — app.css:2058-2062 ---- */
.custom-home-blog .custom-home-blog__see-all {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;                    /* app.css:2060 measures 9px 18px */
	white-space: nowrap;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	border-width: 2px;                     /* app.css:2060 measures 1px */
	border-style: solid;
	border-radius: 16px;
	text-decoration: none;
	transition: background-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
	--custom-press-ink: #FFFFFF;
	--custom-press-ground: #16418C;        /* .btn--navy, app.css:300 */
	--custom-press-edge: transparent;
	--custom-press-shadow: none;
}

.custom-home-blog .custom-home-blog__see-all:hover {
	transform: translateY(-2px);
	--custom-press-ground: #50A3D5;        /* app.css:301 */
	--custom-press-shadow: 0 14px 30px rgba(80, 163, 213, 0.3);
}

/* ------------------------------------------------------------------ */
/* The rail                                                            */
/* ------------------------------------------------------------------ */

.custom-home-blog .custom-home-blog__view {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	cursor: grab;
	touch-action: pan-x pan-y;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.custom-home-blog .custom-home-blog__view::-webkit-scrollbar {
	display: none;
}

.custom-home-blog .custom-home-blog__view.is-dragging {
	scroll-snap-type: none;
	scroll-behavior: auto;
	cursor: grabbing;
}

.custom-home-blog .custom-home-blog__view.is-dragging .custom-home-blog__card {
	pointer-events: none;                  /* app.css:2173 */
}

/* app.css:2175-2198 — a flex line, so the rail can carry a spacer narrower
   than a card at the end of its scroll. */
.custom-home-blog .custom-home-blog__row {
	display: flex;
	align-items: stretch;
	gap: var(--gap, 20px);
}

.custom-home-blog .custom-home-blog__card {
	flex: 0 0 calc((100% - var(--gap, 20px) * (var(--cards, 3) - 1)) / var(--cards, 3));
	height: auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: transparent;
	border: 0;
	border-radius: 0;
	overflow: visible;
	text-decoration: none;
	scroll-snap-align: start;
	transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-home-blog .custom-home-blog__card:hover {
	transform: translateY(-4px);           /* app.css:2245 */
}

.custom-home-blog .custom-home-blog__card.is-hidden {
	display: none;                         /* app.css:2238 */
}

/* ---- the picture — app.css:2246-2261 ---- */
.custom-home-blog .custom-home-blog__card-picture {
	position: relative;
	display: block;
	overflow: hidden;
	flex: 0 0 auto;
	aspect-ratio: 16 / 12.3;
	max-height: 340px;
	min-height: 180px;                     /* app.css:2029 min(180, 26*9) */
	background: #F0F4FA;                   /* --g150, app.css:47 */
}

.custom-home-blog .custom-home-blog__card-picture img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-home-blog .custom-home-blog__card:hover .custom-home-blog__card-picture img {
	transform: scale(1.05);                /* app.css:2261 */
}

/* app.css:2379 — the card's words under the picture */
.custom-home-blog .custom-home-blog__card-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;                        /* the foot line sits on one baseline across the rail */
	padding-top: 18px;                     /* min(18, 2 --vhu) */
}

/* app.css:2381-2382 — category left, day right */
.custom-home-blog .custom-home-blog__card-over {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 10px;                   /* min(10, 1.2 --vhu) */
}

/* app.css:2396-2400 — one tint for every category, unless the section gives each its own */
.custom-home-blog .custom-home-blog__card-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;                              /* app.css:2397 measures 7px */
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	/* app.css:2398 measures .04em, 0.48px here: the nearest even figure is none */
	letter-spacing: 0;
	color: #FFFFFF;
	background-color: var(--custom-card-tint, var(--custom-home-blog-tint, #16418C));
	border-radius: 4px;
}

.custom-home-blog .custom-home-blog__day {
	margin-left: auto;
	font-size: 12px;
	font-weight: 500;
}

/* app.css:2606-2610 — two lines at most */
.custom-home-blog .custom-home-blog__card-title {
	margin: 12px 0 8px;                    /* min(12, 1.4 --vhu) above */
	font-weight: 600;
	line-height: 1.36;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 250ms;
}

/* Kadence takes the top margin off every heading in a page's first widget
   (content.min.css, `.single-content .elementor-widget-container:first-child:not(style) h3`):
   the title's own, heavily enough to stand */
.custom-home-blog .custom-home-blog__card .custom-home-blog__card-body .custom-home-blog__card-title {
	margin-top: 12px;
}

/* app.css:2614-2616 — exactly two lines, held open */
.custom-home-blog .custom-home-blog__card-words {
	margin: 0;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.65;
	color: #475569;                        /* --g700, app.css:41 */
	min-height: 46px;                      /* calc(1.65em * 2) = 46.2 → nearest even */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* app.css:2575-2582 — "อ่านเพิ่มเติม →" at the card's foot, right */
.custom-home-blog .custom-home-blog__card-more {
	display: inline-flex;
	align-self: flex-end;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 14px;                     /* min(14, 1.6 --vhu) */
	font-size: 12px;
	font-weight: 600;
	/* app.css:2578 measures .04em, 0.48px here: the nearest even figure is none */
	letter-spacing: 0;
}

.custom-home-blog .custom-home-blog__card-more i {
	font-style: normal;
	transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-home-blog .custom-home-blog__card:hover .custom-home-blog__card-more i {
	transform: translateX(6px);            /* app.css:2582 measures 5px */
}

/* app.css:2137 — two lines kept for every title, so every picture stands on one line */
@media (min-width: 1025px) {
	.custom-home-blog .custom-home-blog__card-title {
		min-height: 48px;                  /* calc(2 * 1.36em) of 18px = 48.96 → nearest even */
	}
}

/* app.css:2622-2624 — a short desktop window reads the headline alone */
@media (min-width: 1025px) and (max-height: 860px) {
	.custom-home-blog .custom-home-blog__card-words {
		display: none;
	}
}

/* the foot holds the button only on a phone */
.custom-home-blog .custom-home-blog__foot {
	display: none;
}

/* main.js:1236-1242 — with every card on screen the steps step aside */
.custom-home-blog .custom-home-blog__nav[hidden] {
	display: none;
}

/* Elementor's sheet (frontend.min.css, `.elementor img`) comes after the plugin's
   and sets a picture's height to auto and caps its width: the slot's picture
   says its own here, heavily enough to stand */
.custom-home-blog .custom-home-blog__card-picture > img {
	height: 100%;
	max-width: none;
}

/* A batch on its way: the forward step keeps its shape, its arrow out of sight
   and a turning mark in its place. */
.custom-home-blog .custom-home-blog__arrow.is-loading {
	position: relative;
	color: transparent;
}

.custom-home-blog .custom-home-blog__arrow.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	width: 18px;
	height: 18px;
	margin: auto;
	border: 2px solid #16418C;
	border-right-color: transparent;
	border-radius: 50%;
	animation: custom-home-blog-turn 700ms linear infinite;
}

@keyframes custom-home-blog-turn {
	to { transform: rotate(360deg); }
}

.custom-home-blog .custom-home-blog__empty {
	margin-top: 20px;                      /* app.css:2188 — under the rail */
	margin: 0;
	padding: 40px 0;
	text-align: center;
	color: #64748B;                        /* app.css:2070 */
}

/* ---- the step either way — app.css:2053, 2063-2069 ---- */
.custom-home-blog .custom-home-blog__nav {
	display: flex;
	justify-content: center;
	flex-shrink: 0;
	gap: 10px;
	margin-top: 50px;                      /* app.css:2188 + 2625: 20 under the rail, then --sec-gap-sm 28.8 */
}

.custom-home-blog .custom-home-blog__arrow {
	padding: 0;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border-width: 2px;                     /* app.css:2064 measures 1px */
	border-style: solid;
	font-family: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            border-color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            color 250ms cubic-bezier(0.2, 0.8, 0.2, 1),
	            opacity 250ms;
	--custom-press-ink: #16418C;
	--custom-press-ground: #FFFFFF;
	--custom-press-shadow: none;
}

/* A step with nowhere to go keeps its place, dimmed, and refuses the press. */
.custom-home-blog .custom-home-blog__arrow:disabled {
	opacity: 0.3;
	cursor: default;                       /* app.css:2069 */
}

/* ------------------------------------------------------------------ */
/* Tablet — 768px to 1024px                                            */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.custom-home-blog .custom-home-blog__card-picture {
		min-height: 0;                     /* app.css:2328 */
	}
	/* the window-capped spaces at --vhu 8 (app.css:2993) */
	.custom-home-blog .custom-home-blog__eyebrow {
		margin-bottom: 20px;               /* min(22, 2.4 --vhu) = 19.2 */
	}
	.custom-home-blog .custom-home-blog__head {
		margin-bottom: 16px;               /* app.css:2165 clamp(16, 1.5 --vwu, 22) */
	}
	.custom-home-blog .custom-home-blog__card-body {
		padding-top: 16px;                 /* min(18, 2 --vhu) */
	}
	.custom-home-blog .custom-home-blog__presses {
		margin-bottom: 18px;               /* app.css:2193 clamp(18, 2 --vwu, 26) = 18.4 */
	}
	/* the rail's 14 below and --sec-gap-sm 25.6 above the steps meet in one margin */
	.custom-home-blog .custom-home-blog__nav {
		margin-top: 26px;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile — up to 767px                                                */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.custom-home-blog .custom-home-blog__head {
		flex-direction: column;
		align-items: flex-start;           /* app.css:2112 */
	}
	.custom-home-blog .custom-home-blog__presses {
		align-items: flex-start;           /* app.css:2110 */
		margin-bottom: 12px;               /* app.css:3019 */
	}
	.custom-home-blog .custom-home-blog__presses-row {
		gap: 8px;                          /* app.css:2111 */
	}
	.custom-home-blog .custom-home-blog__see-all {
		padding: 8px 14px;                 /* app.css:2062 measures 7px 14px */
		font-size: 12px;
	}
	.custom-home-blog .custom-home-blog__card-words {
		display: none;                     /* app.css:3013 */
	}
	.custom-home-blog .custom-home-blog__nav {
		display: none;                     /* app.css:2261 */
	}
	/* app.css:2625 — the foot under the rail: --sec-gap-sm above it, and the
	   button to every story in it, centred (main.js:1267-1279) */
	.custom-home-blog .custom-home-blog__foot {
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 22px;
	}
	/* app.css:2252-2255 — the rail runs off the right edge of the screen, and a
	   gutter's worth of space follows its last card */
	.custom-home-blog .custom-home-blog__view {
		margin-right: -24px;
	}
	.custom-home-blog .custom-home-blog__row::after {
		content: "";
		flex: 0 0 max(0px, calc(24px - var(--gap, 14px)));
	}
	.custom-home-blog .custom-home-blog__title em::after {
		bottom: 2px;
		height: 4px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.custom-home-blog .custom-home-blog__card,
	.custom-home-blog .custom-home-blog__card-picture img,
	.custom-home-blog .custom-home-blog__press,
	.custom-home-blog .custom-home-blog__see-all,
	.custom-home-blog .custom-home-blog__arrow {
		transition: none;
	}
	.custom-home-blog .custom-home-blog__card-more i {
		transition: none;
	}
	.custom-home-blog .custom-home-blog__card:hover .custom-home-blog__card-more i {
		transform: none;
	}
	.custom-home-blog .custom-home-blog__card:hover,
	.custom-home-blog .custom-home-blog__see-all:hover {
		transform: none;
	}
	.custom-home-blog .custom-home-blog__card:hover .custom-home-blog__card-picture img {
		transform: none;
	}
	.custom-home-blog .custom-home-blog__view {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------------ */
/* One band, one screen — desktop only                                 */
/* ------------------------------------------------------------------ */

/* app.css:336-338 (.sec) gives this band the window's height, and app.css:2830 hands it back
   at 1024 and below, where the content sets the height as it does everywhere
   else. min-height, so a band that outgrows the window takes the room it needs
   and the page scrolls rather than cutting anything off. */
@media (min-width: 1025px) {
	.custom-home-blog {
		min-height: 100vh;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	/* A flex item with auto side margins shrinks to its own content, so the
	   content box is told its width again: the whole band, up to the cap. */
	.custom-home-blog > .custom-home-blog__inner {
		width: 100%;
	}
}
