/* Margarita Arnaoudova – mobile and tablet layout. Nothing here applies above 980px: the desktop stays as it was. */
@media (max-width: 980px) {
	/* the fixed-width layout tables become a single column */
	.ma-page, .ma-sheet, .ma-header, .ma-header-rows, .ma-menu-row, .ma-body,
	.ma-page > tbody, .ma-sheet > tbody, .ma-header > tbody, .ma-header-rows > tbody, .ma-menu-row > tbody, .ma-body > tbody,
	.ma-page > tbody > tr, .ma-sheet > tbody > tr, .ma-header > tbody > tr, .ma-header-rows > tbody > tr, .ma-menu-row > tbody > tr, .ma-body > tbody > tr,
	.ma-page > tbody > tr > td, .ma-sheet > tbody > tr > td, .ma-header > tbody > tr > td, .ma-header-rows > tbody > tr > td, .ma-menu-row > tbody > tr > td, .ma-body > tbody > tr > td {
		display: block; width: auto !important; height: auto !important; box-sizing: border-box;
	}
	.ma-sheet { max-width: 100%; }
	.ma-spacer-row, .ma-gap, .ma-gutter, .ma-right, .ma-crumb-pad, .ma-left-pad { display: none !important; }

	/* header: the nested layout tables are flattened into one grid (display: contents), the HTML is unchanged.
	   Row 1 (white): logo · competition title · flags. Row 2: one grey band (#8f9498) with the menu button on the
	   left and "балет "арабеск"" on the right, as on the desktop. Row 3: the opened menu, full width. */
	.ma-header, .ma-header > tbody { display: block; }
	.ma-header > tbody > tr {
		display: grid !important; grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: "logo text lang" "band band band" "menu menu menu"; align-items: center;
	}
	.ma-header-right, .ma-header-rows, .ma-header-rows > tbody, .ma-header-rows > tbody > tr,
	.ma-menubar, .ma-menu-row, .ma-menu-row > tbody, .ma-menu-row > tbody > tr, .ma-pos-menu { display: contents !important; }
	.ma-logo { grid-area: logo; padding: 8px 6px 8px 10px; }
	.ma-logo img { display: block; width: 62px; height: 75px; clip-path: inset(0 0 0 3px); }   /* the logo file has a thin line on its left edge */
	.ma-pos-header { grid-area: text; padding: 8px 6px; }
	.ma-pos-header p, .ma-pos-header div { margin: 0; text-align: left !important; }
	.ma-pos-header span { font-size: 11px !important; line-height: 1.4; }
	.ma-pos-lang { grid-area: lang; align-self: start; padding: 4px 6px 0 0; }
	.ma-pos-head {
		grid-area: band; display: flex !important; align-items: center; justify-content: flex-end;
		min-height: 58px; padding: 0 12px 0 130px; background: #8f9498;
	}
	.ma-pos-head p { margin: 0 !important; text-align: right; line-height: 1.1; }
	.ma-pos-head .moduletable, .ma-pos-header .moduletable { margin: 0; }   /* Joomla's 25px module gap would push the text off-centre */
	.ma-pos-head span { font-size: 18pt !important; }
	.ma-menu-toggle { grid-area: band; justify-self: start; position: relative; z-index: 1; }
	#ma-menu { grid-area: menu; }
	#jflanguageselection .rawimages { padding-top: 0; white-space: nowrap; }
	#jflanguageselection a { display: inline-block; padding: 10px 5px; }   /* finger-sized flags */
	.ma-copy-row a, .ma-crumb-row a { display: inline-block; padding: 6px 0; }

	.ma-menu-toggle {
		display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 10px; padding: 9px 13px;
		font: bold 13px Verdana, Arial, sans-serif; text-transform: uppercase; color: #fff;
		background: #6f7478; border: 1px solid #a5aaae; border-radius: 4px; cursor: pointer;
		box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
	}
	.ma-menu-toggle[aria-expanded="true"] { background: #5b6064; }
	.ma-menu-toggle-bars, .ma-menu-toggle-bars::before, .ma-menu-toggle-bars::after {
		display: block; width: 16px; height: 2px; background: #fff; position: relative; content: "";
	}
	.ma-menu-toggle-bars::before { position: absolute; top: -5px; }
	.ma-menu-toggle-bars::after { position: absolute; top: 5px; }

	#ma-menu { display: none; float: none; width: 100%; clear: both; background: #8f9498; border-top: 1px solid #a5aaae; box-shadow: 0 3px 6px rgba(0, 0, 0, .2); }
	#ma-menu.is-open { display: block; }
	#ma-menu li { float: none; width: auto; }
	#ma-menu li.ma-sep { display: none; }
	#ma-menu a { padding: 14px 14px; border-top: 1px solid #a5aaae; }
	#ma-menu > li:first-child > a { border-top: 0; }
	#ma-menu li.active > a { background: #6f7478; }
	#ma-menu ul { position: static !important; width: auto; display: none; top: auto !important; left: auto !important; }
	#ma-menu li.is-open > ul { display: block; }
	#ma-menu ul a { padding-left: 30px; background: #9da2a6; }
	#ma-menu ul li.active > a { background: #858a8e; }
	.sf-sub-indicator { top: 1.15em !important; right: 14px !important; }
	#ma-menu li.is-open > a > .sf-sub-indicator { transform: rotate(180deg); }

	/* breadcrumbs, then content first and the left column after it */
	.ma-crumb-row td { padding: 8px 10px; }
	.ma-main-row { display: flex !important; flex-direction: column; }
	.ma-content { order: 1; padding: 0 10px; }
	.ma-left { order: 2; padding: 20px 10px 0; }
	.ma-footer-row, .ma-copy-row { display: block; padding: 10px; }

	/* media and tables inside the content never wider than the screen */
	.ma-content img, .ma-left img { max-width: 100%; height: auto; }
	.ma-content iframe, .ma-left iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
	.ma-content table { max-width: 100%; }
	.ma-content table.contentpaneopen, .ma-content table.blog { width: 100%; table-layout: fixed; }
	.ma-content td { word-wrap: break-word; overflow-wrap: anywhere; }
	.wp-video { width: 100% !important; }
	.componentheading { margin-left: 0; margin-right: 0; }
}

@media (max-width: 480px) {
	.ma-pos-head span { font-size: 15pt !important; }
	.ma-pos-head { padding-left: 120px; }
	.gallery .gallery-icon img { width: calc((100vw - 70px) / 3); height: auto; aspect-ratio: 1; }
}
