/* News detail (dept_new/content_viewnews_m_new.php): single-column article,
   the same layout as sciweb's news-detail.css on Bootstrap 4.1 and dept_new/style.css. */

.nd-page {
	--sci-navy: #003366;
	--sci-focus: #d97706;
	--nd-text: #2d3748;
	--nd-muted: #5c6b7a;
	--nd-line: #e2e8f0;
	--nd-accent: var(--sci-focus);
	max-width: 1000px;
	margin: 0 auto;
	padding: 1rem 16px 3rem;
}

/* dept_new/content_header.php is position: absolute, 84px tall at every width. */
.top-header ~ .nd-page {
	padding-top: calc(84px + 1rem);
}

.nd-article > * {
	margin: 0;
}

.nd-article > * + * {
	margin-top: 2.5rem;
}

/* Breadcrumb */

.nd-breadcrumb .breadcrumb {
	flex-wrap: nowrap;
	margin-bottom: .5rem;
	padding: 0;
	background: none;
	font-size: .875rem;
}

.nd-breadcrumb .breadcrumb-item + .breadcrumb-item::before,
.nd-breadcrumb .breadcrumb-item.active {
	color: var(--nd-muted);
}

.nd-breadcrumb .breadcrumb-item {
	display: flex;
	flex: none;
	align-items: center;
	white-space: nowrap;
}

.nd-breadcrumb .breadcrumb-item.active {
	flex: 0 1 auto;
	min-width: 0;
}

.nd-breadcrumb a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--nd-muted);
}

.nd-breadcrumb-title {
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Header: title, meta, share */

.nd-title {
	max-width: 900px;
	margin: 0;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	font-weight: 700;
	line-height: 1.4;
	color: var(--sci-navy);
	overflow-wrap: break-word;
}

/* The negative margin and overflow clip the divider of whichever item starts a wrapped line. */
.nd-meta {
	display: flex;
	flex-wrap: wrap;
	row-gap: .25rem;
	margin: 1rem 0 0 -.75rem;
	padding: 0;
	overflow: hidden;
	list-style: none;
	font-size: .9rem;
	color: var(--nd-muted);
}

.nd-meta li {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	margin-left: -1px;
	padding: 0 .75rem;
	border-left: 1px solid #cbd5e0;
}

.nd-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--nd-line);
}

.nd-share-label {
	margin-right: .25rem;
	font-size: .9rem;
	color: var(--nd-muted);
}

.nd-share-btn {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	min-height: 44px;
	padding: 0 1.1rem;
	border: 1px solid #cbd5e0;
	border-radius: 999px;
	background: #fff;
	color: var(--sci-navy);
	font: inherit;
	font-size: .9rem;
	line-height: 1;
	transition: background-color .2s, border-color .2s, color .2s;
}

.nd-share-btn[hidden] {
	display: none;
}

.nd-share-btn:hover,
.nd-share-btn:focus-visible {
	border-color: var(--sci-navy);
	background: var(--sci-navy);
	color: #fff;
	text-decoration: none;
}

.nd-share-status {
	font-size: .875rem;
	color: #276749;
}

/* Hero: the blurred copy fills the 16:9 frame so covers of any shape show uncropped. */

.nd-hero-btn {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	padding: 0;
	border: 0;
	border-radius: 12px;
	overflow: hidden;
	background: var(--nd-line);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
	cursor: zoom-in;
}

.nd-hero-backdrop {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: blur(24px) brightness(.85);
	transform: scale(1.15);
}

.nd-hero-img {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nd-hero-badge {
	position: absolute;
	right: .75rem;
	bottom: .75rem;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .3rem .8rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, .7);
	color: #fff;
	font-size: .875rem;
	line-height: 1.4;
}

/* Body. News pasted from Word or Pages carries inline styles such as
   margin: 0px; font-size: 13px; line-height: normal; font-family: 'Helvetica Neue',
   and only !important rules can override inline styles. */

.nd-body {
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
	font-size: 1.125rem;
	line-height: 1.85;
	color: var(--nd-text);
	overflow-wrap: break-word;
}

.nd-body :is(p, span, div, li, td, font) {
	font-family: inherit !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.nd-body p {
	margin: 0 0 1.25rem !important;
}

.nd-body > p:first-child:not(.nd-item) {
	font-size: 1.2rem !important;
}

.nd-body > :last-child {
	margin-bottom: 0 !important;
}

.nd-body :is(h2, h3, h4) {
	margin: 2rem 0 1rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sci-navy);
}

.nd-body h2 {
	font-size: 1.375rem;
}

.nd-body :is(h3, h4) {
	font-size: 1.2rem;
}

.nd-body :is(ul, ol) {
	margin: 0 0 1.25rem;
	padding-left: 1.5rem;
}

.nd-body a {
	color: var(--sci-navy);
	text-decoration: underline;
}

.nd-body :is(img, video) {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
}

.nd-body iframe {
	max-width: 100%;
}

.nd-body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

/* Numbered project cards (class added in the view) */

.nd-body .nd-item {
	--nd-no: 1.875rem;
	--nd-gap: .75rem;
	margin: 0 0 1rem !important;
	padding: 1rem 1.25rem 1rem calc(1.25rem + var(--nd-no) + var(--nd-gap));
	border: 1px solid var(--nd-line);
	border-left: 4px solid var(--nd-accent);
	border-radius: 8px;
	background: #fff;
	line-height: 1.7 !important;
}

.nd-body .nd-item + :not(.nd-item) {
	margin-top: 2rem !important;
}

.nd-item-head {
	display: flex;
	align-items: flex-start;
	gap: var(--nd-gap);
	margin-bottom: .25rem;
	margin-left: calc(-1 * (var(--nd-no) + var(--nd-gap)));
	font-weight: 700;
	color: var(--sci-navy);
}

.nd-item-head + br {
	display: none;
}

.nd-item-no {
	display: inline-flex;
	flex: 0 0 var(--nd-no);
	align-items: center;
	justify-content: center;
	height: var(--nd-no);
	border-radius: 50%;
	background: var(--sci-navy);
	color: #fff;
	font-size: .9375rem;
	line-height: 1;
}

/* Section headings, attachments */

.nd-section-title {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin: 0 0 1rem;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--sci-navy);
}

.nd-section-title::before {
	content: "";
	flex: none;
	width: 4px;
	height: 1.2em;
	border-radius: 2px;
	background: var(--nd-accent);
}

.nd-attachments {
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

.nd-files {
	display: grid;
	gap: .5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nd-file {
	display: flex;
	align-items: center;
	gap: .75rem;
	min-height: 44px;
	padding: .6rem 1rem;
	border: 1px solid var(--nd-line);
	border-radius: 8px;
	background: #f7fafc;
	color: var(--sci-navy);
	overflow-wrap: anywhere;
}

.nd-file:hover {
	border-color: var(--nd-accent);
	background: #fff;
}

.nd-file i {
	flex: none;
	color: var(--nd-accent);
}

/* Gallery */

.nd-gallery-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 992px) {
	.nd-gallery-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.nd-gallery-item {
	margin: 0;
}

.nd-gallery-btn {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	padding: 0;
	border: 0;
	border-radius: 10px;
	overflow: hidden;
	background: var(--nd-line);
	cursor: zoom-in;
	transition: transform .25s ease, box-shadow .25s ease;
}

.nd-gallery-btn:hover,
.nd-gallery-btn:focus-visible {
	box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
	transform: scale(1.03);
}

.nd-gallery-btn img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nd-gallery-btn.is-video {
	cursor: pointer;
}

.nd-gallery-btn.is-video i {
	position: absolute;
	top: 50%;
	left: 50%;
	font-size: 2.5rem;
	color: #fff;
	text-shadow: 0 0 8px rgba(0, 0, 0, .7);
	transform: translate(-50%, -50%);
}

.nd-gallery-item figcaption {
	margin-top: .5rem;
	font-size: .875rem;
	line-height: 1.5;
	color: #4a5568;
}

/* Previous / next */

.nd-pager {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.nd-pager-link {
	display: flex;
	flex-direction: column;
	gap: .3rem;
	min-height: 44px;
	padding: 1rem 1.25rem;
	border: 1px solid var(--nd-line);
	border-radius: 10px;
	background: #fff;
	color: var(--sci-navy);
	transition: border-color .25s, box-shadow .25s;
}

.nd-pager-link.is-next {
	grid-column: 2;
	align-items: flex-end;
	text-align: right;
}

.nd-pager-link:hover,
.nd-pager-link:focus-visible {
	border-color: var(--nd-accent);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
	text-decoration: none;
}

.nd-pager-label {
	font-size: .875rem;
	color: var(--nd-muted);
}

.nd-pager-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-weight: 700;
	line-height: 1.5;
}

/* Related news */

.nd-related-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 576px) {
	.nd-related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 768px) {
	.nd-related-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.nd-card {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1px solid var(--nd-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	transition: transform .25s ease, box-shadow .25s ease;
}

.nd-card:hover,
.nd-card:focus-within {
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
	transform: translateY(-2px);
}

.nd-card-img {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f3f5f8;
}

.nd-card-img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.nd-card-body {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	padding: .75rem 1rem 1rem;
}

.nd-card-date {
	font-size: .8125rem;
	color: var(--nd-muted);
}

.nd-card-title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	color: var(--sci-navy);
	font-weight: 700;
	line-height: 1.5;
}

.nd-card-title::after {
	content: "";
	position: absolute;
	inset: 0;
}

.nd-card-title:hover {
	text-decoration: none;
}

/* Footer */

.nd-footer {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--nd-line);
}

.nd-btn {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	min-height: 44px;
	padding: 0 1.25rem;
	border: 1px solid var(--sci-navy);
	border-radius: 999px;
	font-size: 1rem;
	transition: background-color .2s, color .2s;
}

.nd-btn-back {
	background: #fff;
	color: var(--sci-navy);
}

.nd-btn-back:hover,
.nd-btn-back:focus-visible {
	background: var(--sci-navy);
	color: #fff;
	text-decoration: none;
}

@media (max-width: 575.98px) {
	.nd-body .nd-item {
		--nd-no: 1.75rem;
		--nd-gap: .6rem;
		padding: .9rem 1rem;
	}

	.nd-item-head {
		margin-left: 0;
	}

	.nd-pager {
		grid-template-columns: minmax(0, 1fr);
	}

	.nd-pager-link.is-next {
		grid-column: auto;
	}

	.nd-hero-badge {
		right: .5rem;
		bottom: .5rem;
		font-size: .8125rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nd-gallery-btn,
	.nd-share-btn,
	.nd-btn,
	.nd-pager-link,
	.nd-card {
		transition: none;
	}

	.nd-gallery-btn:hover,
	.nd-gallery-btn:focus-visible,
	.nd-card:hover,
	.nd-card:focus-within {
		transform: none;
	}
}
