/* ============================================================
   UNIVERSAL CSS RESET
   Covers: icons, favicons, Font Awesome, divs, links,
           images, articles — cross-browser & cross-device
   Browsers: Chrome, Edge, Safari, Opera, Firefox
   ============================================================ */


/* ── 1. BOX MODEL ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;  /* padding/border never inflate element size */
  margin: 0;
  padding: 0;
}


/* ── 2. ROOT & HTML ───────────────────────────────────────── */
:root {
  /* Prevents layout shift from scrollbar appearing/disappearing */
  scrollbar-gutter: stable;
  /* Smooth scrolling (respects user preference below) */
  scroll-behavior: smooth;
  /* Prevent font-size inflation on mobile (iOS Safari) */
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  height: 100%;
  /* Consistent tab-size across browsers */
  tab-size: 4;
  -moz-tab-size: 4;
}


/* ── 3. BODY ──────────────────────────────────────────────── */
body {
  min-height: 100%;
  line-height: 1.5;            /* readable default */
  -webkit-font-smoothing: antialiased;    /* macOS/iOS Chrome & Safari */
  -moz-osx-font-smoothing: grayscale;    /* Firefox macOS */
  text-rendering: optimizeLegibility;
}


/* ── 4. TYPOGRAPHY ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

p, blockquote, pre, address, figure, figcaption,
dl, dd, ol, ul, li, hr {
  margin: 0;
  padding: 0;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote::before,
blockquote::after,
q::before,
q::after {
  content: '';
  content: none;
}

b, strong {
  font-weight: bolder;     /* consistent across browsers */
}

small {
  font-size: 80%;
}

sub, sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
sub { bottom: -0.25em; }
sup { top: -0.5em; }

abbr[title] {
  text-decoration: underline dotted;  /* Safari 12+ fix */
  cursor: help;
  border-bottom: none;
}

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Consolas,
               'Liberation Mono', Menlo, monospace;
  font-size: 1em;
}

pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

hr {
  border: none;
  border-top: 1px solid currentColor;
  color: inherit;
  height: 0;
  overflow: visible;
}


/* ── 5. LINKS ─────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;       /* remove underline globally */
  background-color: transparent;
  /* Remove tap highlight on iOS */
  -webkit-tap-highlight-color: transparent;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}


/* ── 6. IMAGES & MEDIA ────────────────────────────────────── */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;          /* never overflow parent */
  height: auto;             /* preserve aspect ratio */
}

img {
  border-style: none;       /* IE 10 fix */
  /* Prevent dragging images accidentally */
  -webkit-user-drag: none;
  user-select: none;
  /* Crisp rendering for icons/logos */
  image-rendering: -webkit-optimize-contrast; /* Safari */
  image-rendering: crisp-edges;              /* Firefox */
}

/* Favicons served via <link> don't need CSS,
   but if you embed them as <img> this covers it. */
img[src$=".ico"],
img[src$=".png"][width="16"],
img[src$=".png"][width="32"] {
  image-rendering: pixelated;   /* keeps small icons sharp */
}


/* ── 7. ICONS & FONT AWESOME ──────────────────────────────── */
/* Ensure icon fonts load before content is shown */
.fa, .fas, .far, .fal, .fab, .fad,
[class^="fa-"], [class*=" fa-"],
[class^="icon-"], [class*=" icon-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Prevent icon text from being selected */
  user-select: none;
  -webkit-user-select: none;
  /* Prevents icon scaling issues */
  line-height: 1;
  vertical-align: middle;
  /* Smooth rendering on all OSes */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  speak: never;           /* hide from screen readers */
}

/* SVG icons */
svg {
  overflow: hidden;         /* IE fix */
  fill: currentColor;       /* inherits text color by default */
  flex-shrink: 0;           /* prevents squishing inside flex containers */
}

svg:not(:root) {
  overflow: hidden;
}

/* Icon inside a button/link — keeps alignment */
button > svg,
a > svg {
  pointer-events: none;
}


/* ── 8. DIVS & LAYOUT CONTAINERS ─────────────────────────── */
div, section, aside, nav, header, footer, main,
article, figure, figcaption, details, summary {
  display: block;
}

/* Preserve font in all containers */
div, section, aside, nav, header, footer, main {
  font: inherit;
}


/* ── 9. ARTICLE ───────────────────────────────────────────── */
article {
  display: block;
  max-width: 100%;
  overflow-wrap: break-word;    /* long words won't overflow */
  word-break: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

article img {
  max-width: 100%;
  height: auto;
}


/* ── 10. TABLES ───────────────────────────────────────────── */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th, td {
  padding: 0;
  text-align: left;
  vertical-align: top;
}


/* ── 11. FORMS & INTERACTIVE ELEMENTS ────────────────────── */
button,
input,
select,
textarea,
optgroup {
  font: inherit;             /* always inherit font from parent */
  margin: 0;
  padding: 0;
  line-height: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

textarea {
  resize: vertical;          /* only allow vertical resize */
  overflow: auto;
}

[type="search"] {
  outline-offset: -2px;      /* Safari fix */
  -webkit-appearance: textfield;
}

::-webkit-search-decoration {
  -webkit-appearance: none;
}

::-webkit-file-upload-button {
  -webkit-appearance: button;
  font: inherit;
}

/* Remove inner padding in Firefox */
::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

/* Fix number input spinners in Chrome/Safari */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  height: auto;
}

fieldset {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
}

label {
  cursor: pointer;
}

select {
  word-wrap: normal;
}


/* ── 12. ACCESSIBILITY ────────────────────────────────────── */
/* Visible focus ring for keyboard users only */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Remove focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Hidden but accessible */
.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;
}

[hidden] {
  display: none !important;
}


/* ── 13. RESPONSIVE MEDIA ─────────────────────────────────── */
/* Fluid images and embeds */
img,
embed,
object,
video,
audio,
iframe {
  max-width: 100%;
}

iframe {
  border: none;
}


/* ── 14. POINTER & TOUCH ──────────────────────────────────── */
/* Remove 300ms tap delay (older mobile browsers) */
a, button, input, select, textarea, label, summary {
  touch-action: manipulation;
}

/* Prevent text selection on UI elements */
button, label {
  user-select: none;
  -webkit-user-select: none;
}


/* ── 15. PRINT ────────────────────────────────────────────── */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  img {
    page-break-inside: avoid;
    max-width: 100% !important;
  }

  article,
  section {
    page-break-inside: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }
}