@font-face {
  font-family: "CustomFont";
  src: url('../fonts/AbrilFatface-Italic.woff2') format('woff2'),
       url('../fonts/AbrilFatface-Italic.woff') format('woff'),
       url('../fonts/AbrilFatface-Italic.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --ff-heading: "CustomFont", Georgia, serif;
  --ff-body: Georgia, "Times New Roman", serif;
  --fs-heading: clamp(2.5rem, 4vw + 1rem, 4rem);
  --fs-body: clamp(1rem, 1vw + 0.3rem, 1.5rem);
  --text-width: 680px;
  --text-pad-x: clamp(22px, 5vw, 40px);
  --text-pad-y: clamp(44px, 7vw, 72px);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body {
  overflow-x: hidden;
  background: #fff;
  color: #000;
}

img,
video {
  display: block;
}

/* FULL-BLEED WORKS — deliberately fill the viewport like the original site. */
.blurry {
  width: 100vw;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.screen {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  object-fit: cover;
  object-position: center;
}

/* PORTRAIT / NATURAL-RATIO WORKS — full browser width, no artificial side margin. */
.portrait {
  width: 100vw;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.responsive {
  width: 100vw;
  height: auto;
}

/* INTENTIONALLY INSET WORKS — retain the visual rhythm of the old site. */
.inne,
.och {
  width: 61vw;
}

.tredje,
.sist {
  width: 41vw;
}

.inne,
.tredje {
  margin-inline: auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.och,
.sist {
  height: auto;
  margin-inline: auto;
}

/*
   Progressive image reveal.
   Images are visible by default. JS only hides an image while it is genuinely
   still loading, so an old/odd phone can never get stuck on an invisible work.
*/
.js .blurry.is-loading > img,
.js .portrait.is-loading > img,
.js .inne.is-loading > img,
.js .tredje.is-loading > img {
  opacity: 0;
}

.blurry > img,
.portrait > img,
.inne > img,
.tredje > img {
  opacity: 1;
  transition: opacity 700ms ease-in-out;
}

/* Once the real image is ready, remove the tiny placeholder completely. */
.blurry.loaded,
.portrait.loaded,
.inne.loaded,
.tredje.loaded {
  background-image: none !important;
}

/* TEXT — same quiet character, less CSS and more controlled line length. */
.rad.text {
  width: min(100%, var(--text-width));
  margin-inline: auto;
  padding: var(--text-pad-y) var(--text-pad-x) 0;
  text-align: center;
  color: #000;
}

.rad.text + .rad.text {
  padding-top: 28px;
  padding-bottom: var(--text-pad-y);
}

h2,
h3,
p {
  margin: 0;
}

h2 {
  font-family: var(--ff-heading);
  font-size: var(--fs-heading);
  font-weight: normal;
  line-height: 1;
  text-align: center;
}

h3 {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: normal;
  line-height: 1.75;
}

.italic {
  font-family: var(--ff-body);
  font-style: italic;
}

.skriv {
  max-width: 100%;
}

/* VIDEO keeps the original full-width presentation. */
.hero {
  width: 100vw;
  position: relative;
}

video {
  width: 100vw;
  height: auto;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

@media (max-width: 1242px) {
  /* This matches the old site's mobile/tablet behavior: full-width works
     become natural-height rather than forced to a tall viewport crop. */
  .screen {
    width: 100vw;
    height: auto;
  }

  .inne,
  .och,
  .tredje,
  .sist {
    width: 75vw;
  }
}

@media (max-width: 600px) {
  .rad.text {
    width: min(100%, 36rem);
  }

  h3 {
    line-height: 1.65;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blurry > img,
  .portrait > img,
  .inne > img,
  .tredje > img {
    transition: none;
  }
}
