/* SwedenSmart shared chrome: header, footer, brand and accessibility states. */

:root {
  --ss-brand-blue: #006aa7;
  --ss-brand-yellow: #fecc02;

  --ss-chrome-bg: rgba(245, 247, 245, .92);
  --ss-chrome-surface: #ffffff;
  --ss-chrome-text: #152019;
  --ss-chrome-muted: #66716a;
  --ss-chrome-line: rgba(21, 32, 25, .14);
  --ss-chrome-hover: rgba(21, 32, 25, .06);
  --ss-footer-bg: #f0f3f1;
  --ss-notice-bg: #e8f1ed;
  --ss-notice-line: #bdd6ca;
  --ss-focus: #006aa7;
}

/* The applications already set data-theme. This is the authoritative state. */
html[data-theme="dark"] {
  --ss-chrome-bg: rgba(14, 20, 17, .92);
  --ss-chrome-surface: #151d19;
  --ss-chrome-text: #eff6f1;
  --ss-chrome-muted: #a6b2aa;
  --ss-chrome-line: rgba(239, 246, 241, .14);
  --ss-chrome-hover: rgba(239, 246, 241, .07);
  --ss-footer-bg: #111915;
  --ss-notice-bg: #17251f;
  --ss-notice-line: #315445;
  --ss-focus: #8ac8f0;
}

/* Sensible fallback for pages that have not set data-theme yet. */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --ss-chrome-bg: rgba(14, 20, 17, .92);
    --ss-chrome-surface: #151d19;
    --ss-chrome-text: #eff6f1;
    --ss-chrome-muted: #a6b2aa;
    --ss-chrome-line: rgba(239, 246, 241, .14);
    --ss-chrome-hover: rgba(239, 246, 241, .07);
    --ss-footer-bg: #111915;
    --ss-notice-bg: #17251f;
    --ss-notice-line: #315445;
    --ss-focus: #8ac8f0;
  }
}

/* ---------- Network header ---------- */

.ss-header {
    position: relative;
    z-index: 20;

    width: 100%;

    color: var(--ss-chrome-text);
    background: var(--ss-chrome-bg);

    border-bottom: 1px solid var(--ss-chrome-line);

    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

/* Main SwedenSmart site:
   this is the actual application/site navigation,
   so keeping it available while scrolling is useful. */

.ss-header--hub {
    position: sticky;
    top: 0;
    z-index: 1000;
}


/* Sub-sites:
   SwedenSmart is only the network/umbrella bar.
   Let it naturally scroll away. */
.ss-header--network {
    position: relative;
    top: auto;
    z-index: 20;

    background: var(--ss-chrome-surface);

    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.ss-header * {
  box-sizing: border-box;
}

.ss-header__inner {
  width: min(1180px, calc(100% - 36px));
  min-height: 64px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.ss-header--network .ss-header__inner {
    min-height: 50px;
}

.ss-header--network .ss-header__brand-copy small {
    display: none;
}


.ss-header__brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ss-chrome-text);
  text-decoration: none;
}

.ss-header__mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ss-brand-blue);
  color: var(--ss-brand-yellow);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}

.ss-header__brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.ss-header__brand-copy strong {
  color: var(--ss-chrome-text);
  font-size: .95rem;
  letter-spacing: -.015em;
}

.ss-header__brand-copy small {
  margin-top: 3px;
  color: var(--ss-chrome-muted);
  font-size: .68rem;
  font-weight: 550;
  white-space: nowrap;
}

.ss-header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ss-header__nav a,
.ss-header__theme {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--ss-chrome-muted);
  font: inherit;
  font-size: .85rem;
  font-weight: 650;
}

.ss-header__nav a {
  padding-inline: 10px;
  text-decoration: none;
}

.ss-header__nav a:hover,
.ss-header__theme:hover {
  color: var(--ss-chrome-text);
  background: var(--ss-chrome-hover);
}

.ss-header__theme {
  width: 38px;
  padding: 0;
  border: 1px solid var(--ss-chrome-line);
  background: var(--ss-chrome-surface);
  cursor: pointer;
}

.ss-header a:focus-visible,
.ss-header button:focus-visible,
.sc-footer a:focus-visible {
  outline: 3px solid var(--ss-focus);
  outline-offset: 3px;
}

/* ---------- Shared footer ---------- */

.sc-footer {
  width: 100%;
  margin-top: 4rem;
  color: var(--ss-chrome-text);
  background: var(--ss-footer-bg);
  border-top: 1px solid var(--ss-chrome-line);
}

.sc-footer * {
  box-sizing: border-box;
}

.sc-footer__inner {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
  padding: 2.6rem 0 3rem;
}

.sc-footer__title {
  margin: 0 0 .45rem;
  color: var(--ss-chrome-text);
  font-size: 1rem;
  font-weight: 800;
}

.sc-footer__text {
  max-width: 780px;
  margin: 0 0 1rem;
  color: var(--ss-chrome-muted);
  font-size: .9rem;
  line-height: 1.65;
}

.sc-footer__notice {
  max-width: 820px;
  margin: 1.1rem 0;
  padding: .95rem 1rem;
  color: var(--ss-chrome-muted);
  background: var(--ss-notice-bg);
  border: 1px solid var(--ss-notice-line);
  border-left: 3px solid var(--ss-brand-blue);
  border-radius: 12px;
  font-size: .86rem;
  line-height: 1.62;
}

.sc-footer__notice strong {
  color: var(--ss-chrome-text);
}

.sc-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem 1rem;
  margin: 1.35rem 0;
}

.sc-footer__links a,
.sc-footer__meta a {
  color: var(--ss-chrome-muted);
  text-decoration-color: transparent;
  text-underline-offset: .18em;
}

.sc-footer__links a {
  font-size: .84rem;
  font-weight: 650;
}

.sc-footer__links a:hover,
.sc-footer__meta a:hover {
  color: var(--ss-chrome-text);
  text-decoration-color: currentColor;
}

.sc-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  color: var(--ss-chrome-muted);
  font-size: .78rem;
  line-height: 1.55;
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .ss-header__inner,
  .sc-footer__inner {
    width: calc(100% - 24px);
  }

  .ss-header__inner {
    min-height: 58px;
    gap: 12px;
  }

  .ss-header__brand-copy small {
    display: none;
  }

  .ss-header__nav {
    gap: 2px;
  }

  .ss-header__nav a {
    padding-inline: 7px;
    font-size: .8rem;
  }

  .sc-footer {
    margin-top: 3rem;
  }
}

@media (max-width: 520px) {
  /* Keep the network bar useful rather than crowded. */
  .ss-header__nav a:nth-of-type(2) {
    display: none;
  }

  .ss-header__mark {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .sc-footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ss-header *,
  .sc-footer * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (prefers-contrast: more) {
  .ss-header,
  .sc-footer,
  .ss-header__theme,
  .sc-footer__notice {
    border-color: var(--ss-chrome-text);
  }
}

@media (forced-colors: active) {
  .ss-header,
  .sc-footer,
  .ss-header__theme,
  .sc-footer__notice,
  .ss-header__mark {
    border-color: CanvasText;
  }

  .ss-header__mark {
    background: Highlight;
    color: HighlightText;
  }
}

@media (max-width: 640px) {

    .ss-header--network .ss-header__inner {
        min-height: 44px;
    }

    .ss-header--network .ss-header__mark {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        border-radius: 8px;
    }

    .ss-header--network .ss-header__brand-copy strong {
        font-size: .88rem;
    }

    .ss-header--network .ss-header__nav a {
        font-size: .76rem;
        padding-inline: 6px;
    }

}

@media (max-width: 520px) {

    .ss-header--network .ss-header__nav a:nth-of-type(2),
    .ss-header--network .ss-header__nav a:nth-of-type(3) {
        display: none;
    }

}
