/* Nasjonalbiblioteket theme for Skosmos 3 (nbvok).
   Colours follow NB's profile palette (dark plum against light peach), as used on www.nb.no.
   Skosmos derives almost every colour from the six base variables below, so most of the
   theme is just these overrides. Served from resource/nb/, so url()s are relative to this file. */

:root {
  /* NB palette */
  --nb-aubergine: #40263E;   /* Navnetrekk logo colour */
  --nb-plum: #550029;        /* nb.no primary-active */
  --nb-peach-light: #FFEAEA; /* nb.no secondary-100 */
  --nb-peach: #FDBECA;       /* nb.no secondary-200 */
  --nb-warm-grey: #E4DFDE;   /* nb.no background-hero */
  --nb-grey-bg: #F4F4F4;     /* nb.no neutrals-background */
  --nb-text-grey: #5B5C62;   /* nb.no text-grey */
  --nb-error: #C72A2A;       /* nb.no system-error */

  /* Skosmos base colours */
  --dark-color: var(--nb-aubergine);
  --medium-color: var(--nb-plum);
  --muted-color: var(--nb-text-grey);
  --secondary-medium-color: var(--nb-peach);
  --light-color: var(--nb-warm-grey);
  --secondary-light-color: var(--nb-peach-light);
  --alert-color: var(--nb-error);

  /* White top bar with aubergine text on every page */
  --topbar-bg-1: var(--white-color);
  --topbar-bg-2: var(--white-color);
  --topbar-text-1: var(--nb-aubergine);
  --topbar-text-2: var(--nb-aubergine);

  /* Logo: Lockup SVG (symbol + name) is 1337 x 182 */
  --nb-logo-ratio: calc(1337 / 182);
}

#topbar {
  border-bottom: 1px solid var(--light-color);
}

/* Logo + service name, shared by the landing page and the top bar on other pages.
   The service name "nbvok" is drawn with ::after next to the Lockup. */
#skosmos-logo,
#skosmos-logo-top {
  --nb-logo-height: 52px;
  display: inline-flex;
  align-items: flex-start;
  width: auto;
  height: calc(var(--nb-logo-height) + 12px);
  padding-left: calc(var(--nb-logo-height) * var(--nb-logo-ratio));
  background-image: url("nb-logo-aubergine.svg");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: auto var(--nb-logo-height);
  text-decoration: none;
}

#skosmos-logo::after,
#skosmos-logo-top::after {
  content: "nbvok";
  margin-left: calc(var(--nb-logo-height) * 0.45);
  padding-left: calc(var(--nb-logo-height) * 0.45);
  border-left: 2px solid var(--nb-aubergine);
  color: var(--nb-aubergine);
  font-weight: 700;
  /* Match "nbvok" to the lettering in the lockup SVG (viewBox height 182):
     cap height 89.5 (0.492 of the logo height), baseline at y=120 (0.659).
     Public Sans Bold at line-height 1: cap height 0.73em, baseline 0.86em from the top.
     font-size 0.674h gives the same cap height; the top margin puts the baseline
     at 6px (half the 12px of extra element height) + 0.659h. */
  font-size: calc(var(--nb-logo-height) * 0.674);
  line-height: 1;
  margin-top: calc(6px + var(--nb-logo-height) * 0.079);
}

/* English UI: English lockup ("National Library of Norway"), 1755 x 182.
   <html lang> follows the UI language, so :lang(en) switches with the language link. */
:lang(en) #skosmos-logo,
:lang(en) #skosmos-logo-top {
  --nb-logo-ratio: calc(1755 / 182);
  background-image: url("nb-logo-aubergine-en.svg");
}

/* Smaller in the top bar on vocabulary and concept pages */
#skosmos-logo-top {
  --nb-logo-height: 34px;
  align-self: center;
}

@media (max-width: 576px) {
  #skosmos-logo { --nb-logo-height: 32px; }
  #skosmos-logo-top { --nb-logo-height: 24px; }
}
