/* =================== *
 * ## Flight Labels ##
 * =================== */

/*
 * Show exactly one section of the map hover label (see
 * config/customers/mel/products/cdm/templates/map-layer-aircraft.inc.tpl).
 *
 * The label node carries both classes: components/AircraftLayer.class.js adds CLASS_VEHICLE_LABEL
 * ("casper-vehicle-label") and CLASS_MAP_ICON_LABEL ("map-icon-label") to the same element, so either
 * selector works. .map-icon-label is used here; the AMS CDM stylesheet keys the same idea off
 * .casper-vehicle-label and is equally valid.
 *
 * The node is created lazily, on FLIGHT_INTERACTED (hover) — it does not exist in the DOM before then.
 *
 * State values come from config/products/cdm/javascript/FlightProvider.js flightStateGetter.
 */
.casper-vehicle .map-icon-label .label-section {
   display: none;
}

.casper-vehicle .map-icon-label .label-section.vehicle[data-fl_state="VEH"],
.casper-vehicle .map-icon-label .label-section.inbound[data-fl_state="INB"],
.casper-vehicle .map-icon-label .label-section.outbound[data-fl_state="OUT"],
.casper-vehicle .map-icon-label .label-section.local[data-fl_state="LOC"],
.casper-vehicle .map-icon-label .label-section.other {
   display: block;
}

/*
 * .other is the fallback for an unknown state and is last in the template, so suppress it (and any
 * later sibling) once a state-specific section has matched.
 */
.casper-vehicle .map-icon-label .label-section.vehicle[data-fl_state="VEH"] ~ .label-section,
.casper-vehicle .map-icon-label .label-section.inbound[data-fl_state="INB"] ~ .label-section,
.casper-vehicle .map-icon-label .label-section.outbound[data-fl_state="OUT"] ~ .label-section,
.casper-vehicle .map-icon-label .label-section.local[data-fl_state="LOC"] ~ .label-section {
   display: none;
}
