/* ============================================================
   nws.RO — CSS RESET
   Reset modern, minimal, bazat pe best practices.
   Normalizează comportamentul cross-browser.

   Autor: nrg evolution srl
   ============================================================ */

/* ── Box model universal ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Documentul HTML ── */
html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    tab-size: 4;
}

/* ── Body — fundament pentru layout ── */
body {
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height — mobil-safe */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
}

/* ── Media responsive implicit ── */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Formulare: moștenesc fontul ── */
input, button, textarea, select {
    font: inherit;
    color: inherit;
}

/* ── Textarea: doar vertical resize ── */
textarea {
    resize: vertical;
}

/* ── Butoane: reset complet ── */
button {
    cursor: pointer;
    border: none;
    background: none;
    -webkit-appearance: none;
    appearance: none;
}

/* ── Link-uri: reset stil ── */
a {
    color: inherit;
    text-decoration: none;
}

/* ── Liste: fără stil implicit ── */
ul, ol {
    list-style: none;
}

/* ── Headings: prevenire overflow ── */
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    text-wrap: balance;
}

/* ── Paragrafe: prevenire overflow ── */
p {
    overflow-wrap: break-word;
    text-wrap: pretty;
}

/* ── Tabele: collapse borders ── */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ── Elemente inline-block ── */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    padding: 0;
}

/* ── Summary cursor ── */
summary {
    cursor: pointer;
}

/* ── Dialog reset ── */
dialog {
    padding: 0;
}

/* ── Elimină decorațiile de pe search ── */
[type="search"]::-webkit-search-decoration,
[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

/* ── Elimină spinner de pe number inputs ── */
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
    height: auto;
}

/* ── Elimină clear button de pe IE/Edge ── */
input::-ms-clear {
    display: none;
}

/* ── Strong/b — ensure bold ── */
b, strong {
    font-weight: bolder;
}

/* ── Code — font mono ── */
code, kbd, samp, pre {
    font-family: var(--font-mono, 'SF Mono', 'Consolas', monospace);
    font-size: 1em;
}

/* ── Accessibility: focus vizibil ── */
:focus-visible {
    outline: var(--focus-ring-width, 2px) solid var(--focus-ring-color, var(--nws-primary, #010ED0));
    outline-offset: var(--focus-ring-offset, 2px);
}

/* Elimină outline la click (mouse) dar păstrează la keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* ── Skip to content link (accesibilitate) ── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 12px 24px;
    background: var(--nws-primary, #010ED0);
    color: white;
    font-weight: 700;
    font-size: 14px;
    border-radius: 0 0 var(--radius-sm, 4px) 0;
    transition: left 0.15s ease;
}

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

/* ── Reduce motion pentru utilizatori cu preferință ── */
@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;
    }
}
