/* ==========================================================================
   Publications page
   Scoped under .pubs-page so alumni.html / resources.html keep the shared
   .pubItem and .imageFigure rules from main.css.
   ========================================================================== */

.pubs-page .pubSection {
	border: 0;
	background: transparent;
	padding: 0;
	margin: 0 0 3em 0;
}

.pubs-page .pubSection-header {
	font-size: 0.95em;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #4a4a4a;
	text-align: left;
	margin: 0 0 1.25em 0;
	padding-bottom: 0.6em;
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

/* Year dividers within a section */
.pubs-page .pubYear {
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.14em;
	color: #3fa7c9;
	margin: 1.75em 0 0.75em 0;
	padding: 0;
}

.pubs-page .pubYear:first-of-type {
	margin-top: 0;
}

.pubs-page .pubLegend {
	margin: 0 0 1.5em 0;
	font-size: 0.8em;
	color: #6a6a6a;
	text-align: center;
}

/* --- Card ---------------------------------------------------------------- */

.pubs-page .pubItem {
	width: auto;
	margin: 0 0 1.25em 0;
	padding: 1.25em;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.09);
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	overflow: visible;
	font-size: 0.95em;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pubs-page .pubItem:hover {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

/* Row on wide screens: text left, figure right. Never re-laid out by JS. */
.pubs-page .pubItem .clearfix {
	display: flex;
	flex-direction: row-reverse;
	gap: 1.5em;
	align-items: flex-start;
}

.pubs-page .pubText {
	flex: 1 1 auto;
	min-width: 0;
	text-align: left;
}

.pubs-page .pubTitle {
	color: #943126;
	line-height: 1.35;
	margin-bottom: 0.25em;
}

.pubs-page .pubItem b {
	font-size: 1.05em;
	line-height: 1.35em;
}

.pubs-page .pubJournal {
	font-size: 0.9em;
	margin-bottom: 0.3em;
}

.pubs-page .pubAuthors {
	font-size: 0.88em;
	line-height: 1.5;
	color: #444;
	overflow-wrap: break-word;
}

.pubs-page .pubSummary {
	margin-top: 0.6em;
	font-size: 0.88em;
	color: #555;
	line-height: 1.55;
	font-style: italic;
}

.pubs-page .pubFooter {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin-top: 0.9em;
	padding-top: 0.7em;
	border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.pubs-page .pubMeta {
	font-size: 0.82em;
	color: #4a4a4a;
	margin-top: 0;
}

.pubs-page .pubNumber {
	font-size: 0.78em;
	color: #8a8a8a;
	padding-left: 0;
	flex: 0 0 auto;
}

/* --- Figure -------------------------------------------------------------- */

/*
   The figure lives in a fixed aspect-ratio box. Its size never depends on
   when the image decodes or on how tall the text beside it is, so nothing
   reflows while scrolling.
*/
.pubs-page .pubFigure {
	position: relative;
	display: block;
	flex: 0 0 auto;
	width: clamp(160px, 20vw, 280px);
	aspect-ratio: 4 / 3;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	overflow: hidden;
	background: #f2f2f2;
	cursor: zoom-in;
	-webkit-appearance: none;
	appearance: none;
}

/*
   Anchor the crop to the top-left. Figures are multi-panel and read
   left-to-right, so the leading panel is the coherent thing to show; a centred
   crop on a wide two-panel figure lands on the seam between panels.
*/
.pubs-page .pubFigure .imageFigure {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	object-fit: cover;
	object-position: left top;
	border-radius: 0;
	transition: transform 0.25s ease;
}

.pubs-page .pubFigure:hover .imageFigure,
.pubs-page .pubFigure:focus-visible .imageFigure {
	transform: scale(1.04);
}

/* Guttman-style "+" affordance */
.pubs-page .pubFigure-zoom {
	position: absolute;
	right: 0.4em;
	bottom: 0.4em;
	width: 1.9em;
	height: 1.9em;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.95em;
	line-height: 1;
	font-weight: 400;
	color: #fff;
	background: rgba(20, 24, 28, 0.68);
	border-radius: 50%;
	pointer-events: none;
	transition: background 0.2s ease;
}

.pubs-page .pubFigure:hover .pubFigure-zoom,
.pubs-page .pubFigure:focus-visible .pubFigure-zoom {
	background: rgba(20, 24, 28, 0.9);
}

.pubs-page .pubFigure:focus-visible {
	outline: 3px solid #3fa7c9;
	outline-offset: 2px;
}

/* --- Controls: search + tag filters -------------------------------------- */

/*
   Deliberately understated: this is a utility strip above the list, not a
   headline. Search and filters share one row on wider screens.
*/
.pubs-page .pubControls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5em 1.25em;
	margin: 0 0 1.75em 0;
}

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

.pubs-page .pubSearch-wrap {
	position: relative;
	flex: 0 1 17em;
	margin: 0;
}

/* Visible to screen readers only; the placeholder carries the visual label. */
.pubs-page .pubSearch-label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pubs-page .pubSearch {
	width: 100%;
	height: auto;
	padding: 0.4em 2em 0.4em 0.85em;
	font-size: 0.8em;
	line-height: 1.4;
	color: #46505a;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 20px;
	box-shadow: none;
}

.pubs-page .pubSearch::placeholder {
	color: #9aa2aa;
}

.pubs-page .pubSearch:focus {
	border-color: #3fa7c9;
	box-shadow: 0 0 0 3px rgba(63, 167, 201, 0.2);
	outline: none;
}

.pubs-page .pubSearch-clear {
	position: absolute;
	top: 50%;
	right: 0.4em;
	transform: translateY(-50%);
	width: 1.5em;
	height: 1.5em;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 1em;
	line-height: 1;
	color: #777;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.pubs-page .pubSearch-clear:hover {
	color: #222;
	background: rgba(0, 0, 0, 0.06);
}

.pubs-page .pubSearch-wrap.has-value .pubSearch-clear {
	display: flex;
}

.pubs-page .pubFilters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.35em;
}

.pubs-page .pubFilters-label {
	font-size: 0.75em;
	color: #8a9199;
	margin-right: 0.15em;
}

/* The theme uppercases and letter-spaces every button, which turns each chip
   into a full-width row. Reset those here. */
.pubs-page .pubFilter {
	display: inline-block;
	height: auto;
	margin: 0;
	padding: 0.3em 0.75em;
	font-size: 0.75em;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	color: #6b747c;
	background: transparent;
	border: 1px solid rgba(0, 0, 0, 0.13);
	border-radius: 20px;
	box-shadow: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pubs-page .pubFilter:hover {
	border-color: #3fa7c9;
	color: #1f6f89;
}

.pubs-page .pubFilter[aria-pressed="true"] {
	background: #2e3842;
	border-color: #2e3842;
	color: #fff;
}

.pubs-page .pubFilter:focus-visible {
	outline: 3px solid #3fa7c9;
	outline-offset: 2px;
}

.pubs-page .pubCount {
	margin: 0;
}

.pubs-page .pubEmpty {
	display: none;
	padding: 2.5em 1em;
	text-align: center;
	color: #666;
	font-size: 0.95em;
}

.pubs-page .pubEmpty.is-visible {
	display: block;
}

.pubs-page .pubEmpty-reset {
	padding: 0;
	font-size: 1em;
	color: #1f6f89;
	background: transparent;
	border: 0;
	border-bottom: 1px solid currentColor;
	cursor: pointer;
}

.pubs-page .pubItem[hidden],
.pubs-page .pubSection[hidden] {
	display: none;
}

/* --- Lightbox ------------------------------------------------------------ */

.pubLightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 3.5em 1em 2.2em 1em;
	background: rgba(10, 12, 15, 0.96);
}

.pubLightbox.is-open {
	display: flex;
}

.pubLightbox-inner {
	max-width: 100%;
	max-height: 100%;
	overflow: auto;
	text-align: center;
	-webkit-overflow-scrolling: touch;
}

.pubLightbox-img {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: 4px;
	background: #fff;
	cursor: zoom-in;
}

/*
   Multi-panel figures are unreadable when shrunk to fit a phone. Tapping the
   image drops the fit constraint so it renders at full width and the inner
   container pans.
*/
.pubLightbox.is-zoomed .pubLightbox-img {
	max-width: none;
	max-height: none;
	width: auto;
	min-width: 170vw;
	cursor: zoom-out;
}

.pubLightbox.is-zoomed .pubLightbox-inner {
	width: 100%;
	text-align: left;
}

.pubLightbox.is-zoomed .pubLightbox-caption {
	display: none;
}

.pubLightbox-caption {
	max-width: 46em;
	margin: 0.9em auto 0 auto;
	font-size: 0.85em;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

.pubLightbox-close {
	position: absolute;
	top: 0.7em;
	right: 0.9em;
	width: 2.2em;
	height: 2.2em;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-size: 1.4em;
	line-height: 1;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.pubLightbox-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

.pubLightbox-hint {
	position: absolute;
	bottom: 0.8em;
	left: 0;
	right: 0;
	font-size: 0.75em;
	color: rgba(255, 255, 255, 0.5);
	text-align: center;
	pointer-events: none;
}

/* --- Small screens ------------------------------------------------------- */

/*
   Two theme wrappers nest around the list and each contributes its own gutter,
   so below desktop widths a fifth of the screen went to padding. Drop the
   inner one and let the outer supply the whole margin.
*/
@media screen and (max-width: 1080px) {
	.pubs-page .wrapper.style5 {
		padding-left: 0;
		padding-right: 0;
	}
}

/*
   Below this the text column beside the figure gets too narrow to read, so the
   figure moves above the text.
*/
@media screen and (max-width: 620px) {
	.pubs-page .wrapper.style4 {
		padding-left: 1em;
		padding-right: 1em;
	}

	.pubs-page .pubSection-main {
		width: auto;
		margin: 0;
		padding: 0;
	}

	.pubs-page .pubItem {
		padding: 1em;
		margin-bottom: 1em;
	}

	.pubs-page .pubItem .clearfix {
		flex-direction: column;
		gap: 0.9em;
	}

	/*
	   Stacked, but kept deliberately smaller than the citation text so the
	   figure stays a visual cue rather than the dominant element. Sized off
	   the viewport only, so the card still cannot reflow mid-scroll.
	*/
	.pubs-page .pubFigure {
		width: min(48%, 175px);
	}

	.pubs-page .pubControls {
		gap: 0.6em;
	}

	.pubs-page .pubSearch-wrap {
		flex: 1 1 100%;
	}

	.pubs-page .pubFilters-label {
		width: 100%;
		margin-bottom: 0.1em;
		text-align: center;
	}

	.pubs-page .pubFooter {
		flex-wrap: wrap;
		gap: 0.4em;
	}

	.pubLightbox {
		padding: 3.2em 0.5em 2.2em 0.5em;
	}

	.pubLightbox-img {
		max-height: 70vh;
	}
}

/* Phones: every pixel of width counts */
@media screen and (max-width: 560px) {
	.pubs-page .wrapper.style4 {
		padding-left: 0.7em;
		padding-right: 0.7em;
	}

	.pubs-page .pubItem {
		padding: 0.9em;
	}

	.pubs-page .pubFilters {
		gap: 0.4em;
	}

	.pubs-page .pubFilter {
		padding: 0.35em 0.7em;
		font-size: 0.73em;
	}
}
