/* Golden Dragon New Materials Limited — site stylesheet */

/* ---------- Fonts ---------- */

@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 400 700;
	font-display: fallback;
	src: url("/fonts/inter-var.woff2") format("woff2");
}

/* Only the 600 weight is self-hosted; used for the wordmark and small labels. */
@font-face {
	font-family: "Montserrat";
	font-style: normal;
	font-weight: 600;
	font-display: fallback;
	src: url("/fonts/montserrat-600.woff2") format("woff2");
}

/* ---------- Tokens ---------- */

:root {
	--white: #ffffff;
	--ink: #0f1c2e;
	--text: #2a3646;
	--muted: #5c6b7e;
	--border: #e1e6ed;
	--surface: #f5f7fa;
	--navy: #0b1f3a;
	--navy-deep: #081629;
	--gold: #f7b321;
	--gold-text: #8a5f00;
	--link: #1a4d8f;
	--focus: #2f6fd0;

	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-label: "Montserrat", var(--font-body);

	--fs-xs: 0.75rem;
	--fs-small: 0.875rem;
	--fs-base: 1rem;
	--fs-prose: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);

	--space-30: clamp(1.25rem, 4vw, 2rem);
	--space-40: clamp(1.75rem, 1.5rem + 1.5vw, 3rem);
	--space-50: clamp(2.5rem, 6vw, 4.5rem);
	--space-60: clamp(3.5rem, 8vw, 6.5rem);
	--gap: 1.5rem;

	--radius: 6px;
	--shadow: 0 1px 2px rgba(15, 28, 46, 0.04), 0 4px 16px rgba(15, 28, 46, 0.06);
	--shadow-hover: 0 2px 4px rgba(15, 28, 46, 0.06), 0 12px 32px rgba(15, 28, 46, 0.10);

	--hero-overlap: clamp(3rem, 10vw, 8rem);

	--content-width: 720px;
	--wide-width: 1200px;
}

/* ---------- Base ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

body {
	margin: 0;
	padding: 0 var(--space-30);
	background: var(--white);
	color: var(--text);
	font-family: var(--font-body);
	font-size: var(--fs-base);
	line-height: 1.6;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--ink);
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
	color: var(--ink);
	font-family: var(--font-body);
	font-weight: 650;
	letter-spacing: -0.015em;
	line-height: 1.25;
}

h1 {
	font-size: clamp(2rem, 1.6rem + 2vw, 3rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.12;
}

h2 { font-size: clamp(1.375rem, 1.25rem + 0.6vw, 1.625rem); }
h3 { font-size: clamp(1.15rem, 1.1rem + 0.3vw, 1.3rem); }
h4 { font-size: 1.1rem; }
h5, h6 {
	font-size: var(--fs-small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

hr {
	border: 0;
	border-top: 1px solid var(--border);
}

::selection {
	background: rgba(247, 179, 33, 0.35);
	color: var(--ink);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0.5rem;
	z-index: 100;
	padding: 0.75rem 1.25rem;
	background: var(--navy);
	color: var(--white);
}

.skip-link:focus {
	left: 0.5rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Layout ---------- */

.wide {
	max-width: var(--wide-width);
	margin-left: auto;
	margin-right: auto;
}

/* Narrow reading column; direct children are spaced by --gap. */
.prose {
	max-width: var(--content-width);
	margin: 0 auto;
}

.prose > * {
	margin-top: var(--gap);
	margin-bottom: 0;
}

.prose > :first-child {
	margin-top: 0;
}

.text-center {
	text-align: center;
}

/*
 * Full-bleed backgrounds for elements inside the padded body: the border
 * image paints past the element's sides without clipping its children
 * (the mobile menu overlay lives inside the header).
 */
.site-header,
.home-title,
.home-title + .search-form,
.entry-hero,
.site-footer {
	border-image: linear-gradient(var(--band), var(--band)) fill 0 // 0 100vmax;
}

/* ---------- Header ---------- */

.site-header {
	--band: var(--white);
	position: sticky;
	top: 0;
	z-index: 30;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--gap);
	padding: 1.1rem 0;
	/* Same full-bleed band, with a hairline along the bottom edge. */
	border-image-source: linear-gradient(to top, var(--border) 1px, var(--white) 1px);
}


.site-title {
	margin: 0;
	font-family: var(--font-label);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.site-title a {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--ink);
	text-decoration: none;
}

.site-title a::before {
	content: "";
	flex: none;
	width: 4px;
	height: 1.6em;
	background: var(--gold);
}

.site-nav a,
.site-footer nav a {
	text-decoration: none;
}

.nav-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav .nav-list a {
	display: block;
	padding: 0.25rem 0;
	border-bottom: 2px solid transparent;
	color: var(--muted);
	font-size: 0.9375rem;
	font-weight: 500;
}

.site-nav .nav-list a:hover {
	color: var(--ink);
}

.site-nav .nav-list a[aria-current="page"] {
	border-bottom-color: var(--gold);
	color: var(--ink);
}

.menu-toggle {
	display: none;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ink);
	cursor: pointer;
}

.menu-toggle svg {
	display: block;
	fill: currentColor;
}

.menu-toggle .icon-close {
	display: none;
}

/* Small screens: the header menu becomes a full-screen overlay. */
@media (max-width: 599px) {
	.menu-toggle {
		display: block;
		position: relative;
		z-index: 20;
	}

	.site-nav .nav-list {
		display: none;
	}

	.site-nav.is-open .nav-list {
		display: flex;
		position: fixed;
		inset: 0;
		z-index: 10;
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
		padding: calc(var(--space-30) + 4rem) var(--space-30) var(--space-30);
		background: var(--white);
	}

	.site-nav.is-open .nav-list a {
		font-size: 1.375rem;
		font-weight: 600;
		color: var(--ink);
	}

	.site-nav.is-open .icon-open { display: none; }
	.site-nav.is-open .icon-close { display: block; }

	html.menu-open {
		overflow: hidden;
	}
}

/* ---------- Buttons and forms ---------- */

.button,
button[type="submit"] {
	display: inline-block;
	padding: 0.75rem 1.4rem;
	border: 0;
	border-radius: var(--radius);
	background: var(--navy);
	color: var(--white);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.button:hover,
button[type="submit"]:hover {
	background: var(--gold);
	color: var(--ink);
}

.search-form label {
	display: block;
	margin-bottom: 0.6rem;
	color: var(--muted);
	font-size: var(--fs-small);
}

.search-form label strong {
	color: var(--ink);
	font-weight: 600;
}

.search-form__row {
	display: flex;
	gap: 0.5rem;
}

.search-form input {
	flex: 1;
	min-width: 0;
	padding: 0.75rem 1rem;
	border: 1px solid #c5cdd8;
	border-radius: var(--radius);
	background: var(--white);
	color: var(--ink);
	font: inherit;
}

.search-form input:focus {
	border-color: var(--focus);
	outline: 3px solid rgba(47, 111, 208, 0.2);
	outline-offset: 0;
}

/* ---------- Home ---------- */

/* Hero band: the title and the search form below it share a navy background. */
.home-title {
	--band: var(--navy);
	margin: 0 auto;
	padding: var(--space-60) 0 var(--space-40);
	color: var(--gold);
	font-size: clamp(2.1rem, 1.5rem + 3vw, 3.75rem);
}

.home-title::before {
	content: "";
	display: block;
	width: 48px;
	height: 3px;
	margin: 0 auto 1.75rem;
	background: var(--gold);
}

.home-title strong {
	color: var(--white);
	font-weight: inherit;
}

.home-title + .search-form {
	--band: var(--navy);
	margin: 0 auto;
	padding-bottom: var(--space-60);
}

.home-title + .search-form label {
	color: #b4c0d0;
	text-align: center;
}

.home-title + .search-form label strong {
	color: var(--white);
}

.home-title + .search-form input {
	border-color: transparent;
	padding-top: 0.9rem;
	padding-bottom: 0.9rem;
}

.home-title + .search-form button[type="submit"] {
	background: var(--gold);
	color: var(--ink);
}

.home-title + .search-form button[type="submit"]:hover {
	background: var(--white);
}

.section-title {
	max-width: var(--wide-width);
	margin: var(--space-50) auto var(--space-30);
	padding-bottom: 0.75rem;
	border-bottom: 1px solid var(--border);
	color: var(--ink);
	font-family: var(--font-label);
	font-size: var(--fs-small);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* ---------- Post cards ---------- */

.post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 2rem var(--gap);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

@media (max-width: 899px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 599px) {
	.post-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.archive-title + .post-grid {
	margin-top: var(--space-30);
}

/* The title link covers the whole card; other links sit above it. */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--white);
	box-shadow: var(--shadow);
	transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
	border-color: #cfd7e2;
	box-shadow: var(--shadow-hover);
	transform: translateY(-2px);
}

.card > :not(:first-child) {
	padding-left: 1.25rem;
	padding-right: 1.25rem;
}

.card img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	background: var(--surface);
}

.card__title {
	margin: 1.25rem 0 0.6rem;
	font-size: 1.125rem;
	font-weight: 650;
	letter-spacing: -0.01em;
	line-height: 1.35;
}

.card__title a {
	color: var(--ink);
	text-decoration: none;
}

.card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card:hover .card__title a {
	color: var(--link);
}

.card__tags,
.card__date {
	margin: 0;
	font-size: var(--fs-xs);
	line-height: 1.5;
}

.card__tags {
	color: var(--gold-text);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.card__tags a {
	position: relative;
	z-index: 1;
	color: inherit;
	text-decoration: none;
}

.card__tags a:hover {
	text-decoration: underline;
}

.card__date {
	margin-top: 0.25rem;
	color: var(--muted);
}

.card__excerpt {
	flex: 1;
	display: flex;
	flex-direction: column;
	margin: 0.85rem 0 0;
	padding-bottom: 1.25rem;
	color: var(--muted);
	font-size: var(--fs-small);
	line-height: 1.6;
}

.card__excerpt a {
	position: relative;
	z-index: 1;
	margin-top: auto;
	padding-top: 1rem;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

.card__excerpt a::after {
	content: " →";
	color: var(--gold-text);
}

.card__excerpt a:hover {
	color: var(--link);
}

.pagination {
	display: flex;
	justify-content: space-between;
	gap: var(--gap);
	margin-top: var(--space-50);
}

.pagination a {
	padding: 0.65rem 1.2rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--ink);
	font-size: var(--fs-small);
	font-weight: 600;
	text-decoration: none;
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pagination a:hover {
	border-color: var(--navy);
	background: var(--navy);
	color: var(--white);
}

.pagination .next {
	margin-left: auto;
}

.archive-title {
	margin: var(--space-50) auto var(--space-30);
	font-size: clamp(1.75rem, 1.5rem + 1.2vw, 2.5rem);
}

/* "Tag: <span>Name</span>" — the prefix reads as a label. */
.archive-title:has(span) {
	color: var(--muted);
	font-weight: 500;
}

.archive-title span {
	color: var(--ink);
	font-weight: 700;
}

/* ---------- Posts and pages ---------- */

.prose {
	color: var(--text);
	font-size: var(--fs-prose);
	line-height: 1.75;
}

.entry-title,
.prose > .entry-title {
	margin: var(--space-50) 0 0;
	font-size: clamp(1.9rem, 1.5rem + 1.8vw, 2.75rem);
}

/* Post hero: navy band with the title; the featured image overlaps its bottom edge. */
.entry-hero {
	--band: var(--navy);
	max-width: var(--wide-width);
	margin: 0 auto;
	padding: var(--space-50) 0 calc(var(--hero-overlap) + var(--space-40));
	text-align: center;
}

.entry-hero > * {
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
}

.entry-hero__category {
	margin-top: 0;
	margin-bottom: 1rem;
	font-family: var(--font-label);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.entry-hero__category a {
	color: var(--gold);
	text-decoration: none;
}

.entry-hero__category a:hover {
	color: var(--white);
}

.entry-hero .entry-title {
	margin-top: 0;
	margin-bottom: 0;
	color: var(--white);
	text-wrap: balance;
}

.entry-hero__meta {
	margin-top: 1.25rem;
	margin-bottom: 0;
	color: #b4c0d0;
	font-size: var(--fs-small);
}

.entry-hero__meta span {
	margin: 0 0.6em;
	color: var(--gold);
}

.entry-figure {
	position: relative;
	max-width: var(--wide-width);
	margin: calc(-1 * var(--hero-overlap)) auto 0;
	text-align: center;
}

.entry-figure img {
	display: block;
	margin: 0 auto;
	border-radius: var(--radius);
	background: var(--white);
	box-shadow: 0 2px 6px rgba(8, 22, 41, 0.12), 0 16px 48px rgba(8, 22, 41, 0.22);
}

.entry-figure figcaption {
	max-width: var(--content-width);
	margin: 0.9rem auto 0;
	color: var(--muted);
	font-size: var(--fs-small);
	line-height: 1.5;
}

.entry-figure + .prose {
	margin-top: var(--space-50);
}

.page-title {
	margin-bottom: var(--space-30);
}

.prose h2 {
	margin-top: 2.75rem;
}

.prose h3 {
	margin-top: 2.25rem;
}

.prose h4,
.prose h5,
.prose h6 {
	margin-top: 2rem;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + * {
	margin-top: 0.75rem;
}

.prose strong {
	color: var(--ink);
	font-weight: 600;
}

.prose a:hover {
	text-decoration-color: var(--gold);
}

.prose figure {
	margin-left: 0;
	margin-right: 0;
}

.prose figure img {
	display: block;
	border-radius: 4px;
}

.prose figcaption {
	margin: 0.5em 0 1em;
	color: var(--muted);
	font-size: var(--fs-small);
	line-height: 1.5;
	text-align: center;
}

.prose figure img + figcaption {
	margin-top: 0.75em;
}

.prose img {
	margin-left: auto;
	margin-right: auto;
}

.prose ul,
.prose ol {
	padding-left: 1.5em;
}

.prose li + li {
	margin-top: 0.4em;
}

.prose li::marker {
	color: var(--gold-text);
}

.prose hr {
	width: 64px;
	margin-left: auto;
	margin-right: auto;
	border-top: 3px solid var(--gold);
}

.text-gold {
	color: var(--gold-text);
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 0.5rem;
}

.gallery figure {
	margin: 0;
}

/* Data tables scroll sideways on narrow screens instead of overflowing. */
.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-size: 0.8125rem;
	line-height: 1.5;
}

.table-wrap table {
	width: 100%;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.table-wrap td,
.table-wrap th {
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--border);
	vertical-align: top;
	text-align: left;
}

/* Hide the outer cell borders; the wrapper draws the frame. */
.table-wrap tr:first-child > * { border-top: 0; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.table-wrap tr > :first-child { border-left: 0; }
.table-wrap tr > :last-child { border-right: 0; }

/* The source tables have no <th>; treat the first row as the header. */
.table-wrap tr:first-child > * {
	background: var(--surface);
	color: var(--ink);
	font-weight: 600;
}

.table-wrap tbody tr:hover > * {
	background: #fafbfc;
}

.table-wrap tbody tr:first-child:hover > * {
	background: var(--surface);
}

.post-meta {
	max-width: var(--content-width);
	margin: var(--space-50) auto 0;
	padding: 1.25rem 1.5rem;
	border-radius: var(--radius);
	background: var(--surface);
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	color: var(--muted);
	font-size: var(--fs-small);
}

.post-meta p {
	margin: 0;
}

.post-meta a {
	color: var(--ink);
	font-weight: 500;
}

/* ---------- Contact card ---------- */

.contact-card {
	padding: 2rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.contact-card__list {
	display: grid;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.prose .contact-card__list li + li {
	margin-top: 0;
}

.contact-card__item {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.contact-card__icon {
	flex: none;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: var(--radius);
	background: var(--navy);
	color: var(--gold);
}

.contact-card__icon svg {
	width: 22px;
	height: 22px;
}

.contact-card__icon svg:not([fill]) {
	fill: currentColor;
}

.contact-card__label {
	margin: 0 0 0.2rem;
	color: var(--muted);
	font-family: var(--font-label);
	font-size: var(--fs-xs);
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.4;
	text-transform: uppercase;
}

.contact-card__value {
	margin: 0;
	color: var(--ink);
	font-size: 1rem;
	font-style: normal;
	font-weight: 500;
	overflow-wrap: anywhere;
}

/* ---------- Search results ---------- */

.search-results {
	margin: var(--space-30) 0 0;
	padding: 0;
	list-style: none;
}

.prose .search-results li {
	margin: 0;
	padding: 1.25rem 0;
	border-bottom: 1px solid var(--border);
}

.search-results h2 {
	margin: 0 0 0.35rem;
	font-size: 1.125rem;
}

.search-results h2 a {
	color: var(--ink);
	text-decoration: none;
}

.search-results h2 a:hover {
	color: var(--link);
}

.search-results p {
	margin: 0.25rem 0 0;
	color: var(--muted);
	font-size: var(--fs-small);
}

/* ---------- Footer ---------- */

.site-footer {
	--band: var(--navy-deep);
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: var(--gap);
	margin-top: var(--space-60);
	padding: var(--space-40) 0;
	color: #9aa8bb;
	font-size: var(--fs-small);
}

.site-footer p {
	grid-column: 1 / -1;
	margin: 0;
	padding-top: var(--gap);
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: var(--fs-xs);
}

.site-footer nav a {
	color: #d3dbe6;
}

.site-footer nav a:hover {
	color: var(--gold);
}

@media (max-width: 599px) {
	.site-footer {
		grid-template-columns: 1fr;
		justify-items: center;
		text-align: center;
	}

	.site-footer .nav-list {
		justify-content: center;
		gap: 0.5rem 1.5rem;
	}
}

.social-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.social-links a {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 50%;
	color: #d3dbe6;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.social-links svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.social-links a:hover {
	border-color: var(--gold);
	background: var(--gold);
	color: var(--ink);
}

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

	.card:hover {
		transform: none;
	}
}
