/**
 * Accessibility CSS enhancements for Virgin Media Television
 * This file adds accessibility-specific styles without modifying existing element styling
 */

/* Skip navigation link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #463668; /* Virgin Media purple */
  color: #fff;
  padding: 8px 15px;
  z-index: 100000;
  transition: top 0.3s ease;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 2px solid #ed0000;
}

/* Ensure focus indicators are visible for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[role="button"]:focus,
.channel:focus,
.program:focus {
  outline: 2px solid #ed0000 !important;
  outline-offset: 2px;
  text-decoration: underline;
}

/* Styles for screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Ensure elements with ARIA roles have appropriate cursor */
[role="button"] {
  cursor: pointer;
}

/* Ensure proper display for elements with roles */
[role="banner"],
[role="navigation"],
[role="main"],
[role="contentinfo"],
[role="region"] {
  display: block;
  padding: 0px;
}

/* High contrast mode support */
@media (forced-colors: active) {
  a:focus,
  button:focus,
  input:focus,
  select:focus,
  textarea:focus,
  [role="button"]:focus {
    outline: 3px solid HighlightText !important;
  }

  /* Ensure text is visible in high contrast mode */
  .home-header-text-area,
  .whats-on,
  .live-now {
    background-color: Canvas;
    color: CanvasText;
  }

  /* Ensure links are visible */
  a {
    color: LinkText;
  }

  a:visited {
    color: VisitedText;
  }

  a:hover,
  a:focus {
    color: ActiveText;
  }
}

/* Improve text contrast for better readability */
.home-header-text-area h1,
.home-header-text-area h2,
.home-header-text-area h3,
.whats-on h1,
.whats-on h2,
.whats-on h3 {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Ensure proper focus styles for channel buttons */
.channel:focus,
.channel:focus-within {
  box-shadow: 0 0 0 2px #ed0000;
  position: relative;
  z-index: 10;
}

/* Improve visibility of TV guide elements */
.guide-header {
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.guide-header .time {
  font-weight: bold;
}

/* Improve form field accessibility */
input:focus,
select:focus,
textarea:focus {
  border-color: #ed0000;
  box-shadow: 0 0 0 2px rgba(237, 0, 0, 0.25);
}

/* Improve link text visibility */
a.catch-up-now,
a.catch-up-3player {
  /* text-decoration: underline; */
  font-weight: bold;
}

/* Ensure proper contrast for footer links */
footer a {
  /* text-decoration: underline; */
}

/* Add focus styles for navigation items */
.nav-item:focus,
.nav-item:focus-within {
  outline: 2px solid #ed0000;
  outline-offset: -2px;
}

/* Ensure proper heading hierarchy is visible */
h1,
h2,
h3,
h4,
h5,
h6 {
  /* margin-top: 1em; */
  margin-bottom: 0.5em;
}

/* Improve visibility of current page in navigation */
.active-nav-item {
  font-weight: bold;
  text-decoration: underline;
}

/* Ensure sufficient spacing between interactive elements for touch targets */
button,
.button,
[role="button"],
.channel,
.nav-item a {
  min-height: 44px;
  min-width: 44px;
}

/* Improve visibility of form labels */
label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Ensure error messages are clearly visible */
.error-message {
  color: #ed0000;
  font-weight: bold;
  padding: 5px;
  margin-top: 5px;
  border-left: 3px solid #ed0000;
}

/* Add visual cues for required form fields */
.required-field::after {
  content: " *";
  color: #ed0000;
  font-weight: bold;
}

/* Ensure proper spacing for better readability */
p,
ul,
ol {
  line-height: 1.5;
  margin-bottom: 1em;
}
