/*
 * Design tokens, reset, typography, layout helpers and shared components.
 * Values come from the SYB Online Figma file.
 */

:root {
	/* Colour */
	--c-ink: #1e2036;
	--c-body: #51515c;
	--c-blue: #0369b8;
	--c-primary: #247cef;
	--c-primary-hover: #1b6fe0;
	--c-primary-glow: #2d90ef;
	--c-primary-shade: rgba(17, 85, 255, 0.28);
	--c-tile: #f3f4fa;
	--c-line: #f2f2f2;
	--c-line-strong: #eceef5;
	--c-border: #dfe2ee;
	--c-white: #ffffff;
	--c-navy: #1b1965;
	--c-dark: #1b1b1b;
	--c-soft: #f3f4ff;
	--c-mute: #8b8da0;
	--c-warm: #ff8a3d;
	--c-tag: #e9f2ff;
	--c-footer: #1f2232;
	--c-footer-text: #e9ecf0;
	--c-cyan: #39cbff;

	/* Type */
	--font-sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--fs-h1: 28px;
	--lh-h1: 36px;
	--fs-h2: 24px;
	--lh-h2: 32px;
	--fs-h3: 20px;
	--lh-h3: 28px;
	--fs-eyebrow: 16px;
	--fs-body: 16px;
	--lh-body: 24px;

	/* Shape */
	--radius-sm: 6px;
	--radius: 8px;
	--radius-md: 12px;
	--radius-lg: 16px;
	--radius-pill: 999px;

	/* Elevation (Figma effect styles) */
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1);
	--shadow-md: 0 2px 4px -2px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	--shadow-lg: 0 4px 6px -4px rgba(0, 0, 0, 0.1), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	--shadow-xl: 0 8px 10px -6px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	--shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

	/* Layout: 390px mobile frame with 20px gutters */
	--container: 1240px;
	--gutter: 20px;
	--section-y: 56px;
	--header-h: 60px;
}

@media (min-width: 768px) {
	:root {
		/* 100px gutters on the 1440px desktop frame, scaling down with the viewport */
		--gutter: clamp(32px, 6.944vw, 100px);
		--section-y: 80px;
		--fs-h1: 32px;
		--lh-h1: 42px;
		--fs-h2: 32px;
		--lh-h2: 38px;
		--fs-eyebrow: 18px;
		--fs-body: 18px;
		--lh-body: 26px;
	}
}

@media (min-width: 1100px) {
	:root {
		--header-h: 61px;
		--section-y: 96px;
	}
}

/* Reset */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

/* While the wheel glide (smooth-scroll.js) moves the page, each step must land at once. */
html.is-smooth-scrolling {
	scroll-behavior: auto;
}

body {
	margin: 0;
	background: var(--c-white);
	color: var(--c-body);
	font-family: var(--font-sans);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.menu-open {
	overflow: hidden;
}

img,
svg,
video {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0;
	color: var(--c-ink);
	font-weight: var(--fw-heading, 600);
	text-wrap: balance;
}

h1 {
	font-size: var(--fs-h1);
	line-height: var(--lh-h1);
}

h2 {
	font-size: var(--fs-h2);
	line-height: var(--lh-h2);
}

h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-h3);
}

p {
	margin: 0;
}

a {
	color: var(--c-blue);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

button {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--c-primary);
	outline-offset: 2px;
	border-radius: 4px;
}

[hidden] {
	display: none !important;
}

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

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

/* Accessibility helpers */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 1000;
	padding: 10px 16px;
	border-radius: var(--radius-sm);
	background: var(--c-ink);
	color: var(--c-white);
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
}

.skip-link:focus {
	top: 12px;
}

/* Layout */

.container {
	width: min(100% - 2 * var(--gutter), var(--container));
	margin-inline: auto;
}

.container--narrow {
	--container: 780px;
}

.section {
	padding-block: var(--section-y);
}

.section--soft {
	background: var(--c-soft);
}

.section-head {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 32px;
}

.eyebrow {
	color: var(--c-blue);
	font-size: var(--fs-eyebrow);
	font-weight: 500;
	line-height: 1.4;
}

.icon {
	flex: none;
}

/* Buttons (button-primary / button-secondary components) */

.btn {
	/* Compact blue drop shadow of the second primary and the outline button. */
	--shadow-btn: 0 4px 10px rgba(36, 124, 239, 0.28);
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	/* Height, side padding, text size and weight come from Brand & Components (SYB Builder). */
	min-height: var(--btn-h, 44px);
	padding: calc((var(--btn-h, 44px) - 20px) / 2) var(--btn-px, 20px);
	border: 0;
	border-radius: var(--radius-sm);
	font-family: inherit;
	font-size: var(--fs-btn, 14px);
	font-weight: var(--fw-btn, 500);
	line-height: 20px;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn:active {
	transform: translateY(0);
}

.btn--sm {
	min-height: 36px;
	padding-block: 8px;
}

.btn--block {
	display: flex;
	width: 100%;
}

.btn--primary {
	background: var(--c-primary);
	color: var(--c-white);
	box-shadow: var(--shadow-lg), inset 0 -3px 3px var(--c-primary-shade), inset 0 3px 3px rgba(255, 255, 255, 0.28);
}

/* The soft blue glow that spills out under the primary button. */
.btn--primary::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 43% 13% -18% 13%;
	border-radius: var(--radius);
	background: var(--c-primary-glow);
	filter: blur(12px);
	opacity: var(--btn-glow, 1);
	pointer-events: none;
}

.btn--primary:hover,
.btn--primary-2:hover {
	background: var(--c-primary-hover);
}

/*
 * Second primary: the same blue button without the wide glow. Its shadow is small and
 * close (4px down, 10px soft), so it suits places where the glow would be too much.
 * The outline button uses the same shadow.
 */
.btn--primary-2 {
	background: var(--c-primary);
	color: var(--c-white);
	box-shadow: var(--shadow-btn), inset 0 -3px 3px var(--c-primary-shade), inset 0 3px 3px rgba(255, 255, 255, 0.28);
}

.btn--secondary,
.btn--white {
	background: var(--c-white);
	color: #1f1f2b;
	box-shadow: var(--shadow-lg), inset 0 -3px 3px rgba(132, 132, 132, 0.28);
}

.btn--white {
	gap: 4px;
	color: #111120;
	font-weight: 600;
	box-shadow: var(--shadow-lg);
}

.btn--secondary:hover,
.btn--white:hover,
.btn--outline:hover {
	background: #f7f8fd;
}

/* White button with a hairline border ("Chat On WhatsApp" in the CTA block). */
.btn--outline {
	padding-block: calc((var(--btn-h, 44px) - 22px) / 2); /* minus the border, so it stays as tall as the others */
	border: 1px solid #ebebeb;
	background: var(--c-white);
	color: #000000;
	font-weight: 600;
	box-shadow: var(--shadow-btn);
}

/* Text links with an arrow */

.text-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--c-blue);
	font-size: 14px;
	font-weight: 600;
	line-height: 20px;
	text-decoration: none;
}

.text-link .icon {
	transition: transform 0.15s ease;
}

.text-link:hover .icon {
	transform: translateX(3px);
}

.text-link--back:hover .icon {
	transform: translateX(-3px);
}

/* Tag (category pill) and filter chips */

.tag {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 20px;
	background: var(--c-tag);
	color: var(--c-blue);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
}

.filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

.chip {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius-pill);
	background: var(--c-white);
	color: var(--c-ink);
	font-size: 14px;
	font-weight: 500;
	line-height: 20px;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.chip:hover {
	border-color: var(--c-primary);
	color: var(--c-blue);
}

.chip.is-active {
	border-color: var(--c-primary);
	background: var(--c-primary);
	color: var(--c-white);
}

/* Article card (article-card component) */

.card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 20px;
}

.article-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--c-line);
	border-radius: var(--radius-md);
	background: var(--c-white);
	box-shadow: var(--shadow-md);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
	box-shadow: var(--shadow-xl);
	transform: translateY(-2px);
}

.article-card__thumb {
	display: block;
	aspect-ratio: 398 / 220;
	overflow: hidden;
	/* Placeholder when an article has no image: blue gradient with ring supergraphic. */
	background:
		repeating-radial-gradient(circle at 92% 64%, transparent 0 26px, rgba(255, 255, 255, 0.16) 26px 27px),
		linear-gradient(135deg, #0067b7 0%, #43a0f9 100%);
}

.article-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.article-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
}

.article-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	color: var(--c-mute);
	font-size: 14px;
	line-height: 20px;
}

.article-card__title {
	font-size: 20px;
	line-height: 28px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.article-card__title a {
	color: inherit;
	text-decoration: none;
}

.article-card__title a:hover {
	color: var(--c-blue);
}

.article-card__excerpt {
	font-size: 16px;
	line-height: 24px;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

.article-card__link {
	margin-top: auto;
	align-self: flex-start;
}

/* Pagination */

.pagination {
	margin-top: 40px;
}

.pagination__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	border: 1px solid var(--c-border);
	border-radius: var(--radius);
	background: var(--c-white);
	color: var(--c-ink);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

.pagination a.page-numbers:hover {
	border-color: var(--c-primary);
	color: var(--c-blue);
}

.pagination .page-numbers.current {
	border-color: var(--c-primary);
	background: var(--c-primary);
	color: var(--c-white);
}

.pagination .page-numbers.dots {
	border-color: transparent;
}

.empty-state {
	padding: 48px 0;
	color: var(--c-mute);
	text-align: center;
}
