[
  {
    "id": "trail-casing-low",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 11,
    "maxzoom": 12,
    "filter": ["all",
      ["has", "activity"],
      ["case", ["has", "tier"],
        ["match", ["get", "tier"], ["intl", "national", "regional"], true, false],
        ["match", ["get", "network"], ["iwn", "icn", "nwn", "ncn", "rwn", "rcn"], true, false]]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": "#ffffff",
      "line-opacity": 0.7,
      "line-width": ["interpolate", ["linear"], ["zoom"], 11, 2.6, 12, 3.2]
    }
  },
  {
    "id": "trail-marked-hike-backbone",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 6,
    "maxzoom": 10,
    "filter": ["all",
      ["==", ["get", "activity"], "hike"],
      ["case", ["has", "tier"],
        ["match", ["get", "tier"], ["intl", "national"], true, false],
        ["match", ["get", "network"], ["iwn", "icn", "nwn", "ncn"], true, false]]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "blue", "#1f6fd4", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a", "purple", "#8e44ad", "violet", "#8e44ad",
        "brown", "#8a6d3b", "white", "#bbbbbb",
        "#7a7a7a"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 6, 1.0, 9, 1.3, 10, 1.4]
    }
  },
  {
    "id": "trail-marked-bike-backbone",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 6,
    "maxzoom": 10,
    "filter": ["all",
      ["==", ["get", "activity"], "bike"],
      ["case", ["has", "tier"],
        ["match", ["get", "tier"], ["intl", "national"], true, false],
        ["match", ["get", "network"], ["iwn", "icn", "nwn", "ncn"], true, false]]],
    "layout": { "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "bike_tier"],
        "intl", "#762a83", "national", "#c51b7d", "regional", "#d05fa2", "local", "#dd8ec0",
        "#c51b7d"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 6, 1.0, 9, 1.3, 10, 1.4],
      "line-dasharray": [2.5, 1.5]
    }
  },
  {
    "id": "trail-marked-canoe-backbone",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 6,
    "maxzoom": 10,
    "filter": ["all",
      ["==", ["get", "activity"], "canoe"],
      ["match", ["get", "tier"], ["intl", "national"], true, false]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a",
        "#0087a0"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 6, 1.0, 9, 1.3, 10, 1.4],
      "line-dasharray": [3, 1.4]
    }
  },
  {
    "id": "trail-marked-hike-mid",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 10,
    "maxzoom": 12,
    "filter": ["all",
      ["==", ["get", "activity"], "hike"],
      ["case", ["has", "tier"],
        ["match", ["get", "tier"], ["intl", "national", "regional"], true, false],
        ["match", ["get", "network"], ["iwn", "icn", "nwn", "ncn", "rwn", "rcn"], true, false]]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "blue", "#1f6fd4", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a", "purple", "#8e44ad", "violet", "#8e44ad",
        "brown", "#8a6d3b", "white", "#bbbbbb",
        "#7a7a7a"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 10, 1.4, 12, 2.0]
    }
  },
  {
    "id": "trail-marked-bike-mid",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 10,
    "maxzoom": 12,
    "filter": ["all",
      ["==", ["get", "activity"], "bike"],
      ["case", ["has", "tier"],
        ["match", ["get", "tier"], ["intl", "national", "regional"], true, false],
        ["match", ["get", "network"], ["iwn", "icn", "nwn", "ncn", "rwn", "rcn"], true, false]]],
    "layout": { "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "bike_tier"],
        "intl", "#762a83", "national", "#c51b7d", "regional", "#d05fa2", "local", "#dd8ec0",
        "#c51b7d"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 10, 1.4, 12, 2.0],
      "line-dasharray": [2.5, 1.5]
    }
  },
  {
    "id": "trail-marked-canoe-mid",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 10,
    "maxzoom": 12,
    "filter": ["all",
      ["==", ["get", "activity"], "canoe"],
      ["match", ["get", "tier"], ["intl", "national", "regional"], true, false]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a",
        "#0087a0"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 10, 1.4, 12, 2.0],
      "line-dasharray": [3, 1.4]
    }
  },
  {
    "id": "trail-casing",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["has", "activity"],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": "#ffffff",
      "line-opacity": 0.75,
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 3.6, 13, 4.8, 16, 6.6],
      "line-offset": ["interpolate", ["linear"], ["zoom"],
        12, ["*", ["coalesce", ["get", "lane_off"], 0], 2.6],
        13, ["*", ["coalesce", ["get", "lane_off"], 0], 3.5],
        16, ["*", ["coalesce", ["get", "lane_off"], 0], 4.8]]
    }
  },
  {
    "id": "trail-marked-hike",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["==", ["get", "activity"], "hike"],
    "layout": {
      "line-cap": "round", "line-join": "round",
      "line-sort-key": ["match", ["get", "tier"], "intl", 4, "national", 3, "regional", 2, 1]
    },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "blue", "#1f6fd4", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a", "purple", "#8e44ad", "violet", "#8e44ad",
        "brown", "#8a6d3b", "white", "#bbbbbb",
        "#7a7a7a"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 2.2, 13, 3.1, 16, 4.4],
      "line-offset": ["interpolate", ["linear"], ["zoom"],
        12, ["*", ["coalesce", ["get", "lane_off"], 0], 2.6],
        13, ["*", ["coalesce", ["get", "lane_off"], 0], 3.5],
        16, ["*", ["coalesce", ["get", "lane_off"], 0], 4.8]]
    }
  },
  {
    "id": "trail-marked-bike",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["==", ["get", "activity"], "bike"],
    "layout": {
      "line-join": "round",
      "line-sort-key": ["match", ["get", "tier"], "intl", 4, "national", 3, "regional", 2, 1]
    },
    "paint": {
      "line-color": ["match", ["get", "bike_tier"],
        "intl", "#762a83", "national", "#c51b7d", "regional", "#d05fa2", "local", "#dd8ec0",
        "#c51b7d"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 2.0, 13, 2.7, 16, 3.9],
      "line-dasharray": [2.5, 1.5],
      "line-offset": ["interpolate", ["linear"], ["zoom"],
        12, ["*", ["coalesce", ["get", "lane_off"], 0], 2.6],
        13, ["*", ["coalesce", ["get", "lane_off"], 0], 3.5],
        16, ["*", ["coalesce", ["get", "lane_off"], 0], 4.8]]
    }
  },
  {
    "id": "trail-marked-canoe",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["==", ["get", "activity"], "canoe"],
    "layout": {
      "line-cap": "round", "line-join": "round",
      "line-sort-key": ["match", ["get", "tier"], "intl", 4, "national", 3, "regional", 2, 1]
    },
    "paint": {
      "line-color": ["match", ["get", "osmc"],
        "red", "#e1251b", "green", "#2a9d3a", "yellow", "#e8b500",
        "black", "#3a3a3a", "orange", "#e8821a",
        "#0087a0"],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 2.2, 13, 3.1, 16, 4.4],
      "line-dasharray": [3, 1.4],
      "line-offset": ["interpolate", ["linear"], ["zoom"],
        12, ["*", ["coalesce", ["get", "lane_off"], 0], 2.6],
        13, ["*", ["coalesce", ["get", "lane_off"], 0], 3.5],
        16, ["*", ["coalesce", ["get", "lane_off"], 0], 4.8]]
    }
  },
  {
    "id": "trail-unmarked",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["!=", ["get", "kind"], "cycle_onstreet"],
      ["match", ["get", "surface"], ["asphalt", "concrete", "paved"], true, false]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "kind"], "cycleway", "#7295bb", "track", "#948a7a", "#a68974"],
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": [3, 2]
    }
  },
  {
    "id": "trail-unmarked-gravel",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["!=", ["get", "kind"], "cycle_onstreet"],
      ["match", ["get", "surface"], ["fine_gravel", "compacted", "gravel"], true, false]],
    "layout": { "line-cap": "butt", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "kind"], "cycleway", "#7295bb", "track", "#948a7a", "#a68974"],
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": [2, 1.5]
    }
  },
  {
    "id": "trail-unmarked-unpaved",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["!=", ["get", "kind"], "cycle_onstreet"],
      ["match", ["get", "surface"], ["unpaved", "ground", "dirt", "grass", "sand"], true, false]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "kind"], "cycleway", "#7295bb", "track", "#948a7a", "#a68974"],
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": [0.3, 2]
    }
  },
  {
    "id": "trail-unmarked-untagged",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["!=", ["get", "kind"], "cycle_onstreet"],
      ["any",
        ["!", ["has", "surface"]],
        ["==", ["get", "surface"], "unknown"]]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": "#9a9a9a",
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": ["step", ["zoom"], ["literal", [3.4, 1.8, 0.3, 1.8]], 14, ["literal", [4, 1.5, 0.35, 1.5]]]
    }
  },
  {
    "id": "trail-unmarked-cobble",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["!=", ["get", "kind"], "cycle_onstreet"],
      ["match", ["get", "surface"], ["cobblestone", "sett", "paving_stones"], true, false]],
    "layout": { "line-cap": "butt", "line-join": "round" },
    "paint": {
      "line-color": ["match", ["get", "kind"], "cycleway", "#7295bb", "track", "#948a7a", "#a68974"],
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": [1.4, 2.0]
    }
  },
  {
    "id": "trail-unmarked-cycle-track",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["==", ["get", "kind"], "cycle_onstreet"],
      ["==", ["get", "cycle"], "track"]],
    "layout": { "line-cap": "round", "line-join": "round" },
    "paint": {
      "line-color": "#7295bb",
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.68],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.6, 14, 2.0, 16, 2.8],
      "line-dasharray": [3, 2]
    }
  },
  {
    "id": "trail-unmarked-cycle-onstreet",
    "type": "line",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["!", ["has", "activity"]],
      ["==", ["get", "kind"], "cycle_onstreet"],
      ["match", ["get", "cycle"], ["lane", "bicycle_road"], true, false]],
    "layout": { "line-cap": "butt", "line-join": "round" },
    "paint": {
      "line-color": "#7295bb",
      "line-opacity": ["interpolate", ["linear"], ["zoom"], 12, 0.0, 12.8, 0.62],
      "line-width": ["interpolate", ["linear"], ["zoom"], 12, 1.3, 14, 1.7, 16, 2.4],
      "line-dasharray": [1.2, 1.9]
    }
  },
  {
    "id": "trail-label",
    "type": "symbol",
    "source": "trails",
    "source-layer": "trail",
    "minzoom": 12,
    "filter": ["all",
      ["any", ["has", "name"], ["has", "ref"]],
      ["any",
        ["==", ["get", "lane_label"], 1],
        ["all",
          ["!", ["has", "lane_label"]],
          ["==", ["coalesce", ["get", "lane_off"], 0], 0]]]],
    "layout": {
      "text-field": ["coalesce", ["get", "ref"], ["get", "name"]],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 11, 9, 14, 11],
      "symbol-placement": "line",
      "text-max-angle": 40,
      "symbol-spacing": 300,
      "symbol-sort-key": 60
    },
    "paint": {
      "text-color": [
        "case",
        ["==", ["get", "activity"], "bike"],
        ["match", ["get", "bike_tier"],
          "intl", "#5e2270", "national", "#a01562", "regional", "#b04586", "local", "#9c6a8c",
          "#a01562"],
        ["==", ["get", "activity"], "canoe"],
        "#006b80",
        ["match", ["get", "osmc"],
          "red", "#b81d15", "blue", "#1a5ab0", "green", "#22842f", "yellow", "#9c7a00", "black", "#3a3a3a",
          "#7a5a3a"]
      ],
      "text-halo-color": "#ffffff",
      "text-halo-width": 1.4
    }
  },
  {
    "id": "trail-poi-dot",
    "type": "circle",
    "source": "trails",
    "source-layer": "trailpoi",
    "minzoom": 11,
    "maxzoom": 14,
    "paint": {
      "circle-radius": ["interpolate", ["linear"], ["zoom"], 11, 2.4, 13, 4.2],
      "circle-color": ["match", ["get", "class"],
        "hut", "#b0301f", "shelter", "#8a6d3b", "water", "#1f6fd4", "campsite", "#2a7d4f",
        "viewpoint", "#8e44ad", "info", "#5d6b7a", "parking", "#4a6fa5",
        "#7a7a7a"],
      "circle-opacity": 0.95,
      "circle-stroke-color": "#ffffff",
      "circle-stroke-width": ["interpolate", ["linear"], ["zoom"], 11, 0.9, 13, 1.4]
    }
  },
  {
    "id": "trail-poi-label",
    "type": "symbol",
    "source": "trails",
    "source-layer": "trailpoi",
    "minzoom": 12,
    "maxzoom": 14,
    "filter": ["has", "name"],
    "layout": {
      "text-field": ["get", "name"],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 12, 9.5, 14, 11],
      "text-anchor": "top",
      "text-offset": [0, 0.55],
      "text-max-width": 9,
      "text-padding": 3,
      "text-allow-overlap": false,
      "text-optional": true,
      "symbol-sort-key": ["match", ["get", "class"],
        "hut", 10, "shelter", 12, "water", 14, "campsite", 16,
        "viewpoint", 18, "info", 22, "parking", 24,
        26]
    },
    "paint": {
      "text-color": ["match", ["get", "class"],
        "hut", "#8f2618", "shelter", "#6f5730", "water", "#1a5ab0", "campsite", "#1f6640",
        "viewpoint", "#71368c", "info", "#4a5663", "parking", "#3b5a85",
        "#5a5a5a"],
      "text-halo-color": "#ffffff",
      "text-halo-width": 1.5
    }
  },
  {
    "id": "trail-marked-cyclenode",
    "type": "circle",
    "source": "trails",
    "source-layer": "cyclenode",
    "minzoom": 13,
    "filter": ["==", ["get", "activity"], "bike"],
    "paint": {
      "circle-radius": ["interpolate", ["linear"], ["zoom"], 13, 4.5, 16, 8],
      "circle-color": "#ffffff",
      "circle-opacity": 0.95,
      "circle-stroke-color": "#c51b7d",
      "circle-stroke-width": ["interpolate", ["linear"], ["zoom"], 13, 1.2, 16, 2]
    }
  },
  {
    "id": "trail-marked-cyclenode-label",
    "type": "symbol",
    "source": "trails",
    "source-layer": "cyclenode",
    "minzoom": 13,
    "filter": ["==", ["get", "activity"], "bike"],
    "layout": {
      "text-field": ["get", "ref"],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 13, 9, 16, 12],
      "text-allow-overlap": false,
      "symbol-sort-key": 20
    },
    "paint": {
      "text-color": "#a01562",
      "text-halo-color": "#ffffff",
      "text-halo-width": 1.4
    }
  },
  {
    "id": "trail-marked-walknode",
    "type": "circle",
    "source": "trails",
    "source-layer": "cyclenode",
    "minzoom": 14,
    "filter": ["==", ["get", "activity"], "hike"],
    "paint": {
      "circle-radius": ["interpolate", ["linear"], ["zoom"], 14, 4.0, 16, 7],
      "circle-color": "#ffffff",
      "circle-opacity": 0.95,
      "circle-stroke-color": "#2f7d32",
      "circle-stroke-width": ["interpolate", ["linear"], ["zoom"], 14, 1.2, 16, 2]
    }
  },
  {
    "id": "trail-marked-walknode-label",
    "type": "symbol",
    "source": "trails",
    "source-layer": "cyclenode",
    "minzoom": 14,
    "filter": ["==", ["get", "activity"], "hike"],
    "layout": {
      "text-field": ["get", "ref"],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 14, 9, 16, 12],
      "text-allow-overlap": false,
      "text-padding": 3,
      "symbol-sort-key": 22
    },
    "paint": {
      "text-color": "#226b28",
      "text-halo-color": "#ffffff",
      "text-halo-width": 1.4
    }
  },
  {
    "id": "range-label",
    "type": "symbol",
    "source": "trails",
    "source-layer": "range",
    "minzoom": 8,
    "filter": ["==", ["geometry-type"], "Point"],
    "layout": {
      "text-field": ["upcase", ["get", "name"]],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 8, 11, 12, 15],
      "text-letter-spacing": 0.35,
      "text-max-width": 8,
      "text-padding": 24,
      "symbol-sort-key": 30
    },
    "paint": {
      "text-color": "#928874",
      "text-halo-color": "rgba(255,255,255,0.8)",
      "text-halo-width": 1.6
    }
  },
  {
    "id": "range-label-line",
    "type": "symbol",
    "source": "trails",
    "source-layer": "range",
    "minzoom": 8,
    "filter": ["==", ["geometry-type"], "LineString"],
    "layout": {
      "text-field": ["upcase", ["get", "name"]],
      "text-font": ["NotoSans-Regular"],
      "text-size": ["interpolate", ["linear"], ["zoom"], 8, 11, 12, 15],
      "text-letter-spacing": 0.35,
      "symbol-placement": "line",
      "symbol-spacing": 700,
      "text-max-angle": 30,
      "symbol-sort-key": 30
    },
    "paint": {
      "text-color": "#928874",
      "text-halo-color": "rgba(255,255,255,0.8)",
      "text-halo-width": 1.6
    }
  }
]
