/* ==========================================================================
   Reset dhe elementet bazë
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

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; }

h1, h2, h3, h4, h5, h6 {
  line-height: var(--lh-tight);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.015em;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

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

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-6) 0;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-text);
}

@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;
  }
}

/* ---------- layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.container-sm { max-width: var(--container-sm); }
.container-wide { max-width: 1600px; }

.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-8); }

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.row-between { justify-content: space-between; }
.row-wrap { flex-wrap: wrap; }
.row-top { align-items: flex-start; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }

.spacer { flex: 1; }

/* ---------- tipografia ndihmese ---------- */
.title-xl { font-size: var(--fs-4xl); line-height: 1.1; letter-spacing: -0.03em; }
.title-lg { font-size: var(--fs-3xl); }
.title    { font-size: var(--fs-2xl); }
.subtitle { font-size: var(--fs-lg); color: var(--text-muted); font-weight: var(--fw-normal); }
.text-sm  { font-size: var(--fs-sm); }
.text-xs  { font-size: var(--fs-xs); }
.muted    { color: var(--text-muted); }
.subtle   { color: var(--text-subtle); }
.strong   { font-weight: var(--fw-semibold); }
.center   { text-align: center; }
.right    { text-align: right; }
.nowrap   { white-space: nowrap; }
.mono     { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clamp-2, .clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .container { padding-inline: var(--sp-4); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .title-xl { font-size: var(--fs-2xl); }
  .title-lg { font-size: var(--fs-xl); }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
}

/* ==========================================================================
   Atributi `hidden` duhet te fitoje gjithmone.
   Cdo rregull i yni qe cakton `display` e anulon rregullin e parazgjedhur te
   shfletuesit, ndaj nje element me `hidden` do te vazhdonte te dukej. Kjo eshte
   e lehte per t'u humbur nga sysh, sepse HTML-ja duket e sakte.
   ========================================================================== */

[hidden] {
  display: none !important;
}
