/**
 * DH Suite — CSS Reset / Normalize
 *
 * Normalizes browser defaults and removes inconsistencies.
 * Does NOT apply design-token-based styling — see base.css for that.
 *
 * Based on patterns already in use across Reach, Respond, and Rally.
 */

/* Cascade layer ordering — loaded first, controls specificity priority.
   Layers listed earlier have LOWER priority; later layers override earlier.
   Unlayered styles (e.g., app-specific CSS) override all layers. */
@layer reset, base, layout, components, utilities;

@layer reset {

/* --- Box Sizing --------------------------------------------------------- */

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

/* --- Document ----------------------------------------------------------- */

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    line-height: 1.15;
    -webkit-tap-highlight-color: transparent;
}

/* --- Sections ----------------------------------------------------------- */

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* --- Grouping Content --------------------------------------------------- */

hr {
    box-sizing: content-box;
    height: 0;
    overflow: visible;
    border: 0;
    border-top: 1px solid;
}

pre {
    font-family: monospace, monospace;
    font-size: 1em;
}

/* --- Text-Level Semantics ----------------------------------------------- */

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
    border-bottom: 0;
}

b,
strong {
    font-weight: bolder;
}

code,
kbd,
samp {
    font-family: monospace, monospace;
    font-size: 1em;
}

small {
    font-size: 80%;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

/* --- Embedded Content --------------------------------------------------- */

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

img {
    border-style: none;
}

/* --- Headings & Paragraphs ---------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

p {
    margin: 0;
}

/* --- Lists -------------------------------------------------------------- */

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- Tables ------------------------------------------------------------- */

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

/* --- Forms -------------------------------------------------------------- */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: 1.15;
    margin: 0;
}

button,
input {
    overflow: visible;
}

button,
select {
    text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
    -webkit-appearance: button;
    appearance: button;
    cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
    border-style: none;
    padding: 0;
}

fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

legend {
    padding: 0;
    display: table;
    max-width: 100%;
    white-space: normal;
}

progress {
    vertical-align: baseline;
}

textarea {
    overflow: auto;
    resize: vertical;
}

[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

[type="search"] {
    -webkit-appearance: textfield;
    appearance: textfield;
    outline-offset: -2px;
}

[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

::-webkit-file-upload-button {
    -webkit-appearance: button;
    font: inherit;
}

/* --- Interactive -------------------------------------------------------- */

summary {
    display: list-item;
    cursor: pointer;
}

details {
    display: block;
}

/* --- Accessibility ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Remove default focus outline — components should apply their own
   using the focus tokens from design-tokens.css */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--focus-ring-color, #3b82f6);
    outline-offset: 2px;
}

} /* end @layer reset */
