/*
 * SOG CJIL theme styles.
 *
 * 1. Base (Neve-equivalent type scale, container, alignments)
 * 2. Page sections and headings (ported from SOG Neve Child)
 * 3. Cards and card grids (CJIL Core blocks)
 * 4. Resource finder and pagination
 * 5. People, lab note, profiles, collections
 * 6. Converted Toolset sections (background images, zoom, buttons)
 * 7. Archives, search, forms
 */

/* 1. Base ------------------------------------------------------------- */

:root {
	--cjil-navy: var(--wp--preset--color--custom-1, #1e3a57);
	--cjil-blue: var(--wp--preset--color--custom-2, #4b9cd3);
	--cjil-violet: var(--wp--preset--color--custom-3, #971cf4);
	--cjil-green: #00bfa4;
	--cjil-sky: #209ed8;
	--cjil-lilac: #d5c4fd;
	--cjil-gutter: 15px;
	--cjil-body-size: 15px;
	--cjil-body-line-height: 1.6;
	--cjil-h1: 36px;
	--cjil-h2: 28px;
	--cjil-h3: 24px;
	--cjil-h4: 20px;
}

@media (min-width: 576px) {
	:root {
		--cjil-h1: 38px;
		--cjil-h2: 30px;
		--cjil-h3: 26px;
		--cjil-h4: 22px;
	}
}

@media (min-width: 960px) {
	:root {
		--cjil-body-size: 16px;
		--cjil-body-line-height: 1.7;
		--cjil-h1: 40px;
		--cjil-h2: 32px;
		--cjil-h3: 28px;
		--cjil-h4: 24px;
	}
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	overflow-x: hidden;
}

img,
video {
	max-width: 100%;
	height: auto;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	left: 8px;
	top: 8px;
	z-index: 100000;
	padding: 12px 16px;
	background: #fff;
	color: var(--cjil-navy);
	font-weight: 700;
}

/* Neve's .container: content areas and editor groups that use the class. */
.container {
	box-sizing: border-box;
	width: 100%;
	max-width: 1170px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--cjil-gutter);
	padding-right: var(--cjil-gutter);
}

/* A .container inside another only needs the width cap, not double padding. */
.container .container {
	padding-left: 0;
	padding-right: 0;
}

/* Full-width blocks break out of the page container. */
.entry-content > .alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: 100vw;
	width: 100vw;
}

.entry-content > .alignwide {
	margin-left: auto;
	margin-right: auto;
	max-width: var(--wp--style--global--wide-size);
}

.site-main {
	display: block;
	padding-bottom: 60px;
}

.entry-content > :first-child {
	margin-top: 0;
}

/* 2. Page sections and headings --------------------------------------- */

.header-img {
	position: relative;
	z-index: 0;
}

.page-heading-wrapper {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	margin-top: -3em;
	background: linear-gradient(to right, var(--cjil-navy) 40%, transparent 40%) no-repeat;
}

.page-heading-fill {
	margin-right: 20%;
	padding: 25px;
	background-color: var(--cjil-navy) !important;
}

.page-heading-fill p {
	color: #fff;
}

.page-heading,
.front-page-heading {
	color: #fff;
	margin-top: 0;
}

.page-heading {
	text-transform: uppercase;
	margin-bottom: 10px;
	font-weight: 300;
}

.front-page-heading {
	font-weight: 600;
	margin-bottom: 25px;
}

.page-subheading {
	color: #fff;
	font-weight: 900;
	font-size: 2em;
	line-height: 1.2;
	margin-bottom: 0;
}

.section-container {
	margin: 75px 0;
	padding: 0 !important;
}

.section-heading {
	font-family: var(--wp--preset--font-family--heading);
	margin-top: 0.85em;
	font-weight: 400;
}

.section-heading strong {
	font-weight: 900;
	color: var(--cjil-blue);
}

.block-heading {
	font-family: var(--wp--preset--font-family--heading);
	color: var(--cjil-blue);
	font-weight: 600;
	font-size: 1.5em;
	margin-bottom: 0;
	text-transform: uppercase;
}

.block-subheading {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: 2em;
}

/* A label like "CORE TEAM" sits right on top of its subheading. */
:where(.is-layout-flow, .entry-content) > .block-heading + * {
	margin-block-start: 0.2em;
}

.left-container {
	margin-right: 20%;
}

.big-text,
.dashboard-cta {
	font-weight: 500;
	font-size: 1.2em;
	line-height: 2em;
}

.dashboard-cta {
	padding: 20px 0;
}

.half-container {
	width: 100%;
}

@media (min-width: 768px) {
	.half-container {
		width: 50%;
	}
}

@media (max-width: 767px) {
	.left-container,
	.page-heading-fill {
		margin-right: 0;
	}
}

.wp-block-separator {
	color: var(--cjil-lilac);
}

.pill {
	background-color: var(--cjil-navy);
	border-radius: 50px;
	color: #fff;
	font-size: 0.75em;
	font-weight: 700;
	padding: 0.5em 1em;
	text-transform: uppercase;
}

/* Focus area list (Explore page): the heading link covers the whole item. */
.cjil-link-card {
	position: relative;
}

.cjil-link-card :is(h1, h2, h3, h4) a {
	color: inherit;
	text-decoration: none;
}

.cjil-link-card :is(h1, h2, h3, h4) a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.cjil-link-card p {
	color: var(--wp--preset--color--neve-link-color);
}

.cjil-link-card:hover :is(h1, h2, h3, h4) a,
.cjil-link-card :is(h1, h2, h3, h4) a:focus-visible {
	text-decoration: underline;
}

.cjil-link-card:focus-within {
	outline: 3px solid var(--cjil-navy);
	outline-offset: 4px;
}

.cjil-link-card :is(h1, h2, h3, h4) a:focus-visible {
	outline: none;
}

.focus-heading {
	margin-bottom: 0;
}

.focus-more-info-text {
	display: block;
	margin: auto;
	text-align: center;
	max-width: 50%;
	height: 5em;
	background: url("../images/cjil-arrow.svg") top right / contain no-repeat;
}

.focus-more-info-text p {
	padding-top: 1.5em;
	margin: auto;
}

.testimonial-quote {
	border-style: none;
}

.toolbox-heading {
	color: var(--cjil-blue);
	text-align: center;
	font-size: 2em;
	font-weight: 300;
}

.toolbox-text {
	width: 50%;
	margin: auto;
}

.arrow-box {
	padding: 40px;
	border: 10px solid var(--cjil-lilac);
}

@media (min-width: 959px) {
	.arrow-box {
		margin: -50px;
	}
}

.arrow-box-arrow {
	float: right;
	margin: -65px -65px 0 0;
	padding: 0 0 20px 20px;
	background-color: #fff;
	width: 25%;
	height: auto;
}

ul.special_bullet {
	list-style: none;
}

ul.special_bullet li {
	padding-left: 1em;
	text-indent: -1.175em;
}

ul.special_bullet li::before {
	color: #000;
	content: "\21D2  ";
}

.core-values-spacing {
	line-height: 30px;
	font-size: 23px;
}

.core-values-header {
	font-weight: 700;
	color: var(--cjil-blue);
	font-size: 25px;
	line-height: 40px;
}

/* 3. Cards and card grids --------------------------------------------- */

.cjil-card-grid {
	display: grid;
	grid-template-columns: repeat(var(--cjil-cols, 4), minmax(0, 1fr));
	gap: 15px;
	margin: 25px 0;
}

.wp-block-cjil-featured-resources .cjil-card-grid {
	--cjil-cols: 3;
	gap: 25px;
	margin-right: 20%;
}

.wp-block-cjil-featured-resources .cjil-card-grid:has(> .card:nth-child(4)) {
	--cjil-cols: 4;
	margin-right: 0;
}

.cjil-card-grid--collection {
	--cjil-cols: 4;
	margin-left: 0;
}

@media (max-width: 959px) {
	.cjil-card-grid,
	.wp-block-cjil-featured-resources .cjil-card-grid {
		--cjil-cols: 2;
		margin-right: 0;
	}
}

@media (max-width: 575px) {
	.cjil-card-grid,
	.wp-block-cjil-featured-resources .cjil-card-grid {
		--cjil-cols: 1;
	}
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	aspect-ratio: 2 / 3;
	box-sizing: border-box;
	color: #000;
	background-color: #fff;
	border: 1px solid #bbb;
	border-radius: 10px;
	box-shadow: 0 0.125em 0.25em 0 rgba(0, 0, 0, 0.2);
	overflow: hidden;
	text-decoration: none;
	transition: box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

/* One card per row: size to content instead of a tall, mostly empty 2:3 box. */
@media (max-width: 575px) {
	.card {
		aspect-ratio: auto;
		padding-bottom: 64px;
	}
}

.card:hover,
.card:focus-visible,
.card:active {
	color: #000;
	border-color: var(--cjil-blue);
	box-shadow: 0 0.5em 1em 0 rgba(0, 0, 0, 0.3);
	text-decoration: none;
}

.card:focus-visible {
	outline: 3px solid var(--cjil-navy);
	outline-offset: 2px;
}

.card-image {
	margin: 0;
	flex: none;
}

.card-image img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.collection-card .card-image img {
	aspect-ratio: auto;
	object-fit: fill;
}

.card-text {
	padding: 25px 25px 0;
	font-weight: 500;
	font-size: 18px;
	line-height: 22px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.card-bottom {
	position: absolute;
	left: 0;
	bottom: 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 40px;
	padding: 0 0 0 25px;
	font-size: 16px;
	background: #fff;
}

.card-bottom-text {
	margin: 0 !important;
}

.post-card .card-bottom-text {
	color: var(--cjil-violet);
}

.collection-card .card-bottom {
	color: #fff;
}

.collection-card--cyan-green .card-bottom {
	background: var(--cjil-green);
}

.collection-card--blue .card-bottom {
	background: var(--cjil-sky);
}

.collection-card--violet .card-bottom {
	background: var(--cjil-violet);
}

/* 4. Resource finder and pagination ----------------------------------- */

.toolbox-search {
	margin-bottom: 25px;
}

.cjil-finder__form {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 25px;
	margin-bottom: 25px;
}

.cjil-finder__field {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 8px;
}

.cjil-finder__field label {
	font-size: 14px;
}

.cjil-finder__field select,
.cjil-finder__field input,
.search-form__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	font: inherit;
	font-size: 14px;
	color: var(--wp--preset--color--neve-text-color);
	background: #fff;
	border: 2px solid #8c8c8c;
	border-radius: 3px;
}

.cjil-finder__field select:focus,
.cjil-finder__field input:focus,
.search-form__input:focus {
	border-color: var(--cjil-navy);
	outline: 2px solid var(--cjil-blue);
	outline-offset: 1px;
}

.cjil-finder__submit {
	min-height: 44px;
}

/* JS applies select changes immediately, so the button is only needed for keywords. */
.cjil-finder[aria-busy="true"] .cjil-finder__results,
.toolbox-search[aria-busy="true"] .cjil-finder__results {
	opacity: 0.5;
	transition: opacity 0.2s;
}

.cjil-finder__empty {
	padding: 25px 0;
}

.cjil-pagination ul,
.cjil-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin: 25px 0;
	padding: 0;
	list-style: none;
}

.cjil-pagination a,
.cjil-pagination span[aria-current],
.cjil-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 48px;
	box-sizing: border-box;
	padding: 0 8px;
	font-size: 28px;
	color: var(--cjil-navy);
	text-decoration: none;
	border: 1px solid #dee2e6;
}

.cjil-pagination a:hover,
.cjil-pagination a:focus-visible {
	background: #e9ecef;
}

.cjil-pagination span[aria-current],
.cjil-pagination .page-numbers.current {
	color: #fff;
	background: var(--cjil-blue);
	border-color: var(--cjil-blue);
}

/* 5. People, lab note, profiles, collections -------------------------- */

.cjil-people {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 25px;
	margin: 25px 0;
}

@media (max-width: 959px) {
	.cjil-people {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.cjil-person__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.cjil-person__name {
	margin: 0.5em 0 0;
	font-size: var(--cjil-h4);
	line-height: 1.3;
	color: var(--wp--preset--color--neve-text-color);
}

.cjil-person__name a {
	color: inherit;
	text-decoration: none;
}

.bio-role {
	margin: 0.25em 0 0;
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.4em;
}

.cjil-lab-note__image {
	margin: 0 0 20px;
}

.cjil-lab-note__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

.cjil-lab-note__buttons .wp-block-button__link {
	min-width: 150px;
	text-align: center;
}

/* Team member and graduate student profiles */
.bio {
	padding-top: 60px;
}

.bio__columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
	gap: 25px;
}

@media (max-width: 767px) {
	.bio__columns {
		grid-template-columns: minmax(0, 1fr);
	}
}

.bio__photo {
	margin: 0 0 0.5em;
}

.bio__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.bio .bio-name {
	margin: 0;
	font-size: var(--cjil-h2);
	line-height: 1.1;
	color: var(--cjil-violet);
}

.bio-title {
	margin: 0.25em 0 0.75em;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4em;
}

.bio__contact {
	margin: 0;
	font-size: 15px;
	overflow-wrap: anywhere;
}

.bio-text {
	padding-top: 30px;
	font-size: 1.4em;
	line-height: 1.7;
}

/* Collection pages */
.collection-heading-wrapper {
	position: relative;
}

.collection-heading-container {
	position: relative;
	padding: 50px 0 25px 15px;
}

.collection-heading-container.container {
	padding-left: calc(var(--cjil-gutter) + 165px);
}

.collection-bookmark {
	position: absolute;
	top: 0;
	left: var(--cjil-gutter);
	width: 150px;
	height: 100%;
	background: #55bba4 url("../images/triangle-background.svg") right top repeat;
}

@media (max-width: 767px) {
	.collection-heading-container.container {
		padding-left: var(--cjil-gutter);
	}

	.collection-bookmark {
		position: static;
		width: 100%;
		height: 40px;
		margin-bottom: 15px;
	}
}

.collection-prefix {
	font-family: var(--wp--preset--font-family--heading);
	color: #55bba4;
	font-weight: 600;
	font-size: 1.5em;
	margin: 0;
	text-transform: uppercase;
}

.collection-heading {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: 2em;
	margin: 0 0 0.5em;
}

.collection-subheading {
	margin-bottom: 0;
}

.collection-body {
	padding-left: calc(var(--cjil-gutter) + 165px);
}

@media (max-width: 767px) {
	.collection-body {
		padding-left: var(--cjil-gutter);
	}
}

/* 6. Converted Toolset sections --------------------------------------- */

/* "Dashboard CTA" and the Explore page's closing note: arrow pinned top right. */
.cjil-bg-cjil-arrow {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 150px;
	padding-right: 175px;
	background: url("../images/cjil-arrow.svg") right top / 150px 150px no-repeat;
}

@media (max-width: 575px) {
	.cjil-bg-cjil-arrow {
		padding-right: 0;
		padding-top: 110px;
		background-size: 100px 100px;
	}
}

/* "quote-hr": a strip of arrows behind the quote. */
.cjil-bg-cjil-arrow-space {
	background: url("../images/cjil-arrow-space.svg") center / contain repeat-x;
}

@media (max-width: 959px) {
	.cjil-bg-cjil-arrow-space {
		margin-top: 25px !important;
		margin-bottom: 25px !important;
		padding: 25px !important;
	}
}

.cjil-zoom {
	overflow: hidden;
}

.cjil-zoom img {
	transition: transform 0.25s ease;
}

.cjil-zoom:hover img,
a:focus-visible .cjil-zoom img {
	transform: scale(1.1);
}

/* Focus-area shortcut buttons ("See all research", …) keep a fixed width. */
#btn-research,
#btn-pilot,
#btn-roadmap {
	margin-top: 25px;
}

@media (min-width: 959px) {
	#btn-research > a,
	#btn-pilot > a,
	#btn-roadmap > a,
	.fixed-btn > a {
		box-sizing: border-box;
		width: 272px;
	}
}

.wp-block-button__link {
	text-decoration: none;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background-color: var(--cjil-blue) !important;
	color: #fff;
}

/* Request Assistance form */
.page-id-50 .gform_wrapper .gform_button,
.page-id-50 form .button,
.page-id-50 form button,
.page-id-50 form input[type="submit"] {
	color: #fff !important;
	background-color: var(--cjil-navy) !important;
}

/* 7. Archives, search, forms ------------------------------------------ */

.archive,
.single-entry {
	padding-top: 50px;
}

.archive__title,
.single-entry__title {
	margin: 0 0 0.5em;
}

.single-entry {
	max-width: 900px;
}

.single-entry__meta {
	margin-top: -0.5em;
	color: #555;
}

.single-entry__image {
	margin: 0 0 1.5em;
}

.search-form {
	display: flex;
	gap: 8px;
	max-width: 520px;
	margin: 1em 0 2em;
}

.search-form__submit {
	flex: none;
}
