/**
 * Version details
 *
 * @package    theme
 * @subpackage COME
 * @copyright  2018 Centrum Otwartej i Multimedialnej Edukacji (COME)
 * @author     Marcin Golebiowski
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 *
 */

/**
 * Display sizes (inherited from Moodle 'Base' theme):
 *
 * Wide displays                    1680        +
 * Large displays                   1200     1679
 * Default displays                 1024     1199    (previously: 980 .. 1199)
 * Tablets                           768      979
 * Small tablets and large phones    481      767
 * Phones                              0      480
 *
 * NOTE: All values in the @media rules are decreased by mystical 17px !
 *
 */

 
/**** Window's size-related rules' alterations *******************************/

@media (min-width: 1663px)   /* 1680 and OVER : Wide displays */
{
/* .region > .section                   { max-width: 1680px; } : DISABLED */
}


@media (min-width: 1183px)   /* 1200 and OVER : Large displays */
{
/*	.region > .section                   { max-width: 990px; } <--- page.css DEFAULT  */
}


@media (min-width: 1007px)    /* 1024 and OVER : Default displays  */
{
/*	.region > .section                   { max-width: 990px; } <--- page.css DEFAULT */
}


/* * 1024px BOUNDARY * * * * * * * * * * * * * * * * * * * * * * * * * * * * */


@media (max-width: 1007px)    /* 1024 and BELOW : Tablets */
{
	.region > .section                   { max-width: 734px; }

	.region-content                      { width: 100%; float: none; }
	.region-content-side                 { width: 100%; max-width: none; margin-top: 30px; }
	.region-content-side > aside         { width: 100%; float: none; margin-left: 0; padding-left: 0; border-left: none; }

	.region-footer                       { height: 220px; }
	#flexible                            { margin-bottom: -415px; }
	#flexible:after, #page-footer        { height:         415px; }
	
	.grid5cList > ul > li                { width: 176px; }
	.grid4cList > ul > li                { width: 234px; }
	.grid3cList > ul > li                { width: 352px; }
	.sliderList > ul > li                { width: 158px; }

	.slideItem > li a                    { background-size: 100% auto; }

	.ssBanner > ul > li:nth-child(2n+1)  { display: none; }

	.view-display-id-news_e > .view-content > div             { width: 224px; }
	.view-display-id-news_e > .view-content > div:first-child { }

	#ttBlock-system-menu                 { }
	#ttBlock-system-locale               { position: absolute; right:  9px; top:    21px; z-index: 0; }
	#ttBlock-system-switches             { position: absolute; right: 44px; bottom:  3px; }
	#ttBlock-system-switches .fa:before  { font-size: inherit; font-size: 2em; line-height: 1.2em; margin-right: 0.3em; }
	
	body.noSideCol .region-content-side  { max-height: 0; }

	#ttBlock-footer > .content > div                   { float: none; }
	#ttBlock-footer > .content > div > span:last-child { margin-right: 0; }
}


@media (max-width: 751px)    /*  768 and BELOW : Small tablets and large phones */
{
	.region > .section                   { max-width: 446px; }

	.region-sysinfo                      { height:  60px; }
	.region-footer-pre                   { height: 240px; }
	.region-footer                       { height: 370px; }
	#flexible                            { margin-bottom: -670px; }
	#flexible:after, #page-footer        { height:         670px; }

	.grid5cList > ul > li                { width: 135px; }
	.grid4cList > ul > li                { width: 208px; }
	.grid3cList > ul > li                { width: 416px; }
	.sliderList > ul > li                { width: 173px; }

	.view-display-id-news_e > .view-content > div             { width: 203px; }
	.view-display-id-news_e > .view-content > div:first-child { width: 416px; margin-right: 0; }

	#ttBlock-system-breadcrumbs          { display: none; }

	.purgecaches                         { display: none; }
	.logininfo > a:first-child:before    { display: block; clear: left; content: ''; }

	#ttBlock-footer-pre > .content > div:first-child, 
	#ttBlock-footer-pre > .content > div:last-child  { float: none; }
	#ttBlock-footer-pre > .content > div { padding-top: 0; text-align: center; }

	.catBox > a                          { width: 193px; }
	.catBox > a > p                      { padding-top: 80%; }

	.attfiltercontrols .lastcol > nobr > span  { clear: both; }

	#ttBlock-footer > .content > div                      { padding: 0 8%; }
	#ttBlock-footer > .content > div:last-child           { padding-top: 0; }
	#ttBlock-footer > .content > div > span               { margin-right: 0; margin-bottom: 20px; }
	#ttBlock-footer > .content > div > span:nth-child(2)  { margin-top: 0; }

	#ttBlock-footer > .content > div:last-child > span:nth-last-child(2)    { display: none; }
	#ttBlock-footer > .content > div:last-child > span:last-child           { display: inline-block; }
}


@media (max-width: 464px)    /*  481 and BELOW : Phones */
{
	.region > .section                   { max-width: 320px; }

	.grid5cList > ul > li                { width: 100%; }
	.grid4cList > ul > li                { width: 100%; }
	.grid3cList > ul > li                { width: 100%; }
	.sliderList > ul > li                { width: calc(100% - 70px); }

	.slideItem > li a                    { background-size: auto 100%; }

	.view-display-id-news_e > .view-content > div             { width: 100%; margin-right: 0; }
	.view-display-id-news_e > .view-content > div:first-child { width: 100%; }

	#logo-hd-1, 
	#logo-hd-2                           { width: 60px; height: 60px; top: 15px; background-size: 60px 60px; }
	#logo-hd-2                           { left: 80px; }

	.cndBrkr                             { font-size: 0; line-height: 0; }
	.cndBrkr:before                      { display: block; clear: left; content: ''; }

	.catBox                              { width: 100%; float: none; }
	.catBox > a                          { width: 266px; }
	.catBox > a > p                      { padding-top: 60%; }

	#ttBlock-footer > .content > div                      { padding: 0 0; }

	#cuConsent                           { padding: 0 10px; }
}

/* * Parent theme rules' resetter  * * * * * * * * * * * * * * * * * * * * * */

@media (max-width: 767px)
{ 
	body                                 { padding-left: 0; padding-right: 0; }
}

/**** Responsive menu (hamburger) ********************************************/

#rmTrigger, 
#rmTrigger + .ttMenuRoot .fwdLink > span, 
#rmTrigger + .ttMenuRoot .bckLink         { display: none; }

#rmTrigger + .ttMenuRoot .fwdLink > span, 
#rmTrigger + .ttMenuRoot .bckLink > span  { line-height: 22px; }
#rmTrigger + .ttMenuRoot .bckLink > span  { margin-right: 0.6em; }

body.rmActive a.fwdLink                   { cursor: pointer; pointer-events: auto; }

body.rmActive #rmTrigger, 
body.rmActive .ttMenuRoot .bckLink        { display: block; }
body.rmActive .ttMenuRoot .fwdLink > span { display: inline; }

body.rmActive #rmTrigger + .ttMenuRoot /* Set .menuRoot properties same as .menuBranch */
{
	position: absolute; z-index: 1; margin: 0; border: 1px solid transparent; 
	padding-top: 5px; 
}

body.rmActive #rmTrigger + .ttMenuRoot > li           { padding-bottom: 0; float: none; }
body.rmActive #rmTrigger + .ttMenuRoot > li > a       { background-color: rgba(224, 224, 224, 0.90); padding: 0.5em 1em; }
body.rmActive #rmTrigger + .ttMenuRoot > li > a:hover { background-color: rgba(240, 240, 240, 0.95); }

body.rmActive #rmTrigger + .ttMenuRoot, 
body.rmActive #rmTrigger + .ttMenuRoot .ttMenuBranch        { visibility: hidden; opacity: 0.0; display: block; }
body.rmActive #rmTrigger + .ttMenuRoot.active, 
body.rmActive #rmTrigger + .ttMenuRoot .ttMenuBranch.active { visibility: visible; }
body.rmActive #rmTrigger + .ttMenuRoot.opened, 
body.rmActive #rmTrigger + .ttMenuRoot .ttMenuBranch.opened { opacity: 1.0; }

body.rmActive #rmTrigger + .ttMenuRoot                      { right: 18px; top: 30px; }
body.rmActive #rmTrigger + .ttMenuRoot .ttMenuBranch        { right: -1px; top: -1px; }
body.rmActive #rmTrigger + .ttMenuRoot li > a               { width: calc(100% + 20px); }

#rmTrigger.opened                        { color: #691114; }

/* * * * Animation : Shift Up * * * */

body.rmActive #rmTrigger.shiftUp + .ttMenuRoot .ttMenuBranch  { top: -16px; }

body.rmActive #rmTrigger.shiftUp +             .ttMenuRoot, 
body.rmActive #rmTrigger.shiftUp + .ttMenuRoot .ttMenuBranch 
{
	max-height:     0; 

	-webkit-transform: translateY(15px);
	    -ms-transform: translateY(15px);
	        transform: translateY(15px);

	transition: transform  250ms ease-out   0ms, 
				opacity    250ms ease-out   0ms, 
				max-height   5ms   linear 250ms, 
				visibility   5ms   linear 250ms; 
}

body.rmActive #rmTrigger.shiftUp +             .ttMenuRoot.active, 
body.rmActive #rmTrigger.shiftUp + .ttMenuRoot .ttMenuBranch.active 
{
	max-height: 500px; 

	-webkit-transform: translateY(0px);
	    -ms-transform: translateY(0px);
	        transform: translateY(0px);

	transition: visibility   5ms   linear   0ms, 
				max-height   5ms   linear   0ms, 
				opacity    250ms ease-out  10ms, 
				transform  250ms ease-out  10ms; 
}

/* * * * Animation : Zoom In * * * */

body.rmActive #rmTrigger.zoomIn  +             .ttMenuRoot, 
body.rmActive #rmTrigger.zoomIn  + .ttMenuRoot .ttMenuBranch 
{
	max-height:     0; 

	-webkit-transform: scale(0.8, 0.8); 
	    -ms-transform: scale(0.8, 0.8); 
	        transform: scale(0.8, 0.8); 

	transition: transform  250ms ease-out   0ms, 
				opacity    250ms ease-out   0ms, 
				max-height   5ms   linear 250ms, 
				visibility   5ms   linear 250ms; 
}

body.rmActive #rmTrigger.zoomIn  +             .ttMenuRoot.opened, 
body.rmActive #rmTrigger.zoomIn  + .ttMenuRoot .ttMenuBranch.opened 
{
	-webkit-transform: scale(1.0, 1.0);
	    -ms-transform: scale(1.0, 1.0);
	        transform: scale(1.0, 1.0);
}

body.rmActive #rmTrigger.zoomIn  +             .ttMenuRoot.active, 
body.rmActive #rmTrigger.zoomIn  + .ttMenuRoot .ttMenuBranch.active 
{
	max-height: 500px; 

	transition: visibility   5ms   linear   0ms, 
				max-height   5ms   linear   0ms, 
				opacity    250ms ease-out  10ms, 
				transform  250ms ease-out  10ms; 
}

/* * * * Animation : No Animation * * * */

body.rmActive #rmTrigger.noAnim  +             .ttMenuRoot, 
body.rmActive #rmTrigger.noAnim  + .ttMenuRoot .ttMenuBranch 
{
	max-height:     0; 
}

body.rmActive #rmTrigger.noAnim  +             .ttMenuRoot.active, 
body.rmActive #rmTrigger.noAnim  + .ttMenuRoot .ttMenuBranch.active 
{
	max-height: 500px; 
}


/**** OPTIONAL : Transitions *************************************************/

.region > .section              { transition: max-width    500ms ease-out 0s; }
.region-sysinfo, 
.region-footer                  { transition: height       500ms ease-out 0s; }
.view-display-id-news_e > .view-content > div, 
#ttBlock-footer .content        { transition: padding-left 500ms ease-out 0s; }

