/**
 * Funding opportunities
 */

/* List block */

.funding-opportunities {
	margin-left: auto;
	margin-right: auto;
	max-width: 630px;
	scroll-margin-top: 100px; /* Clears the sticky header when arriving from a return link */
}

.funding-opportunity {
	margin-top: 40px;
	position: relative;
}

.funding-opportunity h2 {
	margin: 0;
	padding: 0 40px;
}

/* The title is the link, and it covers the whole card */

.funding-opportunities a.funding-opportunity__link,
.funding-opportunities a.funding-opportunity__link:hover,
.funding-opportunities a.funding-opportunity__link:focus,
#content .gb-container.green a.funding-opportunity__link,
#content .gb-container.green a.funding-opportunity__link:hover,
#content .gb-container.green a.funding-opportunity__link:focus {
	color: var(--green-darkest);
	text-decoration: none;
}

.funding-opportunity__link::after {
	content: "";
	inset: 0;
	position: absolute;
}

.funding-opportunity__link:focus-visible {
	outline: none;
}

.funding-opportunity__link:focus-visible::after {
	outline: 2px solid var(--green-dark);
	outline-offset: 2px;
}

.funding-opportunity__status {
	background-color: var(--white);
	font-weight: 700;
	margin: 0;
	padding: 14px 40px;
}

.funding-opportunity:has(a:hover) .funding-opportunity__status-text,
.funding-opportunity:has(a:focus-visible) .funding-opportunity__status-text {
	text-decoration: underline;
}

/* The last word and arrow stay together, so the arrow can't wrap onto a line of its own */

.funding-opportunity__status-end {
	white-space: nowrap;
}

/* Same arrow and size as the "Find out more" links in the post grids */

.funding-opportunity__status-end::after {
	content: url("../img/arrow-down-green.svg");
	display: inline-block;
	margin-left: 5px;
	transform: rotate(270deg);
	vertical-align: -1px;
	width: 16px;
}

.funding-opportunities__empty {
	margin: 0;
	padding: 40px 40px 0;
}

@media (max-width: 767px) {
	.funding-opportunity h2,
	.funding-opportunity__status,
	.funding-opportunities__empty {
		padding-left: 20px;
		padding-right: 20px;
	}
}

/* Single hero, matching the "Open calls and deadlines" hero on the page */

.funding-hero {
	display: flex;
	flex-direction: row-reverse;
	flex-wrap: wrap;
	margin-bottom: 75px;
}

.funding-hero__image,
.funding-hero__text {
	background-color: var(--green-medium);
	width: 50%;
}

.funding-hero__image {
	background-position: left center;
	background-repeat: no-repeat;
	background-size: cover;
	min-height: 480px;
}

.funding-hero__text {
	display: flex;
	flex-direction: column;
	min-height: 420px;
	padding: 50px;
}

.funding-hero__inner {
	margin-left: auto;
	margin-right: 65px;
	max-width: 520px;
	width: 100%;
}

.funding-hero__inner a,
.funding-hero__inner a:hover {
	color: var(--black);
}

.funding-hero h1 {
	font-size: 34px;
	margin: 0 0 20px;
}

.funding-hero__description p:last-child {
	margin-bottom: 20px;
}

.funding-hero__status {
	margin-bottom: 0;
}

@media (max-width: 1024px) {
	.funding-hero__text {
		padding: 40px 30px 30px;
	}

	.funding-hero__image {
		min-height: 450px;
	}
}

@media (max-width: 767px) {
	.funding-hero {
		flex-direction: column;
		margin-bottom: 45px;
	}

	.funding-hero__image,
	.funding-hero__text {
		width: 100%;
	}

	.funding-hero__image {
		min-height: 350px;
	}

	.funding-hero__text {
		min-height: 0;
		padding: 40px 20px 30px;
	}

	.funding-hero__inner {
		margin-left: 0;
	}
}

@media (min-width: 1280px) {
	.funding-hero__image {
		min-height: 500px;
	}
}

@media (min-width: 1500px) {
	.funding-hero__image {
		min-height: 550px;
	}
}

@media (min-width: 1800px) {
	.funding-hero__image {
		min-height: 630px;
	}
}

/* Single content */

.funding-opportunity-content,
.funding-opportunity-footer {
	margin-left: auto;
	margin-right: auto;
	max-width: 630px;
	padding-left: 40px;
	padding-right: 40px;
}

.funding-opportunity-content > h2 {
	margin-top: 50px;
}

.funding-opportunity-content > h2:first-child {
	margin-top: 0;
}

.funding-opportunity-content table {
	max-width: 100%;
}

.funding-opportunity-footer {
	margin-bottom: 75px;
	margin-top: 50px;
}

@media (max-width: 767px) {
	.funding-opportunity-content,
	.funding-opportunity-footer {
		padding-left: 20px;
		padding-right: 20px;
	}

	.funding-opportunity-footer {
		margin-bottom: 55px;
	}
}
