/**
 * Defence record and listing.
 *
 * Inherits Astra's typography, colours and container widths rather than
 * restating them -- the proposal (§5) scopes this as "styled to match the
 * existing site", not a new design. Colours come from Astra's own CSS custom
 * properties where they exist, with the University blue as a fallback.
 */

.phd-defence,
.phd-archive {
	--phd-accent: var(--ast-global-color-0, #10456f);
	--phd-muted: var(--ast-global-color-3, #5a6b7b);
	--phd-rule: var(--ast-border-color, #e3e7eb);
	--phd-surface: var(--ast-global-color-5, #f6f8fa);

	padding-bottom: 3rem;
}

/* ----------------------------------------------------------------- header --
 * Turning off the transparent header (see Display\Templates) also drops the
 * menu colour it carried, leaving Astra's unconfigured default -- a pink that
 * appears nowhere else on the site. These two rules restore the colours the
 * rest of phd.hi.is shows, so the only visible difference on our pages is that
 * the content no longer sits underneath the menu.
 */

body.phd-template .main-header-menu .menu-item > .menu-link {
	color: #10099f;
}

body.phd-template .main-header-menu .menu-item.current-menu-item > .menu-link,
body.phd-template .main-header-menu .menu-item.current-menu-ancestor > .menu-link {
	color: #000;
}

/* ---------------------------------------------------------------- record -- */

.phd-defence__header {
	display: flex;
	flex-wrap: wrap;
	gap: 1.75rem;
	align-items: flex-start;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--phd-rule);
}

.phd-defence__portrait {
	flex: 0 0 220px;
	max-width: 220px;
}

.phd-defence__portrait img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	display: block;
}

.phd-defence__headings {
	flex: 1 1 320px;
	min-width: 0;
}

.phd-defence__badge {
	display: inline-block;
	margin: 0 0 .5rem;
	padding: .2rem .6rem;
	font-size: .78em;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--phd-accent);
	border-radius: 3px;
}

/* The theme's h1 is sized for a page banner; next to a 220px portrait it ran
   to three lines and pushed the facts below the fold. */
.phd-defence__title {
	margin: 0 0 .4rem;
	font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
	line-height: 1.22;
}

.phd-defence__school {
	margin: 0 0 1.1rem;
	font-size: .95em;
	color: var(--phd-muted);
}

.phd-defence__sep {
	margin: 0 .35rem;
	opacity: .6;
}

/* Facts read as a definition list, so a missing row simply is not there. */
.phd-defence__facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: .35rem 1rem;
	margin: 0;
}

.phd-defence__fact {
	display: contents;
}

.phd-defence__facts dt {
	font-weight: 600;
	color: var(--phd-muted);
	font-size: .9em;
	margin: 0;
}

.phd-defence__facts dd {
	margin: 0;
}

.phd-defence__thesis {
	margin: 1.75rem 0;
	padding: 1.1rem 1.25rem;
	background: var(--phd-surface);
	border-left: 3px solid var(--phd-accent);
	border-radius: 0 4px 4px 0;
}

.phd-defence__thesis h2 {
	margin: 0 0 .35rem;
	font-size: .85em;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--phd-muted);
}

.phd-defence__thesis p {
	margin: 0;
	font-size: 1.1em;
	line-height: 1.45;
}

.phd-defence__body {
	margin-top: 1.5rem;
}

.phd-defence__footer {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--phd-rule);
	font-size: .95em;
	color: var(--phd-muted);
}

.phd-defence__footer p {
	margin: 0 0 .4rem;
}

/* --------------------------------------------------------------- listing -- */

.phd-archive__header {
	margin-bottom: 2rem;
}

.phd-archive__title {
	margin: 0 0 .25rem;
}

.phd-archive__count {
	margin: 0;
	color: var(--phd-muted);
}

.phd-archive__year {
	margin-bottom: 2.25rem;
}

.phd-archive__year-title {
	margin: 0 0 .85rem;
	padding-bottom: .35rem;
	font-size: 1.05em;
	letter-spacing: .06em;
	color: var(--phd-muted);
	border-bottom: 1px solid var(--phd-rule);
}

.phd-archive__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: .5rem 1.5rem;
}

.phd-card__link {
	display: flex;
	gap: .9rem;
	align-items: flex-start;
	padding: .6rem;
	border-radius: 4px;
	text-decoration: none;
	color: inherit;
	transition: background-color .15s ease;
}

.phd-card__link:hover,
.phd-card__link:focus-visible {
	background: var(--phd-surface);
}

.phd-card__media {
	flex: 0 0 64px;
}

.phd-card__media img,
.phd-card__media-empty {
	display: block;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 50%;
	background: var(--phd-surface);
}

.phd-card__text {
	min-width: 0;
}

.phd-card__title {
	display: block;
	font-weight: 600;
	line-height: 1.3;
}

/* No separator glyph: when a long department name wraps to its own line a
   "·" wraps with it and leads the line. Spacing alone carries the division
   and survives wrapping. */
.phd-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .1rem 1.1rem;
	margin-top: .2rem;
	font-size: .85em;
	color: var(--phd-muted);
}

.phd-card__date {
	white-space: nowrap;
}

.phd-card__thesis {
	display: block;
	margin-top: .3rem;
	font-size: .88em;
	line-height: 1.4;
	color: var(--phd-muted);
}

.phd-card--upcoming .phd-card__link {
	box-shadow: inset 3px 0 0 var(--phd-accent);
}

@media (max-width: 600px) {
	.phd-defence__portrait {
		flex-basis: 150px;
		max-width: 150px;
	}

	.phd-defence__facts {
		grid-template-columns: 1fr;
		gap: .1rem;
	}

	.phd-defence__fact {
		display: block;
		margin-bottom: .5rem;
	}
}
