/* ==========================================================================
   CERAK Vranje — reset + base typography
   ========================================================================== */

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

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-behavior:smooth;
  /* scroll-padding keeps anchor targets clear of the fixed header */
  scroll-padding-top:calc(var(--header-h) + 1rem);
  -webkit-tap-highlight-color:transparent;
}
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto;} }

body{
  font-family:var(--font-body);
  font-size:var(--fs-base);
  line-height:var(--lh-normal);
  color:var(--fg);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-synthesis-weight:none;
  overflow-x:hidden;            /* belt-and-braces against horizontal overflow */
  min-height:100vh;
  min-height:100svh;
}
/* Padding so fixed mobile chrome never covers page content or submit buttons */
body{ padding-bottom:calc(var(--tabbar-h) + var(--safe-bottom)); }

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

/* No blanket `svg{fill:currentColor}`. A CSS rule beats a presentation
   attribute, so such a rule filled every closed shape in the stroke icon set —
   rects became solid red/grey squares in the tab bar, the product cards and the
   mega menu. Icons are stroke-only and say so here, for the svg AND every
   descendant, so nothing can leak a fill back in. */
.icon,.icon *{fill:none;stroke:currentColor;}
/* The two deliberately solid glyphs (play triangle, facebook) opt back in. */
.icon .icon-fill,.icon.icon-fill{fill:currentColor;stroke:none;}

/* DEFAULT ICON SIZE — do not remove.
   icons.js emits `<svg class="icon" viewBox="0 0 24 24">` with no width/height.
   An inline SVG that has a viewBox but no intrinsic size resolves to width:100%
   of its container, so any `data-icon` span whose ancestor had no `.X .icon`
   rule rendered as a giant outline filling the whole card — the product and
   service cards on proizvodi/usluge were ~270px red glyphs clipped by the card
   edge. 1844 of the 4900 icon spans on the site carry no sizing class.
   Every component rule (`.btn .icon`, `.tab .icon`, …) is specificity 0,2,0 and
   still wins over this 0,1,0 default, so nothing that was already correct
   changes. */
.icon{width:24px;height:24px;flex:none;display:inline-block;vertical-align:middle;}

input,button,textarea,select{font:inherit;color:inherit;}
button{background:none;border:0;cursor:pointer;}

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

a{color:inherit;text-decoration:none;}
p a:not(.btn){
  text-decoration:underline;
  text-underline-offset:.18em;
  text-decoration-thickness:1px;
  text-decoration-color:var(--red-500);
}
p a:not(.btn):hover{color:var(--red-600);}

/* ---- Headings ----
   text-wrap:balance evens the line lengths and kills single-word last lines
   (widows), which was the main reason v1 headings read as ragged. Chrome caps
   balancing at 6 lines, which is above our 4-line budget. */
h1,h2,h3,h4,h5,h6,.section-head__title,.hero__title,.page-hero__title{
  font-family:var(--font-display);
  font-weight:700;
  line-height:var(--lh-tight);
  letter-spacing:var(--ls-tight);
  text-wrap:balance;
}
h3,h4,h5,h6{line-height:var(--lh-snug);}
h1{font-size:var(--fs-4xl);letter-spacing:var(--ls-tighter);}
h2{font-size:var(--fs-3xl);letter-spacing:var(--ls-tighter);}
h3{font-size:var(--fs-2xl);}
h4{font-size:var(--fs-xl);}
h5{font-size:var(--fs-lg);}
h6{font-size:var(--fs-base);}

p{text-wrap:pretty;}
strong,b{font-weight:600;}

/* ---- Mono label: the Swiss/technical voice of the system ---- */
.mono{
  font-family:var(--font-mono);
  font-size:var(--fs-mono);
  letter-spacing:var(--ls-mono);
  text-transform:uppercase;
  font-weight:500;
  font-variant-numeric:tabular-nums;
}
.mono--num{text-transform:none;letter-spacing:.04em;}
.tnum{font-variant-numeric:tabular-nums;}

/* ---- Accessibility ---- */
.skip-link{
  position:absolute;top:-100px;left:var(--space-4);z-index:1000;
  background:var(--ink);color:#fff;padding:.75rem 1.25rem;border-radius:var(--r-sm);
  font-family:var(--font-mono);font-size:var(--fs-xs);letter-spacing:.08em;
  text-transform:uppercase;transition:top var(--t-fast) var(--e-out);
}
.skip-link:focus{top:calc(var(--safe-top) + var(--space-3));}

:focus-visible{
  outline:2px solid var(--red-500);
  outline-offset:3px;
  border-radius:var(--r-xs);
}
/* Never remove focus for keyboard users; only suppress the mouse-click ring */
:focus:not(:focus-visible){outline:none;}

/* Every declaration is !important on purpose: this utility is applied to form
   controls that more specific rules (e.g. `.field input{width:100%}`) would
   otherwise stretch to full width, pushing the page into horizontal overflow. */
.visually-hidden{
  position:absolute!important;
  width:1px!important;height:1px!important;
  min-width:0!important;min-height:0!important;
  padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  white-space:nowrap!important;border:0!important;
  appearance:none!important;
}

/* fieldset defaults to min-width:min-content, which stops it shrinking inside
   grid/flex parents and is a classic source of horizontal overflow. */
fieldset{min-width:0;border:0;padding:0;margin:0;}

/* ---- Selection ---- */
::selection{background:var(--red-500);color:#fff;}

/* ---- Scrollbar (desktop only, subtle) ---- */
@media (pointer:fine){
  ::-webkit-scrollbar{width:10px;height:10px;}
  ::-webkit-scrollbar-track{background:var(--mist);}
  ::-webkit-scrollbar-thumb{background:var(--steel-200);border-radius:var(--r-pill);
    border:2px solid var(--mist);}
  ::-webkit-scrollbar-thumb:hover{background:var(--steel-400);}
}

/* ---- Global reduced-motion contract ----
   Content must never depend on animation to become visible. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}

/* ---- No-JS contract: reveal-gated content is visible unless JS says otherwise.
   .js is set on <html> by core.js, so without JS nothing stays hidden. ---- */
.js [data-reveal]{opacity:0;}
@media (prefers-reduced-motion:reduce){
  .js [data-reveal]{opacity:1;}
}

/* ---- Print ---- */
@media print{
  .site-header,.tabbar,.fab,.preloader,.assistant,.cta-band{display:none!important;}
  body{padding:0;color:#000;background:#fff;}
  a[href^="http"]::after{content:" (" attr(href) ")";font-size:.75em;}
}
