/* ============================================================
   Modern CSS Reset
   ============================================================
   Normalize browser defaults, establish box-sizing model,
   prevent overflow, and set accessibility foundations.
   ============================================================ */

/* ── Box Model ────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Document ─────────────────────────────────────────────── */
html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  font-family: var(--font-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  text-rendering: optimizeLegibility;
}

/* ── Media Elements ───────────────────────────────────────── */
img,
picture,
video,
canvas,
svg,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  font-family: var(--font-primary);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  color: var(--color-text);
}

p {
  overflow-wrap: break-word;
}

/* ── Links ────────────────────────────────────────────────── */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-primary-light);
}

/* ── Lists ────────────────────────────────────────────────── */
ul, ol {
  list-style: none;
}

/* ── Forms ────────────────────────────────────────────────── */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ── Table ────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove focus outline for mouse clicks, keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* ── Accessibility ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *:not(.ticker__content):not(.pub-scroll__track),
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen reader only utility */
.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;
}

/* ── Selection ────────────────────────────────────────────── */
::selection {
  background-color: var(--color-accent);
  color: var(--color-surface);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-background);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-light);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}
