/* LABELS.MSS CONTENTS:
 * - place names
 * - area labels
 * - waterway labels 
 */

/* Font sets are defined in palette.mss */

/* ================================================================== */
/* PLACE NAMES
/* ================================================================== */

/* #place::country[type='country'][zoom>3][zoom<9] {
  text-name: '[name]';
  text-face-name: @sans_bold;
  text-placement: point;
  text-fill: @country_text;
  text-halo-fill: @country_halo;
  text-halo-radius: 1;
  [zoom=3] {
    text-size: 10 + @text_adjust;
    text-wrap-width: 40;
  }
  [zoom=4] {
    text-size: 11 + @text_adjust;
    text-wrap-width: 50;
  }
  [zoom>4] {
    text-halo-radius: 2;
  }
  [zoom=5] {
    text-size: 11 + @text_adjust;
    text-wrap-width: 50;
    text-line-spacing: 1;
  }
  [zoom=6] {
    text-size: 12 + @text_adjust;
    text-character-spacing: 1;
    text-wrap-width: 80;
    text-line-spacing: 2;
  }
  [zoom=7] {
    text-size: 14 + @text_adjust;
    text-character-spacing: 2;
  }
} */

/* #place::state[type='state'][zoom>=5][zoom<=10] {
  text-name: '[name]';
  text-face-name: @sans_bold_italic;
  text-placement: point;
  text-fill: @state_text;
  text-halo-fill: @state_halo;
  text-halo-radius: 1;
  [zoom=6] {
    text-size: 10 + @text_adjust;
    text-wrap-width: 40;
  }
  [zoom=7] {
    text-size: 11 + @text_adjust;
    text-wrap-width: 50;
  }
  [zoom>8] {
    text-halo-radius: 2;
  }
  [zoom=8] {
    text-size: 11 + @text_adjust;
    text-wrap-width: 50;
    text-line-spacing: 1;
  }
  [zoom=9] {
    text-size: 12 + @text_adjust;
    text-character-spacing: 1;
    text-wrap-width: 80;
    text-line-spacing: 2;
  }
  [zoom=10] {
    text-size: 14 + @text_adjust;
    text-character-spacing: 2;
  }
} */

/* ---- Cities ------------------------------------------------------ */

#place::city[type='city'][zoom>=7][zoom<=14] {
  text-name: '[name]';
  text-size: 14;
  text-wrap-width: 60;
  text-face-name: @sans;
  text-placement: point;
  text-fill: @city_text;
  text-halo-fill: @city_halo;
  text-halo-radius: 2;
  [zoom=10] {
    text-wrap-width: 70;
  }
  [zoom=11] {
    text-character-spacing: 1;
    text-wrap-width: 80;
  }
  [zoom=12] {
    text-size: 16;
    text-character-spacing: 1;
    text-wrap-width: 100;
  }
  [zoom=13] {
    text-size: 16;
    text-character-spacing: 2;
    text-wrap-width: 200;
    // text-transform: uppercase;
  }
  [zoom=14] {
    text-size: 16;
    text-character-spacing: 2;
    text-wrap-width: 300;
    // text-transform: uppercase;
  }
}

/* ---- Towns ------------------------------------------------------- */

#place::town[type='town'][zoom>=9] {
  text-name: '[name]';
  text-face-name: @sans;
  text-placement: point;
  text-fill: @town_text;
  text-size: 11;
  text-halo-fill: @town_halo;
  text-halo-radius: 1;
  text-wrap-width: 50;
  [zoom<=11] {
    text-face-name: @sans_lt;
  }
  [zoom>=12] {
    text-size: 12;
    text-line-spacing: 1;
  }
  [zoom>=13] {
    text-size: 12;
    text-character-spacing: 1;
    text-line-spacing: 2;
  }
  [zoom>=14] {
    text-size: 13;
    text-character-spacing: 2;
    text-line-spacing: 3;
  }
  [zoom>=15] {
    text-size: 14;
    text-character-spacing: 3;
    text-line-spacing: 4;
  }
}

/* ---- Other small places ------------------------------------------ */

#place::small[type='village'][zoom>=11],
#place::small[type='hamlet'][zoom>=12],
#place::small[type='suburb'][zoom>=11],
#place::small[type='neighbourhood'][zoom>=12],
#place::small[type='none'][zoom>=17] {
  text-name: '[name]';
  text-face-name: @sans_lt;
  text-placement: point;
  text-fill: @other_text;
  text-size: 11;
  text-halo-fill: @other_halo;
  text-halo-radius: 1;
  text-wrap-width: 30;
  
  [type='suburb'],
  [type='neighbourhood'] {
    // text-face-name: @sans_lt;
    text-transform: uppercase;
  }
  
  [zoom>=14] {
    text-face-name: @sans;
    text-character-spacing: 1;
    text-wrap-width: 40;
    text-line-spacing: 1;
  }
  [zoom>=15] {
    text-face-name: @sans;
    text-halo-radius: 2;
    text-character-spacing: 1;
    text-wrap-width: 60; 
    text-line-spacing: 1;
  }
  [zoom>=16] {
    text-face-name: @sans;
    text-character-spacing: 2;
    text-wrap-width: 120;
    text-line-spacing: 2;
  }
}

/* #place::small[type='locality'][zoom>=15] {
  text-name: '[name]';
  text-face-name: @sans;
  text-placement: point;
  text-fill: @locality_text;
  text-size: 12;
  text-halo-fill: @locality_halo;
  text-halo-radius: 1;
  text-wrap-width: 30;
  [zoom>=16] {
    text-wrap-width: 60;
    text-line-spacing: 1;
  }
} */


// =====================================================================
// AREA LABELS
// =====================================================================

#area_label {
  // Bring in labels gradually as one zooms in, based on polygon area
  [type='park'],
  [type='golf_course'],
  [type='cemetery'],
  [type='hospital'],
  [type='college'],
  [type='school'],
  [type='university'],
  [type='water'] {
    [zoom>=13][area>80000],
    [zoom>=14][area>20000],
    [zoom>=15][area>5000],
    [zoom>=16][area>=0] {
      text-name: "[name]";
      text-halo-radius: 1;
      text-face-name: @sans_lt_italic;
      text-size: 11;
      text-wrap-width: 30;
      text-fill: #888;
      text-halo-fill: #fff;
      // Specific style overrides for different types of areas:
      [type='park'] {
        text-fill: @park * 0.6;
        text-halo-fill: lighten(@park, 20%);
      }
      [type='golf_course'] {
        text-fill: @sports * 0.6;
        text-halo-fill: lighten(@sports, 20%);
      }
      [type='cemetery'][zoom=16] {
        text-fill: @cemetery * 0.6;
        text-halo-fill: lighten(@cemetery, 20%);
      }
      [type='hospital'] {
        text-fill: @hospital * 0.6;
        text-halo-fill: lighten(@hospital, 20%);
      }
      /* [type='school'][zoom>=15],
      [type='college'][zoom>=15], */
      [type='university'][zoom>=15] {
        text-fill: @school * 0.6;
        text-halo-fill: lighten(@school, 20%);
      }
      [type='water'] {
        text-fill: @water * 0.6;
        text-halo-fill: lighten(@water, 20%);
      }
    }
  }
}

/* #poi[type='university'][zoom>=15],
#poi[type='hospital'][zoom>=15],
#poi[type='school'][zoom>=15],
#poi[type='library'][zoom>=15] {
  text-name: "[name]";
  text-face-name: @sans;
  text-size: 11;
  text-wrap-width: 30;
  text-fill: @poi_text;
} */


/* ================================================================== */
/* WATERWAY LABELS
/* ================================================================== */

#waterway_label[type='river'][zoom>=13],
#waterway_label[type='canal'][zoom>=15] {
  text-name: '[name]';
  text-face-name: @sans_italic;
  text-fill: @water * 0.75;
  text-halo-fill: fadeout(lighten(@water, 5%), 25%);
  text-halo-radius: 1;
  text-placement: line;
  text-min-distance: 400;
  text-size: 11;
  /* [zoom=>15] {
    text-size: 12;
    text-spacing: 300;
  } */
}

/* ================================================================== */
/* ROAD LABELS
/* ================================================================== */

/* #motorway_label[zoom>=11][zoom<=14][reflen<=8] {
  shield-name: "[ref]";
  shield-size: 9;
  shield-face-name: @sans_bold;
  shield-fill: #fff;
  shield-file: url(img/shield-motorway-1.png);
  [type='motorway'] {
    [reflen=1] { shield-file: url(img/shield-motorway-1.png); }
    [reflen=2] { shield-file: url(img/shield-motorway-2.png); }
    [reflen=3] { shield-file: url(img/shield-motorway-3.png); }
    [reflen=4] { shield-file: url(img/shield-motorway-4.png); }
    [reflen=5] { shield-file: url(img/shield-motorway-5.png); }
    [reflen=6] { shield-file: url(img/shield-motorway-6.png); }
    [reflen=7] { shield-file: url(img/shield-motorway-7.png); }
    [reflen=8] { shield-file: url(img/shield-motorway-8.png); }
  }
  [type='trunk'] {
    [reflen=1] { shield-file: url(img/shield-trunk-1.png); }
    [reflen=2] { shield-file: url(img/shield-trunk-2.png); }
    [reflen=3] { shield-file: url(img/shield-trunk-3.png); }
    [reflen=4] { shield-file: url(img/shield-trunk-4.png); }
    [reflen=5] { shield-file: url(img/shield-trunk-5.png); }
    [reflen=6] { shield-file: url(img/shield-trunk-6.png); }
    [reflen=7] { shield-file: url(img/shield-trunk-7.png); }
    [reflen=8] { shield-file: url(img/shield-trunk-8.png); }
  }
  [zoom=11] { shield-min-distance: 60; } //50
  [zoom=12] { shield-min-distance: 80; } //60
  [zoom=13] { shield-min-distance: 120; } //120
  [zoom=14] { shield-min-distance: 180; }
} */

#motorway_label[type='motorway'][zoom>9],
#motorway_label[type='trunk'][zoom>9] {
  text-name: "[name]";
  text-face-name: @sans;
  text-placement: line;
  text-fill: @road_text;
  text-halo-fill: @road_halo;
  text-halo-radius: 1;
  text-min-distance: 60;
  text-size: 10;
  [zoom=11] { text-min-distance: 70; }
  [zoom=12] { text-min-distance: 80; }
  [zoom=13] { text-min-distance: 100; }
}

#mainroad_label[type='primary'][zoom>12],
#mainroad_label[type='secondary'][zoom>13],
#mainroad_label[type='tertiary'][zoom>13] {
  text-name: '[name]';
  text-face-name: @sans;
  text-placement: line;
  text-fill: @road_text;
  text-halo-fill: @road_halo;
  text-halo-radius: 1;
  text-min-distance: 60;
  text-size: 11;
}

/* #minorroad_label[zoom>14] {
  text-name: '[name]';
  text-face-name: @sans;
  text-placement: line;
  text-size: 9;
  text-fill: @road_text;
  text-halo-fill: @road_halo;
  text-halo-radius: 1;
  text-min-distance: 60;
  text-size: 11;
} */

/* ================================================================== */
/* ONE-WAY ARROWS
/* ================================================================== */
#motorway_label[zoom>=16],
#mainroad_label[zoom>=16],
#minorroad_label[zoom>=16] {
  [oneway = 'yes'],
  [oneway='-1'] {
     marker-placement:line;
     marker-max-error: 0.5;
     marker-spacing: 200;
     marker-file: url(img/icon/oneway.svg);
     [oneway='-1'] { marker-file: url(img/icon/oneway-reverse.svg); }
     [zoom=16] { marker-transform: "scale(0.5)"; }
     [zoom=17] { marker-transform: "scale(0.75)"; }
  }
}


/* ================================================================== */
/* TRAIN STATIONS
/* ================================================================== */

#train_stations[zoom>15]{
  point-file:url('img/icon/rail-12.png');
  [zoom>=17] { point-file:url('img/icon/rail-18.png'); }
}

/* ****************************************************************** */
