/* A11y toolbar + user controls (font size 3 steps + high-contrast) */
:root{
  --a11y-font-scale: 1;
  --a11y-toolbar-bg: rgba(255,255,255,0.95);
  --a11y-toolbar-fg: #111;
  --a11y-toolbar-border: rgba(0,0,0,0.2);
  --a11y-focus: #ffbf00;
}



/* Ensure hidden elements are actually hidden even if theme overrides defaults */
[hidden]{
  display: none !important;
}

/* Telefonia/Internet plan cards: enforce readable text (normal + contrast modes) */
.plan, .plan-body{
  color: inherit;
}
.plan .list-group-item{
  color: inherit;
}

/* In high contrast mode, force plan cards to black/white for guaranteed readability */
html.a11y-contrast .plan,
html.a11y-contrast .plan-header,
html.a11y-contrast .plan-body{
  background: #000 !important;
  color: #fff !important;
}
html.a11y-contrast .plan .list-group-item{
  background: transparent !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.35) !important;
}

/* Font scale (works best because Mobirise uses rem heavily) */
html{
  font-size: calc(100% * var(--a11y-font-scale));
}

/* Toolbar */
.a11y-toolbar{
  position: fixed;
  right: 12px;
  top: var(--a11y-toolbar-top, 10px);
  bottom: auto;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  max-width: calc(100vw - 24px);
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--a11y-toolbar-border);
  border-radius: 10px;
  background: var(--a11y-toolbar-bg);
  color: var(--a11y-toolbar-fg);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.a11y-toolbar .a11y-group{
  display: inline-flex;
  gap: 6px;
}

.a11y-btn{
  appearance: none;
  border: 1px solid var(--a11y-toolbar-border);
  background: transparent;
  color: inherit;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.a11y-btn[aria-pressed="true"]{
  background: rgba(16,49,120,0.12);
  border-color: rgba(16,49,120,0.55);
}

.a11y-btn:hover{
  background: rgba(0,0,0,0.06);
}

/* Make focus obvious in the toolbar too */
.a11y-btn:focus-visible{
  outline: 3px solid var(--a11y-focus);
  outline-offset: 2px;
}

/* High contrast mode (simple, robust override) */
html.a11y-contrast{
  --a11y-toolbar-bg: rgba(0,0,0,0.92);
  --a11y-toolbar-fg: #fff;
  --a11y-toolbar-border: rgba(255,255,255,0.35);
  --a11y-focus: #ffea00;
}

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

/* Links */
html.a11y-contrast a{
  color: #00e5ff !important;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
html.a11y-contrast a:visited{
  color: #ffea00 !important;
}

/* Common text helpers */
html.a11y-contrast .text-primary,
html.a11y-contrast .text-secondary,
html.a11y-contrast .text-success,
html.a11y-contrast .text-info,
html.a11y-contrast .text-warning,
html.a11y-contrast .text-danger,
html.a11y-contrast .mbr-white,
html.a11y-contrast .mbr-text,
html.a11y-contrast .mbr-section-title,
html.a11y-contrast .mbr-section-subtitle,
html.a11y-contrast .mbr-card-title{
  color: #fff !important;
}

/* Navigation + dropdowns */
html.a11y-contrast .navbar,
html.a11y-contrast .navbar-dropdown,
html.a11y-contrast .navbar-collapse,
html.a11y-contrast .dropdown-menu{
  background-color: #000 !important;
}
html.a11y-contrast .navbar .navbar-caption,
html.a11y-contrast .navbar .nav-link{
  color: #fff !important;
}

/* Cards/sections: ensure readable on image backgrounds */
html.a11y-contrast section{ position: relative; }

html.a11y-contrast section,
html.a11y-contrast .card,
html.a11y-contrast .card-wrapper{
  background-color: transparent;
}
html.a11y-contrast section::before{
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  pointer-events: none;
  z-index: 0;
}
html.a11y-contrast section > *{
  position: relative;
  z-index: 1;
}

/* Buttons */
html.a11y-contrast .btn,
html.a11y-contrast .btn-primary,
html.a11y-contrast .btn-secondary,
html.a11y-contrast .btn-info,
html.a11y-contrast .btn-success,
html.a11y-contrast .btn-warning,
html.a11y-contrast .btn-danger,
html.a11y-contrast .btn-primary-outline,
html.a11y-contrast .btn-secondary-outline,
html.a11y-contrast .btn-info-outline,
html.a11y-contrast .btn-success-outline,
html.a11y-contrast .btn-warning-outline,
html.a11y-contrast .btn-danger-outline{
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
  box-shadow: none !important;
}
html.a11y-contrast .btn:hover{
  background: #ffea00 !important;
  border-color: #ffea00 !important;
}

/* Forms */
html.a11y-contrast input,
html.a11y-contrast textarea,
html.a11y-contrast select{
  background: #fff !important;
  color: #000 !important;
  border-color: #fff !important;
}
html.a11y-contrast label{
  color: #fff !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .a11y-toolbar{
    scroll-behavior: auto;
  }
}


/* Ensure toolbar buttons are visible even if theme hides buttons globally */
.a11y-toolbar button{
  display: inline-flex !important;
}


/* High-contrast: pricing plans (telefonia) */
html.a11y-contrast .plan,
html.a11y-contrast .plan-header,
html.a11y-contrast .plan-body,
html.a11y-contrast .plan .list-group-item{
  background: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
}
html.a11y-contrast .plan .list-group-item::after{
  background-color: #fff !important;
  opacity: 0.35;
}
html.a11y-contrast .plan-title,
html.a11y-contrast .price-figure,
html.a11y-contrast .price-term,
html.a11y-contrast .jm-line-th{
  color: #fff !important;
}


/* Toolbar placement: top-right below fixed navbar if present */
@media (max-width: 480px){
  .a11y-toolbar{
    right: 8px;
    padding: 8px;
  }
  .a11y-btn{
    padding: 7px 10px;
    font-size: 15px;
  }
}

/* Visually hidden text for screen readers */
.a11y-sr-only{
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
