/**
 * News and Opportunities.
 *
 * Brand colours sampled from adroittutors.com, same as the dashboard:
 *   brand red  #830606
 *   deep red   #6F0B0B
 *   body text  #333333
 *   headings   Poppins, already loaded by the theme
 *
 * Every card carries a picture. Where nobody uploaded one, the card draws its
 * own cover in the section's colour rather than leaving a gap, because a grid
 * with three photographs and nine blanks reads as broken rather than as sparse,
 * and whoever fills this section in will not always have an image to hand.
 *
 * The four sections each get a colour of their own. They are all deep and
 * muted so that none of them competes with the brand red, which is kept for
 * the things a student is meant to press.
 *
 * A public page, so it inherits the theme's body font and sits inside whatever
 * the page builder wraps it in. Everything is scoped to .adroit-opps.
 */

.adroit-opps {
	--o-brand: #830606;
	--o-brand-deep: #6f0b0b;
	--o-tint: #fbeaea;
	--o-line: #e8c9c9;
	--o-ink: #333333;
	--o-ink-strong: #1a1a1a;
	--o-faint: #8b8f97;
	--o-rule: #e2e4e8;
	--o-warn: #8a5d00;
	--o-warn-soft: #fdf3df;
	--o-urgent: #a81e17;
	--o-head: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	/* The section colours. */
	--o-news: #35566e;
	--o-scholarships: #1b6349;
	--o-jobs: #8a5d00;
	--o-competitions: #6b2d6b;
	--o-other: #55504f;

	color: var(--o-ink);
	font-size: 16px;
	line-height: 1.55;
}

.adroit-opps *, .adroit-opps *::before, .adroit-opps *::after { box-sizing: border-box; }

/* ------------------------------------------------------------- filters -- */

.adroit-opps-filters {
	display: flex; flex-wrap: wrap; gap: .4rem;
	margin: 0 0 1.4rem; padding: 0 0 1rem;
	border-bottom: 1px solid var(--o-rule);
}
.adroit-opps-filter {
	display: inline-block;
	padding: .4rem .85rem;
	font-family: var(--o-head); font-size: .86rem; font-weight: 600;
	color: var(--o-ink) !important; text-decoration: none !important;
	border: 1px solid var(--o-rule); border-radius: 999px; background: #fff;
	transition: background .12s, border-color .12s, color .12s;
}
.adroit-opps-filter:hover { border-color: var(--o-faint); background: #f7f7f8; }
.adroit-opps-filter.is-on {
	background: var(--o-brand); border-color: var(--o-brand); color: #fff !important;
}
.adroit-opps-filter:focus-visible { outline: 2px solid var(--o-brand); outline-offset: 2px; }

/* -------------------------------------------------------- closing soon -- */

.adroit-opps-soon {
	margin: 0 0 1.8rem; padding: 1.05rem 1.2rem;
	background: var(--o-tint);
	border: 1px solid var(--o-line);
	border-left: 4px solid var(--o-brand);
	border-radius: 8px;
}
.adroit-opps-soon-title {
	margin: 0 0 .55rem; font-family: var(--o-head);
	font-size: .78rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; color: var(--o-brand);
}
.adroit-opps-soon ul { margin: 0; padding: 0; list-style: none; }
.adroit-opps-soon li {
	display: flex; flex-wrap: wrap; gap: .35rem .7rem;
	align-items: baseline; padding: .38rem 0;
}
.adroit-opps-soon li + li { border-top: 1px solid var(--o-line); }
.adroit-opps-soon a {
	font-weight: 600; color: var(--o-brand-deep) !important; text-decoration: none !important;
}
.adroit-opps-soon a:hover { text-decoration: underline !important; }
.adroit-opps-soon span {
	margin-left: auto;
	font-family: var(--o-head); font-size: .78rem; font-weight: 600;
	color: var(--o-urgent);
	white-space: nowrap;
}

/* ---------------------------------------------------------------- list -- */

.adroit-opps-list {
	display: grid; gap: 1.15rem;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.adroit-opp {
	display: flex; flex-direction: column;
	background: #fff;
	border: 1px solid var(--o-rule);
	border-radius: 10px;
	overflow: hidden;
	transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;

	/* The card's own accent, overridden per section below. */
	--o-accent: var(--o-other);
}

.adroit-opp[data-section="news"] { --o-accent: var(--o-news); }
.adroit-opp[data-section="scholarships"] { --o-accent: var(--o-scholarships); }
.adroit-opp[data-section="jobs"] { --o-accent: var(--o-jobs); }
.adroit-opp[data-section="competitions"] { --o-accent: var(--o-competitions); }

.adroit-opp:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(26, 26, 26, .09);
	border-color: #d6d9de;
}
.adroit-opp--closed { opacity: .58; }
.adroit-opp--closed:hover { transform: none; box-shadow: none; }

/* --------------------------------------------------------------- cover -- */

.adroit-opp-cover {
	position: relative;
	aspect-ratio: 16 / 9;
	max-width: 100%;
	background: var(--o-accent);
	border-bottom: 3px solid var(--o-accent);
}

.adroit-opp-shot {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	text-decoration: none !important;
}

.adroit-opp-photo {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}
.adroit-opp:hover .adroit-opp-photo { transform: scale(1.035); }

/*
 * The drawn cover, for a card with no picture. Diagonal hatching in the
 * section's own colour with the section named across it. No image request,
 * nothing to upload, and it never looks like a missing file.
 */
.adroit-opp-drawn {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background-color: var(--o-accent);
	background-image: repeating-linear-gradient(
		135deg,
		rgba(255, 255, 255, .07) 0 10px,
		rgba(255, 255, 255, 0) 10px 20px
	);
}
.adroit-opp-drawn-word {
	font-family: var(--o-head);
	font-size: 1.02rem;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
	text-align: center;
	color: rgba(255, 255, 255, .93);
	line-height: 1.3;
}

/* The deadline, read off the cover rather than hunted for in the text. */
.adroit-opp-flag {
	position: absolute;
	left: .7rem;
	bottom: .7rem;
	padding: .26rem .6rem;
	font-family: var(--o-head);
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .02em;
	border-radius: 999px;
	background: rgba(255, 255, 255, .95);
	color: var(--o-ink-strong);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.adroit-opp-flag--closing { background: var(--o-urgent); color: #fff; }
.adroit-opp-flag--closed { background: rgba(40, 38, 38, .88); color: #fff; }

/* ---------------------------------------------------------------- body -- */

.adroit-opp-body {
	display: flex;
	flex-direction: column;
	gap: .42rem;
	flex: 1;
	padding: .95rem 1.1rem 1.05rem;
}

.adroit-opp-kind {
	margin: 0 !important;
	font-family: var(--o-head); font-size: .68rem; font-weight: 700;
	letter-spacing: .09em; text-transform: uppercase;
	color: var(--o-accent);
}
/*
 * A drawn cover already names the section across it in large letters, so the
 * small label underneath would be the same word twice in two centimetres. It
 * stays on cards that carry a photograph, where it is the only place the
 * section is named.
 */
.adroit-opp--drawn .adroit-opp-kind { display: none; }

.adroit-opp-title {
	margin: 0 !important; font-family: var(--o-head);
	font-size: 1.04rem; font-weight: 600; line-height: 1.34;
	text-wrap: balance;
}
.adroit-opp-title a { color: var(--o-ink-strong) !important; text-decoration: none !important; }
.adroit-opp-title a:hover { color: var(--o-brand) !important; }

.adroit-opp-where { margin: 0 !important; font-size: .84rem; color: var(--o-faint); }
.adroit-opp-summary { margin: 0 !important; font-size: .91rem; }
.adroit-opp-who { margin: 0 !important; font-size: .84rem; color: #5c5f66; }
.adroit-opp-who strong { color: var(--o-ink-strong); font-weight: 600; }

.adroit-opp-foot {
	display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
	margin: auto 0 0 !important; padding-top: .75rem;
	border-top: 1px solid #eeeff2;
}
.adroit-opp-when {
	font-family: var(--o-head);
	font-size: .8rem; font-weight: 600; color: var(--o-faint);
}

.adroit-opp-apply {
	margin-left: auto;
	padding: .42rem .95rem;
	font-family: var(--o-head); font-size: .84rem; font-weight: 600;
	color: #fff !important; text-decoration: none !important;
	background: var(--o-brand); border-radius: 6px;
	transition: background .12s;
}
.adroit-opp-apply:hover { background: var(--o-brand-deep); color: #fff !important; }
.adroit-opp-apply:focus-visible { outline: 2px solid var(--o-brand); outline-offset: 2px; }

/* --------------------------------------------------------------- other -- */

.adroit-opps-empty {
	padding: 2.4rem 1rem; text-align: center; color: var(--o-faint);
	background: #f7f7f8; border: 1px dashed var(--o-rule); border-radius: 10px;
}
.adroit-opps-past { margin: 1.6rem 0 0; font-size: .86rem; }
.adroit-opps-past a { color: var(--o-brand) !important; }

@media (max-width: 600px) {
	.adroit-opps-list { grid-template-columns: 1fr; gap: 1rem; }
	.adroit-opp-apply { margin-left: 0; }
	.adroit-opps-soon span { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.adroit-opp, .adroit-opp-photo, .adroit-opp-apply, .adroit-opps-filter { transition: none; }
	.adroit-opp:hover { transform: none; }
	.adroit-opp:hover .adroit-opp-photo { transform: none; }
}
