/**
 * Theme overrides.
 *
 * Loaded after the bundled stylesheet so these rules win.
 */

/* EAEL "Filterable Gallery" (used by the homepage "Posljednji projekti"
 * and the /projekti page).
 *
 * The gallery is laid out by Isotope (JS), which positions every item
 * absolutely and derives the column count from the measured item width.
 * That makes the column count fragile (rounding / cached layouts can drop
 * it to 2). Here we take the layout over with plain CSS flexbox so the grid
 * is always 3 columns on tablet and up, independent of JS. Mobile (<=767px)
 * keeps the source behaviour of 1 column. */
@media only screen and (min-width: 768px) {
	.eael-filter-gallery-container.eael-filter-gallery-grid {
		display: flex !important;
		flex-wrap: wrap !important;
		align-items: flex-start !important;
		align-content: flex-start !important;
		height: auto !important;
	}

	.eael-filterable-gallery-item-wrap {
		position: static !important;
		left: auto !important;
		top: auto !important;
		transform: none !important;
		width: 33.333333% !important;
	}

	/* Flush the outer cards with the container edges: drop the outer gutter
	   margin on the first and last card of every row. */
	.eael-filterable-gallery-item-wrap:nth-child(3n+1) .eael-gallery-grid-item {
		margin-left: 0 !important;
	}

	.eael-filterable-gallery-item-wrap:nth-child(3n) .eael-gallery-grid-item {
		margin-right: 0 !important;
	}
}

/* Location ("/lokacija/<grad>") pages: add breathing room below the
 * text-editor blocks that sit above the "Pogledajte više" buttons. */
.page-id-7382 .elementor-widget-text-editor {
	margin-bottom: 30px;
}
