/* YIMCAL responsive additions.
   Loaded after the original stylesheets; desktop styles are untouched.
   All overrides live inside media queries except the viewport/mobilenav helpers. */

/* ==== Mobile navigation toggle (hidden on desktop) ==== */
#mobileNavToggle {
	display: none;
	float: right;
	margin: 12px 8px 0 0;
	padding: 10px 14px;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #ffffff;
	background: #143a61;
	border: 1px solid #0f2c49;
	border-radius: 5px;
	cursor: pointer;
	text-decoration: none;
	line-height: 1;
}
#mobileNavToggle:active { background: #0f2c49; }
body.mobile-nav-open #mobileNavToggle { background: #0f2c49; }

/* Menu collapse behaviour only applies on small screens (set inside the
   max-width:1024px query); on desktop the nav is untouched. */

/* ==== Fluid media helpers (safe: only clamp oversized assets) ==== */
img, video { max-width: 100%; height: auto; }
iframe, embed, object { max-width: 100%; }

/* ==== Tablet & below: everything narrower than the 1008px layout ==== */
@media only screen and (max-width: 1024px) {

	#Layoutcontainer { width: 100%; max-width: 1008px; }

	/* --- Navigation: collapsible menu --- */
	header nav { padding-bottom: 0; }
	#mobileNavToggle { display: block; }
	header nav ul.megaMenu { display: none; }
	body.mobile-nav-open header nav ul.megaMenu { display: block; }
	header nav ul.megaMenu > li { float: none; display: block; width: 100%; }
	header nav ul.megaMenu > li > a {
		float: none;
		display: block;
		height: auto;
		line-height: normal;
		padding: 14px 16px;
		font-size: 18px;
	}
	header nav ul.megaMenu ul.sub-menu { position: static; width: 100%; display: block; }
	header nav ul.megaMenu ul.sub-menu li { float: none; display: block; width: 100%; }
	header nav ul.megaMenu ul.sub-menu li a {
		display: block;
		padding: 12px 16px 12px 30px;
		height: auto;
		line-height: normal;
		float: none;
	}

	/* --- Two-column layout stacks: content first, sidebar below --- */
	#Leftcontent {
		width: auto;
		float: none;
		padding: 15px 16px 0 16px;
	}
	#Rightcontainer {
		width: auto;
		float: none;
		margin: 15px 16px 0 16px;
	}
	.Rightcontent { width: auto; }
	.Rightinner { padding: 20px 15px 0 15px; }

	/* --- Header --- */
	.Hrightsection {
		float: left;
		width: auto;
		max-width: 100%;
		margin: 12px 0 0 0;
	}
	form#searchform input#s { width: 180px; }
	h1#Logo { margin-left: 8px; }

	/* --- Fixed-width boxes become fluid --- */
	.Bloglistright { width: auto; float: none; padding-left: 73px; }
	.Commentbox { width: auto; }
	.Commentboxleft { width: auto; float: none; }
	.Commentcontent { width: auto; float: none; }
	.Aboutright { width: auto; float: none; }
	.Avatarwrap:before { display: none; }

	/* --- Contact form fields --- */
	.Columfull dl dt input[type="text"],
	.Columfull dl dt textarea {
		width: 100% !important;
		max-width: 452px;
		min-width: 0;
		box-sizing: border-box;
	}
	.Columfull dl dt textarea { min-height: 180px; }
	input#author, input#email, input#url {
		width: 100% !important;
		margin-left: 0 !important;
		box-sizing: border-box;
	}
	textarea#comment { width: 100% !important; box-sizing: border-box; }
	h3#reply-title { margin: 39px 0 0 0; float: none; width: auto; }

	/* --- Sidebar promo buttons scale --- */
	a.Donatenowbig,
	a.Getinvolvedbut,
	.Connectwithus { width: auto; max-width: 263px; box-sizing: border-box; }

	/* --- Event booking form --- */
	#em-booking { width: 100%; }
	.em-booking-form-details { width: auto !important; box-sizing: border-box; }

	.pdf_file_download { width: auto; }

	/* --- Slider --- */
	#slider { max-width: 100%; }
	article.Slideshow { max-width: 100%; }

	/* --- Photo columns --- */
	.Photocolum, .Colum1 { width: auto; float: none; max-width: 292px; }
}

/* ==== Mobile: large phones ==== */
@media only screen and (max-width: 640px) {

	h1 { font-size: 24px; }
	h2 { font-size: 21px; }

	/* Header: logo and search stack */
	h1#Logo { float: none; margin: 0 auto; }
	.Hrightsection { margin: 0 8px; width: auto; max-width: none; }
	.Hrightsection form#searchform { width: 100%; box-sizing: border-box; }
	form#searchform input#s { width: 60% !important; min-width: 0; }
	span.Hrightshadow { display: none; }
	header h1[style], header .Pageheaderh1 { font-size: 20px; }

	/* Content padding tightens */
	#Leftcontent { padding: 10px 12px 0 12px; }
	#Rightcontainer { margin: 10px 12px 0 12px; }
	.Rightinner { padding: 15px 10px 0 10px; }

	/* Sidebar promo buttons center */
	a.Donatenowbig, a.Getinvolvedbut, .Connectwithus {
		float: none;
		margin: 0 auto 20px auto;
		display: block;
		width: 263px;
		max-width: 100%;
	}

	/* Blog rows */
	.Bloglistright { padding-left: 0; }
	.Commentbox { padding: 5px 8px; }

	/* Comment form */
	input#author, input#email, input#url, textarea#comment {
		margin-right: 0 !important;
	}
	p.form-submit { width: 100%; }

	/* Tap target sizing for footer links */
	footer nav ul li { padding: 6px 8px; }
	footer nav { margin: 0 2px; }
}

/* ==== Small phones (320px) ==== */
@media only screen and (max-width: 400px) {
	h1 { font-size: 21px; }
	h2 { font-size: 18px; }
	form#searchform input#s { width: 55% !important; }
	a.Bluebutton { float: none; display: inline-block; margin-bottom: 8px; }
	input#em-booking-submit { margin: 0; }
	.email-input-wrap, .Emailform input[type=submit] { float: none; }
	.Emailinput { width: 100% !important; box-sizing: border-box; }
	.Emailinput input[type=text] { width: 100% !important; box-sizing: border-box; }
}

/* ==== Very small (320px exact) ==== */
@media only screen and (max-width: 359px) {
	h1 { font-size: 19px; }
	h2 { font-size: 17px; }
}
