/* Reset, element defaults, utilities (.sr), reduced-motion. */

*,
*::before,
*::after {
  box-sizing:border-box;
}
html {
  scroll-behavior:smooth;
}
body {
  margin:0;
  overflow-x:clip;
  font-family:var(--font-body,'Tajawal',system-ui,sans-serif);
  background:var(--bg-base);
  color:var(--slate-800);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
a {
  color:inherit;
  text-decoration:none;
}
img {
  max-width:100%;
}
svg {
  display:block;
  flex-shrink:0;
}
:focus-visible {
  outline:2px solid var(--primary);
  outline-offset:3px;
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important;
  }
}

html {
  scroll-padding-top:calc(var(--header-h) + 1rem);
}
.sr {
  position:absolute;
  width:1px;
  height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
}
h1,
h2 {
  font-family:var(--font-display);
  color:var(--slate-900);
}

/* Author display rules must never beat the hidden attribute */
[hidden] {
  display:none!important;
}

/* A native <audio> control has an intrinsic minimum width of about 300px, which width:100% does not override; without
   min-width:0 it is what makes a narrow card scroll sideways on a phone. */
audio,
video {
  max-width:100%;
  min-width:0;
}

/* iOS zooms the page in when it focuses a field whose text is under 16px, and never zooms back out. */
@media (max-width:30rem) {
  input,
  select,
  textarea {
    font-size:max(16px,1rem);
  }
}
