/* ==========================================================================
   Fortura – design system
   1. Tokens   2. Base   3. Layout   4. Typography   5. Components
   6. Sections   7. Pages   8. Forms (contact + Formie)
   ========================================================================== */

/* Self-hosted variable fonts (latin subset), see web/static/fonts */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/newsreader.woff2') format('woff2');
}

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/newsreader-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/schibsted-grotesk.woff2') format('woff2');
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --orange: #dd5e1a;
  --orange-dark: #c24e12;
  --orange-light: #f09a63;
  --peach: #ffd2b3;
  --ink: #2a221c;
  --cream: #faf7f2;
  --sand: #f2ebe1;
  --sand-line: #ebe3d8;
  --line: #e3d9cc;
  --input-border: #d6cabb;
  --muted: #5a4d42;
  --muted-2: #7a6c60;
  --on-dark: #d9cfc3;
  --on-dark-muted: #a8998b;
  --dark-line: #4a3d33;
  --white: #fff;
  --error: #b3261e;

  --font-serif: 'Newsreader', Georgia, serif;
  --font-sans: 'Schibsted Grotesk', system-ui, sans-serif;

  --fs-h1: clamp(48px, 7vw, 92px);
  --fs-h1-page: clamp(48px, 6.5vw, 84px);
  --fs-h2: clamp(40px, 5vw, 64px);
  --fs-statement: clamp(30px, 3.6vw, 46px);
  --fs-doc-title: clamp(22px, 2.6vw, 32px);

  --radius-pill: 999px;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-float: 0 18px 40px -16px rgba(42, 34, 28, 0.28);

  --container: 1240px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-y: clamp(64px, 9vw, 112px);
  --header-offset: 96px;
}

/* 2. Base ------------------------------------------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

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

a {
  color: var(--orange-dark);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--ink);
}

h1,
h2,
h3,
p,
figure,
blockquote {
  margin: 0;
}

input,
textarea,
button {
  font: inherit;
}

em {
  font-style: italic;
  color: var(--orange);
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

[hidden] {
  display: none !important;
}

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

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

.section--dark {
  background: var(--ink);
  color: var(--cream);
}

.section--sand {
  background: var(--sand);
  padding-block: clamp(64px, 9vw, 104px);
}

.stack {
  display: flex;
  flex-direction: column;
}

.stack-6 { gap: 6px; }
.stack-12 { gap: 12px; }
.stack-16 { gap: 16px; }
.stack-18 { gap: 18px; }
.stack-20 { gap: 20px; }
.stack-28 { gap: 28px; }
.stack-32 { gap: 32px; }
.stack-36 { gap: 36px; }
.stack-48 { gap: 48px; }
.stack-56 { gap: 56px; }

/* Responsive auto-fit grid: --min is the narrowest column */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 320px)), 1fr));
  gap: var(--gap, 16px);
}

.grid--cards { --min: 260px; }
.grid--wide { --min: 340px; }

/* 4. Typography ------------------------------------------------------------ */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-dark);
}

.eyebrow--line::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--orange);
}

.eyebrow--on-dark { color: var(--orange-light); }
.eyebrow--muted { color: var(--muted-2); }

.display,
.heading,
.statement {
  font-family: var(--font-serif);
  font-weight: 400;
}

.display {
  font-size: var(--fs-h1);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.display--page { font-size: var(--fs-h1-page); }

.heading {
  font-size: var(--fs-h2);
  line-height: 1;
  letter-spacing: -0.02em;
}

.statement {
  font-size: var(--fs-statement);
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.title-serif {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
}

.title-serif--md { font-size: 28px; }
.title-serif--lg { font-size: 32px; }

.lead {
  font-size: 20px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 30em;
  text-wrap: pretty;
}

/* Rich text from the CMS */
.richtext {
  text-wrap: pretty;
}

.richtext > * + * { margin-top: 1em; }
.richtext strong { font-weight: 600; color: var(--ink); }
.richtext ul { padding-left: 1.2em; }
.richtext--lg { font-size: 18px; line-height: 1.65; color: var(--muted); }
.richtext--body { font-size: 17px; line-height: 1.65; color: var(--muted); }
.richtext--small { font-size: 15px; color: var(--muted-2); }
.richtext--muted { color: var(--muted); }

.section--dark .richtext { color: var(--on-dark); }
.section--dark .richtext strong { color: var(--white); }

/* 5. Components ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn--primary { background: var(--ink); color: var(--cream); }
.btn--primary:hover { background: var(--orange-dark); color: var(--white); }

.btn--outline { border-color: var(--input-border); color: var(--ink); }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }

.btn--light { background: var(--cream); color: var(--ink); }
.btn--light:hover { background: var(--peach); color: var(--ink); }

.btn--outline-light { border-color: var(--muted); color: var(--cream); }
.btn--outline-light:hover { border-color: var(--cream); color: var(--white); }

.btn--sm { padding: 10px 18px; }
.btn--block { display: flex; width: 100%; }
.contact-form .btn { align-self: flex-start; margin-top: 8px; }
.btn--arrow::after { content: '\00a0→'; }

.link-underline {
  font-weight: 500;
  color: var(--orange-dark);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.link-underline:hover { color: var(--ink); }

.card {
  border-radius: var(--radius-lg);
  padding: 32px;
}

.card--outline { border: 1px solid var(--line); }

.panel {
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 48px);
}

.panel--white { background: var(--white); box-shadow: 0 1px 0 var(--line); }
.panel--dark { background: var(--ink); color: var(--cream); }

.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--sand-line);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sand-line);
}

.header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 16px;
}

.header__logo img { height: 30px; width: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 15px;
  font-weight: 500;
}

.nav__link { color: var(--ink); }
.nav__link:hover,
.nav__link[aria-current] { color: var(--orange-dark); }
.nav__call-prefix { display: none; }

.menu-toggle {
  display: none;
  padding: 10px 18px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

@media (max-width: 819px) {
  .js .menu-toggle { display: inline-flex; }

  .js .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--gutter) 28px;
    border-bottom: 1px solid var(--sand-line);
    background: var(--cream);
  }

  .js .header.is-open .nav { display: flex; }

  .nav { flex-wrap: wrap; gap: 8px 20px; }

  .js .nav__link {
    padding: 16px 0;
    border-top: 1px solid var(--sand-line);
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 400;
  }

  .js .nav__link:first-child { border-top: 0; }

  .js .nav__call {
    margin-top: 16px;
    padding: 16px 20px;
    text-align: center;
  }

  .js .nav__call-prefix { display: inline; }
}

/* Footer */
.footer {
  background: var(--ink);
  color: var(--on-dark-muted);
  font-size: 14px;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-block: 28px 40px;
}

.contact + .footer .footer__inner { border-top: 1px solid var(--dark-line); }
.contact + .footer { padding-top: 0; }

.footer__links { display: flex; gap: 24px; }
.footer__links a { color: var(--on-dark); }
.footer__links a:hover { color: var(--white); }

/* Tabs */
.tabs__list {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--sand);
}

.tabs__tab {
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.tabs__tab[aria-selected='true'] { background: var(--ink); color: var(--cream); }

.js .tabs [hidden] { display: none; }
.no-js .tabs__list { display: none; }

.tabs__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.tabs__intro { max-width: 560px; color: var(--muted); line-height: 1.55; }

/* Definition-style list with hairlines */
.hairlist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  column-gap: 48px;
}

.hairlist__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 0;
  border-top: 1px solid var(--sand-line);
}

.hairlist__title { font-size: 17px; font-weight: 600; }
.hairlist__text { color: var(--muted); line-height: 1.55; }
.hairlist__text > * + * { margin-top: 0; }

/* Numbered service card */
.service-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 300px;
  padding: 32px 28px;
  border-radius: var(--radius-lg);
  background: var(--cream);
  transition: background-color 0.2s ease;
}

.service-card:hover { background: var(--white); }
.service-card__number { font-family: var(--font-serif); font-size: 20px; color: var(--orange); }
.service-card__title { margin-top: auto; font-size: 22px; font-weight: 600; line-height: 1.3; }
.service-card__text { color: var(--muted); }

/* Document row */
.doc-group__label { margin-bottom: 16px; }

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 4px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.doc-row:last-child { border-bottom: 1px solid var(--line); }
.doc-row:hover { color: var(--orange-dark); padding-left: 12px; }
.doc-row__title { min-width: 0; font-family: var(--font-serif); font-size: var(--fs-doc-title); line-height: 1.2; }

.doc-row__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--muted-2);
}

.doc-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-pill);
  color: var(--ink);
}

/* Info item (label + value) */
.info__label { font-size: 13px; color: var(--on-dark-muted); }
.info__value { font-size: 16px; line-height: 1.55; }
.info__value--lg { font-size: 20px; }
a.info__value { color: var(--white); }
a.info__value:hover { color: var(--orange-light); }

/* 6. Sections -------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
  padding-block: clamp(28px, 5vw, 72px) clamp(56px, 8vw, 96px);
}

.hero__title em { color: var(--orange); }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__media-wrap { position: relative; }
.hero__media { aspect-ratio: 4 / 5; }

.hero__card {
  position: absolute;
  left: 16px;
  bottom: 24px;
  max-width: min(280px, 80%);
  padding: 20px 22px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-float);
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.3;
}

@media (min-width: 600px) and (max-width: 999px) {
  .hero__media { aspect-ratio: 21 / 9; }
}

@media (min-width: 1000px) {
  .hero__card { left: -40px; }
}

.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 64px;
}

.about__body { align-self: end; gap: 22px; font-size: 18px; line-height: 1.65; color: var(--on-dark); }
.about__closing { color: var(--white); font-weight: 600; }

.who {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
  padding-block: clamp(32px, 5vw, 112px) var(--section-y);
}

.who__media { aspect-ratio: 4 / 3; }

@media (min-width: 600px) and (max-width: 1099px) {
  .who__media { aspect-ratio: 21 / 9; }
}

@media (min-width: 1100px) {
  .who__media { position: sticky; top: var(--header-offset); }
}

.divided > * { padding-block: 36px; border-bottom: 1px solid var(--line); }
.divided > :first-child { padding-top: 0; }
.divided > :last-child { padding-bottom: 0; border-bottom: 0; }

.services__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.help__intro { max-width: 720px; }

.quote { padding-block: 0 var(--section-y); }

.quote__figure {
  max-width: 900px;
  padding-top: 64px;
  border-top: 1px solid var(--line);
  gap: 28px;
}

.quote__text { line-height: 1.2; }
.quote__mark { color: var(--orange); font-style: normal; }
.quote__author { display: flex; gap: 10px; align-items: baseline; }
.quote__author strong { font-weight: 600; }
.quote__author span { color: var(--muted-2); }

.contact__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 64px;
  padding-block: var(--section-y) clamp(56px, 7vw, 88px);
}

.contact__intro { color: var(--on-dark); font-size: 18px; line-height: 1.6; max-width: 30em; }
.contact__info { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; }

.contact__panel {
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius-xl);
  padding: clamp(24px, 4vw, 44px);
}

/* 7. Pages ----------------------------------------------------------------- */
.page-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-block: clamp(48px, 8vw, 80px) clamp(32px, 5vw, 56px);
}

.documents {
  display: flex;
  flex-wrap: wrap;
  gap: 48px 64px;
  align-items: flex-start;
  padding-bottom: clamp(64px, 10vw, 112px);
}

.documents__groups { display: flex; flex-direction: column; gap: 56px; flex: 2 1 520px; min-width: 0; }

.help-box {
  flex: 1 1 300px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 36px 32px;
  border-radius: var(--radius-xl);
  background: var(--ink);
  color: var(--cream);
}

.help-box p { color: var(--on-dark); }
.help-box__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.help-box .btn { padding: 14px 20px; }

@media (min-width: 960px) {
  .help-box { position: sticky; top: var(--header-offset); }
}

/* Vacancies */
.vacancy-hero { padding-block: clamp(28px, 5vw, 72px) 0; }
.vacancy-hero__media { aspect-ratio: 21 / 9; }
.prose-narrow { max-width: 760px; }

.vacancy-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  transition: transform 0.2s ease;
}

.vacancy-card:hover { transform: translateY(-4px); color: var(--ink); }
.vacancy-card__image { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--sand-line); }
.vacancy-card__body { display: flex; flex-direction: column; gap: 10px; padding: 24px 28px 28px; }
.vacancy-card__text { color: var(--muted); }

.terms-card { border: 1px solid var(--dark-line); }
.terms-card__item { padding-block: 14px; border-top: 1px solid var(--dark-line); color: var(--on-dark); }
.terms-card__title { margin-bottom: 8px; }

.back-link { display: inline-flex; gap: 8px; font-weight: 500; }
.back-link::before { content: '←'; }

/* 404 */
.not-found { padding-block: var(--section-y); }
.not-found__code { font-family: var(--font-serif); font-size: var(--fs-h1); line-height: 1; color: var(--orange); }

/* Cookie consent banner (plugin markup) */
.cc-window {
  padding: 16px var(--gutter) !important;
  background: var(--ink) !important;
  color: var(--on-dark) !important;
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
}

.cc-window.cc-floating { border-radius: var(--radius-md) !important; }

.cc-window .cc-link { color: var(--white) !important; opacity: 1 !important; }

.cc-window .cc-btn {
  padding: 10px 18px !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: var(--cream) !important;
  color: var(--ink) !important;
  font-weight: 500 !important;
  text-transform: none !important;
}

.cc-window .cc-btn:hover { background: var(--peach) !important; }

/* 8. Forms ----------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 500; }

.input,
.formie .fui-input,
.formie .fui-select,
.formie .fui-textarea,
.formie input[type='text'],
.formie input[type='email'],
.formie input[type='tel'],
.formie input[type='number'],
.formie textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input:focus,
.formie input:focus,
.formie textarea:focus,
.formie select:focus {
  border-color: var(--ink);
  background: var(--white);
}

textarea.input { min-height: 140px; resize: vertical; }

.field--error .input { border-color: var(--error); }
.field__error { color: var(--error); font-size: 14px; font-weight: 400; }

.form-message { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 15px; }
.form-message--error { background: #fdecea; color: var(--error); }

.form-success {
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.form-success p { font-size: 17px; line-height: 1.6; color: var(--muted); }

/* Honeypot: off-screen, not display:none, so bots still fill it */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Formie (vacancy form). Scoped with .formie so it wins over Formie's own theme CSS. */
.formie .fui-form { display: flex; flex-direction: column; gap: 18px; }
.formie .fui-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; }
.formie .fui-row > * { flex: 1 1 240px; min-width: 0; padding: 0; }
.formie .fui-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.formie .fui-label,
.formie .fui-legend { margin: 0; font-size: 14px; font-weight: 500; }
.formie .fui-instructions { font-size: 14px; color: var(--muted-2); }
.formie .fui-error-message,
.formie .fui-alert-error { color: var(--error); font-size: 14px; }
.formie .fui-alert-success { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--sand); color: var(--ink); }

.formie .fui-btn.fui-submit {
  align-self: flex-start;
  margin: 8px 0 0;
  padding: 16px 26px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--cream);
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.formie .fui-btn.fui-submit:hover { background: var(--orange-dark); color: var(--white); }
.formie .fui-btn-wrapper { margin: 0; padding: 0; }
