/* ==========================================================================
   Nymölla Skog – base styles
   Modern reset, self-hosted @font-face, global type, layout primitives.
   ========================================================================== */

/* ---- Self-hosted fonts (variable, latin + latin-ext incl. å ä ö) ---- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2-variations");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-var.woff2") format("woff2-variations");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-page-bg);
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
}

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

/* ---- Headings ---- */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-heading);
  color: var(--color-heading);
  text-wrap: balance;
}

/* ---- Layout ---- */
.ns-container {
  width: 100%;
  max-width: calc(var(--container-max) + (var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---- Utilities ---- */
.ns-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Text selection (PM brief: rust instead of the browser default) ---- */
::selection {
  background: var(--ns-rust);
  color: var(--ns-beige-light);
}

/* ---- Focus & motion (derived decisions, see psd-spec.md) ---- */
:focus-visible {
  outline: 2px solid var(--focus-ring-light-bg);
  outline-offset: 3px;
}

/* Anchor-jump targets (smooth-scroll.js moves focus to the target heading so
   screen readers land there) shouldn't show the focus ring when the jump was
   triggered by a tap/click — only for keyboard activation. */
.ns-jump-target:focus-visible:not(.ns-jump-target--keyboard) {
  outline: none;
}

/* Dark backgrounds use the light focus ring. .cc_div is the cookie consent
   banner (assets/css/cookieconsent.css) — its modal bg is --ns-green-dark. */
.ns-header :focus-visible,
.ns-hero :focus-visible,
.ns-map__card :focus-visible,
.cc_div :focus-visible {
  outline-color: var(--focus-ring-dark-bg);
}

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