/* Bahnhof Speedtest – stil i tråd med bahnhof.no. Bygger på Bootstrap 5 (vendor/bootstrap). */

/* ---------- Fonter (ligger lokalt, ingen kall til Google) ---------- */
@font-face {
  font-family: "Hubot Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/hubot-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Hubot Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/hubot-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-sans-3-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Farger og grunnoppsett ---------- */
:root {
  --bhf-orange: #ea600a;
  --bhf-orange-dark: #c94f05;
  --bhf-black: #0b0b0b;
  --bhf-heading: #1a1a1a;
  --bhf-text: #363636;
  --bhf-muted: #6b6b6b;
  --bhf-light: #f5f5f5;
  --bhf-border: #e3e3e3;
  --font-heading: "Hubot Sans", "Source Sans 3", sans-serif;

  --bs-body-font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --bs-body-color: var(--bhf-text);
  --bs-body-font-size: 1.0625rem;
  --bs-link-color-rgb: 234, 96, 10;
  --bs-link-hover-color-rgb: 201, 79, 5;
}

body { background: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--bhf-heading);
  letter-spacing: -0.01em;
}

section { scroll-margin-top: 80px; }

/* Flagg (img/flags/*.svg) – samme utseende overalt */
.flag {
  width: 1.375rem; height: 1rem;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
  vertical-align: -2px;
}

/* ---------- Meny ---------- */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--bhf-border);
}
.navbar-brand img { height: 44px; width: auto; }
.navbar .nav-link {
  color: var(--bhf-heading);
  font-weight: 600;
  font-size: .9375rem;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--bhf-orange); }

/* Nedtrekksmenyer for land og språk */
.country-menu {
  --bs-dropdown-link-active-bg: var(--bhf-orange);
  --bs-dropdown-link-hover-color: var(--bhf-orange);
  border-color: var(--bhf-border);
  border-radius: .75rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  padding: .4rem;
  min-width: 11rem;
}
.country-menu .dropdown-item { border-radius: .5rem; font-weight: 600; padding: .5rem .75rem; }
.country-menu .flag { margin-right: .5rem; }
.lang-menu .dropdown-item.active { background: rgba(234,96,10,.1); color: var(--bhf-orange); }

.lang-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--bhf-border);
  border-radius: 999px;
  padding: .45rem .8rem;
  font-weight: 700;
  font-size: .8125rem;
  color: var(--bhf-heading);
  background: #fff;
}
.lang-btn:hover, .lang-btn.show { border-color: var(--bhf-orange); color: var(--bhf-heading); background: #fff; }
.lang-btn .flag { display: block; }

/* ---------- Knapper ---------- */
.btn-bhf, .btn-bhf-outline {
  font-weight: 700;
  border-radius: 999px;
  padding: .7rem 1.6rem;
}
.btn-bhf {
  --bs-btn-bg: var(--bhf-orange);
  --bs-btn-border-color: var(--bhf-orange);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--bhf-orange-dark);
  --bs-btn-hover-border-color: var(--bhf-orange-dark);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--bhf-orange-dark);
  --bs-btn-active-border-color: var(--bhf-orange-dark);
}
.btn-bhf-outline {
  --bs-btn-color: #fff;
  --bs-btn-border-color: rgba(255,255,255,.6);
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: #111;
  --bs-btn-hover-border-color: #fff;
}

/* ---------- Toppfelt ---------- */
.hero {
  position: relative;
  background: var(--bhf-black);
  color: #fff;
  overflow: hidden;
  padding: 5rem 0 4.5rem;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 70%;
  height: 180%;
  background: radial-gradient(closest-side, rgba(234,96,10,.55), rgba(234,96,10,0) 70%);
  transform: rotate(-20deg);
  pointer-events: none;
}
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.25rem); }
.hero .lead { color: rgba(255,255,255,.85); max-width: 40rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  padding: .35rem .9rem;
  font-size: .875rem;
  font-weight: 600;
}
.hero-badge .dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: #3ddc84; box-shadow: 0 0 0 4px rgba(61,220,132,.2);
}

/* ---------- Faktakort ---------- */
.facts { margin-top: -2.5rem; position: relative; z-index: 2; }
.fact-card {
  background: #fff;
  border: 1px solid var(--bhf-border);
  border-radius: 1rem;
  padding: 1.5rem;
  height: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}
.fact-card .icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: .75rem;
  display: grid; place-items: center;
  background: rgba(234,96,10,.1);
  color: var(--bhf-orange);
  margin-bottom: .9rem;
}
.fact-card .value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--bhf-heading);
  line-height: 1.1;
}
.fact-card .label { color: var(--bhf-muted); font-size: .9375rem; }

/* ---------- Seksjoner ---------- */
.section-fold { padding: 2rem 0; border-bottom: 1px solid var(--bhf-border); }
.section-open { padding: 3.5rem 0; }
.section-alt { background: var(--bhf-light); }
.eyebrow {
  color: var(--bhf-orange);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .8125rem;
  margin-bottom: .5rem;
}
.section-intro { color: var(--bhf-muted); max-width: 42rem; }
.faq-list { max-width: 860px; }

/* Sammenleggbare seksjoner */
.fold-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%;
  background: none; border: 0; padding: 0;
  text-align: left; color: inherit;
}
.fold-toggle:focus-visible { outline: 3px solid rgba(234,96,10,.35); outline-offset: 6px; border-radius: .5rem; }
.fold-text { display: block; }
.fold-title {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--bhf-heading);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.fold-teaser { display: block; color: var(--bhf-muted); margin-top: .25rem; }
.fold-toggle:not(.collapsed) .fold-teaser { display: none; }
.fold-icon {
  flex-shrink: 0;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--bhf-border);
  background: #fff;
  position: relative;
  transition: background-color .15s, border-color .15s;
}
.fold-icon::before {
  content: "";
  position: absolute; left: 50%; top: 50%;
  width: .6rem; height: .6rem;
  border-right: 2px solid var(--bhf-heading); border-bottom: 2px solid var(--bhf-heading);
  transform: translate(-50%, -70%) rotate(45deg);
  transition: transform .2s;
}
.fold-toggle:hover .fold-icon { border-color: var(--bhf-orange); }
.fold-toggle:not(.collapsed) .fold-icon { background: var(--bhf-orange); border-color: var(--bhf-orange); }
.fold-toggle:not(.collapsed) .fold-icon::before {
  border-color: #fff;
  transform: translate(-50%, -30%) rotate(-135deg);
}
.fold-inner { padding-top: 1.5rem; padding-bottom: .5rem; }

/* ---------- Kort ---------- */
.service-card, .file-card, .location-card, .tip-card {
  background: #fff;
  border: 1px solid var(--bhf-border);
  border-radius: 1rem;
  padding: 1.5rem;
  height: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.service-card, a.file-card { display: block; color: inherit; text-decoration: none; }
a.service-card:hover, a.file-card:hover {
  border-color: var(--bhf-orange);
  box-shadow: 0 8px 24px rgba(234,96,10,.12);
  transform: translateY(-2px);
}
.service-card h3, .location-card h3 { font-size: 1.25rem; }
.arrow { color: var(--bhf-orange); font-weight: 700; }

.file-card .size {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2rem;
  color: var(--bhf-heading);
  line-height: 1;
}
.file-card .meta { color: var(--bhf-muted); font-size: .875rem; }

.tip-card h3 { font-size: 1.0625rem; margin-bottom: .35rem; }
.tip-card p { color: var(--bhf-muted); margin: 0; font-size: .9375rem; }
.tip-card .num {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--bhf-orange);
  font-size: 1.25rem;
}

/* Lokasjonskort */
.location-card.current { border: 2px solid var(--bhf-orange); }
.loc-label { font-size: .875em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bhf-muted); }
.location-card.current .loc-label { color: var(--bhf-orange); }
.loc-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .25rem; }
.loc-links a { color: var(--bhf-orange); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.loc-links a:hover { text-decoration: underline; }
.loc-feature { font-weight: 700; color: var(--bhf-text); }

/* ---------- Kommandoer ---------- */
.cmd-tabs .nav-link {
  color: var(--bhf-text);
  font-weight: 600;
  border-radius: 999px;
  padding: .4rem 1rem;
}
.cmd-tabs .nav-link.active { background: var(--bhf-heading); color: #fff; }
.cmd {
  display: flex; align-items: center; gap: .75rem;
  min-width: 0;
  background: #111;
  color: #f1f1f1;
  border-radius: .75rem;
  padding: .9rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9rem;
}
.cmd code {
  color: inherit;
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
}
.cmd .prompt { color: var(--bhf-orange); user-select: none; }
.cmd .size-tag {
  flex-shrink: 0;
  min-width: 3.4rem;
  text-align: center;
  background: var(--bhf-orange);
  color: #fff;
  font-weight: 700;
  font-size: .75rem;
  border-radius: .4rem;
  padding: .15rem .4rem;
  user-select: none;
}
@media (max-width: 575.98px) {
  .cmd { gap: .5rem; padding: .75rem; font-size: .8rem; }
  .cmd .prompt { display: none; }
}
.btn-copy {
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  border-radius: .5rem;
  padding: .3rem .7rem;
}
.btn-copy:hover { background: rgba(255,255,255,.2); color: #fff; }

/* iperf */
.flag-list dt { margin-top: .75rem; }
.flag-list dt:first-child { margin-top: 0; }
.flag-list dd { color: var(--bhf-muted); margin-bottom: 0; }
.flag-list code, .install-list code, .callout code {
  color: var(--bhf-heading); background: rgba(0,0,0,.05);
  padding: .1rem .35rem; border-radius: .3rem;
}
.iperf-out {
  background: #111; color: #f1f1f1;
  border-radius: .5rem; padding: .6rem .75rem;
  font-size: .8rem; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ---------- Merknader ---------- */
.notice {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--bhf-heading); color: #fff;
  border-radius: .75rem;
  padding: .9rem 1.25rem;
}
.notice::before {
  content: "!";
  flex-shrink: 0;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--bhf-orange); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .875rem; line-height: 1;
  margin-top: .05rem;
}
.notice strong { color: #fff; }

.callout {
  border-left: 4px solid var(--bhf-orange);
  background: rgba(234,96,10,.06);
  border-radius: 0 .75rem .75rem 0;
  padding: 1rem 1.25rem;
}

/* ---------- Spørsmål og svar ---------- */
.accordion {
  --bs-accordion-border-color: var(--bhf-border);
  --bs-accordion-border-radius: .75rem;
  --bs-accordion-inner-border-radius: .75rem;
  --bs-accordion-btn-focus-box-shadow: 0 0 0 .2rem rgba(234,96,10,.25);
  --bs-accordion-active-bg: #fff;
  --bs-accordion-active-color: var(--bhf-orange);
}
.accordion-item { margin-bottom: .75rem; border: 1px solid var(--bhf-border) !important; border-radius: .75rem !important; overflow: hidden; }
.accordion-button { font-weight: 600; }

/* ---------- Bunntekst ---------- */
footer {
  background: var(--bhf-light);
  border-top: 1px solid var(--bhf-border);
  font-size: .9375rem;
}
footer a { color: var(--bhf-heading); font-weight: 600; text-decoration: none; }
footer a:hover { color: var(--bhf-orange); }
.footer-logo { height: 40px; width: auto; }
.footer-countries a { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Utskrift / PDF ---------- */
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4; margin: 10mm; }
  /* Vis alt innhold: sammenleggbare seksjoner og svar i «Spørsmål og svar» */
  .collapse:not(.navbar-collapse) { display: block !important; height: auto !important; }
  .fold-teaser { display: none; }
  .accordion-button::after { display: none; }
  /* Knapper og menyer som ikke gir mening på papir */
  .navbar-toggler, .dropdown, .btn-copy, .fold-icon, .cmd-tabs { display: none !important; }
  .navbar { position: static; }
  .tab-content > .tab-pane { display: block !important; opacity: 1 !important; margin-bottom: 1rem; }
  .row > *, .fact-card, .service-card, .file-card, .location-card, .tip-card, .cmd, .callout, .notice, .accordion-item {
    break-inside: avoid;
  }
  .section-fold, .section-open { break-inside: auto; }
  a.service-card:hover, a.file-card:hover { transform: none; box-shadow: none; }
}
