/* BASE: Reset, defaults, accessibility
   Keep this file minimal and neutral.
   =========================== */

/* 1) Box-sizing: border-box for predictable sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2) Remove default margins on structural elements */
html, body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote,
dl, dd, ul, ol {  margin: 0; }

/* 3) Body defaults (colors and fonts come from theme.css) */
html:focus-within { scroll-behavior: smooth; /* enhance anchor scroll */
}
body {
  min-height: 100vh;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 4) Lists */
ul, ol {
  padding-left: 1.25rem; /* readable default; theme.css overrides for content lists */
}
li { margin: 0; }

/* 5) Headings: inherit font-weight/size from theme.css */
h1, h2, h3, h4, h5, h6 { font-weight: inherit; }

/* 6) Images, media */
img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
  border: 0;
  vertical-align: middle; /* helps with inline placement */
}

/* 7) Anchors */
a {
  text-decoration: none;
  color: inherit; /* theme.css will set link colors */
}
a:hover, a:focus { text-decoration: underline; }

/* 8) Forms (basic normalization) */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
}
textarea { resize: vertical; }

/* 9) Tables: neutral baseline; theme.css adds visual style */
table {
  border-collapse: collapse;
  width: 100%;
}
th, td { text-align: left; vertical-align: top; }

/* 10) Accessibility: focus-visible ring for keyboard users */
:focus-visible {
  outline: 2px solid #5B9BFF; /* neutral focus; can be themed later */
  outline-offset: 2px;
}
:focus { outline: none; } /* rely on :focus-visible */

/* 11) Selection color (subtle) */
::selection {
  background: rgba(155, 188, 255, 0.4);
}

/* 12) Smooth anchor offset helpers (if you have sticky headers) */
/* Example usage: add class="anchor-offset" on #top if a sticky header overlaps anchors */
.anchor-offset {
  scroll-margin-top: 80px; /* adjust if your header height differs */
}

/* 13) Visually hidden utility (accessible to screen readers) */
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* 14) Content width helper (optional) */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 20px;
}

/* 15) Spacing utilities (small set; extend as needed) */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mb-2 { margin-bottom: 1rem !important; }

/* 16) Text utilities */
.text-center { text-align: center !important; }
.text-right  { text-align: right !important; }
.text-left   { text-align: left !important; }

/* 17) Print baseline (visual styles live in print.css/theme.css) */
@media print {
  *, *::before, *::after { box-sizing: border-box; }
  body { line-height: 1.3; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 90%; }
  img { page-break-inside: avoid; }
}
