/* Wersja mobilna (telefony, wąskie okna) – nadpisuje stałe szerokości szablonu templatemo (940/960 px).
   Wczytywany po pozostałych arkuszach (index.php); na szerokich ekranach nic nie zmienia. */

@media (max-width: 760px) {
	html, body { overflow-x: hidden; }
	body { font-size: 13px; -webkit-text-size-adjust: 100%; }
	img, iframe, video { max-width: 100%; }
	input, select, textarea, button { font-size: 16px; }   /* bez automatycznego powiększania pól w iOS */

	/* --- nagłówek: logo z nazwą, język, przycisk menu, wyszukiwarka --- */
	#templatemo_site_title_bar_wrapper { height: auto; }
	#templatemo_site_title_bar { width: auto; height: auto; padding: 10px 14px 12px; background: none; display: flex; flex-wrap: wrap; align-items: center; row-gap: 10px; }
	#site_title { float: none; width: auto; padding: 0; text-align: left; order: 1; flex: 1 1 0; min-width: 0; }
	#site_title h1 a { justify-content: flex-start; gap: 8px; }
	#site_title h1 a img { width: 40px; height: 48px; }
	#site_title h1 a span { width: auto; font-size: 13px; line-height: 1.25; letter-spacing: .2px; }
	#templatemo_site_title_bar #lang_box { order: 2; float: none; width: auto; height: auto; margin: 0; padding: 0; font-size: 0; }
	#templatemo_site_title_bar #lang_box select { font-size: 14px; padding: 2px; }
	#templatemo_site_title_bar #search_box { order: 4; float: none; flex: 1 1 100%; height: auto; margin: 0; padding: 0; }
	#search_box form { float: none; display: flex; gap: 6px; height: auto; }
	#searchfield { flex: 1 1 auto; width: auto !important; min-width: 0; height: 36px !important; box-sizing: border-box; font-size: 16px !important; }
	#searchbutton { flex: none; width: 90px !important; height: 36px !important; }
	/* menu „hamburger”: przycisk ☰ obok wyboru języka, lista rozwijana pod wyszukiwarką (index.php, #menu_toggle) */
	#menu_toggle { order: 3; display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 36px; margin: 0 0 0 8px;
		padding: 0 9px; background: #fff; border: 1px solid #b9c4d0; border-radius: 6px; cursor: pointer; }
	#menu_toggle span { display: block; height: 2px; background: #204567; border-radius: 1px; transition: transform .2s, opacity .2s; }
	.menu-open #menu_toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.menu-open #menu_toggle span:nth-child(2) { opacity: 0; }
	.menu-open #menu_toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
	#templatemo_site_title_bar #templatemo_menu { order: 5; display: none; float: none; flex: 1 1 100%; height: auto; margin: 0 -14px -12px; padding: 0;
		background: #fff; border-top: 1px solid #c6d0dc; }
	#templatemo_site_title_bar.menu-open #templatemo_menu { display: block; }
	#templatemo_menu li { display: block; }
	#templatemo_menu li a, #templatemo_menu li a:hover, #templatemo_menu li .current { float: none; position: static; height: auto; margin: 0;
		padding: 11px 16px; text-align: left; font-size: 15px; color: #204567; background: none; border-bottom: 1px solid #e3e8ee; }
	#templatemo_menu li a span, #templatemo_menu li a:hover span, #templatemo_menu li .current span { display: none; }
	#templatemo_menu li .current { color: #ba0808; background: #f4f6f9; border-left: 4px solid #ba0808; padding-left: 12px; }
	#templatemo_menu li a:hover { background: #f4f6f9; text-decoration: none; }

	/* pasek pod nagłówkiem (Poznań Project, wyszukiwanie rozszerzone) */
	#templatemo_banner_top { height: auto; }
	#templatemo_banner_top_inside { width: auto; height: auto; padding: 0 10px; display: flex; flex-wrap: wrap; justify-content: space-between; }
	#top_links { float: none; width: auto; margin: 0; font-size: 11px; line-height: 28px; }
	#top_links span { display: none; }
	#top_expand { float: none; width: auto; height: auto; }
	#search_slider { height: auto; }
	#search_ext_body, #search_person_box, #search_place_box { width: auto !important; height: auto; max-width: 100%; }
	#search_ext_body { padding: 0 8px; box-sizing: border-box; }
	.search_person { border-bottom: 1px dotted #bbb; padding-bottom: 4px; }
	.search_person .person_option { float: none; display: inline-block; vertical-align: top; }
	.search_person .person_option input[type=text] { max-width: 150px; }
	.search_person .person_option[style*="width:200px"] { width: auto !important; min-width: 170px; }
	input[id^="personsim"] { width: 40px !important; }   /* „100” mieści się przy większej czcionce */
	#search_year_box > div[style*="width: 600px"] { width: auto !important; padding: 0 14px 0 10px !important; }
	#search_year_box input { width: 52px !important; }
	#search_ext_body [style*="width: 600px"], #search_ext_body [style*="width:600px"] { width: auto !important; max-width: 100%; }
	#templatemo_banner_bottom { height: 8px; }

	/* --- treść --- */
	#templatemo_content { width: auto; padding: 10px; }
	#templatemo_content #twitter_section p.head { width: auto; font-size: 20px !important; line-height: 1.3; }
	.section_w940, .section_w450 { float: none; width: auto; }
	.margin_r_40, .margin_r_20 { margin-right: 0; }
	.box, .section_w940 > .box { float: none; width: auto; min-height: 0; margin: 0 0 14px; padding: 16px; }
	.section_w940 > .box:hover { transform: none; }
	#templatemo_content #twitter_section p.head { padding: 18px 14px; }
	#templatemo_content [style*="width: 320px"], #templatemo_content [style*="width:320px"] { width: auto !important; float: none !important; }
	#templatemo_content table { display: block; max-width: 100%; overflow-x: auto; }   /* szerokie tabele przewijane w poziomie */
	h2 { font-size: 20px; line-height: 1.25; }

	/* wyniki wyszukiwania */
	.result_box { width: auto; padding: 10px 6px; box-sizing: border-box; }
	.lbox, .rbox, .result_box .lbox { float: none; width: auto !important; }
	.rbox { margin-top: 6px; }

	/* strona główna: „O projekcie”, pod nim wsparcie – przed „Twój profil” / „Dołącz do projektu” (main.php) */
	.about-mobile, .support-mobile { display: block; }
	.about-desktop, .support-desktop { display: none; }

	/* Zawartość bazy: opis miejscowości pod mapą */
	#content_map #map_canvas { height: 60vh; min-height: 300px; }
	#content_map #map_info_box { position: relative; width: auto; max-height: none; margin-top: 10px; box-shadow: none; }

	/* rejestracja: pola jedno pod drugim */
	.reg-card { padding: 18px 14px; }
	.reg-grid { grid-template-columns: 1fr; }

	/* karty na stronie głównej jedna pod drugą */
	.section_w940:has(> .box) { flex-direction: column; gap: 0; }
	.section_w940 > .box, .section_w940 > .box.margin_r_20 { flex: none; }   /* w kolumnie flex: 1 1 0 zgniatał karty do zera */

	/* stopka */
	#templatemo_footer { width: auto; padding: 30px 12px 16px; }
	#templatemo_footer .section_w240 { float: none; width: auto; padding: 0 0 12px; }

	/* okienka (facebox) mieszczą się na ekranie */
	#facebox { left: 4px !important; right: 4px; }
	#facebox .popup, #facebox .content { max-width: calc(100vw - 16px); box-sizing: border-box; }
	#facebox .content { width: auto !important; overflow-x: auto; }
}
