/* Sitewide polish layered on top of style.css: contrast, motion, focus
   states, and mobile fixes. Kept separate so the legacy template CSS in
   style.css stays untouched and these changes are easy to find. */

/* ---------- Base ---------- */
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	/* body already hides horizontal overflow, but iOS Safari can still
	   pan sideways; clipping at the root stops that without creating a
	   scroll container (which would break position: sticky/fixed). */
	overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}
::selection {
	background: rgba(31, 102, 194, .18);
}

/* Visible keyboard focus everywhere (the template removed outlines on
   buttons and never styled focus for links). Mouse clicks don't trigger
   :focus-visible, so this only shows up for keyboard users. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible {
	outline: 3px solid var(--brand-accent-light);
	outline-offset: 2px;
}

.btn {
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn-primary:hover,
.btn-default:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(18, 26, 36, .18);
}

/* ---------- Navigation ---------- */
/* #999 at 11px was below WCAG contrast; darken and add a touch of
   letter-spacing so the uppercase labels read cleanly. */
.menuBar li a {
	color: #5a5a5a;
	letter-spacing: .4px;
}
@media (min-width: 1200px) {
	.menuBar li a {
		font-size: 12px;
	}
}
header.main__header {
	transition: box-shadow .3s ease;
}
header.main__header.is-scrolled {
	box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
}

/* Mobile menu: Nav.astro toggles .is-open (replaces jQuery slideToggle). */
@media (max-width: 767px) {
	.menuBar.is-open {
		display: block;
		animation: menu-drop .25s ease both;
	}
	.menuBar li a {
		font-size: 14px;
		padding: 11px 0;
	}
	.menuBar li.active a {
		color: var(--brand-accent);
		font-weight: 700;
	}
	a.submenu {
		top: 27px;
	}
}
@keyframes menu-drop {
	from { opacity: 0; transform: translateY(-6px); }
	to { opacity: 1; transform: none; }
}

/* ---------- Title banners ---------- */
/* The blurred photo banners put white text straight on light imagery
   (sky, clouds, a pale newsroom shot), so headings and subtitles were
   often hard to read. A dark brand-tinted gradient sits between the
   photo (::before) and the text. */
.titles.aboutus::after,
.titles.research::after,
.titles.pub::after,
.titles.news::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(100deg, rgba(18, 26, 36, .72) 0%, rgba(18, 26, 36, .45) 55%, rgba(31, 102, 194, .30) 100%);
	pointer-events: none;
}
.titles.aboutus,
.titles.research,
.titles.pub,
.titles.news {
	isolation: isolate;
	overflow: hidden;
}
.titles h2,
.titles .container p.small-paragraph {
	text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.titles .container p.small-paragraph {
	color: #f3f3f3;
}
/* Frame the glass facade reflecting the sky instead of the EXPLORE sign
   and its mirror image, which blur into what looks like doubled text. */
.titles.aboutus::before {
	background-position: center 88%;
}

/* Banner text eases in on load. */
@media (prefers-reduced-motion: no-preference) {
	.titles .container > * {
		animation: banner-in .7s cubic-bezier(.2, .7, .2, 1) both;
	}
	.titles .container > h2 {
		animation-delay: .08s;
	}
	.titles .container > p {
		animation-delay: .18s;
	}
	.titles .seper {
		animation: seper-grow .8s cubic-bezier(.2, .7, .2, 1) .1s both;
	}
}
@keyframes banner-in {
	from { opacity: 0; transform: translateY(14px); }
	to { opacity: 1; transform: none; }
}
.titles .seper {
	width: 56px;
	border-top-width: 3px;
}
@keyframes seper-grow {
	from { width: 0; }
	to { width: 56px; }
}

/* Header is 88px tall on phones (see Nav.astro), not 124px. */
@media (max-width: 767px) {
	.header-splash {
		margin-top: 88px;
		padding-top: 30px;
	}
	.main__middle__container:not(.homepage) {
		padding-top: 110px;
	}
	.header-splash ~ .main__middle__container {
		padding-top: 20px;
	}
	.titles h2 {
		font-size: 34px;
		line-height: 1.15;
	}
}

/* ---------- Scroll reveal ---------- */
/* site.js adds .reveal only when JS runs and reduced motion is off, so
   content is never hidden for no-JS or motion-sensitive visitors. Uses
   the individual `translate` property so it never fights hover effects
   that use `transform`. */
.js .reveal {
	opacity: 0;
	translate: 0 22px;
	transition: opacity .6s ease var(--reveal-delay, 0ms), translate .6s cubic-bezier(.2, .7, .2, 1) var(--reveal-delay, 0ms);
}
.js .reveal.is-visible {
	opacity: 1;
	translate: none;
}

/* ---------- Side navs (People, News) ---------- */
aside ul li a {
	display: inline-block;
	transition: color .2s ease, transform .2s ease;
}
aside ul li a:hover {
	text-decoration: none;
	transform: translateX(3px);
}
aside ul li.is-current a {
	color: var(--brand-dark);
	font-weight: 700;
}
aside ul li.is-current a::before {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	margin-right: 8px;
	border-radius: 50%;
	background: var(--brand-accent);
	vertical-align: middle;
}
@media (max-width: 767px) {
	aside ul li.is-current a {
		background: var(--brand-accent);
		color: #fff;
	}
	aside ul li.is-current a::before {
		display: none;
	}
}

/* ---------- Home ---------- */
.concept-icon {
	transition: transform .3s ease, box-shadow .3s ease;
}
.concept-item:hover .concept-icon {
	transform: translateY(-3px) scale(1.06);
	box-shadow: 0 8px 18px rgba(31, 102, 194, .3);
}

/* ---------- Research ---------- */
.three__blocks .col-md-4 {
	transition: border-color .3s ease;
}

/* ---------- News ---------- */
.news-container {
	border-radius: 6px;
}

/* Page title banners are centered. The logo at the left of the header is
   large, so a left-aligned title right under it read as two competing
   left-edge anchors. Centering the banner text (and its accent bar) gives
   the title its own axis. */
.titles .container {
	text-align: center;
}
.titles .seper {
	margin-left: auto;
	margin-right: auto;
}
