/* Modern CSS Reset — Editorial Precision */

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

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  tab-size: 4;
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  line-height: inherit;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

fieldset {
  border: none;
}

dialog {
  padding: 0;
  border: none;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-primary);
  color: var(--surface-base);
}

/* Utility: hidden — used by Stimulus controllers to toggle visibility */
.hidden {
  display: none !important;
}

/* Canonical: HTML's [hidden] attribute always wins, regardless of which
   component CSS sets `display`. The UA stylesheet's `[hidden] { display: none }`
   has attribute-selector specificity (0,1,0) and is clobbered by any
   class-selector display rule (e.g. .copy-field { display: flex }).
   Marking the rule !important here ensures the HTML semantic always works
   so the field-reveal pattern (and every other Stimulus reveal/hide)
   composes reliably. */
[hidden] {
  display: none !important;
}

/* Skip navigation link — visible only on focus */
.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background: var(--accent-primary);
  color: var(--surface-base);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  transition: top var(--duration-fast) var(--ease-out);
}
.skip-nav:focus {
  top: var(--space-4);
}

/* Remove default spinner for number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* Material Symbols — icon font configuration */
.material-symbols-rounded {
  font-variation-settings:
  'FILL' 0,
  'wght' 300,
  'GRAD' -25,
  'opsz' 20
}

/* SVG icon utility */
.svg-icon {
  fill: currentColor;
  width: 18px;
  height: 18px;
  display: inline-block;
  font-size: 18px;
}
