/* TS Stansen AB – fristående version av stansen.se
   Typsnitt: Libre Baskerville (SIL Open Font License, se fonts/OFL.txt) */

@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/libre-baskerville-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/libre-baskerville-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Färger från gamla sidan */
:root {
  --green: #399583;
  --topbar: #2e3842;
  --footer: #1d242a;
}

/* Varje sektion har ett färgschema: --bg bakgrund, --fg text */
.scheme-b    { --bg: var(--green); --fg: #fff; --tint: rgba(0, 0, 0, .08); --tint2: rgba(0, 0, 0, .15); }
.scheme-f    { --bg: #fff;         --fg: #000; --tint: rgba(0, 0, 0, .04); --tint2: rgba(0, 0, 0, .08); }
.scheme-g    { --bg: #000;         --fg: #fff; --tint: rgba(255, 255, 255, .06); --tint2: rgba(255, 255, 255, .11); }
.scheme-even { --bg: #222;         --fg: #fff; }
[class*="scheme-"] { background: var(--bg); color: var(--fg); }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3.25rem;
}

body {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.75;
  color: #000;
  background: #fff;
}

img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0 0 1em;
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .225em;
}
h2 { font-size: 1.35em; }
p { margin: 0 0 1.5em; }
.pre { white-space: pre-line; }

/* ---------- Toppfält ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  align-items: center;
  height: 3.25rem;
  padding: 0 1.25rem;
  background: var(--topbar);
}
.topbar a {
  color: #fff;
  font-size: .85em;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .225em;
}

/* ---------- Toppbild ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6em 1rem;
  color: #fff;
  text-align: center;
  background-color: #2e3842;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.hero h1 {
  display: inline-block;
  margin: 0;
  padding: 1.35em 0 1.35em .5em; /* vänsterpadding väger upp letter-spacing */
  font-size: 2em;
  letter-spacing: .5em;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.hero p {
  margin: 2em 0 0;
  font-size: .8em;
  letter-spacing: .225em;
}
.hero-more {
  position: absolute;
  bottom: 2em;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-size: .75em;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .225em;
}
.hero-more span { font-size: 1.6em; line-height: 1.2; }

/* ---------- Sektioner ---------- */
.block { padding: 5em 0 4em; }
.inner {
  width: min(60em, 100% - 32px);
  margin: 0 auto;
}

header.major {
  margin-bottom: 3em;
  text-align: center;
}
header.major h2 {
  display: inline-block;
  margin-bottom: 1.25em;
}
header.major h2::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: .9em;
  background: currentColor;
  opacity: .25;
}
header.major .pre {
  max-width: 48em;
  margin: 0 auto;
}

/* ---------- Kort (exempel/produkter) ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cards li { background: var(--tint); }
.cards li:nth-child(4n+2),
.cards li:nth-child(4n+3) { background: var(--tint2); }

.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: -3px;
}
.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(0, 0, 0, .1);
  transition: opacity .2s;
}
.card:hover img { opacity: .9; }
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: .75em;
  padding: 2.5em;
}
.card-title {
  font-weight: 700;
  line-height: 1.5;
  text-transform: uppercase;
  letter-spacing: .225em;
}
.card-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  white-space: pre-line;
}
.card-more,
.button {
  display: inline-block;
  border-radius: 5px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .5);
}
.card-more {
  margin-top: .75em;
  padding: .3em 1em;
  font-size: .85em;
}
.button {
  padding: .9em 2.25em;
  font-size: .75em;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .225em;
}

/* ---------- Bild + text sida vid sida ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.split-media { min-height: 24em; }
.split-media iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 24em;
  border: 0;
}
.split-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.split-media.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2em;
  background: #fff;
}
.split-media.logos img {
  width: auto;
  height: auto;
  max-height: 32em;
  object-fit: contain;
}
.split-content {
  align-self: center;
  padding: 4em 3em;
}

/* ---------- Kontakt ---------- */
.contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5em 3.5em;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}
.contact li {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.contact .label {
  font-size: .75em;
  text-transform: uppercase;
  letter-spacing: .225em;
  opacity: .7;
}

/* ---------- Sidfot ---------- */
.footer {
  padding: 3em 1rem;
  background: var(--footer);
  color: rgba(255, 255, 255, .5);
  font-size: .75em;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .225em;
}

/* ---------- Bildruta när man klickar på ett kort ---------- */
dialog {
  width: min(56em, 100% - 32px);
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: #fff;
  color: #000;
  overflow: hidden;
}
/* Bilden krymper vid behov så att texten och stängknappen alltid syns */
dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog::backdrop { background: rgba(0, 0, 0, .8); }
body:has(dialog[open]) { overflow: hidden; }
dialog img {
  flex: 0 1 auto;
  width: 100%;
  min-height: 0;
  max-height: 70vh;
  object-fit: contain;
  background: #111;
}
.dialog-body {
  flex: 0 0 auto;
  max-height: 50vh;
  padding: 2em;
  overflow: auto;
}
.dialog-body h2 { font-size: 1.1em; }
.dialog-body p { margin: 0; }
.dialog-close {
  position: absolute;
  top: .5rem;
  right: .5rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Mobil ---------- */
@media (max-width: 736px) {
  body { font-size: 15px; }
  h2 { font-size: 1.1em; }
  .hero h1 {
    font-size: 1.35em;
    letter-spacing: .3em;
    padding-left: .3em;
  }
  .block { padding: 3.5em 0 3em; }
  .cards { grid-template-columns: 1fr; }
  .cards li:nth-child(n) { background: var(--tint); }
  .cards li:nth-child(even) { background: var(--tint2); }
  .card-body { padding: 1.75em 1.25em; }
  .split { grid-template-columns: 1fr; }
  .split-media,
  .split-media iframe { min-height: 18em; }
  .split-content { padding: 3em 16px; }
}

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