/* Academy Passport - front end. Colours come from --ap-* variables set per site. */

#ap-root.ap {
	--ap-line: color-mix(in srgb, var(--ap-ink) 16%, transparent);
	--ap-muted: color-mix(in srgb, var(--ap-ink) 74%, var(--ap-paper));
	--ap-radius: 6px;
	color: var(--ap-ink);
	font-family: var(--ap-sans);
	font-size: 16px;
	line-height: 1.6;
	width: min(1040px, calc(100% - 32px));
	margin: 0 auto 72px;
	box-sizing: border-box;
}
#ap-root.ap--closed, #ap-root.ap--staff { margin-top: 32px; }
#ap-root.ap *, #ap-root.ap *::before, #ap-root.ap *::after { box-sizing: inherit; }
#ap-root.ap p { margin: 0 0 .75em; }
#ap-root.ap a { color: var(--ap-cover); }
#ap-root.ap :focus-visible { outline: 2px solid var(--ap-cover); outline-offset: 2px; }

/* ---------- Cover ---------- */
#ap-root .ap-cover {
	position: relative;
	color: #fff;
	background:
		radial-gradient(120% 140% at 12% 0%, rgba(255, 255, 255, .12), transparent 55%),
		radial-gradient(90% 90% at 100% 100%, rgba(0, 0, 0, .30), transparent 60%),
		var(--ap-cover);
}
#ap-root .ap-cover::before { /* stitching */
	content: "";
	position: absolute;
	inset: 8px;
	border: 1px dashed rgba(255, 255, 255, .22);
	border-radius: 4px;
	pointer-events: none;
}
#ap-root .ap-cover__academy {
	font-family: var(--ap-serif);
	font-size: 14px;
	letter-spacing: .04em;
	color: color-mix(in srgb, var(--ap-gold) 80%, #fff);
	margin: 0;
}
#ap-root .ap-cover__word {
	font-family: var(--ap-serif);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .34em;
	color: var(--ap-gold);
	text-shadow: 0 1px 0 rgba(0, 0, 0, .35), 0 -1px 0 rgba(255, 255, 255, .12);
	margin: 0;
	line-height: 1.1;
}
#ap-root .ap-cover__rule { display: block; width: 72px; height: 2px; background: var(--ap-gold); margin: 14px auto 0; opacity: .85; }
#ap-root .ap-crest { display: inline-grid; place-items: center; width: 112px; height: 112px; border-radius: 50%; flex: none; }
#ap-root .ap-crest img { width: 100%; height: 100%; object-fit: contain; }
#ap-root .ap-crest--mono {
	border: 2px solid var(--ap-gold);
	box-shadow: inset 0 0 0 5px var(--ap-cover), inset 0 0 0 6px var(--ap-gold);
	color: var(--ap-gold);
	font-family: var(--ap-serif);
	font-weight: 700;
	letter-spacing: .08em;
	font-size: 16px;
}

/* Closed book (signed out) */
#ap-root.ap--closed { background: transparent; overflow: visible; }
#ap-root .ap-book { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(16px, 3vw, 32px) 0; }
#ap-root .ap-cover--book {
	aspect-ratio: 5 / 7;
	border-radius: 6px 14px 14px 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	text-align: center;
	padding: 32px 20px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 18px 24px 40px -18px rgba(0, 0, 0, .45);
}
#ap-root .ap-cover--book .ap-cover__word { font-size: clamp(22px, 2.6vw, 30px); margin-top: 28px; }
#ap-root .ap-signin { max-width: 46ch; }
#ap-root .ap-h2 { font-family: var(--ap-serif); font-size: clamp(26px, 3vw, 34px); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; color: var(--ap-ink); text-transform: none; letter-spacing: normal; }
#ap-root .ap-h3 { font-family: var(--ap-serif); font-size: 20px; font-weight: 700; margin: 0 0 .4em; text-transform: none; letter-spacing: normal; }

/* Open passport: full-width banner (breaks out of the theme column to the screen edges) */
#ap-root .ap-cover--band {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}
#ap-root .ap-cover__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	grid-template-areas: "crest titles out" "crest id id";
	gap: 6px 24px;
	align-items: center;
	width: min(1040px, 100%);
	margin: 0 auto;
	padding: 28px 32px 26px;
	position: relative;
}
#ap-root .ap-cover__inner .ap-crest { grid-area: crest; width: 96px; height: 96px; }
#ap-root .ap-cover__titles { grid-area: titles; }
#ap-root .ap-cover--band .ap-cover__word { font-size: clamp(24px, 3.4vw, 36px); }
#ap-root .ap-cover__out { grid-area: out; align-self: start; color: rgba(255, 255, 255, .8) !important; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
#ap-root .ap-cover__out:hover { color: #fff !important; }
#ap-root .ap-idline { grid-area: id; display: flex; flex-wrap: wrap; gap: 6px 36px; margin: 10px 0 0; }
#ap-root .ap-idline div { min-width: 0; }
#ap-root .ap-idline dt { font-size: 12px; color: color-mix(in srgb, var(--ap-gold) 70%, #fff); margin: 0; }
#ap-root .ap-idline dd { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }

/* ---------- The island: the beige passport box, separate from the banner ---------- */
#ap-root .ap-island { background: var(--ap-paper); border-radius: var(--ap-radius); margin-top: 40px; overflow: hidden; }

/* ---------- Standing ---------- */
#ap-root .ap-standing { padding: 28px 32px 8px; border-bottom: 1px solid var(--ap-line); }
#ap-root .ap-standing__line { font-family: var(--ap-serif); font-size: 20px; margin: 0 0 12px !important; }
#ap-root .ap-standing__line strong { font-family: var(--ap-sans); font-size: 44px; line-height: 1; color: var(--ap-cover); margin-right: 4px; font-weight: 700; }
#ap-root .ap-meter { height: 6px; background: var(--ap-line); border-radius: 3px; overflow: hidden; max-width: 560px; margin-bottom: 14px; }
#ap-root .ap-meter span { display: block; height: 100%; background: var(--ap-cover); border-radius: 3px; }
#ap-root .ap-standing__note { color: var(--ap-muted); font-size: 15px; max-width: 70ch; }
#ap-root .ap-standing__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 18px !important; }

/* ---------- Tabs ---------- */
#ap-root .ap-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--ap-line); overflow-x: auto; }
#ap-root .ap-tabs button {
	appearance: none;
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	border-radius: 0;
	padding: 16px 12px 13px;
	font: 600 15px var(--ap-sans);
	text-transform: none;
	letter-spacing: normal;
	color: var(--ap-muted);
	cursor: pointer;
	white-space: nowrap;
	box-shadow: none;
}
#ap-root .ap-tabs button[aria-selected="true"] { color: var(--ap-ink); border-bottom-color: var(--ap-gold); background: none; }
#ap-root .ap-tabs button:hover { color: var(--ap-ink); background: none; }
#ap-root .ap-panel { padding: 24px 32px 36px; }
#ap-root .ap-panel[hidden] { display: none; }
#ap-root .ap-lede { color: var(--ap-muted); max-width: 64ch; }

/* ---------- Entries (stamps) ---------- */
#ap-root .ap-year { font-family: var(--ap-serif); font-size: 22px; font-weight: 700; text-transform: none !important; margin: 18px 0 4px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; color: var(--ap-ink); }
#ap-root .ap-year span { font-family: var(--ap-sans); font-size: 14px; font-weight: 400; text-transform: none !important; color: var(--ap-muted); }
#ap-root .ap-entries { list-style: none; margin: 0 0 12px; padding: 0; }
#ap-root .ap-entry {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr) auto auto;
	gap: 6px 22px;
	align-items: center;
	padding: 18px 0;
	border-top: 1px dotted color-mix(in srgb, var(--ap-ink) 28%, transparent);
}
#ap-root .ap-entry:first-child { border-top-style: solid; border-top-color: var(--ap-line); }
#ap-root .ap-stamp {
	--stamp: var(--ap-cover);
	width: 82px;
	height: 82px;
	border-radius: 50%;
	border: 2px solid var(--stamp);
	box-shadow: inset 0 0 0 4px var(--ap-paper), inset 0 0 0 5px var(--stamp);
	color: var(--stamp);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	transform: rotate(var(--tilt, -4deg));
	opacity: .96;
	mix-blend-mode: multiply;
	animation: ap-press .45s cubic-bezier(.2, .9, .3, 1.2) both;
}
#ap-root .ap-entries .ap-entry:nth-child(2) .ap-stamp { animation-delay: .06s; }
#ap-root .ap-entries .ap-entry:nth-child(3) .ap-stamp { animation-delay: .12s; }
#ap-root .ap-entries .ap-entry:nth-child(4) .ap-stamp { animation-delay: .18s; }
#ap-root .ap-entries .ap-entry:nth-child(n+5) .ap-stamp { animation-delay: .24s; }
#ap-root .ap-stamp__day { font-family: var(--ap-sans); font-weight: 700; font-size: 24px; line-height: 1; }
#ap-root .ap-stamp__mon { font-size: 10px; font-weight: 600; letter-spacing: .02em; margin-top: 3px; }
#ap-root .ap-entry--external .ap-stamp { --stamp: color-mix(in srgb, var(--ap-ink) 62%, var(--ap-paper)); border-style: dashed; box-shadow: none; }
@keyframes ap-press {
	from { transform: rotate(var(--tilt, -4deg)) scale(1.35); opacity: 0; }
	to { transform: rotate(var(--tilt, -4deg)) scale(1); opacity: .96; }
}
#ap-root .ap-entry__title { font-family: var(--ap-serif); font-size: 18px; line-height: 1.35; font-weight: 700; text-transform: none !important; letter-spacing: normal !important; margin: 0 0 4px; color: var(--ap-ink); }
#ap-root .ap-entry__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; margin: 0 !important; }
#ap-root .ap-entry__status { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ap-cover); background: color-mix(in srgb, var(--ap-gold) 24%, transparent); padding: 2px 8px; border-radius: 3px; margin: 6px 0 0 !important; }
#ap-root .ap-entry__keep { font-size: 13px; color: var(--ap-muted); margin: 2px 0 0 !important; }
#ap-root .ap-entry__credits { font-family: var(--ap-sans); font-size: 28px; font-weight: 700; line-height: 1; text-align: right; margin: 0 !important; color: var(--ap-ink); }
#ap-root .ap-entry__credits small { display: block; font-family: var(--ap-sans); font-size: 12px; font-weight: 400; color: var(--ap-muted); margin-top: 4px; }
#ap-root .ap-entry__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0 !important; font-size: 14px; min-width: 120px; }
#ap-root .ap-empty { border: 1px dashed var(--ap-line); border-radius: var(--ap-radius); padding: 28px; max-width: 60ch; }

/* ---------- Forms ---------- */
#ap-root .ap-form { max-width: 760px; }
#ap-root .ap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
#ap-root .ap-span2 { grid-column: 1 / -1; }
#ap-root .ap-field { display: block; margin: 0; }
#ap-root .ap-signin .ap-field { margin-bottom: 14px; }
#ap-root .ap-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--ap-ink); }
#ap-root.ap input[type="text"], #ap-root.ap input[type="email"], #ap-root.ap input[type="tel"], #ap-root.ap input[type="date"], #ap-root.ap input[type="number"], #ap-root.ap input[type="file"], #ap-root.ap select, #ap-root.ap textarea {
	width: 100%;
	font: 16px/1.4 var(--ap-sans);
	color: var(--ap-ink);
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--ap-ink) 28%, transparent);
	border-radius: 4px;
	padding: 11px 12px;
	margin: 0;
	box-shadow: none;
}
#ap-root.ap input[type="file"] { padding: 9px; background: color-mix(in srgb, #fff 60%, var(--ap-paper)); }
#ap-root.ap input:focus, #ap-root.ap select:focus, #ap-root.ap textarea:focus { border-color: var(--ap-cover); outline: 2px solid color-mix(in srgb, var(--ap-cover) 30%, transparent); outline-offset: 0; }
#ap-root .ap-btn {
	display: inline-block;
	appearance: none;
	background: var(--ap-cover);
	color: #fff !important;
	border: 1px solid var(--ap-cover);
	border-radius: 4px;
	padding: 12px 22px;
	font: 600 15px/1.2 var(--ap-sans);
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none !important;
	cursor: pointer;
}
#ap-root .ap-btn:hover { background: color-mix(in srgb, var(--ap-cover) 85%, #000); }
#ap-root .ap-btn--quiet { background: transparent; color: var(--ap-cover) !important; }
#ap-root .ap-btn--quiet:hover { background: color-mix(in srgb, var(--ap-cover) 8%, transparent); }
#ap-root .ap-link { color: var(--ap-cover); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
#ap-root .ap-link--muted { color: var(--ap-muted) !important; font-weight: 400; }
#ap-root .ap-flash { border-left: 3px solid var(--ap-gold); background: color-mix(in srgb, #fff 70%, var(--ap-paper)); padding: 12px 16px; margin: 0 0 16px !important; font-size: 15px; }
#ap-root.ap--open > .ap-flash { margin: 24px 0 0 !important; }
#ap-root .ap-flash--error { border-left-color: #B3261E; }
#ap-root .ap-fine { font-size: 14px; color: var(--ap-muted); }
#ap-root .ap-note { padding: 24px 32px; margin: 0; background: var(--ap-paper); border-radius: var(--ap-radius); }
#ap-root .ap-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
#ap-root .ap-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---------- Staff panel and preview ---------- */
#ap-root .ap-note p { margin: 0 0 14px; }
#ap-root .ap-staffform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
#ap-root .ap-staffform .ap-label { flex: 1 0 100%; margin: 0; }
#ap-root .ap-staffform select { width: auto; min-width: 260px; max-width: 100%; }
#ap-root .ap-preview-bar { margin: 24px 0 0 !important; padding: 10px 20px; background: var(--ap-ink); color: #fff; font-size: 14px; border-radius: var(--ap-radius); }
#ap-root .ap-preview-bar a { color: var(--ap-gold) !important; margin-left: 8px; }
#ap-root.ap--preview form, #ap-root.ap--preview .ap-link--muted { pointer-events: none; opacity: .55; }
#ap-root.ap--preview .ap-link--muted { display: none; }
#ap-root .ap-preview-foot { text-align: center; margin: -48px 0 48px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
	#ap-root .ap-book { grid-template-columns: 1fr; }
	#ap-root .ap-cover--book { max-width: 260px; width: 100%; margin: 0 auto; }
	#ap-root .ap-cover__inner { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "crest titles" "id id" "out out"; padding: 22px 20px; }
	#ap-root .ap-cover__inner .ap-crest { width: 64px; height: 64px; }
	#ap-root .ap-cover__out { justify-self: start; margin-top: 8px; }
	#ap-root .ap-idline { gap: 8px 24px; }
	#ap-root .ap-standing, #ap-root .ap-panel { padding-left: 20px; padding-right: 20px; }
	#ap-root .ap-tabs { padding: 0 12px; }
	#ap-root .ap-grid { grid-template-columns: 1fr; }
	#ap-root .ap-entry { grid-template-columns: 72px minmax(0, 1fr); }
	#ap-root .ap-stamp { width: 70px; height: 70px; }
	#ap-root .ap-stamp__day { font-size: 21px; }
	#ap-root .ap-stamp__mon { font-size: 9px; }
	#ap-root .ap-crest--mono { font-size: 11px; letter-spacing: .04em; }
	#ap-root .ap-entry__credits, #ap-root .ap-entry__actions { grid-column: 2; text-align: left; align-items: flex-start; flex-direction: row; gap: 16px; }
	#ap-root .ap-entry__credits { display: flex; align-items: baseline; gap: 8px; font-size: 22px; }
	#ap-root .ap-entry__credits small { display: inline; margin: 0; }
	#ap-root.ap--open > .ap-flash { margin: 16px 0 0 !important; }
	#ap-root .ap-island { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { #ap-root .ap-stamp { animation: none; } }
@media print {
	#ap-root .ap-tabs, #ap-root .ap-standing__actions, #ap-root .ap-entry__actions, #ap-root .ap-cover__out, #ap-add, #ap-details { display: none !important; }
	#ap-records { display: block !important; }
}

/* The full-width banner is 100vw wide: stop the scrollbar width from causing a sideways scroll. */
body:has(#ap-root .ap-cover--band) { overflow-x: clip; }

/* Elementor puts padding around the shortcode's container. Remove it above the full-width banner
   (only for the container(s) that hold the open passport) so the banner touches the site header. */
.e-con:has(#ap-root .ap-cover--band),
.e-con-inner:has(#ap-root .ap-cover--band),
.elementor-section:has(#ap-root .ap-cover--band),
.elementor-widget-wrap:has(#ap-root .ap-cover--band),
.elementor-widget-container:has(#ap-root .ap-cover--band) {
	padding-top: 0 !important;
	padding-block-start: 0 !important;
	--padding-top: 0px;
	--padding-block-start: 0px;
}
.e-con:has(#ap-root .ap-cover--band),
.e-con-inner:has(#ap-root .ap-cover--band),
.elementor-section:has(#ap-root .ap-cover--band),
.elementor-widget:has(#ap-root .ap-cover--band),
.elementor-element:has(> #ap-root .ap-cover--band) { margin-top: 0 !important; margin-block-start: 0 !important; }
