/*
 *
 *  * Copyright 2015 encuestame
 *  *
 *  *  Licensed under the Apache License, Version 2.0 (the "License");
 *  *  you may not use this file except in compliance with the License.
 *  *  You may obtain a copy of the License at
 *  *
 *  *       http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  *  Unless required by applicable law or agreed to in writing, software
 *  *  distributed under the License is distributed on an "AS IS" BASIS,
 *  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  *  See the License for the specific language governing permissions and
 *  *  limitations under the License.
 *
 */

// Original author: Rafal Bromirski;
// Author: Eduard Mayer;
// twitter: http://twitter.com/vsxed;
//
// Licensed under a MIT License (just as the original);
//
// ---
//
//
// Requirements:
// LESS 1.3.3+
//
// Values
// ---
// @hdpi-value		(HDPI pixel ratio)
// @mdpi-value		(MDPI pixel ratio)
// @ldpi-value			(LDPI pixel ratio)
// ---
//
// Profiles
// ---
// @hdpi			(HDPI Android devices)
// @mdpi			(MDPI Android devices)
// @ldpi			(LDPI Android devices)
// ---
// @wp 			(Windows Phone 7 and 8 devices with a resolution of 480x800 px)
// @wp-hdpi 			(New gen Windows Phone 8 HDPI devices with a min device width of 720px)
// ---
// @ iphone 			(iPhone (2, 3G, 3GS) landscape & portrait)
// @ iphone-landscape 	(iPhone (2, 3G, 3GS) only landscape)
// @ iphone-portrait 		(iPhone (2, 3G, 3GS) only portrait)
// ---
// @ iphone4 			(iPhone (4, 4S) landscape & portrait)
// @ iphone4-landscape 	(iPhone (4, 4S) only landscape)
// @ iphone4-portrait 		(iPhone (4, 4S) only portrait)
// ---
// @ iphone5 			(iPhone (5) landscape & portrait)
// @ iphone5-landscape 	(iPhone (5) only landscape)
// @ iphone5-portrait  	(iPhone (5) only portrait)
// ---
// @ ipad 			(iPad (1, 2, Mini) landscape & portrait)
// @ ipad-landscape (iPad 	(iPad (1, 2, Mini) only landscape)
// @ ipad-portrait 		(iPad (1, 2, Mini) only portrait)
// ---
// @ ipad-retina 		(iPad (3, 4) landscape & portrait)
// @ ipad-retina-landscape 	(iPad (3, 4) only landscape)
// @ ipad-retina-portrait 	(iPad (3, 4) only portrait)
// ---

// VARIABLES
//
@hdpi-value: 1.3;
@mdpi-value: 1;
@ldpi-value: 0.75;

// --- HDPI - Value set to 1.3 to target Google Nexus 7 and above (http://bjango.com/articles/min-device-pixel-ratio/) ---
@hdpi: ~"only screen and (-webkit-min-device-pixel-ratio: "@hdpi-value~") and (-moz-min-device-pixel-ratio: "@hdpi-value~") and (-o-min-device-pixel-ratio: "@hdpi-value~") and (min-resolution: "round(@hdpi-value*96)~"dpi) and (min-resolution: "@hdpi-value~"dppx)";

// --- LDPI (Android) - Value set to 0.75 to target Androids LDPI-Devices, also set to a device width of 240px and a device height of 320px ---
@ldpi: ~"only screen and (-webkit-min-device-pixel-ratio: "@ldpi-value~") and (-moz-min-device-pixel-ratio: "@ldpi-value~") and (-o-min-device-pixel-ratio: "@ldpi-value~") and (min-resolution: "round(@ldpi-value*96)~"dpi) and (min-resolution: "@ldpi-value~"dppx), only screen and (device-width: 240px) and (device-height: 320px)";

// --- MDPI (Android) - Value set to 1 to target Androids MDPI-Devices ---
@mdpi: ~"only screen and (-webkit-min-device-pixel-ratio: "@mdpi-value~") and (-moz-min-device-pixel-ratio: "@mdpi-value~") and (-o-min-device-pixel-ratio: "@mdpi-value~") and (min-resolution: "round(@mdpi-value*96)~"dpi) and (min-resolution: "@mdpi-value~"dppx), only screen and (device-width: 320px) and (device-height: 480px)";

// --- Windows Phone 7 and some WP8 devices, dpi's not set ---
@wp: ~"only screen and (device-width: 480px) and (device-width: 800px)";

// --- New gen Windows Phone 8 devices, min width of 720px ---
@wp-hdpi: ~"only screen and (min-device-width: 720px) and (device-width: 1280px)";

// --- iPhone (2, 3G, 3GS) landscape & portrait ---
@iphone: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 1)";

// --- iPhone (2, 3G, 3GS) only portrait ---
@iphone-portrait: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 1) and (orientation: portrait)";

// --- iPhone (2, 3G, 3GS) only landscape ---
@iphone-landscape: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 1) and (orientation: landscape)";

// --- iPhone (4, 4S) landscape & portrait ---
@iphone4: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 2/3)";

// --- iPhone (4, 4S) only portrait ---
@iphone4-portrait: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 2/3) and (orientation: portrait)";

// --- iPhone (4, 4S) only landscape ---
@iphone4-landscape: ~"only screen and (min-device-width: 320px) and (max-device-width: 480px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 2/3) and (orientation: landscape)";

// --- iPhone (5) landscape & portrait ---
@iphone5: ~"only screen and (min-device-width: 320px) and (max-device-width: 568px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 40/71)";

// --- iPhone (5) only portrait ---
@iphone5-portrait: ~"only screen and (min-device-width: 320px) and (max-device-width: 568px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 40/71) and (orientation: portrait)";

// --- iPhone (5) only landscape ---
@iphone5-landscape: ~"only screen and (min-device-width: 320px) and (max-device-width: 568px) and (-webkit-device-pixel-ratio: 2) and (device-aspect-ratio: 40/71) and (orientation: landscape)";

// --- iPad + iPad Mini portrait & landscape ---
@ipad: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 1)";

// --- iPad + iPad Mini only portrait ---
@ipad-portrait: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 1) and (orientation: portrait";

// --- iPad + iPad Mini only landscape ---
@ipad-landscape: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 1) and (orientation: landscape";

// --- iPad (Retina) portrait & landscape ---
@ipad-retina: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 2)";

// --- iPad (Retina) only portrait ---
@ipad-retina-portrait: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait";

// --- iPad (Retina) only landscape ---
@ipad-retina-landscape: ~"only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape";