/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  font-family: var(--font-family-base);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  line-height: var(--line-height-body);
  transition: background-color var(--transition-fast), color var(--transition-fast);
  /* Keep manual browser zoom available while preserving text adjustment. */
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height, 80px) + var(--space-md));
  overflow-x: clip;
}

body {
  min-height: 100vh;
  /* Always show scrollbar to prevent layout shift */
  overflow-y: visible;
  overflow-x: clip;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: var(--line-height-heading);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
p { margin-bottom: var(--space-md); }

/* Focus Management (A11Y) */
:focus:not(:focus-visible) {
  outline: none;
}

[tabindex="-1"]:focus {
  outline: none !important;
}

input:focus,
button:focus,
[role="button"]:focus {
  outline: none;
}

:focus-visible,
input:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.focus-outline-ring:focus-visible {
  outline: 2px solid #55c7e8;
  outline-offset: 2px;
  border-radius: 4px;
}

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

a:hover {
  text-decoration: underline;
}

/* Underline Links Accessibility Mode */
.link-underlines a:not(.btn):not([class*="btn-"]):not(.page-link):not(.category-btn) {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Buttons Reset */
button {
  font-family: inherit;
  font-size: var(--font-size-body);
  background: none;
  border: none;
  cursor: pointer;
}

/* Images & Media */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utility Classes */
.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;
}

.sr-only-focusable:focus, .sr-only-focusable:focus-visible {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  margin: 0;
}
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-sm);
  z-index: 9999;
}

/* Simple Hidden state */
.hidden {
  display: none !important;
}

button:disabled {
  cursor: not-allowed;
}
