/* Center the site with a comfortable max width; use padding for small screens */
body { max-width: 900px; margin: 0 auto; padding: 1rem; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; }
a { text-decoration: none; color: #0645ad; }
a:visited { color: #0645ad; }
#profilepic { height: 300px; float: right; margin-bottom: 20px; margin-left: 15px }
#about { margin-top: 30px; }
h3.section-teaser { background-color: rgb(245,245,245); padding: 0.6% 1%; clear: both; margin-top: 1.5em; }
header.site-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2em; }
nav.site-nav { font-size: 16px; }
nav.site-nav a { margin-left: 1em; }
.info { margin-left: 0; }
#footer { margin-top: 2em; }
#emailid { font-family: monospace; }
.back-home { font-size: 0.95em; margin-top: 1em; display: inline-block; }

/* Mobile navigation */
.nav-toggle { display: none; background: transparent; border: 0; font-size: 24px; }
.site-nav { display: flex; gap: 0.6em; }

@media (max-width: 700px) {
	/* On small screens let padding handle spacing */
	body { max-width: 100%; padding: 0.8rem; }
	#profilepic { height: 180px; float: none; display: block; margin: 0 auto 1rem; }
	header.site-header { flex-direction: row; align-items: center; }
	.nav-toggle { display: inline-block; }

	/* Replace textual hamburger with an inline SVG background so it renders reliably on mobile */
	.nav-toggle {
		width: 48px;
		height: 48px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0;
		border-radius: 6px;
		color: transparent; /* keep aria-label for screen readers, hide text visually */
		background: transparent no-repeat center/contain;
		margin-left: 0.6rem;
	}

	.nav-toggle::before {
		content: "";
		display: block;
		width: 28px;
		height: 20px;
		background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230645ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='3' y1='6' x2='21' y2='6'/><line x1='3' y1='12' x2='21' y2='12'/><line x1='3' y1='18' x2='21' y2='18'/></svg>");
		background-repeat: no-repeat;
		background-position: center;
		background-size: contain;
	}
	.site-nav { display: none; flex-direction: column; background: #fff; position: absolute; right: 5%; top: 3.4rem; padding: 0.6rem 1rem; box-shadow: 0 4px 10px rgba(0,0,0,0.08); border-radius: 6px; }
	.site-nav.open { display: flex; }
	nav.site-nav a { margin-left: 0; margin-bottom: 0.5rem; }
}

@media (min-width: 701px) {
	header.site-header { align-items: flex-start; gap: 1.5em; }
	nav.site-nav { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; gap: 1.1em; margin-top: 1.9em; }
	nav.site-nav a { margin-left: 0; white-space: nowrap; }
	/* Only these two labels wrap, onto two tight lines */
	nav.site-nav a[href="mentoring.html"], nav.site-nav a[href="thesis.html"] { white-space: normal; width: min-content; }
}

/* Current page in the menu */
/* Menu links: a bold underline slides in on hover. The text-shadow thickens the letters
   without changing their width, so neighbouring links don't shift. */
nav.site-nav a { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 3px; text-underline-offset: 5px; transition: text-decoration-color 0.15s, color 0.15s, text-shadow 0.15s; }
nav.site-nav a:hover { color: #033a8c; text-decoration-color: currentColor; text-shadow: 0 0 0.65px currentColor, 0 0 0.65px currentColor; }
nav.site-nav a.current { font-weight: 600; text-decoration-color: currentColor; text-decoration-thickness: 2px; }
nav.site-nav a.current:hover { text-decoration-thickness: 3px; }

/* Labelled profile links: GitHub/ORCID/MathSciNet under the name (home), Goodreads (others).
   All buttons share one fixed size. */
.link-badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.6em 0 0.5em; }
.link-badge { box-sizing: border-box; width: 132px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px; border: 1px solid #d8dbe0; border-radius: 10px; color: #222; font-size: 15px; font-weight: 500; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s, transform 0.15s; }
a.link-badge:visited { color: #222; }
.link-badge:hover { border-color: #0645ad; background-color: #e3ecfa; box-shadow: 0 0 0 1px #0645ad, 0 3px 8px rgba(6,69,173,0.18); transform: translateY(-1px); }
.link-badge img { height: 24px; width: auto; }
.link-badge i { font-size: 24px; line-height: 1; }
.profile-links { margin: -0.6em 0 1.6em; }
@media (max-width: 700px) {
	.link-badges { gap: 6px; }
	.link-badge { width: 120px; height: 36px; gap: 6px; padding: 0 4px; font-size: 13.5px; }
	.link-badge img { height: 21px; }
	.link-badge i { font-size: 21px; }
}
