/***************************************************************************************************************
* MMRISK BASE STYLES
* Foundation for the design system
* 
* This file contains resets and additional base element styling that extends globals.css
* All design tokens and basic element styling now imported from globals.css
***************************************************************************************************************/

/*==============================================
* RESETS
* Modern CSS reset complementing globals.css
===============================================*/

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* Note: Main body styling now in globals.css */

/* Make images, videos, and embeds responsive */
img, picture, video, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Remove default styling from headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-heading);
  line-height: var(--line-height-tight);
  margin: 0;
}

/* Consistent heading sizes */
h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-3);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h6 {
  font-size: var(--font-size-md);
  margin-bottom: var(--space-2);
}

/* Remove list styling but maintain layout */
ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Set default link styles */
a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-600);
}

a:focus {
  outline: 2px solid var(--color-primary-300);
  outline-offset: 2px;
}

/* Paragraph spacing */
p {
  margin-bottom: var(--space-4);
  max-width: 70ch; /* Improves readability on large screens */
}

/* Default button reset */
button, input, optgroup, select, textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Focus styling for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
}

/* Visibility helper 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-width: 0;
}

/* Skip to main content link for accessibility */
.skip-link {
  position: absolute;
  top: -50px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--space-2) var(--space-4);
  z-index: var(--z-index-tooltip);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}
