/* ==========================================================================
   Base: webfonts, reset, element defaults
   ========================================================================== */

/* ---- self-hosted webfonts (latin-ext subset covers Slovak diacritics) ---- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fraunces/fraunces-v38-latin_latin-ext-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fraunces/fraunces-v38-latin_latin-ext-600.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/fraunces/fraunces-v38-latin_latin-ext-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/karla/karla-v33-latin_latin-ext-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/karla/karla-v33-latin_latin-ext-700.woff2") format("woff2");
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem);
  /* rotovaný dekoratívny pás mierne presahuje okraj — orežeme vodorovné
     pretečenie; "clip" (nie "hidden") zachová sticky hlavičku a zvislý skrol */
  overflow-x: clip;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-espresso);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  /* rotované dekoratívne prvky (pás) presahujú okraj — orežeme vodorovné
     pretečenie; "clip" (nie "hidden") zachová sticky hlavičku */
  overflow-x: clip;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.15;
  color: var(--color-espresso);
  text-wrap: balance;
}

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

p {
  max-width: 65ch;
}

a {
  color: var(--color-burgundy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-burgundy-dark);
}

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

button {
  font: inherit;
  cursor: pointer;
}

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

::selection {
  background-color: var(--color-burgundy);
  color: var(--color-white);
}

/* ---- skip link ---- */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-burgundy);
  color: var(--color-white);
  font-weight: 700;
  transform: translateY(-120%);
  transition: transform var(--duration-quick) ease;
}

.skip-link:focus {
  transform: translateY(0);
  color: var(--color-white);
}

/* ---- utilities ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
