/* The switch between the two networks of Bus Mallorca (the overnight brief of 13 Nov 2026, task 2): Interurbano (TIB buses, trains and
   metro, /tib/) | Urbano (EMT Palma, /emt/). Two links in a pill, the network on show raised and marked aria-current="page"; each link
   leads to the same kind of page of the other network when it has one (map, statistics, privacy, terms), else to its map.
   On a computer it sits in the header. On a phone (up to 899 px) it is where the thumb is, at the bottom of the screen: floating over the
   foot of a page (.net-switch--float), or inside the sheet of a map (.net-switch-row; the header's copy, .net-switch--head, hides), so it
   never covers the map's controls or the sheet. Words and links in the visitor's language: the server pages write them, netswitch.js
   puts them into the static pages. Tokens of platform/assets/theme.css; light and dark. */
.net-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; flex: none; box-sizing: border-box;
  border-radius: 999px; background: var(--db-surface-2, #eee9e0); border: 1px solid var(--db-border, #ddd6ca);
}
.net-switch a {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; height: 34px; padding: 0 14px;
  box-sizing: border-box; border-radius: 999px; font: 700 14px/1 var(--db-font, system-ui, sans-serif); letter-spacing: -.005em;
  color: var(--db-muted, #5d6066) !important; text-decoration: none !important; white-space: nowrap; transition: background-color .15s, color .15s;
}
.net-switch a:hover { color: var(--db-text, #1b1d21) !important; }
.net-switch a[aria-current="page"] {
  background: var(--db-surface, #fffdf9); color: var(--db-text, #1b1d21) !important;
  box-shadow: 0 1px 3px rgba(27, 22, 14, .2), 0 0 0 1px var(--db-border, #ddd6ca);
}
.net-switch a:focus-visible { outline: 2px solid var(--db-accent, #b8461a); outline-offset: 2px; }
/* a dot in the colour of each network: the orange of Bus Mallorca for the island, EMT's red for Palma */
.net-switch a::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--net-dot, currentColor); flex: none; }
.net-switch a[data-net="tib"] { --net-dot: #b8461a; }
.net-switch a[data-net="emt"] { --net-dot: #c8102e; }
:root[data-theme="dark"] .net-switch a[data-net="tib"] { --net-dot: #f08a4b; }
:root[data-theme="dark"] .net-switch a[data-net="emt"] { --net-dot: #f0657a; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .net-switch a[data-net="tib"] { --net-dot: #f08a4b; }
  :root:not([data-theme="light"]) .net-switch a[data-net="emt"] { --net-dot: #f0657a; }
}

/* the row of the switch inside a map's sheet: phones only (on a computer the header has it) */
.net-switch-row { display: none; }
@media (max-width: 899px) {
  .net-switch--head { display: none !important; }
  .net-switch-row { display: flex; justify-content: center; padding: 0 0 10px; }
  /* a page without a map's sheet: the switch floats at the bottom, above the home bar; the page keeps room for it */
  .net-switch--float {
    position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1100;
    box-shadow: var(--db-shadow-lg, 0 14px 36px rgba(27, 22, 14, .16)); background: var(--db-surface-2, #eee9e0);
  }
  body.has-net-float { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
/* a small phone: the logo without its word in the platform's top bar (as nav.css does on the pages with the three buttons), so the
   theme, language and account buttons fit (the legal pages were 4 px too wide at 320 px) */
@media (max-width: 430px) {
  body.has-net-float .db-topbar .db-brand > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .net-switch a { transition: none; }
}
@media print {
  .net-switch, .net-switch-row { display: none !important; }
}
