/**
* @file plugins/themes/default/styles/body.less
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @brief Classes for site-wide elements and layout scaffolding
*/

body {
	font-family: @font;
	font-size: @font-base;
	line-height: @line-base;
	color: @text;
	background: @bg;
}

a {
	color: @primary;
    
	&:hover,
	&:focus {
		color: @primary-lift;
	}
}

// Lock in images so they don't run outside their container
img {
	max-width: 100%;
	width: auto;
	height: auto;
}

.pkp_structure_content,
.pkp_site_name_wrapper,
.pkp_navigation_primary_wrapper,
.pkp_search_mobile,
.pkp_structure_footer {
	.pkp_helpers_clear;
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding-left: @base;
    padding-right: @base;
}

.pkp_structure_main {
	padding: @base;
}

.has_site_logo {
	.pkp_site_name,
	.pkp_navigation_primary_wrapper {
		width: auto;
	}

	.pkp_head_wrapper {
		.pkp_helpers_clear;
		position: relative;
		width: 100%;
		margin: 0 auto;
		padding-right: @base;
	}
}

@media (min-width: @screen-phone) {
	.pkp_structure_main {
		padding: @double;
	}
}

@media (min-width: @screen-tablet) {
	.pkp_structure_content,
    .pkp_site_name_wrapper,
    .pkp_navigation_primary_wrapper,
    .pkp_search_mobile,
    .pkp_structure_footer {
		width: @screen-tablet-container;
		padding: 0;
    }
	
	// Full-height borders wrapping primary content column
	.pkp_structure_main {
		&:before,
		&:after {
			content: '';
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			width: 1px;
		}

		&:after {
			left: @screen-tablet-container;
		}
	}

	.has_site_logo .pkp_head_wrapper {
		width: @screen-tablet-container;
		padding-left: 0;
		padding-right: 0;
	}
}

@media (min-width: @screen-desktop) {
    
    .pkp_navigation_primary_wrapper,
    .pkp_search_mobile {
		width: @screen-desktop-container + @sidebar-width
    }

	.pkp_site_name_wrapper {
		width: @screen-desktop-container
	}

    .pkp_structure_footer,
    .pkp_structure_content {
        width: @screen-fill;
    }

	.pkp_structure_content {
		padding-top: @triple;
		display: block;
	}

	.pkp_structure_sidebar {
		float: right;
		width: 22vw;
	}

	.pkp_structure_main {
		float: left;
		padding: 0 @triple @triple;
		width: 70vw;

		&:after {
			left: @screen-desktop-container;
		}
	}

	// Center the content panel when no sidebar is present
	.pkp_structure_main:first-child:last-child {
		float: none;
		width: 100%;
		margin-top: 0px;

		// Aligns the left and right borders
		@no-sidebar-margins: @sidebar-width / 2;
		&:before {
			left: @no-sidebar-margins;
		}

		&:after {
			left: auto;
			right: @no-sidebar-margins;
		}
	}
	.has_site_logo .pkp_head_wrapper{
		width: @screen-fill;
	}
}

@media (min-width: @screen-lg-desktop) {
    .pkp_site_name_wrapper,
    .pkp_navigation_primary_wrapper,
    .pkp_search_mobile {
        width: @screen-lg-desktop-container;
    }
    
    .pkp_structure_footer,
    .pkp_structure_content	{
        width: @screen-fill;
    }

	.pkp_structure_sidebar {
		float: right;
		width: @sidebar-width;
	}

	.pkp_structure_main {
		width: 76vw;
		&:after {
			left: @screen-lg-desktop-container;
		}
	}

	.has_site_logo .pkp_head_wrapper {
			width: @screen-fill;
	}
}

