/* DanceSpace – mobile and tablet layout. Nothing here applies above 980px, so the desktop stays as it was. */
@media (max-width: 980px) {
	body { min-width: 0; }
	.wrapper960 { width: auto; max-width: 928px; padding: 0 10px; box-sizing: border-box; }

	/* header, rebuilt from the elements of the desktop background (style3/header.jpg): a light grey strip with the
	   logo and the beige rings, under it the ochre band, which holds the menu button – the desktop's beige pill */
	#body_bg { background: none; }
	#container_header {
		height: auto; padding: 0;
		background:
			radial-gradient(circle at calc(100% - 64px) 118%, transparent 0 34px, rgba(212, 203, 168, .55) 34px 47px, transparent 47px 54px,
				rgba(212, 203, 168, .5) 54px 60px, transparent 60px 66px, rgba(212, 203, 168, .42) 66px 79px, transparent 79px) top / 100% 78px no-repeat,
			linear-gradient(180deg, #f4f4f3 0%, #e6e6e5 100%) top / 100% 78px no-repeat,
			linear-gradient(90deg, #7d6a1d 0%, #9d8630 18%, #b6a04e 42%, #bca655 55%, #a99343 76%, #8a7524 92%, #7a671c 100%);
		box-shadow: 0 2px 4px rgba(0, 0, 0, .18);
	}
	#container_header .wrapper960 { padding: 0; }
	#header_items { display: flex; align-items: center; min-height: 78px; padding: 0 92px 0 14px; box-sizing: border-box; }
	#logo, .logo_container { position: static; width: auto; height: auto; float: none; }
	h1.logo-text { float: none !important; margin: 0; padding: 8px 0; }
	h1.logo-text a { font-size: 22px; line-height: 1.22; white-space: normal; display: block; position: static; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }

	/* menu: a button opens it; submenus open on tap */
	.ds-menu-toggle {
		display: inline-flex; align-items: center; gap: 9px;
		margin: 11px 14px; padding: 9px 16px;
		font: bold 14px Arial, Helvetica, sans-serif; color: #3A3A3A;
		background: #e8e7d8; border: 1px solid #d8c990; border-radius: 5px; cursor: pointer;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
	}
	.ds-menu-toggle[aria-expanded="true"] { background: #fff; }
	.ds-menu-toggle-bars, .ds-menu-toggle-bars::before, .ds-menu-toggle-bars::after {
		display: block; width: 18px; height: 2px; background: #3A3A3A; position: relative; content: "";
	}
	.ds-menu-toggle-bars::before { position: absolute; top: -6px; }
	.ds-menu-toggle-bars::after { position: absolute; top: 6px; }

	#hornav { display: none; float: none; margin: 0 14px 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); overflow: hidden; }
	#hornav.is-open { display: block; }
	#hornav ul, #hornav li, #hornav li li { float: none !important; position: static; }
	#hornav ul a, #hornav .separator { border-left: 0; border-top: 1px dotted #bbb; line-height: 44px; padding: 0 14px; white-space: normal; }
	#hornav > ul > li:first-child > a { border-top: 0; }
	#hornav li.menu-item-has-children > a::after { content: "▾"; float: right; }
	#hornav li.menu-item-has-children.is-open > a::after { content: "▴"; }
	#hornav ul li ul {
		position: static; left: auto !important; display: none; margin: 0; padding: 0 0 4px;
		border: 0; border-radius: 0; background: #f4f3ea; min-width: 0;
	}
	#hornav li.is-open > ul { display: block; }
	#hornav ul ul a, #hornav ul ul a:hover { line-height: 1.3; padding: 11px 14px 11px 28px; white-space: normal; border-bottom: 1px dashed #ddd; }

	/* columns stack: content first, then the right column (in the HTML the column comes first, as in Joomla) */
	#main { display: flex; flex-direction: column; }
	#main > .clear { display: none; }
	#content_remainder { order: 1; }
	#sidecol_a { order: 2; }
	#sidecol_b { order: 3; }
	#content_remainder, #sidecol_a, #sidecol_b { float: none !important; width: auto !important; }
	.side_margins, .maincontent { margin: 5px 0; }
	#sidecol_a .sidecol_block { max-width: 640px; margin: 0 auto; }
	.ds-infobox { height: auto !important; max-height: none; overflow: visible !important; }

	/* media never wider than the screen */
	.maincontent img, .sidecol_block img { max-width: 100%; height: auto; }
	.maincontent iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
	.maincontent table { max-width: 100%; }
	.wp-video { width: 100% !important; }

	/* tab blocks */
	div.tabcontents { width: auto !important; max-width: 640px; margin-left: auto; margin-right: auto; }   /* no empty white area beside the 640px slideshow on tablets */
	.tabcontents [id^="view"] > div[style*="overflow"] { width: auto !important; height: auto !important; max-height: 70vh; margin: 10px !important; }
	ul.tabs { margin: 8px 0; }
	ul.tabs li a { display: inline-block; padding: 9px 14px; font-size: 13px; }

	.gallery .gallery-icon img { width: calc((100vw - 60px) / 3); max-width: 150px; height: auto; aspect-ratio: 3 / 2; }

	#joomla51 { padding: 0 10px; }
}

@media (max-width: 480px) {
	body { font-size: 14px; }
	h2, h2 a:link, h2 a:visited { font-size: 22px; line-height: 26px; }
	h1.logo-text a { font-size: 19px; }
}
