/*
 * Responsive layout for phones and small tablets.
 * The Joomla site switched to a second template (yoo_vida) on phones: hamburger menu in an
 * off-canvas panel, centred logo, stacked content. This reproduces that look on the same markup.
 */

@media (max-width: 979px) {

	body, body#page { min-width: 0 !important; }
	.wrapper { width: auto !important; padding: 0 10px; }
	#toolbar, #header { margin: 0; }
	img { max-width: 100%; height: auto; }

	/* Header: yellow band, hamburger, centred logo, no collage / bubble */
	#block-header > div { background-image: none !important; min-height: 0 !important; }
	#header { position: relative; min-height: 0; padding: 10px 0 0; text-align: center; }
	#logo { position: static !important; display: inline-block; margin: 0 auto; }
	#logo img { padding: 0 !important; margin: 0 !important; max-width: 70vw; }
	#logo img.lep-logo-rabbit { display: block; margin: 0 auto !important; max-width: 200px; }
	#menubar, #menu { display: none !important; }
	#top-a, #innertop .mod-line { display: none !important; }
	#innertop .grid-box { float: none !important; width: auto !important; }

	.lep-menu-toggle {
		display: block; position: absolute; top: 14px; left: 4px; z-index: 20;
		width: 44px; height: 40px; padding: 0; border: 0; background: transparent; cursor: pointer;
	}
	.lep-menu-toggle span { display: block; width: 26px; height: 3px; margin: 6px auto; background: #ed1c24; border-radius: 2px; }

	/* Off-canvas panel */
	.lep-offcanvas {
		display: block; position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 1000;
		background: rgba(0,0,0,.35); visibility: hidden; opacity: 0; transition: opacity .2s, visibility .2s;
	}
	.lep-offcanvas-bar {
		position: absolute; top: 0; bottom: 0; left: 0; width: 270px; max-width: 85%; overflow-y: auto;
		background: #333; color: #fff; padding: 50px 15px 20px; transform: translateX(-100%); transition: transform .25s;
		font-size: 16px;
	}
	body.lep-offcanvas-open .lep-offcanvas { visibility: visible; opacity: 1; }
	body.lep-offcanvas-open .lep-offcanvas-bar { transform: none; }
	body.lep-offcanvas-open { overflow: hidden; }
	.lep-offcanvas-close { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: #fff; font-size: 28px; line-height: 1; cursor: pointer; }
	.lep-offcanvas .lep-nav, .lep-offcanvas .lep-nav ul { list-style: none; margin: 0; padding: 0; }
	.lep-offcanvas .lep-nav li { position: relative; border-bottom: 1px solid #444; }
	.lep-offcanvas .lep-nav a { display: block; padding: 10px 40px 10px 0; color: #ccc; text-decoration: none; }
	.lep-offcanvas .lep-nav li.active > a, .lep-offcanvas .lep-nav a:hover { color: #fff; }
	.lep-offcanvas .lep-nav-sub { display: none; padding-left: 15px; border-top: 1px solid #444; }
	.lep-offcanvas .lep-nav li.open > .lep-nav-sub { display: block; }
	.lep-offcanvas .lep-nav-sub li { border: 0; }
	.lep-offcanvas .lep-nav-sub a { padding: 6px 0; font-size: 14px; }
	.lep-offcanvas .lep-nav-toggle { position: absolute; top: 8px; right: 0; width: 34px; height: 28px; border: 0; background: none; cursor: pointer; }
	.lep-offcanvas .lep-nav-toggle::before { content: ""; position: absolute; top: 9px; left: 12px; width: 8px; height: 8px; border-right: 2px solid #ccc; border-bottom: 2px solid #ccc; transform: rotate(45deg); }
	.lep-offcanvas li.open > .lep-nav-toggle::before { transform: rotate(-135deg); top: 13px; }
	.lep-offcanvas .searchbox { margin-top: 20px; }

	/* Main: single column */
	#main, #maininner, #sidebar-b { float: none !important; width: auto !important; min-height: 0 !important; }
	.grid-block, .grid-box { float: none; width: auto; }
	#innertop .grid-box, #top-b .grid-box { width: auto !important; }
	.module, #breadcrumbs, #content, #footer { margin: 15px 5px; }
	#sidebar-b .module.mod-box { margin: 20px 10px !important; }

	/* Recipes */
	#yoo-zoo .teaser-item .pos-media, #yoo-zoo .item .pos-media { float: none !important; margin: 0 0 10px !important; text-align: center; }
	#yoo-zoo .teaser-item .pos-media img, #yoo-zoo .item .pos-media img { width: 100%; max-width: 400px; }
	#yoo-zoo .item .ingredients, #yoo-zoo .item .directions { overflow: hidden; }
	#yoo-zoo .item .pos-ingredients, #yoo-zoo .item .pos-directions, #yoo-zoo .item .pos-sidebar { float: none !important; width: auto !important; margin: 0 0 15px !important; padding: 0 !important; }
	#yoo-zoo .pos-infobar li { display: inline-block; margin: 0 8px 6px 0; padding: 4px 8px; border: 1px dotted #c7a14a; }
	#yoo-zoo .frontpage-categories .sub-categories ul, #yoo-zoo .categories ul, #yoo-zoo .width25, #yoo-zoo .width50, #yoo-zoo .width33 { float: none !important; width: auto !important; }

	/* Articles */
	#system .content img[style*="float"] { float: none !important; display: block; margin: 0 auto 10px !important; }
	#system .content p[style*="justify"] { text-align: left !important; }
	.contact .thumbnail.pull-right { float: none; margin: 0 0 10px; text-align: center; }
	.lep-contact-form input[type="text"], .lep-contact-form input[type="email"], .lep-contact-form textarea { width: 100%; box-sizing: border-box; }

	/* Footer */
	#footer { text-align: center; }
	#footer > div { float: none; }
	#totop-scroller { right: 5px; }
}

@media (max-width: 480px) {
	#yoo-zoo .pos-infobar li { display: block; margin-right: 0; }
	.lep-postit { transform: none !important; margin: 15px 0 !important; }
	.lep-postit .lep-pin { display: none; }
}

@media (max-width: 979px) {
	/* room for the hamburger button next to the centred logo */
	#header { padding-left: 50px; padding-right: 50px; }
	.lep-gallery-gallery figure, .lep-gallery-grid figure { flex-basis: calc(50% - 6px); }
}
