/*
 * MOBILE OVERRIDES
 *
 * Loaded after the user's theme with media="screen and (max-width: 800px)",
 * so it never affects desktop. Layout only: no colors, so it works on top of
 * every theme (default, delight, simplegreen, old, and user-created ones).
 */

html{
	-webkit-text-size-adjust:100%;
	text-size-adjust:100%;
}

/* PAGE */

div#page{
	width:auto;
	max-width:100%;
}

/* HEADER */

div#header{
	/* simplegreen hides it when logged in; on mobile it is the only link
	   to the welcome page (the menu item is hidden below) */
	display:block;
	height:auto;
	padding:8px 12px;
	text-align:center;
}

div#header p{
	position:static;
	margin:0.15em 0;
	text-indent:0;
	text-align:center;
}

div#header p.heading{
	font-size:28px;
}

div#header p.subheading{
	font-size:16px;
}

/* OPTIONS (menu): static bar on top, items wrap */

div#options{
	position:static;
	float:none;
	width:auto;
	height:auto;
	overflow:hidden;
	border-right:0;
}

div#options ul{
	float:none;
	width:100%;
	display:flex;
	flex-wrap:wrap;
}

div#options ul li{
	float:none;
	width:auto;
	flex:1 1 25%;
}

/* hide the "welcome" item (always first, in both user and guest menus);
   the header heading links to the welcome page */
div#options ul li:first-child{
	display:none;
}

div#options ul li a{
	font-size:100%;
	height:auto;
	min-height:40px;
	line-height:40px;
	padding:0 4px;
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}

div#options div.loginfo{
	float:none;
	display:block;
	height:auto;
	margin:0;
	clear:both;
	text-align:center;
}

div#options div.loginfo div.logname,
div#options div.loginfo div.logout{
	float:none;
	display:inline-block;
}

/* MAIN */

div#main{
	margin-top:0;
	margin-left:0;
	border-left:0;
	padding:12px 10px;
}

h2{
	margin-left:0.3em;
}

h3{
	margin-left:0.5em;
}

p{
	text-align:left;
	text-indent:0;
}

p.note, form.inline{
	margin-left:0.5em;
}

/* FORMS: labels above fields, full-width fields, 16px so iOS doesn't zoom */

form label{
	float:none;
	display:block;
	width:auto;
	text-align:left;
	padding:0;
}

form input.typetext, form input.typepassword, form textarea, form select{
	box-sizing:border-box;
	width:100%;
	max-width:100%;
	font-size:16px;
}

form input.typesubmit{
	font-size:16px;
	padding:6px 16px;
}

/* login boxes (all themes) and settings columns (simplegreen and its copies
   float changesettings/guestpage and every subsection at 50%) */
div.section.login div.subsection,
div.section.changesettings,
div.section.guestpage,
div.subsection{
	width:auto;
	float:none;
}

/* checkbox rows: label and box on one line */
form div.formitem:has(input.typecheckbox) label{
	display:inline;
	margin-right:0.5em;
}

div.section.editstyle textarea{
	width:100%;
}

/* ITEM LISTS (friend menus, groups) */

div.items ul li{
	width:50%;
}

div.sfriends ul li{
	width:100%;
}

div.items ul li a{
	font-size:100%;
	margin:2px;
	white-space:nowrap;
	overflow:hidden;
	text-overflow:ellipsis;
}

/* GIFTS: one full-width column (old/simplegreen float fixed-size cards),
   title on its own row, status + actions below it */

div.item{
	float:none;
	width:auto;
	height:auto;
	margin-left:0;
	margin-right:0;
}

div.item div.content{
	height:auto;
}

div.item div.heading, div.item div.features{
	float:none;
	width:auto;
	height:auto;
	min-height:24px;
	overflow:hidden;
}

div.item div.heading{
	font-size:120%;
}

div.item div.features div.feature.act img,
div.manage div.feature.act img{
	/* icons are 24px PNGs: keep them crisp, pad to a 36px tap target */
	padding:6px;
	background-origin:content-box;
	background-position:center;
	background-repeat:no-repeat;
	margin-left:4px;
}

.thumb{
	max-width:40%;
	height:auto;
}

/* status text left, action icons right, vertically centered */
div.item div.features,
div.manage{
	display:flex;
	flex-wrap:wrap;
	align-items:center;
}

div.item div.features div.feature,
div.manage div.feature{
	float:none;
}

div.item div.features div.feature.act{
	margin-left:auto;
}

/* themes that show action labels instead of icons ("Ano", "Ne") */
div.manage div.feature.act{
	margin-right:12px;
}

div.manage{
	width:auto;
	line-height:normal;
	padding:4px 0;
}

/* keeper question: text on its own line, Yes/No icons below it */
div.manage div.feature.text{
	flex:1 1 100%;
	text-align:left;
}

iframe{
	max-width:100%;
}

/* FOOTER */

div#footleft, div#footcenter, div#footright{
	float:none;
	text-align:center;
}
