/* FLOGVIT.video. The family palette and chrome (portal/STYLE.md, SETTINGS.md, FOOTER.md), copied from
   music as the other products do (with the same px-floor rules, flogvit-com#48). The accent is himmel. The light mode comes first; dark follows the system, and an explicit
   [data-fv-theme] from the fv-prefs cookie wins either way. */
:root {
  --paper: #faf9f6; --surface: #ffffff; --ink: #1b1b18; --ink-2: #67665f; --line: #dcdacf;
  --paper-2: #f0eee6; --paper-3: #e8e6dc; --bad: #c03b2e;
  --accent: #2266a0; --accent-tint: #e3edf6;
  --font-ui: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-lyric: "Literata", Georgia, serif;
  --side: 2rem;
  /* The page's width: room for three films side by side, and a player that fills a laptop. */
  --page: 1280px;
  --gutter: max(var(--side), env(safe-area-inset-left));
  --gutter-r: max(var(--side), env(safe-area-inset-right));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161614; --surface: #1e1e1b; --ink: #edece6; --ink-2: #99978d; --line: #2e2d29;
    --paper-2: #211f1c; --paper-3: #262420; --bad: #e0604f;
    --accent: #82b8e8; --accent-tint: #1b2733;
  }
}
:root[data-fv-theme='light'] {
  --paper: #faf9f6; --surface: #ffffff; --ink: #1b1b18; --ink-2: #67665f; --line: #dcdacf;
  --paper-2: #f0eee6; --paper-3: #e8e6dc; --bad: #c03b2e;
  --accent: #2266a0; --accent-tint: #e3edf6;
}
:root[data-fv-theme='dark'] {
  --paper: #161614; --surface: #1e1e1b; --ink: #edece6; --ink-2: #99978d; --line: #2e2d29;
  --paper-2: #211f1c; --paper-3: #262420; --bad: #e0604f;
  --accent: #82b8e8; --accent-tint: #1b2733;
}
html { color-scheme: light; }
@media (prefers-color-scheme: dark) { html { color-scheme: dark; } }
:root[data-fv-theme='light'] { color-scheme: light; }
:root[data-fv-theme='dark'] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; }
@media (max-width: 1024px) { :root { --side: 1.5rem; } }
@media (max-width: 640px) { :root { --side: 0.75rem; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.55 var(--font-ui);
}
a { color: var(--accent); text-underline-offset: 0.15em; }
button { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; }
/* A long word in a big heading ("Innstillinger" at 150 % text on 320 px) breaks with a hyphen, or anywhere,
   rather than widen the page. */
h1, h2 { hyphens: auto; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link {
  position: absolute; left: 0.5rem; top: -10rem; z-index: 100; padding: 0.6rem 1rem;
  background: var(--ink); color: var(--paper); border-radius: 4px; font-weight: 600; text-decoration: underline;
}
.skip-link:focus { top: 0.5rem; }
.main:focus { outline: none; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; }
.container { max-width: var(--page); margin: 0 auto; padding: 2rem var(--gutter-r) 3rem var(--gutter); }

/* Segment choices on the settings page (theme, language); they wrap rather than push past a phone. */
.fv-seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.fv-segBtn { font: inherit; font-size: 0.875rem; padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; }
.fv-segBtn.on { background: var(--paper-2); color: var(--ink); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--paper); font: 500 0.875rem/1.2 var(--font-ui);
  text-decoration: none; cursor: pointer;
}
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:hover { border-color: var(--accent); }

/* ---------- chrome (from books) ---------- */
.fv-wordmark {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.fv-menu {
  position: relative;
  display: inline-block;
}

.fv-summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.fv-summary::-webkit-details-marker {
  display: none;
}
.fv-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.fv-caret {
  flex: none;
  color: var(--ink-2);
  transition: transform 180ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .fv-caret {
    transition: none;
  }
}

.fv-menu[open] .fv-caret {
  transform: rotate(180deg);
}

/* INGEN FASTE PX-GULV I CHROMEN — flogvit-com#48.
   Her sto `min-width: 230px`. Panelet står 23 px inn fra venstre kant, så
   gulvet alene var mer enn et 320 px-viewport har igjen; med tekstforstørrelse
   fra tilgjengelighetsinnstillingene vokste oppføringene i tillegg, og panelet
   ble 25–55 px bredere enn skjermen — verst på finsk, minst på tysk. Målt i
   Chrome, 320 px, 150 % tekst, alle åtte språkene.
   Gulvet er derfor i `em` — det er TEKST som skal få plass, og den vokser med
   brukeren — og BEGGE kantene er klippet mot viewportet. Bare et `min()`-gulv
   holder ikke: innholdet dyttet panelet forbi skjermkanten på egen hånd, så
   `max-width` er den som faktisk binder ved 150 %. */
.fv-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: min(14em, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  /* Panelet henger fra headeren og ruller ikke med siden. Med hele familien i
     lista rekker det ikke ned til «Konto og innstillinger» på 320 × 568 — det
     ruller da i seg selv. */
  max-height: calc(100vh - 5em);
  max-height: calc(100dvh - 5em - env(safe-area-inset-top));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  z-index: 80;
}

.fv-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  /* `min-width: auto` på et flex-barn betyr «aldri smalere enn min-content»,
     og da presser en lang oppføring panelet ut igjen uansett hva taket over
     sier. `flex-wrap` er den andre halvdelen: wordmarken er en LÅST enhet
     («FLOGVIT.photosuite» skal ikke brekkes midt i), så når raden ikke lenger
     rekker, må merkelappen få falle ned på egen linje. */
  min-width: 0;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--ink);
  /* `white-space: nowrap` sto her. Konto-oppføringen er en hel setning som er
     ulikt lang på åtte språk — «kommer snart»-merkelappen og kontoteksten er
     nettopp den variable teksten regelen i flogvit.com/CLAUDE.md advarer mot.
     Wordmarken beholder sin egen nowrap i `.fv-wm`; den er en etikett. */
  white-space: normal;
}
.fv-item:hover {
  background: rgba(27, 27, 24, 0.06);
  color: var(--ink);
}
.fv-item[aria-current=true] {
  background: rgba(27, 27, 24, 0.06);
}
.fv-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.fv-wm {
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* Wordmarken er en LÅST enhet (portal/STYLE.md) — «FLOGVIT.photosuite» skal
     ikke brekkes midt i. Den lå tidligere i `white-space: nowrap` på hele
     `.fv-item`; da den måtte vekk derfra (flogvit-com#48 — konto-oppføringen er
     en setning som er ulikt lang på åtte språk), hører den her, der den bare
     gjelder merkenavnet. lab og puzzles har den samme regelen samme sted. */
  white-space: nowrap;
}

.fv-prod {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: 0.95em;
  letter-spacing: 0;
}

.fv-dot {
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
}

/* Prikkfargen er data, ikke CSS: layouten setter `--fv-dot`/`--fv-dot-dark`
   fra src/lib/family-menu.json (kopi av portal/design/family-menu.json). Uten
   dem er prikken blekk — det er FLOGVIT. selv. */
.fv-dot {
  color: var(--fv-dot, var(--ink));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-fv-theme='light']) .fv-dot {
    color: var(--fv-dot-dark, var(--ink));
  }
}
:root[data-fv-theme='dark'] .fv-dot {
  color: var(--fv-dot-dark, var(--ink));
}

.fv-soon {
  cursor: default;
}
.fv-soon .fv-brand-b,
.fv-soon .fv-prod {
  color: var(--ink-2);
}
.fv-soon:hover {
  background: transparent;
}

.fv-chip {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
}

.fv-product {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 500;
  font-size: 0.95em;
  color: var(--ink);
  text-decoration: none;
}
.fv-product:hover {
  color: var(--accent);
}
.fv-product:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.fv-kontoitem {
  font-size: 13px;
  border-top: 1px solid var(--border, var(--line));
  margin-top: 4px;
  padding-top: 10px;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter-r) 0 var(--gutter);
}
/* The row wraps when it cannot fit (WCAG 1.4.10): the nav drops below the
   wordmark instead of pushing the page past a phone's edge (books#23). */
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding-top: 22px;
  padding-bottom: 22px;
}
@media (max-width: 640px) {
  .site-header__inner {
    gap: 0.5rem;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}
.site-header__brand {
  font-size: 1.25rem;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .site-header__brand {
    font-size: 1.0625rem;
  }
}
@media (max-width: 400px) {
  .site-header__brand {
    font-size: 1rem;
  }
}




.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  align-items: center;
  gap: 2rem;
  margin-left: auto;
  font-size: 14px;
}
@media (max-width: 1024px) {
  .site-header__nav {
    gap: 1.5rem;
  }
}
@media (max-width: 640px) {
  .site-header__nav {
    gap: 0.5rem;
    font-size: 13px;
  }
}
.site-header__nav-link {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 500;
  transition: color 150ms ease;
  white-space: nowrap;
}
.site-header__nav-link:hover { color: var(--accent); }
.site-header__nav-link[aria-current='page'] { color: var(--accent); }
.site-header__settings { color: var(--ink-2); text-decoration: none; font-size: 1.1rem; line-height: 1; padding: 6px 2px; }
.site-header__settings:hover, .site-header__settings[aria-current='page'] { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 4rem;
  color: var(--ink-2);
  font-size: 13px;
}
.site-footer__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 2rem var(--gutter-r) 1.5rem var(--gutter);
}
.site-footer__tag { margin: 0 0 1rem; max-width: 42ch; }
.site-footer__brand-name { color: var(--ink); text-decoration: none; }
.site-footer__brand-word {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.95em; letter-spacing: 0;
  color: var(--ink); text-decoration: none;
}
.site-footer__legal {
  grid-column: 1/-1;
  border-top: 1px solid var(--paper-3);
  padding-top: 18px;
  margin-top: 8px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  letter-spacing: 0.04em;
}
.site-footer__legal-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
}
.site-footer__legal-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-left: auto;
}
.site-footer__legal-links a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 150ms ease;
}
.site-footer__legal-links a:hover {
  color: var(--accent);
}
.site-footer__legal-copy {
  white-space: nowrap;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, border-color 150ms ease;
}
.account-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}


.account-chip__plus { font: 700 0.6875rem/1 var(--font-mono); color: var(--accent); }
.notice { border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; background: var(--surface); }

/* ---------- the films ---------- */
.home__title { font-size: 2.5rem; line-height: 1.1; font-weight: 800; margin: 0 0 0.5rem; }
.home__lead { color: var(--ink-2); margin: 0 0 1.25rem; max-width: 40em; }
.home__count { font: 500 0.8125rem/1.4 var(--font-mono); color: var(--ink-2); margin: 1.25rem 0 0.75rem; }

.speech { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin: 1rem 0; }
.speech__label { font: 500 0.8125rem/1.4 var(--font-mono); color: var(--ink-2); }
.fv-segBtn { text-decoration: none; }

/* Posters side by side, as many as fit at about 20 em each; a long title wraps, never widens a card. */
.film-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(20em, 100%), 1fr)); gap: 1.75rem 1.25rem;
}
.film-card { min-width: 0; }
.film-card__link { display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink); text-decoration: none; }
.film-card__poster {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: 10px; background: var(--paper-3); margin-bottom: 0.4rem;
}
.film-card__title { font: 700 1.125rem/1.3 var(--font-ui); overflow-wrap: anywhere; }
.film-card__meta { font-size: 0.875rem; color: var(--ink-2); }
.film-card__link:hover .film-card__title, .film-card__link:focus-visible .film-card__title { color: var(--accent); }
.film-card__link:hover .film-card__poster { outline: 3px solid var(--accent); outline-offset: 0; }

.film__back { margin: 0 0 1rem; font-weight: 600; }
.film__back a { text-decoration: none; }
.film__player { background: #000; border-radius: 12px; overflow: hidden; }
/* On a laptop the whole film shows with its title under it, without scrolling. */
@media (min-width: 40.01em) { .film__player { max-width: max(30rem, calc((100svh - 13rem) * 16 / 9)); } }
.film__video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; }
.film__title { font-size: 2.25rem; line-height: 1.15; font-weight: 800; margin: 1.25rem 0 0.35rem; }
.film__meta { color: var(--ink-2); margin: 0; }
.film__note { color: var(--ink-2); font-size: 0.875rem; }
.film__about { max-width: 40em; font-size: 1.0625rem; }
.film__next { margin: 1.5rem 0 0; }
.film__next .btn { display: inline-block; text-decoration: none; overflow-wrap: anywhere; line-height: 1.35; }
.film__more { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.film__more h2 { font-size: 1.5rem; margin: 0 0 1rem; }

/* ---------- settings and the accessibility statement ---------- */
.settings h1 { font-size: 2.5rem; line-height: 1.1; margin: 0 0 0.5rem; }
.settings__hint { color: var(--ink-2); margin: 0 0 1.5rem; }
.settings__group { margin-bottom: 1.75rem; }
.settings__group h2 { font-size: 1.3125rem; margin: 0 0 0.6rem; }
.a11y-statement .fv-a11y { max-width: 42rem; }
.a11y-statement .fv-a11y h2 { font-size: 1.3125rem; margin: 2rem 0 0.5rem; }
.a11y-statement .fv-a11y h1, .a11y-statement .fv-a11y h2 { hyphens: auto; overflow-wrap: anywhere; }


/* ---------- phones ---------- */
/* The player and the posters go to the edges (they are pictures); the text keeps its 12 px. */
@media (max-width: 40em) {
  .container { padding-top: 1rem; }
  .home__title, .settings h1 { font-size: 2rem; }
  .film__title { font-size: 1.75rem; }
  .film__player { margin-inline: calc(-1 * var(--gutter)) calc(-1 * var(--gutter-r)); border-radius: 0; }
  .film-card__poster { margin-inline: calc(-1 * var(--gutter)) calc(-1 * var(--gutter-r)); width: calc(100% + var(--gutter) + var(--gutter-r)); border-radius: 0; }
}
