/* =========================================================================
   theme-chrome.css — header, navbar and footer ported from
   parimalparag.github.io (css/_base.scss + css/_layout.scss).

   The original partials style everything through the --global-* custom
   properties. Here those are mapped onto this site's existing design tokens
   (css/index.css), so the chrome picks up the dist-sys color scheme (both
   light and dark) while the structure/style of the navbar and footer match
   the personal site. Loaded AFTER the inlined index.css so it wins conflicts.

   Fonts come from the same Google Fonts stack as parimalparag.github.io:
   Fira Sans (body/nav), Poppins, Roboto / Roboto Slab, Montserrat,
   Fira Sans Condensed.
   ========================================================================= */

/* Map the ported theme variables onto dist-sys tokens */
:root {
	--global-bg-color: var(--color-void);
	--global-text-color: var(--color-text);
	--global-text-color-light: var(--color-text-muted);
	--global-theme-color: var(--color-neon);
	--global-hover-color: var(--color-neon);
	--global-divider-color: var(--color-divider);
	--global-footer-bg-color: var(--color-deep-teal);
	--global-footer-text-color: var(--color-text-muted);
	--global-footer-link-color: var(--color-text);

	--max-content-width: 900px;
}

/* Body offsets for the fixed navbar / footer (from _layout.scss).
   Only applied to pages that opt into the ported chrome layout. */
body.fixed-top-nav {
	padding-top: 72px;
}
body.fixed-bottom-footer {
	padding-bottom: 70px;
}

.container {
	max-width: var(--max-content-width);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1rem;
	padding-right: 1rem;
}

.container.mt-5 {
	margin-top: 3rem;
}

/* Typography inside the container mirrors the source theme */
.container h1,
.container h2,
.container h3,
.container h4,
.container h5,
.container h6 {
	font-family: "Fira Sans", sans-serif;
	font-weight: 300;
}

/* ---------------------------------------------------------------------------
   Navbar (CSS-only reimplementation — no Bootstrap)
   --------------------------------------------------------------------------- */

.navbar {
	box-shadow: none;
	border-bottom: 1px solid var(--global-divider-color);
	background-color: var(--global-bg-color);
	opacity: 0.98;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1030;
}

.navbar .container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
	max-width: none;
}

.navbar-brand {
	color: var(--global-text-color);
	text-decoration: none;
	font-weight: lighter;
	font-size: 1.25rem;
	font-family: "Fira Sans", sans-serif;
}

.navbar-brand .font-weight-bold {
	font-weight: bold;
}

.navbar-toggler {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	margin-left: auto;
	display: none; /* shown via media query on mobile */
}

.navbar-toggler .icon-bar {
	display: block;
	width: 22px;
	height: 2px;
	background-color: var(--global-text-color);
	border-radius: 1px;
	margin-bottom: 4px;
	transition: all 0.2s;
}

.navbar-toggler.collapsed .top-bar {
	transform: rotate(45deg);
	transform-origin: 10% 10%;
}
.navbar-toggler.collapsed .middle-bar {
	opacity: 0;
}
.navbar-toggler.collapsed .bottom-bar {
	transform: rotate(-45deg);
	transform-origin: 10% 90%;
}
.navbar-toggler .top-bar {
	transform: rotate(0);
}
.navbar-toggler .middle-bar {
	opacity: 1;
}
.navbar-toggler .bottom-bar {
	transform: rotate(0);
}

/* Desktop nav: horizontal list with CSS hover/focus dropdowns. */
.navbar-collapse {
	display: flex;
	flex-basis: auto;
	flex-grow: 1;
	align-items: center;
}

.navbar-nav {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	margin-left: auto;
	align-items: center;
}

.navbar-nav .nav-item {
	position: relative;
}

.navbar-nav .nav-link {
	display: block;
	padding: 0.5rem 0.4rem;
	color: var(--global-text-color);
	font-family: "Fira Sans", sans-serif;
	font-size: 1rem;
	font-weight: 300;
	text-decoration: none;
}
.navbar-nav .nav-link:hover {
	color: var(--global-hover-color);
}

.navbar-nav .nav-item.active > .nav-link {
	background-color: inherit;
	font-weight: 400;
	color: var(--global-theme-color);
}
.navbar-nav .nav-item.active > .nav-link:hover {
	color: var(--global-hover-color);
}

/* CSS dropdown via :focus-within (keyboard + hover accessible). */
.navbar-nav .dropdown .dropdown-toggle::after {
	content: " ▾";
	font-size: 0.7em;
	color: var(--global-text-color);
}

.navbar-nav .dropdown .dropdown-menu {
	display: none;
	position: absolute;
	right: 0;
	left: auto;
	min-width: max-content;
	background-color: var(--global-bg-color);
	border: 1px solid var(--global-divider-color);
	padding: 0.25rem 0;
}

.navbar-nav .dropdown .dropdown-menu a {
	display: block;
	padding: 0.4rem 1rem;
	color: var(--global-text-color);
	font-family: "Fira Sans", sans-serif;
	font-size: 1rem;
	font-weight: 300;
	white-space: nowrap;
	text-decoration: none;
}
.navbar-nav .dropdown .dropdown-menu a:hover {
	color: var(--global-hover-color);
	background-color: var(--global-bg-color);
}

.navbar-nav .dropdown .dropdown-menu .dropdown-item {
	font-size: 0.9rem;
	font-weight: 300;
}

.navbar-nav .dropdown .dropdown-menu .dropdown-divider {
	height: 0;
	margin: 0.25rem 0;
	border-top: 1px solid var(--global-divider-color);
}

.navbar-nav .dropdown:hover .dropdown-menu,
.navbar-nav .dropdown:focus-within .dropdown-menu {
	display: block;
}

.toggle-container {
	display: flex;
	align-items: center;
	padding: 0 0.5rem;
}

.toggle-container a {
	display: flex;
	align-items: center;
	color: var(--global-text-color);
	cursor: pointer;
}

.toggle-container .fa-sun {
	display: none;
}
html[data-theme="dark"] .toggle-container .fa-sun {
	display: block;
	padding-left: 10px;
}
html[data-theme="dark"] .toggle-container .fa-moon {
	display: none;
}

/* Mobile: collapse the nav behind a hamburger toggle. */
@media (max-width: 575.98px) {
	.navbar-toggler {
		display: inline-block;
	}
	.navbar-collapse {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		align-items: flex-start;
		padding-top: 0.5rem;
	}
	.navbar-collapse.open {
		display: flex;
	}
	.navbar-nav {
		margin-left: 0;
		flex-direction: column;
		width: 100%;
	}
	.navbar-nav .dropdown .dropdown-menu {
		position: static;
		border: none;
		padding-left: 1rem;
	}
}

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

.footer-socials {
	position: relative;
	font-size: x-large;
	display: inline;
	padding-right: 30px;
}

.footer-socials a {
	color: var(--global-footer-link-color);
	text-decoration: none;
}

.footer-socials a i::before {
	color: var(--global-footer-text-color);
	transition: all 0.2s ease-in-out;
}

.footer-socials a:hover i::before {
	color: var(--global-theme-color);
}

@media only screen and (max-width: 700px) {
	.footer-socials {
		display: block;
		text-align: center;
		padding: 0;
	}
}

footer.fixed-bottom {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background-color: var(--global-footer-bg-color);
	font-size: 0.75rem;
	text-align: center;
	z-index: 1030;
}

footer.fixed-bottom .container {
	color: var(--global-footer-text-color);
	padding-top: 9px;
	padding-bottom: 8px;
	font-family: "Fira Sans", sans-serif;
}

footer.fixed-bottom a {
	color: var(--global-footer-link-color);
}

footer.fixed-bottom a:hover {
	color: var(--global-theme-color);
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   Mirrored publications page (/publications/)
   Fragment is extracted verbatim from parimalparag.github.io /pubs/ by
   scripts/mirror-pubs.mjs; these are the classes it relies on (ported from
   css/_base.scss there). Colors follow this site's tokens.
   --------------------------------------------------------------------------- */

.mirrored-pubs {
	.post-meta {
		color: var(--global-text-muted);
		font-size: 0.875rem;
		margin-bottom: 0;
	}
	.post-title {
		font-size: 2rem;
		font-weight: 300;
	}
	h2 {
		font-size: 1.5rem;
		font-weight: 300;
	}
	h3 {
		font-size: 1.3rem;
		font-weight: 300;
	}
}

/* Type-colored publication titles — same palette as parimalparag.github.io */
.pub-title--conference b {
	color: DarkGreen;
}
.pub-title--journal b {
	color: DarkBlue;
}
.pub-title--dissertation b {
	color: Purple;
}
.pub-title--patent b {
	color: Maroon;
}

.pub-item {
	margin-bottom: 0.5em;
}

.publications {
	margin-top: 2rem;
}

/* ---------------------------------------------------------------------------
   Collaborators card grid (/collaborators/) — ported from
   parimalparag.github.io css/_layout.scss; uses the --global-* token mapping
   above so cards follow this site's color scheme.
   --------------------------------------------------------------------------- */

.collab-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1.5rem;
	margin-top: 1.5rem;
}

.collab-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1rem;
	border: 1px solid var(--global-card-border-color, var(--color-divider));
	border-radius: 0.5rem;
	text-decoration: none;
	color: inherit;
	transition: background 200ms ease, box-shadow 200ms ease;
}

.collab-card:hover {
	background: var(--color-dark-forest);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.collab-avatar {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 0.75rem;
	border: 1px solid var(--global-card-border-color, var(--color-divider));
}

.collab-info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.collab-name {
	font-weight: 500;
	color: var(--global-theme-color);
}

.collab-affiliation {
	font-size: 0.85rem;
	color: var(--global-text-color-light);
}
