/* WCAG 2.2 Accessibility Styles */

/* Skip Navigation Link */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #000;
  color: #fff;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid #ffbf47;
  outline-offset: 0;
  color: #fff;
}

/* Visible Focus Indicators (WCAG 2.4.7 / 2.4.11 / 2.4.12) */
*:focus {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* High contrast focus for dark backgrounds */
.nav-menu a:focus-visible,
.navbar-nav a:focus-visible,
.own-menu-item a:focus-visible,
footer a:focus-visible,
.footer-area a:focus-visible,
.main-footer a:focus-visible,
header a:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

.navbar-toggler:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 2px;
}

/* Ensure interactive elements have pointer cursor */
button,
[role="button"],
a[href],
input[type="submit"],
input[type="button"],
select {
  cursor: pointer;
}

/* Screen reader only utility class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Minimum target size for touch (WCAG 2.5.8 - 24x24px) */
.navbar-nav .nav-link,
.dropdown-item {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Ensure form inputs have sufficient size */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  min-height: 44px;
}

/* Disabled state styling (WCAG 1.4.1 - not relying on color alone) */
button:disabled,
input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Ensure prefers-reduced-motion is respected (WCAG 2.3.3) */
@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;
  }

  .preloader {
    display: none !important;
  }
}

/* Banner text contrast fix over background images (WCAG 1.4.3) */
.banner-caption p.red-btn {
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 14px;
  border-radius: 4px;
  display: inline-block;
}

/* Prevent opacity-based animations from causing WAVE contrast false positives
   on banner buttons. The slideInRight transform still provides the visual effect. */
.banner-caption a.btn.red-btn {
  opacity: 1 !important;
}

/* Fix h4 contrast in sidebar news lists (WCAG 1.4.3) —
   Global h4 has background:#202020 + h4 a has color:#0c0c0c = 1.2:1.
   These sidebar headings are inline text, not header bars. */
.Popular-news ul li h4,
.aside-widget h4 {
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
}

.Popular-news ul li h4 a,
.aside-widget h4 a {
  color: #0c0c0c;
}

/* Darken red link color to meet WCAG AAA 7:1 contrast on light backgrounds (WCAG 1.4.6) */
.red-color {
  color: #b30000 !important;
}

/* Lighten red on dark backgrounds to meet WCAG AA 4.5:1 contrast (WCAG 1.4.3) */
.main-footer .red-color,
.copy-rights .red-color {
  color: #ff9999 !important;
}

/* Reset default button styling on slick arrows (changed from span to button for ARIA compliance) */
button.slick-arrow {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: inherit;
}

/* Darken default link & label color to meet WCAG AAA 7:1 contrast on #fafafa (WCAG 1.4.6) */
a {
  color: #545454;
}

label {
  color: #545454;
}

/* Ensure text can be resized up to 200% (WCAG 1.4.4) */
html {
  font-size: 100%;
}

/* High contrast mode support */
@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible {
    outline: 3px solid LinkText;
  }

  .skip-to-content:focus {
    outline: 3px solid LinkText;
  }
}

/* Ensure sufficient line spacing for readability (WCAG 1.4.12) */
p, li, dd, dt, td, th, label, span, a {
  line-height: 1.5;
}

/* Form validation styling - visual + text cues (WCAG 1.4.1, 3.3.1) */
input:invalid:not(:placeholder-shown),
textarea:invalid:not(:placeholder-shown) {
  border-color: #d32f2f;
  border-width: 2px;
  box-shadow: none;
}

input:invalid:not(:placeholder-shown):focus,
textarea:invalid:not(:placeholder-shown):focus {
  outline-color: #d32f2f;
}

/* ===== ESPA Publicity Bar ===== */
.espa-bar {
  background: #fff;
  border-bottom: 2px solid #0066b3;
  padding: 6px 0;
  z-index: 9999;
  position: relative;
}

.espa-bar-inner {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.espa-logo {
  height: 50px;
  width: auto;
}

.espa-text {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

@media (max-width: 576px) {
  .espa-bar-inner {
    justify-content: center;
    text-align: center;
  }
  .espa-logo {
    height: 40px;
  }
  .espa-text {
    font-size: 11px;
  }
}

/* ===== Accessibility Widget ===== */
.a11y-widget {
  position: fixed;
  right: 15px;
  bottom: 80px;
  z-index: 10000;
}

.a11y-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #0066b3;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.2s;
}

.a11y-toggle:hover,
.a11y-toggle:focus-visible {
  background: #004a80;
}

.a11y-panel {
  position: absolute;
  bottom: 60px;
  right: 0;
  width: 280px;
  background: #fff;
  border: 2px solid #0066b3;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  padding: 16px;
}

.a11y-panel-title {
  margin: 0 0 12px;
  font-size: 16px;
  color: #333;
  padding-right: 30px;
}

.a11y-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  padding: 4px 8px;
  line-height: 1;
}

.a11y-close:hover,
.a11y-close:focus-visible {
  color: #000;
}

.a11y-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.a11y-option > span {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
}

.a11y-btn-group {
  display: flex;
  gap: 4px;
}

.a11y-btn-group button {
  flex: 1;
  padding: 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
  border-radius: 4px;
  color: #333;
}

.a11y-btn-group button:hover,
.a11y-btn-group button:focus-visible {
  background: #0066b3;
  color: #fff;
  border-color: #0066b3;
}

.a11y-option > button {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  border-radius: 4px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-option > button:hover,
.a11y-option > button:focus-visible {
  background: #e8f0fe;
  border-color: #0066b3;
}

.a11y-option > button[aria-pressed="true"] {
  background: #0066b3;
  color: #fff;
  border-color: #0066b3;
}

/* High Contrast Mode */
html.a11y-high-contrast {
  filter: contrast(1.4);
}

html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast a {
  color: #ffff00 !important;
}

html.a11y-high-contrast .a11y-panel {
  filter: contrast(0.714);
}

/* Underline Links Mode */
html.a11y-underline-links a {
  text-decoration: underline !important;
}

/* Readable Font Mode */
html.a11y-readable-font * {
  font-family: Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.05em;
}

/* ===== Cookie Consent Banner ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #2d2d2d;
  color: #fff;
  z-index: 10001;
  padding: 16px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.cookie-banner-inner {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-inner p {
  flex: 1;
  margin: 0;
  font-size: 14px;
  min-width: 200px;
  color: #fff;
}

.cookie-banner-inner a {
  color: #8bb8e8;
  text-decoration: underline;
  display: inline;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
}

.cookie-btn {
  padding: 8px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.cookie-accept {
  background: #2e7d32;
  color: #fff;
}

.cookie-accept:hover,
.cookie-accept:focus-visible {
  background: #1b5e20;
}

.cookie-reject {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
}

.cookie-reject:hover,
.cookie-reject:focus-visible {
  background: rgba(255,255,255,0.1);
}

/* ===== Footer Legal Links ===== */
.footer-legal-links {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-legal-links li {
  display: inline;
}

.footer-legal-links a {
  color: #ccc;
  font-size: 13px;
  display: inline;
  text-decoration: underline;
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
  color: #fff;
}

/* ===== Legal Pages Styling ===== */
.legal-page {
  padding: 40px 0 60px;
  background: #fff;
}

.legal-page h2 {
  color: #333;
  margin-bottom: 20px;
  font-size: 28px;
}

.legal-page h3 {
  color: #444;
  margin: 25px 0 10px;
  font-size: 20px;
}

.legal-page p,
.legal-page li {
  color: #555;
  font-size: 15px;
  line-height: 1.7;
}

.legal-page ul {
  padding-left: 20px;
}

.legal-page .last-updated {
  color: #888;
  font-style: italic;
  margin-bottom: 20px;
}

/* ===== Sponsor / Partner Logos ===== */
.sponsor-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
}

.sponsor-logos a,
.sponsor-logos > img {
  display: inline-block;
}

.sponsor-logos img {
  height: 50px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.sponsor-logos a:hover img,
.sponsor-logos a:focus-visible img {
  opacity: 1;
}
