/**
 * Base element styles and resets. Loaded after tokens.css.
 */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-family-base);
  font-size: var(--text-base);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: var(--line-height-tight);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-3);
}

h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-xl);
}

p {
  margin: 0 0 var(--space-4);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--color-link-hover);
}

/* Visible, high-contrast focus state for every interactive element.
   Never rely on :hover styling alone for keyboard users. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--color-focus-ring);
  border-radius: var(--radius-sm);
}

/* Numbers and calculator results must be highly readable and aligned. */
.calcoryn-numeric {
  font-family: var(--font-family-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.calcoryn-icon {
  width: 1.5em;
  height: 1.5em;
  flex-shrink: 0;
}

.calcoryn-container {
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.calcoryn-conversion-table__scroll {
  overflow-x: auto;
}

.calcoryn-conversion-table__table {
  width: 100%;
  border-collapse: collapse;
}

.calcoryn-conversion-table__table th,
.calcoryn-conversion-table__table td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border);
}

.calcoryn-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calcoryn-skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-primary-dark);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--motion-duration-base) var(--motion-easing);
}

.calcoryn-skip-link:focus {
  top: var(--space-4);
}
