/*
 * GENERISANO - ne uredjivati rucno: izmene idu u tools/build-base-css.php,
 * pa "php tools/build-base-css.php" iz foldera plugina. Osnova izolacije od teme.
 * Ucitava se PRE oglasnik-form.css i oglasnik-listing.css (oba ga navode kao
 * zavisnost).
 *
 * Sav CSS plugina je u sloju "oglasnik" i svaka deklaracija je !important:
 * uslojeni !important pobedjuje SVE neuslojene stilove teme (ukljucujuci
 * njihove !important), bez obzira na specificnost selektora.
 *
 * Ovde se za svaki element plugina prvo PONISTAVA sve sto dolazi spolja
 * (all: revert = podrazumevane vrednosti browsera), pa se postavlja neutralna
 * osnova (font, boja, izgled elemenata). Svi selektori su :where() - nulta
 * specificnost - pa bilo koje pravilo komponente u ostalim fajlovima uvek
 * pobedjuje ovu osnovu. Tema tako ne moze da menja izgled plugina niti da
 * bude u konfliktu s njim, a plugin izgleda isto na svakoj temi.
 *
 * Koren plugina se prepoznaje automatski (element sa oglasnik-* klasom koji
 * nije unutar drugog takvog elementa) - bez rucnog dodavanja klase u sablone.
 */
@layer oglasnik {

/* ---------- 1. Ponistavanje svega sto dolazi od teme ---------- */

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *)),
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	all: revert !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *))::before,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *))::after,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *))::before,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *))::after,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *))::placeholder {
	all: revert !important;
}

/*
 * ---------- 2. Koren: jedan font, velicina, boja i ritam za svaku temu ----------
 * all: revert iznad ponistava stilove teme NA korenu, ali nasledna svojstva
 * (font, boja, razmak slova, velika slova...) bi i dalje stizala od roditelja
 * koji pripada temi. Zato koren eksplicitno postavlja SVAKO nasledno
 * tipografsko svojstvo - lanac nasledjivanja od teme se prekida tacno ovde.
 */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *)) {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	font-style: normal !important;
	font-variant: normal !important;
	font-stretch: normal !important;
	font-feature-settings: normal !important;
	font-kerning: auto !important;
	font-size-adjust: none !important;
	line-height: 1.5 !important;
	color: #111 !important;
	-webkit-text-fill-color: currentColor !important;
	caret-color: auto !important;
	accent-color: var(--oglasnik-accent, #2563eb) !important;
	letter-spacing: normal !important;
	word-spacing: normal !important;
	text-transform: none !important;
	text-shadow: none !important;
	text-indent: 0 !important;
	text-align: left !important;
	text-rendering: auto !important;
	white-space: normal !important;
	word-break: normal !important;
	overflow-wrap: break-word !important;
	hyphens: manual !important;
	tab-size: 8 !important;
	quotes: auto !important;
	list-style: disc outside none !important;
	cursor: auto !important;
	visibility: visible !important;
	border-collapse: separate !important;
	border-spacing: 0 !important;
	empty-cells: show !important;
	caption-side: top !important;
	color-scheme: light !important;
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
	-webkit-text-size-adjust: 100% !important;
	text-size-adjust: 100% !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *)),
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *))::before,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main):not(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *))::after,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)),
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *))::before,
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) *:not([style], [contenteditable], svg, svg *, img, picture, video, iframe, canvas, object, embed, .leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *))::after {
	box-sizing: border-box !important;
}

/*
 * Uredjivac opisa (contenteditable) je izuzet iz all: revert - browser mu
 * mogucnost kucanja daje preko svojstava koja bi revert ponistio. Zato mu se
 * ovde ponistava samo ono sto teme realno diraju na div-ovima.
 */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is([contenteditable]):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: none !important;
	float: none !important;
	max-width: none !important;
	font: inherit !important;
	color: inherit !important;
	letter-spacing: inherit !important;
	word-spacing: inherit !important;
	text-transform: inherit !important;
	text-shadow: inherit !important;
	text-indent: 0 !important;
	text-decoration: none !important;
	text-align: left !important;
}

/* ---------- 3. Osnovni izgled elemenata ---------- */

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h1, h2, h3, h4, h5, h6):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	font-weight: 700 !important;
	line-height: 1.25 !important;
	margin: 0 0 0.5em !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h1):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-size: 1.75em !important; }
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h2):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-size: 1.4em !important; }
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h3):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-size: 1.15em !important; }
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h4):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-size: 1em !important; }
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(h5, h6):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-size: 0.9em !important; }

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(p):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	margin: 0 0 1em !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(ul, ol):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	margin: 0 0 1em !important;
	padding: 0 0 0 1.25em !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(a):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	color: var(--oglasnik-accent, #2563eb) !important;
	text-decoration: none !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(blockquote):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	margin: 0 0 1em !important;
	padding: 0 0 0 12px !important;
	border-left: 3px solid rgba(127, 127, 127, 0.4) !important;
}

/* Slike se ne resetuju kroz all (dimenzije iz HTML atributa) - samo ono sto teme najcesce diraju. */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(img):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	max-width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: none !important;
	filter: none !important;
	opacity: 1 !important;
	float: none !important;
	vertical-align: middle !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(table):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	width: 100% !important;
	border-collapse: collapse !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(th, td):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	padding: 8px 10px !important;
	text-align: left !important;
	vertical-align: middle !important;
	border-bottom: 1px solid rgba(127, 127, 127, 0.2) !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(th):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) { font-weight: 600 !important; }

/* Polja i dugmad: browserov font (13px) i boje zamenjuju se fontom plugina. */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(input, select, textarea, button):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	font: inherit !important;
	color: inherit !important;
	margin: 0 !important;
	max-width: 100% !important;
	vertical-align: middle !important;
}

/* Tekstualna polja, izbor i opis - jedan izgled (isti kao .oglasnik-field polja). */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"]), select, textarea):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	padding: 8px 10px !important;
	background-color: transparent !important;
	border: 1px solid rgba(127, 127, 127, 0.4) !important;
	border-radius: 6px !important;
	outline: none !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(input:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"]), select, textarea):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)):focus {
	border-color: var(--oglasnik-accent, #2563eb) !important;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(textarea):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	resize: vertical !important;
}

:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(input[type="checkbox"], input[type="radio"]):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	width: 16px !important;
	height: 16px !important;
	margin: 0 6px 0 0 !important;
	accent-color: var(--oglasnik-accent, #2563eb) !important;
	cursor: pointer !important;
	flex-shrink: 0 !important;
}

/* Dugmad bez sopstvene klase - neutralna osnova (bez browserove sive pozadine i ivice). */
:where(:is([class^="oglasnik-"], [class*=" oglasnik-"]):not(body, .oglasnik-theme-main) :is(button, input[type="submit"], input[type="button"], input[type="reset"]):not(.leaflet-container, .leaflet-container *, .gm-style, .gm-style *, .cf-turnstile, .cf-turnstile *)) {
	appearance: none !important;
	-webkit-appearance: none !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	cursor: pointer !important;
}

/* ---------- 4. Pomocne klase ---------- */

/*
 * Jedini nacin skrivanja/prikazivanja iz JS-a i sablona (inline style.display
 * bi bio ignorisan - pregazio bi ga !important iz ostalih pravila). :not(#...)
 * podize specificnost iznad svih komponentnih pravila sa display-om.
 */
.oglasnik-is-hidden:not(#oglasnik-x) {
	display: none !important;
}

} /* @layer oglasnik */
