/* Accessibility: font size switcher (3 steps) */

:root {
  /* Base font size slightly increased */
  --font-base: 17px;
}

html {
  font-size: var(--font-base);
}

/* Ensure the whole document uses the html base size */
body, main {
  font-size: inherit;
}

/* Steps: 1=base, 2=+1px, 3=+2px */
html[data-fontscale="1"] { font-size: 17px; }
html[data-fontscale="2"] { font-size: 18px; }
html[data-fontscale="3"] { font-size: 19px; }

/* Simple UI styling */
.fontsize-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-left: 10px;
}

.fontsize-switch button {
  appearance: none;
  font: inherit;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 6%);
  color: inherit;
  cursor: pointer;
}

.fontsize-switch button[aria-pressed="true"] {
  background: rgb(255 255 255 / 14%);
  border-color: rgb(255 255 255 / 34%);
}

/* Light backgrounds fallback */
@media (prefers-color-scheme: light) {
  .fontsize-switch button {
    border-color: rgb(0 0 0 / 18%);
    background: rgb(0 0 0 / 4%);
  }

  .fontsize-switch button[aria-pressed="true"] {
    background: rgb(0 0 0 / 8%);
    border-color: rgb(0 0 0 / 24%);
  }
}

/* Footer toggle button */
.font-toggle{
  margin-left:6px;
  padding:4px 8px;
  border-radius:8px;
  border:1px solid rgb(255 255 255 / 22%);
  background: rgb(255 255 255 / 6%);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

@media (prefers-color-scheme: light){
  .font-toggle{
    border-color: rgb(0 0 0 / 18%);
    background: rgb(0 0 0 / 4%);
  }
}

.font-toggle:focus{
  outline:2px solid rgb(102 179 255 / 70%);
  outline-offset: 2px;
}

.font-toggle:focus:not(:focus-visible){
  outline:none;
}

.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;
}
