/* AUSWEBPRO Core: accessibility toolbar and the preferences it applies (classes on <html>). */

/* -------------------------------------------------------------------------
   1. Preferences
   ------------------------------------------------------------------------- */

/* Text size. The theme sizes text in rem, so scaling the root scales all text. */
html.a11y-size-1 { font-size: 112.5%; }
html.a11y-size-2 { font-size: 125%; }
html.a11y-size-3 { font-size: 150%; }
/* Logotypes keep their designed size (WCAG 1.4.4 exempts logos) so the masthead never overflows. */
html[class*="a11y-size-"] .wordmark { font-size: clamp(26px, 5.2vw, 60px); }
html[class*="a11y-size-"] .footer-brand { font-size: 24px; }
html[class*="a11y-size-"] .topbar__brand { font-size: 17px; }
@media (max-width: 782px) { html[class*="a11y-size-"] .topbar__brand { font-size: 15px; } }

/* High contrast: keeps the layout and brand, darkens greys, strengthens lines. */
html.a11y-contrast {
	--c-text: #000; --c-muted: #1a1a1a; --c-soft: #1a1a1a;
	--c-rule: #1a1a1a; --c-rule-dash: #1a1a1a; --c-rule-strong: #000;
	--c-bg-alt: #fff; --c-link: #00307a; --c-ink: #000;
}
html.a11y-contrast body { color: #000; }
html.a11y-contrast .site-footer { --f-bg: #000; --f-text: #fff; --f-link: #fff; --f-muted: #fff; --f-rule: #fff; }
html.a11y-contrast .entry-content a,
html.a11y-contrast .awp-consent a,
html.a11y-contrast .site-footer a:not(.footer-brand) { text-decoration: underline; text-underline-offset: 3px; }
html.a11y-contrast input:not([type="checkbox"]):not([type="radio"]),
html.a11y-contrast textarea,
html.a11y-contrast select { border: 2px solid #000 !important; background: #fff !important; color: #000 !important; }
html.a11y-contrast .card-media,
html.a11y-contrast .media-ph { outline: 1px solid #000; outline-offset: -1px; }
html.a11y-contrast :focus-visible { outline-width: 3px !important; }

/* Dyslexia-friendly font. Downloaded only when this option is on. */
@font-face { font-family: "OpenDyslexic"; src: url("fonts/OpenDyslexic-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("fonts/OpenDyslexic-Bold.woff2") format("woff2"); font-weight: 600 900; font-style: normal; font-display: swap; }
html.a11y-dyslexic {
	--f-serif: "OpenDyslexic", Verdana, sans-serif;
	--f-sans: "OpenDyslexic", Verdana, sans-serif;
}
html.a11y-dyslexic body,
html.a11y-dyslexic button,
html.a11y-dyslexic input,
html.a11y-dyslexic select,
html.a11y-dyslexic textarea,
html.a11y-dyslexic .awp-consent,
html.a11y-dyslexic .awp-a11y { font-family: "OpenDyslexic", Verdana, sans-serif; font-style: normal; }
html.a11y-dyslexic em, html.a11y-dyslexic i { font-style: normal; font-weight: 700; }
html.a11y-dyslexic .wordmark,
html.a11y-dyslexic .footer-brand,
html.a11y-dyslexic .topbar__brand,
html.a11y-dyslexic .drawer__brand { font-family: "Source Serif 4", Georgia, serif; } /* keep the brand wordmark */

/* Readable spacing: generous line, word and paragraph spacing (within WCAG 1.4.12 ranges). */
html.a11y-spacing body { line-height: 1.8; }
html.a11y-spacing :is(p, li, dd, dt, blockquote, figcaption, label, td, th, .card__excerpt, .article__standfirst) {
	line-height: 1.8 !important; letter-spacing: .05em !important; word-spacing: .16em !important;
}
html.a11y-spacing :is(h1, h2, h3, h4, .card__title, .article__title) { line-height: 1.4 !important; letter-spacing: .03em !important; word-spacing: .12em !important; }
html.a11y-spacing .entry-content :is(p, ul, ol, blockquote) { margin-bottom: 2em; }
html.a11y-spacing .entry-content { text-align: left; }
html.a11y-spacing :is(.wordmark, .footer-brand, .topbar__brand) { letter-spacing: .01em !important; word-spacing: normal !important; }

/* The wider font and spacing make long words wider: let them wrap so nothing scrolls sideways (WCAG 1.4.10). */
html.a11y-dyslexic body, html.a11y-spacing body { overflow-wrap: anywhere; hyphens: auto; }
html.a11y-dyslexic :is(.wordmark, .footer-brand, .topbar__brand), html.a11y-spacing :is(.wordmark, .footer-brand, .topbar__brand) { overflow-wrap: normal; hyphens: manual; }

/* Underline links. */
html.a11y-links a:not(.wordmark):not(.footer-brand):not(.topbar__brand):not(.card-media):not(.section-head__more):not(.share__btn):not(.skip-link) {
	text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important;
}

/* Highlight focus: high-visibility two-tone ring that works on light and dark backgrounds. */
html.a11y-focus :focus-visible {
	outline: 3px solid #ffbf47 !important; outline-offset: 0 !important;
	box-shadow: 0 0 0 6px #0b0c0c !important; border-radius: 2px;
}
/* Edge-to-edge top bar buttons: draw the ring inside so the screen edge never clips it. */
html.a11y-focus .iconbtn:focus-visible { outline: 4px solid #ffbf47 !important; outline-offset: -4px !important; box-shadow: inset 0 0 0 7px #0b0c0c !important; }

/* Reduce motion. The visitor's system setting is also respected by the theme. */
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after {
	animation-duration: 0s !important; animation-iteration-count: 1 !important;
	transition: none !important; scroll-behavior: auto !important;
}
html.a11y-motion .card-media img, html.a11y-motion .card-media:hover img { transform: none !important; }

/* Video captions: readable on any frame. */
video::cue { background: rgba(0, 0, 0, .85); color: #fff; line-height: 1.4; }

/* -------------------------------------------------------------------------
   2. Toolbar
   ------------------------------------------------------------------------- */
.awp-a11y-sr {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link.awp-a11y-skip:focus { left: 180px; }

button.awp-a11y-btn {
	position: fixed; left: 16px; bottom: calc(16px + var(--awp-a11y-lift, 0px)); z-index: 95;
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 48px; padding: 0; margin: 0;
	border: 2px solid #fff; border-radius: 50%;
	background: #05070f; color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
	font-size: 16px; line-height: 1; cursor: pointer;
}
button.awp-a11y-btn:hover, button.awp-a11y-btn:focus, button.awp-a11y-btn[aria-expanded="true"] { background: #1f5fa8; color: #fff; border-color: #fff; }
button.awp-a11y-btn:focus-visible { outline: 3px solid #1f5fa8; outline-offset: 3px; }
button.awp-a11y-btn svg { width: 28px; height: 28px; }
.has-drawer .awp-a11y-btn { display: none; }
/* Where the footer content reaches the left edge, leave room so its last row never sits under the button. */
@media (max-width: 1240px) { body .site-footer { padding-bottom: 88px; } }

.awp-a11y {
	position: fixed; left: 16px; bottom: calc(76px + var(--awp-a11y-lift, 0px)); z-index: 96;
	box-sizing: border-box;
	width: min(380px, calc(100vw - 32px));
	max-height: calc(100vh - 96px - var(--awp-a11y-lift, 0px));
	max-height: calc(100dvh - 96px - var(--awp-a11y-lift, 0px));
	overflow-y: auto; overscroll-behavior: contain;
	padding: 0 20px 20px;
	background: #fff; color: #171717;
	border: 1px solid #171717; border-top: 4px solid #171717;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
	font-family: var(--f-sans, "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
	font-size: 1rem; line-height: 1.45; text-align: left;
}
.awp-a11y[hidden] { display: none; }
.awp-a11y *, .awp-a11y *::before, .awp-a11y *::after { box-sizing: border-box; }

.awp-a11y__head {
	position: sticky; top: 0; z-index: 1;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin: 0 -20px 4px; padding: 12px 12px 12px 20px;
	background: #fff; border-bottom: 1px solid #d9d9d9;
}
.awp-a11y .awp-a11y__title { margin: 0; font-family: var(--f-serif, Georgia, serif); font-size: 1.375rem; font-weight: 700; line-height: 1.2; color: #171717; }
.awp-a11y button.awp-a11y__close {
	display: flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0; margin: 0;
	border: 0; border-radius: 0; background: transparent; color: #171717;
}
.awp-a11y button.awp-a11y__close:hover, .awp-a11y button.awp-a11y__close:focus { background: #f3f1ed; color: #171717; }
.awp-a11y__intro { margin: 8px 0 16px; font-size: .875rem; color: #454545; }

.awp-a11y fieldset.awp-a11y__sizes {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
	min-width: 0; margin: 0 0 8px; padding: 0; border: 0;
}
.awp-a11y__sizes legend {
	grid-column: 1 / -1; float: left; width: 100%; padding: 0; margin: 0 0 8px;
	font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #171717;
}
.awp-a11y label.awp-a11y__size {
	display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; padding: 8px 12px;
	border: 1px solid #767676; line-height: 1.2; font-weight: 600; color: #171717; cursor: pointer;
}
.awp-a11y__size--1 span { font-size: 1.0625rem; }
.awp-a11y__size--2 span { font-size: 1.125rem; }
.awp-a11y__size--3 span { font-size: 1.25rem; }
.awp-a11y__size input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: #05070f; }
.awp-a11y__size:has(input:checked) { border: 2px solid #05070f; background: #f3f1ed; padding: 7px 11px; }
.awp-a11y__size:has(input:focus-visible) { outline: 2px solid #1f5fa8; outline-offset: 2px; }

.awp-a11y__opts { list-style: none; margin: 8px 0 0; padding: 0; }
.awp-a11y__opt {
	display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center;
	padding: 12px 0; border-top: 1px solid #d9d9d9;
}
.awp-a11y__opt label { display: block; margin: 0; font-weight: 600; line-height: 1.3; color: #171717; cursor: pointer; }
.awp-a11y__desc { grid-column: 1; margin: 2px 0 0; font-size: .8125rem; line-height: 1.4; color: #595959; }
html.a11y-contrast .awp-a11y__desc, html.a11y-contrast .awp-a11y__intro { color: #1a1a1a; }

/* Switch: native checkbox, restyled. State shows by knob position and fill, not colour alone. */
.awp-a11y__opt input[type="checkbox"] {
	grid-column: 2; grid-row: 1 / span 2;
	-webkit-appearance: none; appearance: none;
	position: relative; width: 48px; height: 28px; margin: 0; flex: none;
	border: 2px solid #595959; border-radius: 14px; background: #fff; cursor: pointer;
}
.awp-a11y__opt input[type="checkbox"]::before {
	content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
	border-radius: 50%; background: #595959; transition: transform .15s;
}
.awp-a11y__opt input[type="checkbox"]:checked { background: #05070f; border-color: #05070f; }
.awp-a11y__opt input[type="checkbox"]:checked::before { transform: translateX(20px); background: #fff; }
.awp-a11y__opt input[type="checkbox"]:focus-visible { outline: 2px solid #1f5fa8; outline-offset: 2px; }

.awp-a11y__foot {
	position: sticky; bottom: -20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	margin: 8px -20px -20px; padding: 12px 20px 16px; background: #fff; border-top: 1px solid #d9d9d9;
}
.awp-a11y button.awp-a11y__reset {
	min-height: 44px; margin: 0; padding: 10px 16px;
	border: 2px solid #05070f; border-radius: 0; background: #fff; color: #05070f;
	font-family: inherit; font-size: .9375rem; font-weight: 600; line-height: 1.2; white-space: normal;
}
.awp-a11y button.awp-a11y__reset:hover, .awp-a11y button.awp-a11y__reset:focus { background: #05070f; color: #fff; }
.awp-a11y .awp-a11y__link { font-size: .875rem; font-weight: 600; color: #1f5fa8; text-decoration: underline; text-underline-offset: 2px; }

.awp-a11y :focus-visible { outline: 2px solid #1f5fa8; outline-offset: 2px; }
html.a11y-focus .awp-a11y :focus-visible { outline: 3px solid #ffbf47 !important; box-shadow: 0 0 0 6px #0b0c0c !important; }

@media (max-width: 600px) {
	button.awp-a11y-btn { left: 12px; bottom: calc(12px + var(--awp-a11y-lift, 0px)); width: 44px; height: 44px; }
	button.awp-a11y-btn svg { width: 26px; height: 26px; }
	.awp-a11y { left: 8px; right: 8px; width: auto; bottom: calc(64px + var(--awp-a11y-lift, 0px)); max-height: calc(100dvh - 80px - var(--awp-a11y-lift, 0px)); }
	.skip-link.awp-a11y-skip:focus { left: 8px; top: 56px; }
}

/* Windows High Contrast / forced colours: fall back to native controls. */
@media (forced-colors: active) {
	.awp-a11y__opt input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; width: 24px; height: 24px; }
	.awp-a11y__opt input[type="checkbox"]::before { display: none; }
	button.awp-a11y-btn { border: 2px solid ButtonText; }
}

@media (prefers-reduced-motion: reduce) {
	.awp-a11y__opt input[type="checkbox"]::before { transition: none; }
}

@media print {
	.awp-a11y-btn, .awp-a11y { display: none !important; }
}
