/**
 * Design tokens (din docs/design-tokens.md). Contrast verificat:
 * #FFFFFF pe #0B1F3A = 15.8:1; #FFFFFF pe #142B52 = 11.9:1;
 * #142B52 pe #FFFFFF (text corp) = 11.9:1 — toate depășesc AA (4.5:1).
 */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF;
}

:root {
  --color-primary: #0B1F3A;
  --color-secondary: rgb(13, 45, 87);
  --color-accent: #B5121B;
  --color-accent-light: #FFADAD;
  --color-background: #0F2747;
  --color-surface: #FFFFFF;
  --color-text: #142B52;
  --color-text-on-dark: #FFFFFF;
  --color-border: #d5d9e0;
  --color-surface-muted: #f4f6f9;

  --radius-sm: 4px;
  --radius-md: 8px;

  --space-05: 4px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;

  --font-family: 'Onest', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --text-h1: 40px;
  --text-h2: 28px;
  --text-h3: 22px;
  --text-body: 16px;
  --text-small: 14px;

  --focus-ring: 3px solid #B5121B;

  /* File-type icons used in the document listing (documente_categorie view).
     Raster icons extracted from OFEDFQ1.eps (files/icons), mapped by MIME
     class in components.css. --icon-file-generic is the fallback. */
  --icon-file-pdf: url('/sites/default/files/icons/i25.png');
  --icon-file-word: url('/sites/default/files/icons/i23.png');
  --icon-file-docx: url('/sites/default/files/icons/i45.png');
  --icon-file-excel: url('/sites/default/files/icons/i43.png');
  --icon-file-ppt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Crect width='48' height='48' rx='10' fill='%23c43e1c'/%3E%3Ctext x='24' y='30' font-family='Arial,Helvetica,sans-serif' font-size='15' font-weight='700' fill='%23fff' text-anchor='middle'%3EPPT%3C/text%3E%3C/svg%3E");
  --icon-file-txt: url('/sites/default/files/icons/i04.png');
  --icon-file-png: url('/sites/default/files/icons/i10.png');
  --icon-file-jpg: url('/sites/default/files/icons/i11.png');
  --icon-file-rar: url('/sites/default/files/icons/i12.png');
  --icon-file-mp4: url('/sites/default/files/icons/i13.png');
  --icon-file-image: url('/sites/default/files/icons/i10.png');
  --icon-file-archive: url('/sites/default/files/icons/i40.png');
  --icon-file-generic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M14 4 H30 l8 8 V40 a4 4 0 0 1 -4 4 H14 a4 4 0 0 1 -4 -4 V8 a4 4 0 0 1 4 -4 Z' fill='none' stroke='%230B1F3A' stroke-width='3'/%3E%3Cpath d='M30 4 v8 h8 Z' fill='%230B1F3A'/%3E%3C/svg%3E");
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.6;
  font-size: var(--text-body);
}

h1, h2, h3, h4 {
  color: var(--color-primary);
  line-height: 1.2;
  font-weight: 700;
  margin: var(--space-4) 0 var(--space-2);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: 18px; }

small, .text-small { font-size: var(--text-small); }

p { margin: 0 0 var(--space-2); }

a {
  color: var(--color-secondary);
  text-underline-offset: 2px;
}

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

/* Always-visible focus ring, required for keyboard navigation. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

/* Text alignment utilities (used by DataTables and Views) */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -100px;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top 0.15s ease-in-out;
}

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