/**
 * Extra, manually-included stylesheet — NOT loaded automatically by any
 * template/module override. Fixes the "thomasimmos" search widget
 * (mod_bsdimmo_search, .bsdm-search-grid) on landscape tablets (roughly
 * iPad-landscape-and-similar widths) for thomas-immobilien.com.
 *
 * Two distinct bugs at this width range (verified live at 1024x768):
 *
 * 1) The grid jumps straight from 8 columns (>=768px) to the full 12-column
 *    DESKTOP layout at >=992px - a 1024px-wide tablet gets the same column
 *    count as a 1920px monitor, just squeezed into half the physical space.
 *    Several "span 2" fields (1/6 of 1024px minus gaps) are then too narrow
 *    for their Select2 placeholder text ("Anzahl Schlafzimmer" -> "An...").
 *
 * 2) .bsdm-search-grid uses align-items: end (bottom-alignment). Objektart
 *    (short: one small label + one Select2 box) shares a row with Kaufpreis
 *    and Grundstücksfläche (tall: label + input + slider). Bottom-aligning
 *    those together leaves Objektart's label floating in empty space near
 *    the top of the row instead of level with the other two labels - reads
 *    as a layout glitch over the hero photo.
 *
 * Fix: give this width range its own 6-column grid (instead of inheriting
 * the 12-column desktop one) so every "span 2" field becomes 3/6 = half a
 * row at a genuinely wider column, and switch to align-items: start so all
 * three top-row labels line up regardless of field height. Same
 * inline-style-matching approach as the mobile file - see that file's
 * comment for why attribute selectors instead of nth-child.
 *
 * Include this file AFTER bsdimmo-modern.css, e.g.:
 *   <link rel="stylesheet" href="/media/com_bsdimmo/css/bsdimmo-search-thomasimmos-tablet-landscape.css" media="(min-width: 768px) and (max-width: 1300px)">
 */

@media (min-width: 768px) and (max-width: 1300px) {
	.bsdm-search-grid {
		grid-template-columns: repeat(6, 1fr) !important;
		align-items: start !important;
	}

	/* Full-width fields (Objektart, Kaufpreis, Grundstücksfläche,
	   Referenznummer, Städte/Umkreis combo, the Suchen/Zurücksetzen row)
	   stay full-width in the new 6-column grid. */
	.bsdm-search-grid-item[style*="span 4"] {
		grid-column: span 6 !important;
	}

	/* Half-width fields (Mieten/Kaufen, Schlafzimmer, Bäder,
	   Neubau/Bestandsimmobilien, Bundesland, Meerblick) become 3/6 - a
	   genuinely wider column than the 2/12 they'd get from the desktop
	   grid at this same physical width. */
	.bsdm-search-grid-item[style*="span 2"] {
		grid-column: span 3 !important;
	}

	/* Bottom-aligned short labels (see note 2 above) no longer apply once
	   align-items is start, but give every field's own <small> label a
	   consistent baseline regardless of what's below it. */
	.bsdm-search-grid-item > small,
	.bsdm-search-field > small {
		margin-bottom: 0.35rem;
	}
}
