/* ==========================================================================
   Digital Earth - CSS Reset / Normalize
   A modern CSS reset with sensible defaults
   ========================================================================== */

/* Box sizing rules */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent font size inflation */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Remove default margin and padding */
* {
  margin: 0;
  padding: 0;
}

/* Remove list styles on ul, ol elements with a list role */
ul[role='list'],
ol[role='list'] {
  list-style: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Remove all animations, transitions and smooth scroll for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove default fieldset styles */
fieldset {
  border: none;
}

/* Remove default legend styles */
legend {
  padding: 0;
}

/* Remove default table spacing */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Remove default quote styling */
blockquote,
q {
  quotes: none;
}

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

/* Hidden attribute support */
[hidden] {
  display: none !important;
}

/* Visually hidden (for screen readers) */
.visually-hidden,
.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;
}

/* Skip to content link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary, #0F766E);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 3px solid var(--color-accent-cool, #7DD3FC);
  outline-offset: 2px;
}

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

/* Scrollbar styling (optional, webkit only) */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-alt, #F5F5F4);
}

::-webkit-scrollbar-thumb {
  background: var(--color-stone, #78716C);
  border-radius: 6px;
  border: 3px solid var(--color-bg-alt, #F5F5F4);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-slate, #475569);
}

/* Selection styling */
::selection {
  background: var(--color-primary-200, #99F6E4);
  color: var(--color-primary-900, #134E4A);
}

/* Placeholder styling */
::placeholder {
  color: var(--color-text-muted, #78716C);
  opacity: 1;
}

/* Autofill styling */
:-webkit-autofill,
:-webkit-autofill:hover,
:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-text, #1C1917);
  -webkit-box-shadow: 0 0 0px 1000px var(--color-surface, #FFFFFF) inset;
  transition: background-color 5000s ease-in-out 0s;
}
