/*
 * EG Course 1.10.12: the certificates. A certificate's page and a stage's certificate page (the
 * course page with ?certificate=), and the "Certificates" row of the Account page. The sheet itself
 * is drawn by certificate.js; here is everything around it, and how it prints.
 */

.egc-cert-page {
	max-width: 1000px;
	margin: 0 auto;
	color: var(--eg-text, #313b2f);
}

.egc-cert-page h1 {
	margin: 8px 0 18px;
	color: var(--eg-ink, #1f2c1e);
	font-size: clamp(26px, 3.2vw, 34px);
	line-height: 1.15;
}

.egc-cert-page [hidden] {
	display: none !important;
}

/* The sheet. */
.egc-cert {
	margin: 0 0 20px;
}

.egc-cert__sheet {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 16px 36px -22px rgba(52, 84, 32, 0.55), 0 1px 3px rgba(31, 44, 30, 0.12);
}

/* The same words as text: without JavaScript, and until the sheet is drawn. */
.egc-cert__plain {
	padding: clamp(22px, 5vw, 56px);
	border: 1px solid var(--eg-panel-border, #e3e6dc);
	border-top: 6px solid var(--egc-green, #446931);
	border-radius: 6px;
	background: #fff;
}

.egc-cert__plain p {
	margin: 0;
}

.egc-cert__plain-issuer {
	color: var(--egc-green-dark, #355d20);
	font-weight: 650;
}

.egc-cert__plain .egc-cert__plain-name {
	margin: 18px 0 10px;
	color: var(--eg-ink, #1f2c1e);
	font-size: clamp(30px, 6vw, 60px);
	font-weight: 700;
	line-height: 1.05;
	overflow-wrap: anywhere;
}

.egc-cert__plain-what {
	font-size: clamp(18px, 2.6vw, 26px);
}

.egc-cert__plain .egc-cert__plain-code {
	margin-top: 18px;
	color: var(--eg-muted, #6a7267);
	font-size: 14.5px;
}

/* What the owner can do with it. */
.egc-cert-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 14px;
}

.egc-cert-actions:empty {
	display: none;
}

/* 1.10.13: "Share" and the site's share choices (course.css draws them), in a row. */
.egc-cert-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 14px;
}

.egc-cert-share__label {
	margin-right: 6px;
	color: var(--eg-ink, #1f2c1e);
	font-size: 15px;
	font-weight: 650;
}

/* A phone: "Share" on a line of its own, and the six choices closer together, on one row down to 390 px. */
@media (max-width: 520px) {
	.egc-cert-share__label {
		flex: 0 0 100%;
		margin: 0 0 2px;
	}
}

@media (max-width: 400px) {
	.egc-cert-share {
		gap: 3px;
	}

	.egc-cert-share .egc-share__copy {
		padding: 0 8px;
	}
}

.egc-cert-name {
	margin: 0 0 22px;
	font-size: 15px;
}

.egc-cert-name > summary {
	width: fit-content;
	color: var(--eg-muted, #6a7267);
	cursor: pointer;
}

.egc-cert-name > summary:hover {
	color: var(--eg-ink, #1f2c1e);
}

.egc-cert-form label,
.egc-cert-name label {
	display: block;
	margin: 12px 0 6px;
	color: var(--eg-ink, #1f2c1e);
	font-weight: 650;
}

.egc-cert-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	max-width: 580px;
}

.egc-cert-form__row input[type="text"] {
	flex: 1 1 240px;
	min-width: 0;
	min-height: 46px;
	box-sizing: border-box;
	padding: 0 12px;
	border: 1px solid var(--eg-rule-strong, #cfcbbf);
	border-radius: var(--eg-radius, 6px);
	background: #fff;
	color: var(--eg-ink, #1f2c1e);
	font: inherit;
}

.egc-cert-form__row input[type="text"]:focus-visible {
	border-color: var(--egc-green, #446931);
	outline: none;
	box-shadow: var(--eg-focus, 0 0 0 3px rgba(68, 105, 49, 0.35));
}

.egc-cert-form .egc-learning__fine {
	margin: 8px 0 0;
}

/* The site's word for the certificate. */
.egc-cert-proof {
	max-width: 760px;
	margin: 4px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--eg-rule, #e5e2d9);
}

.egc-cert-proof h2 {
	margin: 0 0 8px;
	color: var(--eg-ink, #1f2c1e);
	font-size: 18.5px;
	line-height: 1.3;
}

.egc-cert-proof p {
	margin: 0 0 8px;
}

.egc-cert-proof .egc-learning__fine {
	margin: 0 0 4px;
}

.egc-cert-course {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 16px;
	margin: 22px 0 0;
	color: var(--eg-ink, #1f2c1e);
	font-weight: 650;
}

.egc-cert-notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	border: 1px solid #cfe0bd;
	border-radius: 6px;
	background: var(--eg-tint, #f2f7ec);
	color: var(--egc-green-dark, #355d20);
	font-size: 15px;
}

.egc-cert-notice--error {
	border-color: #efc7bd;
	background: #fdf1ee;
	color: #8f2c18;
}

/* A stage's certificate page. */
.egc-cert-stage {
	max-width: 640px;
}

.egc-cert-stage > p {
	margin: 0 0 16px;
}

.egc-cert-stage__progress {
	max-width: 420px;
	margin: 0 0 18px;
}

/* Printing: only the sheet, on a page of its own. certificate.js marks the sheet and what holds it. */
@media print {
	@page {
		size: landscape;
		margin: 0;
	}

	body.egc-course-page--certificate * {
		display: none !important;
	}

	body.egc-course-page--certificate [data-egc-print] {
		display: block !important;
		position: static !important;
		float: none !important;
		width: auto !important;
		max-width: none !important;
		min-height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		background: none !important;
		box-shadow: none !important;
		transform: none !important;
	}

	body.egc-course-page--certificate canvas[data-egc-print] {
		width: 100% !important;
		height: auto !important;
		border-radius: 0 !important;
	}
}

/* The Account page: "Certificates", a row under the course (EG Account's card, the course's list). */
.ega .ega-card--certificates .egc-certs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 30px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ega .ega-card--certificates .egc-certs__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 9px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.4;
}

.ega .ega-card--certificates .egc-certs__item::before {
	content: none;
}

.ega .ega-card--certificates .egc-certs__item a {
	color: var(--ega-moss, #446931);
	font-weight: 650;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ega .ega-card--certificates .egc-certs__item strong {
	color: var(--ega-ink, #1f2c1e);
	font-weight: 650;
}

.ega .ega-card--certificates .egc-certs__item span {
	color: var(--ega-muted, #6a7267);
	font-size: 14px;
}

@container ega-dash (min-width: 640px) {
	.ega .ega-card--certificates {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: baseline;
		gap: 6px 26px;
		padding-top: 16px;
		padding-bottom: 16px;
	}

	.ega .ega-card--certificates > h2 {
		margin: 0;
		font-size: 18.5px;
	}
}
