/* ==========================================================================
   base.css – reset si stiluri pentru elemente HTML simple
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* fara scroll orizontal */
  background-color: var(--color-bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; /* Safari */
  user-select: none;
  animation: page-in var(--transition-page) backwards;
  transition: opacity var(--transition-page);
  display: flex;
  flex-direction: column;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
  -webkit-touch-callout: none
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: var(--line-height-heading);
}

:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 4px;
}

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

/* ---------- Scrollbar ---------- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar-thumb) var(--color-bg);
}

/* Safari (nu suportă încă scrollbar-color pe toate versiunile) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--color-scrollbar-thumb);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ---------- Tranziție între pagini ---------- */
body.is-leaving {
  opacity: 0;
}

@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

[hidden] {
  display: none !important;
}

.is-selectable {
  -webkit-user-select: text;
  user-select: text;
}