/* -- R U A 2027 MATHS WIZARD: PROBLEMS ----------------------------------------------------- */
/*
	Layout (mobile first):
	- Narrow screens: English problem, then Afrikaans problem, then the diagram, all stacked
	  full width and left aligned for easy reading.
	- Wider screens (40rem and up): English text on the left, Afrikaans text on the right
	  (right aligned), with the diagram centred below both texts.
*/


:root
{
	--maths-wizard-2027-heading-colour-top: #4d4dff;
	--maths-wizard-2027-heading-colour-bottom: #00006b;
	--maths-wizard-2027-heading-fallback-colour: #0000cc;
	--maths-wizard-2027-divider-colour: #00006622;
}


h2
{
	font-size: 1.5rem;
	font-weight: bold;
	text-align: center;
}


.maths-wizard-2027-problem
{
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"english"
		"afrikaans"
		"diagram";
	row-gap: 1.25rem;
	width: 100%;
	max-width: 100%;
	margin: 0 0 3rem;
	padding: 0;
	padding-top: 2rem;
	border-top: #0a84ff solid 1px;
}


.maths-wizard-2027-problem:last-child
{
	border-bottom: #0a84ff solid 1px;
}


.maths-wizard-2027-problem *,
.maths-wizard-2027-problem *::before,
.maths-wizard-2027-problem *::after
{
	box-sizing: border-box;
}


.problem-english
{
	grid-area: english;
	min-width: 0;
	text-align: left;
}


.problem-afrikaans
{
	grid-area: afrikaans;
	min-width: 0;
	text-align: left;
	padding-top: 1.25rem;
	border-top: 0.0625rem solid var(--maths-wizard-2027-divider-colour);
}


.problem-heading-english,
.problem-heading-afrikaans
{
	margin: 0 0 0.75rem;
	padding: 0.1em 0;
	font-family: "Orbitron", "Eurostile", "Century Gothic", "Verdana", sans-serif;
	font-size: clamp(1.4rem, 5.5vw, 1.8rem);
	font-weight: 900;
	line-height: 1.25;
	letter-spacing: 0.08em;

	/* Vertical linear gradient (top to bottom) applied to the heading text */
	color: var(--maths-wizard-2027-heading-fallback-colour);
	background-image: linear-gradient(to bottom, var(--maths-wizard-2027-heading-colour-top) 0%, var(--maths-wizard-2027-heading-colour-bottom) 100%);
	background-repeat: no-repeat;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}


.problem-heading-english
{
	text-align: left;
}


.problem-heading-afrikaans
{
	text-align: left;
}


.problem-text-english,
.problem-text-afrikaans
{
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.8;
	overflow-wrap: break-word;
	word-wrap: break-word;
}


.problem-text-english
{
	text-align: left;
}


.problem-text-afrikaans
{
	text-align: left;
}


.problem-diagram
{
	grid-area: diagram;
	min-width: 0;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	width: 100%;
	margin: 0;
	padding: 0;
}


.problem-diagram-image
{
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	max-height: 50vh;
}


/* Multiple-answer problems (e.g. problem 3, 5 and 7): display the letter + input
   pairs in as many columns as will comfortably fit, instead of one per line. */
.answer-items
{
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
	gap: 0.5rem 1rem;
	margin-top: 0.5rem;
}


.answer-item
{
	display: flex;
	align-items: center;
	gap: 0.35rem;
}


.answer-item label
{
	font-weight: bold;
	min-width: 1rem;
	text-align: right;
}


#btnMathsWizard2027Submit
{
	text-align: center;
	margin-left: auto;
	margin-right: auto;
}


/* -- R U A 2027 MATHS WIZARD: LANDING PAGE ------------------------------------------------- */

.maths-wizard-2027-container
{
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 1.5rem;
	margin: 1.5rem 0;
}


.maths-wizard-image-left
{
	flex: 0 0 auto;
}


.maths-wizard-image-left img
{
	max-width: 220px;
	height: auto;
	display: block;
}


.maths-wizard-content-right
{
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}


.maths-wizard-heading
{
	margin-bottom: 0.8rem;
	text-align: center;
	width: 100%;
}


.maths-wizard-heading img
{
	max-width: 100%;
	height: auto;
	display: block;
	margin: 0 auto;
	font-size: 1.8rem;
	font-weight: bold;
}


.maths-wizard-countdown
{
	font-size: 1.4rem;
	font-weight: bold;
	margin: 0.5rem 0;
	text-align: center;
}


.maths-wizard-info
{
	font-size: 1rem;
	margin: 0.5rem 0;
	text-align: center;
}


.maths-wizard-download
{
	margin: 0.5rem 0 0 0;
	text-align: center;
}


.maths-wizard-download a
{
	display: inline-block;
	background-color: #0000ff;
	color: #ffffff;
	border: 1px solid #000066;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
	text-decoration: none;
	font-weight: bold;
	padding: 0.6rem 1.2rem;
	border-radius: 4px;
}


.maths-wizard-team-selection-image
{
	width: 100%;
	height: auto;
	display: block;
	margin-top: 2em;
	margin-bottom: 2em;
}


/* Small phones: slightly tighter spacing */
@media (max-width: 24rem) /* 384px */
{
	.maths-wizard-2027-problem
	{
		margin-bottom: 2.25rem;
		row-gap: 1rem;
	}

	.problem-text-english,
	.problem-text-afrikaans
	{
		font-size: 1rem;
		line-height: 1.7;
	}
}


/* Tablets and larger: English left, Afrikaans right, diagram below */
@media (min-width: 40rem) /* 640px */
{
	.maths-wizard-2027-problem
	{
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-areas:
			"english afrikaans"
			"diagram diagram";
		column-gap: 3rem;
		row-gap: 1.75rem;
	}

	.problem-afrikaans
	{
		padding-top: 0;
		border-top: 0;
		text-align: right;
	}

	.problem-heading-afrikaans,
	.problem-text-afrikaans
	{
		text-align: right;
	}

	.problem-text-english,
	.problem-text-afrikaans
	{
		font-size: 1.2rem;
		line-height: 1.9;
	}

	.problem-diagram-image
	{
		max-width: min(100%, 36rem);

		/* On desktop/tablet screens the diagrams rendered too tall; show them
		   at about half the previous height. Problem 4 is excluded because its
		   diagram already displays at the correct size. */
		max-height: 25vh;
	}

	.problem-diagram-image-full-height
	{
		max-height: 50vh;
	}
}


/* Print: avoid splitting a problem across pages */
@media print
{
	.maths-wizard-2027-problem
	{
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
