/* geomedialab.org — plain CSS, no framework.
   Palette from the lab logo: Waterman-map blue, slate wordmark, warm greys. */

:root {
	--blue: #2f6fb3;
	--blue-dark: #1f4f85;
	--slate: #3f4a63;
	--text: #22262e;
	--muted: #6b7280;
	--line: #e3e1dc;
	--bg: #ffffff;
	--bg-soft: #f6f5f2;
	--radius: 4px;
	--max: 1200px;
	--pad: clamp(1rem, 4vw, 2.5rem);
	--font: 'Muli', system-ui, sans-serif;
	color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--text);
	background: var(--bg);
	-webkit-tap-highlight-color: transparent;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad) 3rem; }

a { color: var(--blue); text-underline-offset: 0.15em; }
a:hover { color: var(--blue-dark); }

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

h1, h2, h3, h4 { color: var(--slate); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.45rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }

.date, .project-years, .person-role { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.25rem; }

.read-more { font-weight: 600; text-decoration: none; }
.read-more::after { content: " \2192"; }

/* ── header / nav ───────────────────────────────────────────── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem max(var(--pad), (100% - var(--max)) / 2 + var(--pad));
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--slate); }
.brand img { width: 72px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.01em; }
.brand-sub { font-size: 0.8rem; color: var(--muted); }

.nav-items { display: flex; align-items: center; gap: 1.5rem; }
.nav-item { color: var(--slate); text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 0.25rem; }
.nav-item:hover, .nav-item[aria-current="page"] { color: var(--blue); }
.nav-item[aria-current="page"] { text-decoration: underline; text-underline-offset: 0.4em; text-decoration-thickness: 2px; }

#open, #close {
	display: none;
	width: 2.5rem; height: 2.5rem;
	padding: 0.4rem;
	border: 0; background: none; color: var(--slate); cursor: pointer;
}
#open svg, #close svg { width: 100%; height: 100%; }

@media (max-width: 720px) {
	.brand img { width: 56px; }
	.brand-sub { display: none; }
	#open { display: block; }
	.nav-items .lang-selector { order: -1; margin-right: 0.5rem; }
	/* the menu drops over the page instead of pushing it down */
	.nav-items .nav-item { display: none; }
	.site-header.nav-open #open { display: none; }
	.site-header.nav-open #close { display: block; }
	.site-header.nav-open .nav-items {
		position: absolute;
		top: 100%; left: 0; right: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
		padding: 0.5rem var(--pad) 1rem;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
	}
	.site-header.nav-open .nav-items #close { position: absolute; top: -3.1rem; right: var(--pad); }
	.site-header.nav-open .nav-item { display: block; padding: 0.6rem 0; font-size: 1.15rem; }
}

/* ── project gallery (horizontal) ───────────────────────────── */
/* deliberately raw, like the original site: a nowrap row in an overflow-x div */

.tile-gallery {
	margin: 1.5rem 0 1rem;
	overflow-x: auto;
	overflow-y: hidden;
	white-space: nowrap;
}
.project-card {
	display: inline-block;
	vertical-align: top;
	width: 220px;
	margin: 6px;
	white-space: normal;
	text-align: center;
	text-decoration: none;
	color: var(--text);
}
.project-card-img { display: block; height: 250px; border-radius: 5px; overflow: hidden; }
.project-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-card:hover .project-card-img { opacity: 0.9; }
.project-card-title { display: block; margin-top: 0.5rem; }
.project-card-years { display: block; color: #b8b8b8; }

/* ── landing: about (left) + news (right) ───────────────────── */

.landing-columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	border-top: 1px solid var(--line);
	padding-top: 0.5rem;
}
.landing-news h2 { margin-top: 2rem; }
@media (max-width: 860px) { .landing-columns { grid-template-columns: 1fr; } }

/* partner lists read as a compact list */
.landing-about ul { padding-left: 1.1rem; }
.landing-about li { margin: 0.15rem 0; }

/* ── news cards ─────────────────────────────────────────────── */

.post-card { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.post-card:first-of-type { padding-top: 0; }
.post-card h3 { margin: 0 0 0.4rem; }
.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a:hover { color: var(--blue); }
.post-card p { margin: 0.4rem 0; }
.post-card-img { display: block; margin-bottom: 0.6rem; }
.post-card-img img { max-width: 100%; max-height: 520px; width: auto; border-radius: var(--radius); display: block; }
.empty { color: var(--muted); }

.news-page { max-width: 760px; margin: 2rem auto 0; }

/* ── page / project / post prose ────────────────────────────── */

.page { margin-top: 2rem; }
.prose { max-width: 760px; }
.page.prose, .post { margin-left: auto; margin-right: auto; }
.project { max-width: 900px; margin-left: auto; margin-right: auto; }
.prose img { display: block; margin: 1.25rem auto; border-radius: var(--radius); max-height: 75vh; width: auto; }
/* consecutive images in one paragraph sit side by side */
.prose p:has(> img + img) { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; }
.prose p:has(> img + img) img { width: 100%; height: 100%; max-height: 340px; object-fit: cover; margin: 0; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; margin: 1.25rem 0; border-radius: var(--radius); }
.prose blockquote { margin: 1.25rem 0; padding: 0.25rem 1rem; border-left: 3px solid var(--blue); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.post-img { display: block; max-width: 100%; max-height: 85vh; width: auto; border-radius: var(--radius); margin: 1rem 0; }

.project-header { margin-bottom: 1.5rem; }

/* previous / next project arrows either side of the body, as on the original site */
.project-frame { display: grid; grid-template-columns: 3rem minmax(0, 1fr) 3rem; gap: 1rem; align-items: start; }
.project-arrow { font-size: 9em; line-height: 1; text-decoration: none; position: sticky; top: 30vh; text-align: center; }
@media (max-width: 720px) {
	.project-frame { grid-template-columns: 1.5rem minmax(0, 1fr) 1.5rem; gap: 0.5rem; }
	.project-arrow { font-size: 4em; }
}

/* heading anchors from markdown-it-anchor */
.heading-wrapper { position: relative; }
.heading-wrapper .anchor { position: absolute; inset: 0; }

/* ── team ───────────────────────────────────────────────────── */

.people-grid {
	display: grid;
	/* 4 across like the original team page, so the order reads row by row */
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1.75rem 1.25rem;
	align-items: start;
}
.person-toggle {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	opacity: 0.95;
	transition: opacity 0.4s;
}
.person-toggle[disabled] { cursor: default; }
.person-toggle:not([disabled]):hover { opacity: 0.75; }
.team.has-open .person-toggle[aria-expanded="false"] { opacity: 0.4; }
.team.has-open .person-toggle[aria-expanded="false"]:hover { opacity: 0.7; }
.person-toggle[aria-expanded="true"] { opacity: 1; }
.person-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.person-photo { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 5px; background: var(--bg-soft); }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.person-name { display: block; margin: 0.6rem 0 0.1rem; font-size: 1.05rem; font-weight: 700; color: var(--slate); }
.person-role { display: block; }
/* bio slides open below the card, over the cards beneath it (out of flow, so
   the row never changes height) */
.person-card { position: relative; }
.person-bio {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 2;
	background: var(--bg);
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.4s ease;
}
.person-toggle[aria-expanded="true"] + .person-bio { padding-bottom: 1rem; }
.person-bio > div { overflow: hidden; font-size: 0.95rem; visibility: hidden; transition: visibility 0.4s; }
.person-toggle[aria-expanded="true"] + .person-bio { grid-template-rows: 1fr; }
.person-toggle[aria-expanded="true"] + .person-bio > div { visibility: visible; }
.person-bio p { margin: 0.5rem 0; }
@media (max-width: 860px) { .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── contact ────────────────────────────────────────────────── */

.contact-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.contact-map { height: min(70vh, 560px); border-radius: var(--radius); overflow: hidden; background: #f4f2ee; }
.contact-card h2 { margin-top: 0; }
.contact-card address { font-style: normal; margin-bottom: 1rem; }
@media (max-width: 860px) {
	.contact-grid { grid-template-columns: 1fr; }
	.contact-map { height: 60vh; }
}

/* ── footer ─────────────────────────────────────────────────── */

.site-footer { font-size: 0.92rem; color: var(--muted); }
.footer-inner {
	max-width: var(--max);
	margin: 0 auto;
	padding: 2rem var(--pad);
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 1.5rem;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer strong { color: var(--slate); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.3rem; }
.site-footer a { color: var(--slate); }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; } }

.lang-selector { display: flex; gap: 0.3rem; color: var(--muted); }
.lang-selector a { color: var(--slate); text-decoration: none; text-transform: uppercase; font-size: 0.9rem; }
.lang-selector a[href] { color: var(--blue); }
.lang-selector a[href]:hover { text-decoration: underline; }
.post-card .more { text-decoration: none; white-space: nowrap; }
.post-card[data-href] { cursor: pointer; }
.post-card:hover h3 a { color: var(--blue); }
/* jumping from the landing page lands the card just under the sticky header */
.post-card { scroll-margin-top: 5.5rem; }
