/* AUK WCAG 2.2 AA structural contrast and focus corrections. */

/* Darker brand-adjacent action colours keep white button text above 4.5:1. */
.tbg-cta-btn--configure,
.tbg-cta-btn--call,
.auk-cta-strip__cta-row .tbg-cta-btn--configure,
.auk-cta-strip__cta-row .tbg-cta-btn--call,
.auk-contact-strip__cta-row .tbg-cta-btn--configure,
.auk-contact-strip__cta-row .tbg-cta-btn--call,
.tbg-cta-row .tbg-cta-btn--configure,
.tbg-cta-row .tbg-cta-btn--call {
	background-color: #c2410c !important;
	border-color: #c2410c !important;
}

.tbg-cta-btn--configure:hover,
.tbg-cta-btn--configure:focus,
.tbg-cta-btn--call:hover,
.tbg-cta-btn--call:focus {
	background-color: #9a3412 !important;
	border-color: #9a3412 !important;
}

.tbg-cta-btn--chat,
.auk-cta-strip__cta-row .tbg-cta-btn--chat,
.auk-contact-strip__cta-row .tbg-cta-btn--chat,
#auk-tawk-jit-chip {
	background-color: #0f766e !important;
	border-color: #0f766e !important;
}

.tbg-cta-btn--chat:hover,
.tbg-cta-btn--chat:focus,
.auk-cta-strip__cta-row .tbg-cta-btn--chat:hover,
.auk-cta-strip__cta-row .tbg-cta-btn--chat:focus,
.auk-contact-strip__cta-row .tbg-cta-btn--chat:hover,
.auk-contact-strip__cta-row .tbg-cta-btn--chat:focus,
#auk-tawk-jit-chip:hover,
#auk-tawk-jit-chip:focus {
	background-color: #115e59 !important;
	border-color: #115e59 !important;
}

/* Muted text that fell just below the normal-text threshold. */
.auk-breadcrumb-current {
	color: #596273 !important;
}

.auk-contact-layout h3[style*="color:#718096"],
.auk-contact-layout address[style*="color:#718096"] {
	color: #526174 !important;
}

.wpforms-required-label {
	color: #b42318 !important;
}

/* Full-site crawl follow-up: small supporting text on the refurbished,
   About, Finance, warranty and withheld configurator pages. */
.auk-refurb-card__pricenote,
.auk-team-card__body > p:nth-child(3),
.page-id-21 .auk-section__inner > p,
.page-id-22 .auk-section__inner > div > div > p {
	color: #526174 !important;
}

.results__count,
.product-section__count {
	color: #475569 !important;
}

.auk-footer__copyright a {
	color: #ffffff !important;
	text-decoration: underline !important;
	text-underline-offset: 0.15em;
}

/* Two-tone focus treatment: dark inner ring on light areas, white outer ring
   on dark or coloured areas. It supplements, rather than replaces, labels. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid #0a2240 !important;
	outline-offset: 2px !important;
	box-shadow: 0 0 0 6px #ffffff !important;
}

/* WordPress renders submenu arrow buttons at 12x12px. Keep the visual arrow
   small, but enlarge its clickable/focusable box to the WCAG 2.2 AA 24px
   minimum target size. */
button.wp-block-navigation__submenu-icon {
	width: 24px !important;
	min-width: 24px !important;
	height: 24px !important;
	min-height: 24px !important;
	padding: 6px !important;
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

/* The theme's legacy dropdown rule otherwise leaves WordPress block submenus
   at display:none even after aria-expanded becomes true. */
.auk-header__nav-chrome .wp-block-navigation__submenu-icon[aria-expanded="true"] + .wp-block-navigation__submenu-container,
.auk-header__nav-chrome .wp-block-navigation-item.auk-keyboard-open > .wp-block-navigation__submenu-container {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	overflow: visible !important;
	width: max-content !important;
	min-width: 220px;
	height: auto !important;
}

/* The Home hero places white text over a photograph. A 65% navy veil keeps
   the brightest sampled part of the text area above 5:1 while leaving the
   product image visible. */
.home .auk-hero::before {
	background: rgba(10, 34, 64, 0.65) !important;
}

/* Case-study key results: retain the highlight while meeting normal-text contrast. */
.auk-cs-meta-list__row--highlight dt,
.auk-cs-meta-list__row--highlight dd {
	color: #9a3412 !important;
}

/* Small case-study sector labels require a darker teal on white. */
.auk-cs-card__sector-tag {
	color: #0f766e !important;
}

/* Older CTA styles load at the same specificity later in the cascade. */
body .auk-cta-strip__cta-row a.tbg-cta-btn--chat,
body .auk-contact-strip__cta-row a.tbg-cta-btn--chat {
	background-color: #0f766e !important;
	border-color: #0f766e !important;
}

body a.tbg-cta-btn.tbg-cta-btn--chat {
	background-color: #0f766e !important;
	border-color: #0f766e !important;
}

body .auk-cta-strip__cta-row a.tbg-cta-btn--chat:hover,
body .auk-cta-strip__cta-row a.tbg-cta-btn--chat:focus,
body .auk-contact-strip__cta-row a.tbg-cta-btn--chat:hover,
body .auk-contact-strip__cta-row a.tbg-cta-btn--chat:focus {
	background-color: #115e59 !important;
	border-color: #115e59 !important;
}

body a.tbg-cta-btn.tbg-cta-btn--chat:hover,
body a.tbg-cta-btn.tbg-cta-btn--chat:focus {
	background-color: #115e59 !important;
	border-color: #115e59 !important;
}

/* Wide accessory tables remain available through a labelled keyboard-scrollable region. */
.tbg-acc-group__body {
	overflow-x: auto !important;
	-webkit-overflow-scrolling: touch;
}

.auk-sector-glance__prose,
.auk-sector-glance__aside {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* The current FSE header hides the whole navigation wrapper below 900px,
   including WordPress's own responsive-menu button. Restore the button and
   keep the full menu out of the layout until WordPress marks it open. */
@media (max-width: 900px) {
	.auk-header__inner {
		grid-template-columns: auto 1fr auto !important;
		gap: 0.75rem !important;
	}

	.auk-header__logo { grid-column: 1; }

	.auk-header__actions {
		grid-column: 2;
		grid-row: 1;
		justify-self: end;
		gap: 0.5rem !important;
		min-width: 0;
	}

	.auk-header__nav-chrome {
		display: flex !important;
		grid-column: 3;
		grid-row: 1;
		align-items: center;
		justify-self: end;
		width: auto !important;
		min-width: 44px;
	}

	.auk-header__nav-chrome .wp-block-navigation {
		width: auto !important;
		min-width: 44px;
	}

	.auk-header__nav-chrome .wp-block-navigation__responsive-container-open,
	.auk-header__nav-chrome .wp-block-navigation__responsive-container-close {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 44px !important;
		min-width: 44px !important;
		height: 44px !important;
		min-height: 44px !important;
		padding: 10px !important;
	}

	.auk-header__nav-chrome .wp-block-navigation__responsive-container:not(.is-menu-open) {
		display: none !important;
	}

	.auk-header__nav-chrome .wp-block-navigation__responsive-container.is-menu-open {
		display: flex !important;
	}

	.auk-header__nav-chrome .wp-block-navigation__submenu-icon[aria-expanded="true"] + .wp-block-navigation__submenu-container,
	.auk-header__nav-chrome .wp-block-navigation-item.auk-keyboard-open > .wp-block-navigation__submenu-container {
		position: static !important;
		width: 100% !important;
		min-width: 0 !important;
		padding-left: 1rem !important;
	}
}

@media (max-width: 640px) {
	/* Keep the primary quote route plus the menu within a 320px viewport. The
	   Contact Us route remains available as the final item in the mobile menu. */
	.auk-header__actions a[href="/contact-us/"] {
		display: none !important;
	}
}

@media (min-width: 641px) and (max-width: 1100px) {
	/* The five trust statements exceed tablet and small-laptop viewports when
	   forced onto one line. Let the row wrap inside the hero rather than hiding
	   its first and last statements beyond the clipped hero boundary. */
	.auk-hero__trust {
		flex-wrap: wrap !important;
		white-space: normal !important;
		gap: 0.5rem 0 !important;
		max-width: 100%;
		padding-inline: 1rem;
		box-sizing: border-box;
	}
}

@media (min-width: 601px) and (max-width: 680px) {
	/* The canonical four-button CTA row is wider than the narrow-tablet gap
	   between its phone stack (<=600px) and the width at which one row fits. */
	.auk-cta-strip__cta-row,
	.tbg-cta-row,
	.auk-contact-strip__cta-row {
		flex-wrap: wrap !important;
	}
}

@media (max-width: 480px) {
	/* At 320 CSS pixels the former fixed-height hero overlapped its trust line,
	   heading and introduction. Put the pieces back into normal document flow. */
	.home .auk-hero {
		display: block !important;
		height: auto !important;
		min-height: calc(100dvh - 60px);
		padding: 1rem 1rem 2rem !important;
		overflow: visible !important;
	}

	.home .auk-hero__top {
		position: static !important;
		padding: 0 !important;
		margin: 0 0 1.25rem !important;
	}

	.home .auk-hero__trust {
		flex-direction: column;
		gap: 0.35rem !important;
		white-space: normal !important;
	}

	.home .auk-trust-pill + .auk-trust-pill::before {
		display: none;
	}

	.home .auk-hero__inner {
		padding-inline: 0 !important;
	}

	.home .auk-hero h1 {
		font-size: clamp(2rem, 11vw, 2.5rem);
		line-height: 1.08;
		margin-bottom: 1rem;
	}

	.home .auk-hero__sub {
		font-size: 1rem;
		line-height: 1.5;
		margin-bottom: 1.25rem;
	}

	.auk-cs-archive .auk-cs-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Task252: the responsive menu temporarily owns the viewport. Restore the
   undecided consent banner as soon as the menu closes; never change its choice. */
body:has(.wp-block-navigation__responsive-container.is-menu-open) .auk-consent {
  visibility: hidden !important;
  pointer-events: none !important;
}
/* Escape must dismiss a submenu even while the pointer remains over its trigger. */
.wp-block-navigation .wp-block-navigation-item.auk-hover-dismissed > .wp-block-navigation__submenu-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}
.auk-cookie-table-scroll:focus-visible {
  outline: 3px solid #0a2240 !important;
  outline-offset: 3px !important;
}
/* A233-05 visual hardening: a clear boundary for white fields on white cards.
   Preserve native validation/error colours and the existing focused treatment. */
.wpforms-container .wpforms-form :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="url"], textarea, select):not(.wpforms-error):not(:focus),
.auk-faqs__search-input:not(:focus), .auk-faq-search__input:not(:focus) {
  border-color: #64748b !important;
}

/* Task275 (A233-05 residuals, 1.4.11/1.4.3): boundaries the Task252 hardening did not reach.
   1. Complaints: the page's own !important #aebdce border also overrode the WPForms error border (1.91:1).
      Keep the WPForms error colour in the invalid, unfocused state. Focus treatment is unchanged. */
.auk-complaints-page .wpforms-form :is(input, select, textarea):is(.wpforms-error, [aria-invalid="true"]):not(:focus) {
  border-color: #d63637 !important;
}
/* 2. WPForms custom checkboxes/radios draw their box in ::before with the form's 25% black border (1.84:1).
      Unchecked only; the checked state already has its own strong treatment. */
.wpforms-container .wpforms-form :is(input[type="checkbox"], input[type="radio"]):not(:checked)::before {
  border-color: #64748b !important;
}
/* 3. Locations postcode finder: placeholder text (2.54:1) and the active/hovered suggestion (1.1:1 grey,
      meta text 4.39:1 on it). Visual only; widget behaviour and markup are unchanged. */
.auk-pcf__input::placeholder {
  color: #64748b !important;
  opacity: 1;
}
.auk-pcf__item:hover,
.auk-pcf__item--active {
  background: #e8f0fa !important;
  box-shadow: inset 4px 0 0 #0057b8;
}
.auk-pcf__item:hover .auk-pcf__meta,
.auk-pcf__item--active .auk-pcf__meta {
  color: #475569 !important;
}
/* 4. Cookie customisation switches: the off track (#cbd5e0) is 1.49:1 against the white card, so an off switch has no
      visible boundary. Give the off track a 2 px #64748b inner ring (4.76:1); the light track, the on (#0a3ca0) and
      locked states and the existing focus treatment are unchanged. */
.auk-consent-toggle:not(.is-on):not(.is-locked):not(:focus-visible) {
  box-shadow: inset 0 0 0 2px #64748b;
}
/* 5. Refurbished filter chips: the pressed state is shown only by a navy-to-red hue change (2.42:1 between states).
      Add a non-colour cue (underline plus inner ring) to the pressed chip. */
.auk-filterpod__btn[aria-pressed="true"],
.auk-filterpod__btn.is-active {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px !important;
  box-shadow: inset 0 0 0 2px #ffffff;
}
/* 6. Windows contrast themes (forced colours) remove background colours, which made the consent switches invisible and
      the pressed state of configurator and refurbished chips indistinguishable. System colours keep both visible. */
@media (forced-colors: active) {
  .auk-consent-toggle {
    border: 1px solid ButtonText !important;
    box-sizing: border-box !important;
  }
  .auk-consent-toggle::after {
    forced-color-adjust: none;
    background: ButtonText !important;
    top: 1px !important;
    left: 1px !important;
  }
  .auk-consent-toggle.is-on {
    forced-color-adjust: none;
    background: Highlight !important;
    border-color: Highlight !important;
  }
  .auk-consent-toggle.is-on::after {
    background: HighlightText !important;
    left: 21px !important;
  }
  .qchip[aria-pressed="true"],
  .auk-filterpod__btn[aria-pressed="true"],
  .auk-filterpod__btn.is-active {
    forced-color-adjust: none;
    background: Highlight !important;
    color: HighlightText !important;
    border-color: Highlight !important;
  }
}

/* Task455 N455-02 (1.4.10): at 400% browser zoom the viewport is about 320 x 190 CSS px and the fixed first-visit
   consent panel (about 343 px tall) grew above the top edge, so its heading, text and Cookie Policy link could not be
   reached. Keep the panel inside the viewport and let it scroll; nothing changes while the panel already fits. */
.auk-consent.is-visible {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 480px) {
  .auk-consent.is-visible {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
}
/* Task455 N455-03: the decorative scroll hint (aria-hidden) floats over text in very short viewports (400% zoom). */
@media (max-height: 420px) {
  .auk-scroll-indicator { display: none !important; }
}
