
/* Extracted common styles from index.html and index_wcag.html */

/* RNIB-style colour themes (light, dark, yellow) */
html[data-theme="light"] {
  --theme-bg: #ffffff;
  --theme-bg-tint: #EDE9F8;
  --theme-bg-card: #ffffff;
  --theme-bg-inverse: #111111;
  --theme-text: #111111;
  --theme-text-muted: #555554;
  --theme-text-inverse: #ffffff;
  --theme-brand: #4C3BC9;
  --theme-brand-dark: #3A2DA8;
  --theme-brand-light: #F3F0FF;
  --theme-brand-muted: #4A3F9E;
  --theme-border: #e5e7eb;
  --theme-focus: #4C3BC9;
  --theme-footer-bg: #4C3BC9;
  --theme-footer-select-bg: #3A2DA8;
}
html[data-theme="dark"] {
  --theme-bg: #111111;
  --theme-bg-tint: #1d1d1d;
  --theme-bg-card: #292929;
  --theme-bg-inverse: #ffffff;
  --theme-text: #ffffff;
  --theme-text-muted: #dddddd;
  --theme-text-inverse: #111111;
  --theme-brand: #b8adf5;
  --theme-brand-dark: #d4ccff;
  --theme-brand-light: #1d1d1d;
  --theme-brand-muted: #d4ccff;
  --theme-border: #505050;
  --theme-focus: #fedb66;
  --theme-footer-bg: #111111;
  --theme-footer-select-bg: #292929;
}
html[data-theme="yellow"] {
  --theme-bg: #fdc300;
  --theme-bg-tint: #f9dc86;
  --theme-bg-card: #f9dc86;
  --theme-bg-inverse: #111111;
  --theme-text: #111111;
  --theme-text-muted: #505050;
  --theme-text-inverse: #ffffff;
  --theme-brand: #111111;
  --theme-brand-dark: #000000;
  --theme-brand-light: #f9dc86;
  --theme-brand-muted: #111111;
  --theme-border: rgba(17, 17, 17, 0.3);
  --theme-focus: #ffffff;
  --theme-footer-bg: #111111;
  --theme-footer-select-bg: #292929;
}

html[data-theme] body {
  background-color: var(--theme-bg);
  color: var(--theme-text);
}

/* Lock typefaces so Tailwind CDN fallbacks do not use Times or system UI. */
.font-sans {
  font-family: Inter, system-ui, sans-serif !important;
}
.font-serif {
  font-family: "Playfair Display", Georgia, serif !important;
}
html[data-theme] :focus-visible {
  outline-color: var(--theme-focus);
}
html[data-theme] .skip-link:focus {
  background: var(--theme-bg-card);
  color: var(--theme-text);
}
html[data-theme] .bg-white,
html[data-theme] .bg-white\/95 {
  background-color: var(--theme-bg) !important;
}
html[data-theme] .bg-brand-light {
  background-color: var(--theme-bg-tint) !important;
}
html[data-theme] .bg-brand {
  background-color: var(--theme-brand) !important;
}
html[data-theme] .bg-brand-dark,
html[data-theme] .hover\:bg-brand-dark:hover {
  background-color: var(--theme-brand-dark) !important;
}
html[data-theme] .text-ink {
  color: var(--theme-text) !important;
}
html[data-theme] .text-ink-muted {
  color: var(--theme-text-muted) !important;
}
html[data-theme] .text-brand,
html[data-theme] .hover\:text-brand:hover {
  color: var(--theme-brand) !important;
}
html[data-theme] .text-brand-dark,
html[data-theme] .hover\:text-brand-dark:hover {
  color: var(--theme-brand-dark) !important;
}
html[data-theme] .border-gray-100,
html[data-theme] .border-gray-200,
html[data-theme] .border-t.border-gray-100 {
  border-color: var(--theme-border) !important;
}
html[data-theme] .hover\:border-brand:hover {
  border-color: var(--theme-brand) !important;
}
html[data-theme] header {
  border-color: var(--theme-border) !important;
}
html[data-theme] footer.bg-brand {
  background-color: var(--theme-footer-bg) !important;
}
/* Footer is injected after load; keep link colours in CSS (not Tailwind visited: utilities). */
footer.bg-brand a,
footer.bg-brand a:visited,
footer.bg-brand a:hover,
footer.bg-brand a:focus-visible {
  color: #ffffff;
}
html[data-theme] #language-select {
  background-color: var(--theme-footer-select-bg) !important;
}
html[data-theme] #language-select option {
  background-color: var(--theme-footer-select-bg);
  color: #ffffff;
}
html[data-theme] .hover\:bg-gray-100:hover {
  background-color: var(--theme-bg-tint) !important;
}
html[data-theme] .bg-brand-light.text-brand {
  background-color: var(--theme-brand-light) !important;
  color: var(--theme-brand) !important;
}

.partner-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem;
  text-align: left;
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}
.partner-link__logo {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
  border-radius: 0.375rem;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.partner-link__logo--wide {
  width: 5.5rem;
  height: 2.75rem;
}
.partner-link__text {
  min-width: 0;
}
.partner-link:hover {
  color: var(--theme-text);
}
.partner-link:focus-visible {
  outline: 2px solid var(--theme-focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.partner-link sup {
  font-size: 0.55em;
  font-weight: 700;
  vertical-align: super;
  line-height: 0;
}
html[data-theme] .partner-link {
  color: var(--theme-text-muted);
}
html[data-theme] .partner-link:hover {
  color: var(--theme-text);
}
@media (min-width: 640px) {
  .partner-link {
    font-size: 1.25rem;
  }
}

.theme-switcher {
  position: relative;
}
.theme-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--theme-text);
  background: var(--theme-bg-card);
  border: 2px solid var(--theme-text);
  white-space: nowrap;
}
.theme-switcher__toggle-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
}
.theme-switcher__panel {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  width: min(18rem, calc(100vw - 2rem));
  padding: 1.25rem 1rem 1rem;
  background: #ffffff;
  color: #111111;
  border: 2px solid #111111;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  z-index: 60;
}
.theme-switcher__panel[hidden] {
  display: none;
}
.theme-switcher__arrow {
  position: absolute;
  top: -0.55rem;
  right: 1.25rem;
  width: 0.875rem;
  height: 0.875rem;
  background: #ffffff;
  border-left: 2px solid #111111;
  border-top: 2px solid #111111;
  transform: rotate(45deg);
}
.theme-switcher__heading {
  margin: 0 0 1rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}
.theme-switcher__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.theme-switcher__option--wcag {
  grid-column: 1 / -1;
  background: #000000;
  color: #ffffff;
}
.theme-switcher__option {
  flex: 1 1 0;
  min-height: 2.75rem;
  padding: 0.625rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  border: 2px solid #111111;
  text-align: center;
}
.theme-switcher__option[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px #111111;
}
.theme-switcher__option--light {
  background: #ffffff;
  color: #111111;
}
.theme-switcher__option--dark {
  background: #111111;
  color: #ffffff;
}
.theme-switcher__option--yellow {
  background: #fdc300;
  color: #111111;
}

/* Accessible account buttons — 44px targets, high contrast, clear labels */
.btn-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.625rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 9999px;
  border: 2px solid var(--theme-text);
  text-decoration: none;
  white-space: nowrap;
}
.btn-auth:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-auth:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-auth--primary {
  background-color: var(--theme-brand);
  border-color: var(--theme-brand);
  color: #ffffff;
}
html[data-theme="yellow"] .btn-auth--primary {
  color: #ffffff;
}
.btn-auth--primary:hover,
.btn-auth--primary:focus-visible {
  background-color: var(--theme-brand-dark);
  border-color: var(--theme-brand-dark);
}
.btn-auth--secondary {
  background-color: var(--theme-bg-card);
  color: var(--theme-text);
  border-color: var(--theme-text);
}
.btn-auth--secondary:hover,
.btn-auth--secondary:focus-visible {
  background-color: var(--theme-bg-tint);
}
.btn-auth--on-dark {
  background-color: #ffffff;
  border-color: #ffffff;
  color: #111111;
}
.btn-auth--on-dark:hover,
.btn-auth--on-dark:focus-visible {
  background-color: #f5f6f6;
}
.auth-text-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-text-link:focus-visible {
  outline: 3px solid var(--theme-focus);
  outline-offset: 2px;
}

/* Visible focus rings for keyboard users without altering default appearance */
:focus-visible {
  outline: 2px solid #4C3BC9;
  outline-offset: 3px;
}
header a:focus-visible,
header button:focus-visible {
  outline: 2px solid var(--theme-focus);
  outline-offset: 3px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1.25rem;
  background: #fff;
  color: #1A1A2E;
  z-index: 100;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
#redirect-notice {
  display: none;
}
#redirect-notice.is-visible {
  display: block;
}
#language-select option {
  background-color: #3A2DA8;
  color: #ffffff;
}

/* Cookie consent banner and preferences page toggles */
.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 1rem;
  background: var(--theme-bg-card);
  color: var(--theme-text);
  border-top: 2px solid var(--theme-text);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
}
.cookie-consent-banner[hidden] {
  display: none;
}
.cookie-consent-banner__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 768px) {
  .cookie-consent-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.cookie-consent-banner__heading {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.cookie-consent-banner__description {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--theme-text-muted);
}
.cookie-consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cookie-consent-banner__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 2px solid var(--theme-text);
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--theme-text);
}
.cookie-consent-banner__btn--primary {
  background: var(--theme-brand);
  border-color: var(--theme-brand);
  color: #ffffff;
}
.cookie-consent-banner__btn--secondary {
  background: var(--theme-bg-card);
}
.cookie-consent-banner__btn--link {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-consent-banner__btn:hover,
.cookie-consent-banner__btn:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-toggle {
  min-width: 6.5rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 2px solid var(--theme-border);
  background: var(--theme-bg-card);
  color: var(--theme-text);
}
.cookie-toggle[aria-pressed="true"] {
  border-color: var(--theme-brand);
  color: var(--theme-brand);
}
.cookie-toggle[aria-pressed="false"] {
  color: var(--theme-text-muted);
}
.cookie-toggle:hover,
.cookie-toggle:focus-visible {
  border-color: var(--theme-brand);
}
#cookie-preferences-status {
  min-height: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--theme-brand);
}

/* Logo wordmark — RNIB-style accent bar under the brand name */
.site-logo__wordmark {
  display: inline-block;
  padding-bottom: 0.2rem;
  border-bottom: 0.18em solid #0066b3;
  line-height: 1.15;
}
html[data-theme="dark"] .site-logo__wordmark {
  border-bottom-color: #4da3e0;
}
html[data-theme="yellow"] .site-logo__wordmark {
  border-bottom-color: #0066b3;
}
html[data-theme="wcag"] .site-logo__wordmark {
  border-bottom-color: #000000;
}

/* Header primary navigation — styles live in CSS because the header is
   injected after load, so Tailwind may not generate utility classes for it. */
.site-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }
}
.site-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--theme-text);
  text-decoration: none;
  border-radius: 9999px;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.site-nav-link:hover,
.site-nav-link:focus-visible {
  background-color: var(--theme-bg-tint, #f3f0ff);
  color: var(--theme-brand);
}
.site-nav-link[aria-current="page"] {
  color: var(--theme-brand);
  background-color: var(--theme-brand-light, #f3f0ff);
}


