/* The shared page frame on a phone: cookie bar, top bar, logo and menu, footer.
   Loaded by mwlPageLayout only for a page that calls setPhoneFriendly(), and only while nobody is
   logged in. Logged-in pages never load this file: they are the desktop version on every device.
   Everything here is for a narrow screen, so a desktop is not changed either. */

@media screen and (max-width: 700px) {

	/* Cookie bar: the text next to a smaller button */
	#cookieBar {
		display: flex;
		align-items: center;
		gap: 12px;
		height: auto;
		padding: 10px 16px;
	}

	#cookieDisclaimerText {
		float: none;
		max-width: none;
		font-size: 13px;
		line-height: 1.35;
	}

	#cookieButton {
		float: none;
		flex: none;
		padding: 10px 14px;
		font-size: 13px;
	}


	/* Top bar: language and theme to the left, log in to the right.
	   The middle part holds the name of a logged-in member, so it is empty here.
	   (!important: the parts have their minimum width in a style attribute.) */
	#newLookTopContainer {
		display: flex;
		justify-content: space-between;
	}

	#newLookTopContainer .topInfoContainer {
		width: auto;
		min-width: 0 !important;
	}

	#newLookTopContainer .topInfoContainer:first-of-type {
		padding-left: 16px;
	}

	#newLookTopContainer .topInfoContainer:nth-of-type(2) {
		display: none;
	}


	/* Logo and menu: the logo above the three links.
	   The page has two copies of the menu: the one at the top (#mainMenuContainer3) and one that
	   follows the scroll (#mainMenuContainer). A phone only gets the one at the top; the page's
	   scroll script fades it out, which opacity stops here.
	   (!important: the table cells have their width in a style attribute.) */
	#mainMenuContainer {
		display: none;
	}

	#mainMenuContainer3 {
		height: auto;
		opacity: 1 !important;
	}

	#mainMenuContainer3 table,
	#mainMenuContainer3 tbody,
	#mainMenuContainer3 tr,
	#mainMenuContainer3 td {
		display: block;
		width: auto !important;
		height: auto !important;
	}

	/* The empty cells that centre the menu on a desktop */
	#mainMenuContainer3 td:first-of-type,
	#mainMenuContainer3 td:last-of-type {
		display: none;
	}

	#mainMenuContainer3 td img.mwlLogo {
		display: block;
		width: 150px;
		height: auto;
		margin: 6px auto 0;
	}

	body:first-of-type ul#mainMenu {
		display: flex;
		width: 100%;
		padding: 0 !important;
	}

	body:first-of-type ul#mainMenu > li {
		display: block;
		flex: 1 1 auto;
		width: auto !important;
	}

	ul#mainMenu a {
		padding: 12px 4px;
		font-size: 13px;
	}


	/* The page itself: no empty space where an ad banner would be, no minimum height,
	   and the page's own side margins instead of the frame's */
	div.bannerReplacement {
		display: none;
	}

	#mainContainer {
		min-height: 0;
		border-left: 0;
		border-right: 0;
	}

	/* 20px at the top as on a desktop: the logout notice of the front page sits in that space */
	#newLookContentsContainer {
		padding: 20px 0 12px;
	}

	/* The green help tab would cover the text; Help is among the footer links */
	.helpSideButton {
		display: none;
	}

	#scrollUp {
		right: 16px;
		bottom: 16px;
	}


	/* Footer: one column */
	#newLookFooterContainer1 {
		min-height: 0;
		padding: 10px 24px 24px;
		text-align: left;
	}

	.footerInfoContainer {
		display: block;
		width: auto;
		min-width: 0;
	}


	/* Safari on an iPhone zooms the page in when a field with text smaller than 16px is tapped,
	   and the pages set 15px on their fields (!important: so this one rule covers every page) */
	input[type=text],
	input[type=password],
	input[type=email],
	input[type=search],
	select,
	textarea {
		font-size: 16px !important;
	}


	/* Older pages (lawAndSec.php, pricelist.php) have their text in div.cText: 80% of the window
	   wide and justified, which on a phone is a narrow column with wide gaps between the words */
	div.cText {
		width: auto;
		margin-left: 16px;
		margin-right: 16px;
		text-align: left;
	}
}
