/* Tablet and phone layout. The 940px desktop design above this width is unchanged. */

.ag-menu-toggle { display: none; }

@media (max-width: 979px) {
	html, body { min-width: 0; }
	body { padding-top: 10px; }
	.container_12 { width: auto; max-width: 940px; padding: 0 10px; box-sizing: border-box; }
	.container_12 .grid_3, .container_12 .grid_4, .container_12 .grid_8,
	.container_12 .grid_9, .container_12 .grid_12 { float: none; width: auto; margin-left: 0; margin-right: 0; }
	img { max-width: 100%; height: auto; }
	iframe, embed, object, video { max-width: 100%; }
	.content iframe, #page-content iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
	.content table, #page-content table { display: block; max-width: 100%; overflow-x: auto; }

	/* Header: banner, then a bar with the menu button and the social icons. */
	#header, #header .grid_12 { height: auto; background: none; }
	#header .grid_12 { display: grid; grid-template-columns: 1fr auto; }
	#widget_header_1 { position: static; grid-column: 1 / -1; grid-row: 1; width: auto; line-height: 0; }
	#widget_header_1 img { width: 100%; border-radius: 6px; }
	nav.primary { position: relative; top: auto; left: auto; grid-column: 1 / -1; grid-row: 2; margin: 10px 0 0; background: #fff; border: 1px solid #ddd; border-radius: 5px; }
	#widget_header_2 { position: relative; top: auto; right: auto; grid-column: 2; grid-row: 2; align-self: start; margin: 19px 10px 0 0; z-index: 3; }

	.ag-menu-toggle { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 15px; border: 0; background: none; font: 400 14px 'Trebuchet MS', sans-serif; text-transform: uppercase; color: #444; cursor: pointer; }
	.ag-menu-toggle span, .ag-menu-toggle span::before, .ag-menu-toggle span::after { display: block; width: 18px; height: 2px; background: #444; content: ''; transition: transform .2s; }
	.ag-menu-toggle span { position: relative; }
	.ag-menu-toggle span::before { position: absolute; top: -6px; }
	.ag-menu-toggle span::after { position: absolute; top: 6px; }
	nav.primary.is-open .ag-menu-toggle span { background: transparent; }
	nav.primary.is-open .ag-menu-toggle span::before { transform: translateY(6px) rotate(45deg); }
	nav.primary.is-open .ag-menu-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

	#topnav { display: none; float: none; border-top: 1px solid #ddd; }
	nav.primary.is-open #topnav { display: block; }
	#topnav li { float: none; background: none; padding: 0; margin: 0; border-bottom: 1px solid #eee; }
	#topnav li:last-child { border-bottom: 0; }
	#topnav li a { height: auto; line-height: 46px; padding: 0 15px; }
	#topnav ul { position: static; display: block !important; visibility: visible !important; opacity: 1 !important; height: auto !important; width: auto; margin: 0; padding: 0; border: 0 !important; border-radius: 0; background: none; }
	#topnav li li { background: none; border-bottom: 0; border-top: 1px solid #eee; text-align: left; }
	#topnav li li a { padding-left: 32px; line-height: 40px; font-size: 13px; text-align: left; }

	/* Home slider: first slide image and its caption, stacked. */
	#slider-wrapper { height: auto; margin-top: 10px; }
	#slider { width: auto; height: auto; background: none; }
	#slider > img, #slider > a { display: none; }
	#slider > img:first-child, #slider > a:first-child, #slider > a:first-child img { display: block; position: static; width: 100%; border-radius: 6px 6px 0 0; }
	#slider + .nivo-html-caption { display: block; background: #af2e19; border-radius: 0 0 6px 6px; padding: 20px; line-height: 22px; font: 400 14px/22px 'Trebuchet MS', sans-serif; color: #fff; }
	#slider + .nivo-html-caption font[size="6"] { font-size: 22px; line-height: 28px; }
	#slider + .nivo-html-caption a { color: #fff; }

	/* Content and sidebar stacked. */
	.primary_content_wrap, body.home .primary_content_wrap { padding: 20px 0 30px; }
	#content, #sidebar { float: none; }
	#sidebar { margin-top: 30px; }
	.post-holder { padding: 15px; }
	.home .grid_4 { margin-bottom: 25px; }

	/* Footer stacked and centred. */
	#footer { height: auto; padding-bottom: 20px; }
	nav.footer, #widget-footer { float: none; text-align: center; }
	nav.footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; }
	nav.footer ul li { float: none; margin: 0 10px 0 0; padding: 0 0 0 11px; }
	#widget-footer { margin-top: 12px; display: flex; justify-content: center; align-items: center; gap: 10px; }
	#widget-footer > div, #widget-footer .widget_text, #widget-footer .textwidget, #footer ul.social-networks { float: none; }
	#footer ul.social-networks { margin: 0; }
	#back-top { left: auto; right: 15px; bottom: 20px; margin: 0; }
}

@media (max-width: 600px) {
	.featured-thumbnail { float: none; margin: 0 0 12px; }
	.featured-thumbnail img { float: none; }
	.gallery_box_single .gallery { grid-template-columns: repeat(2, 1fr); }
	.content [style*="justify"], .content blockquote { text-align: left !important; }
	.post-holder .entry-title { font-size: 1.4em; }
	.wpcf7 input[type="text"], .wpcf7 input[type="email"] { max-width: 100%; }
}
