/*
 * 3B-AUTO — stilovi teme.
 * Boje, tipografija i razmaci definirani su u theme.json; ovdje je samo ono
 * što blokovi sami ne pokrivaju. Bez vanjskih biblioteka.
 */

/* --- Osnove ------------------------------------------------------------ */

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

img, video { max-width: 100%; height: auto; }

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, textarea, select):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-light);
	outline-offset: 2px;
	border-radius: 4px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--wp--preset--color--accent);
	color: #ffffff;
	padding: .75rem 1.25rem;
	z-index: 1000;
	font-weight: 700;
}

.skip-link:focus { left: .5rem; top: .5rem; }

/* --- Zaglavlje --------------------------------------------------------- */

.tba-header {
	position: sticky;
	top: 0;
	z-index: 500;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

/* Zamućenje je na pseudo-elementu: backdrop-filter na samom zaglavlju zarobio bi
   mobilni izbornik (position: fixed) unutar visine zaglavlja pa se ne bi vidio. */
.tba-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(11, 22, 38, .9);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

/* Logotip + naziv + djelatnost kao jedna cjelina. */
.tba-brand .wp-block-site-logo img { display: block; }

.tba-brand__text { gap: .1rem; }

.tba-brand .wp-block-site-title {
	line-height: 1.05;
	margin: 0;
}

.tba-brand .wp-block-site-title a { text-decoration: none; }

.tba-brand__tagline {
	margin: 0;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	line-height: 1.2;
	white-space: nowrap;
}

/* Na uskim ekranima zaglavlje mora ostati nisko: ostaje samo logotip i naziv. */
@media (max-width: 782px) {
	.tba-brand .wp-block-site-logo img { width: 56px; }
	.tba-brand__tagline { display: none; }
}

/* Otvoren mobilni izbornik iznad trake za poziv. */
.tba-header:has(.is-menu-open) { z-index: 1000; }

.tba-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.25rem 1.5rem 2rem;
}

.tba-header .is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 3.5rem;
}

.tba-header .is-menu-open .wp-block-navigation__container,
.tba-header .is-menu-open .wp-block-page-list {
	gap: 0 !important;
	width: 100%;
	align-items: stretch !important;
}

.tba-header .is-menu-open .wp-block-navigation-item {
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.tba-header .is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 1rem .25rem !important;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.6rem;
	font-weight: 600;
	color: var(--wp--preset--color--white);
}

.tba-header .is-menu-open .wp-block-navigation-item__content:hover,
.tba-header .is-menu-open .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--accent-light); }

.tba-header .wp-block-navigation__responsive-container-close { top: 1.5rem; right: 1.5rem; }
.tba-header .wp-block-navigation__responsive-container-close svg { width: 30px; height: 30px; }

.tba-header .wp-block-navigation a { text-decoration: none; }
.tba-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent-light); }

.tba-header__tel .tba-tel {
	color: var(--wp--preset--color--white);
	background: rgba(255, 255, 255, .06);
	border: 1px solid var(--wp--preset--color--line);
	padding: .6rem 1rem;
	border-radius: 12px;
}

.tba-header__tel .tba-tel:hover { border-color: var(--wp--preset--color--accent-light); }
.tba-header__tel .tba-icon { color: var(--wp--preset--color--accent-light); }

/* --- Hero -------------------------------------------------------------- */

.tba-hero {
	position: relative;
	min-height: clamp(520px, 78vh, 760px);
	display: flex;
	align-items: flex-end;
}

.tba-hero .wp-block-cover__inner-container { width: 100%; }

/* Tamno plavi zastor preko fotografije, da hero prati paletu bez obzira na boje slike. */
.tba-hero > .wp-block-cover__background {
	background: var(--wp--preset--gradient--hero-veil) !important;
	opacity: 1 !important;
}

/* object-position: kadar se po visini rezze; pomak prema gore zadrzava i krov vozila
   i donji dio kabine s natpisom na vratima. */
/* Slika je u <picture> (manja inačica za mobitel, vidi functions.php), pa selektor nije ">". */
.tba-hero .tba-hero__slika { display: contents; }

.tba-hero .wp-block-cover__image-background {
	filter: saturate(.7);
	object-position: center 25%;
}

/* Zamucenje samo ispod teksta, koje se prema desno postupno gubi.
   Radi preko backdrop-filtera, pa ostaje i kad se fotografija zamijeni drugom.
   Napomena: desna strana moze biti ostra samo onoliko koliko je ostra sama fotografija. */
@media (min-width: 601px) {
	.tba-hero::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		pointer-events: none;
		backdrop-filter: blur(18px) saturate(.9);
		-webkit-backdrop-filter: blur(18px) saturate(.9);
		-webkit-mask-image: linear-gradient(to right, #000 0%, #000 40%, rgba(0, 0, 0, .6) 56%, rgba(0, 0, 0, .2) 70%, transparent 82%);
		mask-image: linear-gradient(to right, #000 0%, #000 40%, rgba(0, 0, 0, .6) 56%, rgba(0, 0, 0, .2) 70%, transparent 82%);
	}

	/* Tamni zastor se prema desno stanjuje da se fotografija bolje vidi. */
	.tba-hero > .wp-block-cover__background {
		-webkit-mask-image: linear-gradient(to right, #000 0%, #000 42%, rgba(0, 0, 0, .74) 62%, rgba(0, 0, 0, .45) 100%);
		mask-image: linear-gradient(to right, #000 0%, #000 42%, rgba(0, 0, 0, .74) 62%, rgba(0, 0, 0, .45) 100%);
	}

	/* Stariji preglednici bez backdrop-filtera: vrati puni zastor da tekst ostane citljiv. */
	@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		.tba-hero > .wp-block-cover__background {
			-webkit-mask-image: none;
			mask-image: none;
		}
	}
}

/* Mobitel: uspravni izrez iste fotografije (auto na platformi), umjesto uske trake široke slike. */
@media (max-width: 600px) {
	/* Uspravni izrez dolazi iz <source media="(max-width: 600px)"> u HTML-u, ne iz CSS-a:
	   tako ga preglednik nađe odmah i ne preuzima uz njega i široku sliku. */
	.tba-hero .wp-block-cover__image-background { object-position: center 20%; }

	/* Ista zamisao kao na racunalu, samo okrenuta za 90 stupnjeva:
	   gore vozilo ostro, prema dolje se zamucuje jer ondje stoji tekst. */
	.tba-hero::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		pointer-events: none;
		backdrop-filter: blur(14px) saturate(.9);
		-webkit-backdrop-filter: blur(14px) saturate(.9);
		-webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .18) 34%, rgba(0, 0, 0, .7) 50%, #000 62%);
		mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .18) 34%, rgba(0, 0, 0, .7) 50%, #000 62%);
	}

	/* Zastor smije biti svjetliji nego prije jer citljivost sada drzi zamucenje. */
	.tba-hero > .wp-block-cover__background {
		background: linear-gradient(180deg, rgba(11, 22, 38, .26) 0%, rgba(11, 22, 38, .44) 34%, rgba(11, 22, 38, .72) 58%, rgba(11, 22, 38, .84) 100%) !important;
		-webkit-mask-image: none;
		mask-image: none;
	}

	/* Bez podrske za backdrop-filter: vrati tamniji zastor da tekst ostane citljiv. */
	@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
		.tba-hero > .wp-block-cover__background {
			background: linear-gradient(180deg, rgba(11, 22, 38, .3) 0%, rgba(11, 22, 38, .62) 38%, rgba(11, 22, 38, .9) 70%, rgba(11, 22, 38, .97) 100%) !important;
		}
	}
}

.tba-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .75rem;
	font-size: clamp(1.05rem, 2.2vw, 1.35rem);
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-light);
	margin: 0 0 1rem;
}

.tba-hero__eyebrow::before {
	content: "";
	width: 44px;
	height: 3px;
	background: var(--wp--preset--color--accent);
	display: inline-block;
}

.tba-hero h1 {
	font-size: var(--wp--preset--font-size--hero);
	text-transform: uppercase;
	letter-spacing: -0.02em;
	max-width: 16ch;
}

.tba-hero__sub { max-width: 60ch; color: var(--wp--preset--color--text); }

.tba-hero__points {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	max-width: none; /* smije biti šire od tekstnog stupca (820px), da stane u jedan red */
	color: var(--wp--preset--color--muted);
	font-weight: 600;
}

.tba-hero__points li::before {
	content: "";
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	margin-right: .6rem;
	vertical-align: middle;
}

/* --- Sekcije ----------------------------------------------------------- */

.tba-section { padding-block: var(--wp--preset--spacing--60); }
.tba-section--tight { padding-block: var(--wp--preset--spacing--50); }

/* Zaglavlje sekcije poravnato s lijevim rubom mreže (kartica), a ne centrirano u uskom stupcu. */
.tba-section > .tba-section__head {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	margin-bottom: var(--wp--preset--spacing--40);
}

.tba-section__head > * {
	max-width: 65ch !important;
	margin-left: 0 !important;
	margin-right: auto !important;
}

.tba-section__head h2 { margin-top: .35rem; }

.is-style-nadnaslov {
	font-size: .85rem !important;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-light) !important;
	margin-bottom: .5rem;
	display: flex;
	align-items: center;
	gap: .65rem;
}

.is-style-nadnaslov::before {
	content: "";
	width: 28px;
	height: 2px;
	background: var(--wp--preset--color--accent);
	flex: none;
}

.has-text-align-center.is-style-nadnaslov { justify-content: center; }

.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	color: var(--wp--preset--color--text);
	line-height: 1.55;
}

.is-style-kartica {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	padding: 1.75rem;
}

/* Prednosti ("Zašto odabrati nas"): ploče s crvenim rubom na vrhu. */
.is-style-prednosti { gap: 1.25rem !important; }

.is-style-prednosti .wp-block-column {
	background: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-top: 3px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--md);
	padding: 1.6rem 1.5rem 1.75rem;
}

.is-style-prednosti h3 {
	font-size: 1.45rem;
	margin: 0 0 .6rem;
}

.is-style-prednosti p { margin: 0; font-size: 1rem; line-height: 1.6; }

/* Mobitel/tablet: prednosti 2 × 2 umjesto jedne ispod druge. */
@media (max-width: 781px) {
	.is-style-prednosti {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: .65rem !important;
	}
	.is-style-prednosti .wp-block-column { flex-basis: auto !important; padding: 1rem .9rem 1.1rem; }
	.is-style-prednosti h3 { font-size: 1.12rem; margin-bottom: .4rem; }
	.is-style-prednosti p { font-size: .82rem; line-height: 1.45; }
}

.is-style-okvir img {
	border: 1px solid var(--wp--preset--color--line);
	box-shadow: var(--wp--preset--shadow--card);
}

/* --- Traka s brojkama / prednostima ------------------------------------ */

.tba-strip {
	background: var(--wp--preset--color--surface);
	border-block: 1px solid var(--wp--preset--color--line);
}

/* --- Česta pitanja (blokovi Details) ----------------------------------- */

/* Poravnato s lijevim rubom naslova sekcije, kao i ostale sekcije. */
.tba-section > .tba-faq {
	max-width: var(--wp--style--global--wide-size) !important;
	margin-left: auto !important;
	margin-right: auto !important;
}

.tba-faq > * {
	max-width: 860px !important;
	margin-left: 0 !important;
	margin-right: auto !important;
}

.tba-faq .wp-block-details {
	background: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius--md);
	padding: 0;
	margin: 0 0 .65rem;
}

.tba-faq summary {
	cursor: pointer;
	list-style: none;
	padding: 1.05rem 3rem 1.05rem 1.25rem;
	font-weight: 700;
	font-size: 1.08rem;
	position: relative;
}

.tba-faq summary::-webkit-details-marker { display: none; }

.tba-faq summary::after {
	content: "+";
	position: absolute;
	right: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--accent-light);
}

.tba-faq details[open] summary::after { content: "\2212"; }

.tba-faq summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-light);
	outline-offset: 2px;
	border-radius: var(--wp--custom--radius--md);
}

.tba-faq .wp-block-details > p {
	margin: 0;
	padding: 0 1.25rem 1.15rem;
	color: var(--wp--preset--color--muted);
	line-height: 1.65;
}

/* --- Galerija ---------------------------------------------------------- */

.wp-block-gallery.tba-gallery img {
	border-radius: var(--wp--custom--radius--md);
	transition: transform .35s ease, filter .35s ease;
	filter: saturate(.92);
}

.wp-block-gallery.tba-gallery .wp-block-image:hover img {
	transform: scale(1.02);
	filter: saturate(1.05);
}

/* --- Podnožje ---------------------------------------------------------- */

.tba-footer {
	background: #07101d;
	border-top: 1px solid var(--wp--preset--color--line);
	padding-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
	color: var(--wp--preset--color--muted);
}

.tba-footer a { color: var(--wp--preset--color--text); text-decoration: none; }
.tba-footer a:hover { color: var(--wp--preset--color--accent-light); text-decoration: underline; }
.tba-footer h2, .tba-footer h3 { font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
/* Razdjelnik između linkova radi CSS, pa izostanak jednog linka
   (npr. ako stranica pravila privatnosti još ne postoji) ne ostavi visecu točku. */
.tba-footer__links a + a::before {
	content: "·";
	margin: 0 .55rem;
	color: var(--wp--preset--color--line);
}

.tba-footer__bottom { border-top: 1px solid var(--wp--preset--color--line); padding-top: 1.25rem; font-size: .9rem; }

/* --- Sadržaj članka ---------------------------------------------------- */

.tba-entry :where(h2) { margin-top: 2.5rem; }
.tba-entry :where(h3) { margin-top: 2rem; }

.tba-breadcrumbs {
	font-size: .9rem;
	color: var(--wp--preset--color--muted);
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	list-style: none;
	padding: 0;
	margin: 0 0 1rem;
}

.tba-breadcrumbs a { text-decoration: none; }
.tba-breadcrumbs li + li::before { content: "›"; margin-right: .4rem; color: var(--wp--preset--color--line); }

/* --- Diskretna animacija pri skrolanju --------------------------------- */

.tba-reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .5s ease, transform .5s ease;
	will-change: opacity, transform;
}

.tba-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.tba-reveal { opacity: 1; transform: none; transition: none; }
	.wp-block-gallery.tba-gallery img { transition: none; }
}

/* --- Sitnice ----------------------------------------------------------- */

.tba-muted { color: var(--wp--preset--color--muted); }

.wp-block-separator { opacity: .35; }

@media (max-width: 600px) {
	.tba-hero { min-height: clamp(460px, 70vh, 640px); }
	.tba-hero h1 { max-width: 100%; }
}

/* Podnožje: usluge jedna ispod druge, kontakt bez lomljenja, razmak iznad dostupnosti. */
.tba-footer .tba-usluge-popis { flex-direction: column; gap: .55rem; }
.tba-footer .tba-nap__value { overflow-wrap: normal; word-break: normal; }
.tba-footer .tba-hours__badge,
.tba-footer .tba-nap,
.tba-footer .tba-usluge-popis { margin-top: 1.4rem; }

/* --- Izbor jezika (HR · EN · DE) ---------------------------------------- */

.tba-lang {
	display: inline-flex;
	align-items: center;
	gap: .15rem;
	padding: .2rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 10px;
	background: rgba(255, 255, 255, .04);
}

.tba-lang__item {
	padding: .35rem .55rem;
	border-radius: 7px;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
}

.tba-lang__item:hover { color: var(--wp--preset--color--white); text-decoration: none; }
.tba-lang__item.is-current { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--white); }

/* Mobitel: zaglavlje u jednom redu (logo · jezici · izbornik). Broj telefona je
   ionako uvijek u traci "Nazovi" na dnu ekrana. */
@media (max-width: 600px) {
	.tba-header__row,
	.tba-header__row > .wp-block-group:last-child { flex-wrap: nowrap !important; }
	.tba-header__row > .wp-block-group:last-child { gap: .6rem !important; }
	.tba-header__tel { display: none !important; }
	.tba-header .wp-block-site-title { font-size: 1.15rem; }
	.tba-lang__item { padding: .35rem .45rem; font-size: .78rem; }
}

/* Tanka traka na vrhu samo za izbor jezika (desno). */
.tba-header { padding-top: 0 !important; }

.tba-topbar {
	background: rgba(0, 0, 0, .28);
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding-block: .25rem;
	margin-bottom: .75rem;
}

.tba-topbar .tba-lang { border: 0; background: none; padding: 0; gap: .1rem; }
.tba-topbar .tba-lang__item { padding: .3rem .5rem; font-size: .75rem; border-radius: 6px; }

/* Traka suradnika stoji odmah ispod hero sekcije, kao uska vrpca. */
.tba-partneri-sekcija {
	padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

/* --- Galerija kao carousel ---------------------------------------------- */

/* Vodoravno klizanje s "uskakanjem" slika. Bez JavaScript biblioteke:
   prst na mobitelu i kotačić/strelice na računalu rade sami od sebe. */
.tba-gallery-okvir {
	position: relative;
}

.wp-block-gallery.tba-gallery {
	display: flex;
	flex-wrap: nowrap;
	gap: .75rem;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: .75rem;
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--line) transparent;
}

.wp-block-gallery.tba-gallery::-webkit-scrollbar { height: 6px; }
.wp-block-gallery.tba-gallery::-webkit-scrollbar-track { background: transparent; }
.wp-block-gallery.tba-gallery::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--line);
	border-radius: 3px;
}

/* Svaka slika zadržava svoj omjer; ujednačena je samo visina.
   Selektori su namjerno "teški" jer jezgrin CSS galerije ima jaču specifičnost
   i inače bi slike rastegnuo preko cijele širine. */
.wp-block-gallery.has-nested-images.tba-gallery figure.wp-block-image {
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
	height: clamp(240px, 34vw, 380px);
	margin: 0;
	scroll-snap-align: center;
}

.wp-block-gallery.has-nested-images.tba-gallery figure.wp-block-image img {
	height: 100% !important;
	width: auto !important;
	max-width: none !important;
	object-fit: cover;
	flex: none;
}

/* Jezgra na neke slike stavlja apsolutno pozicioniran natpis — ovdje ga nema,
   ali pravilo bi inače moglo rastegnuti figuru. */
.wp-block-gallery.has-nested-images.tba-gallery figure.wp-block-image:not(#individual-image) {
	width: auto !important;
	max-width: none !important;
}

.wp-block-gallery.tba-gallery:focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 4px;
}

/* Strelice dodaje theme.js; bez JavaScripta galerija i dalje radi prstom i kotačićem. */
.tba-gallery-strelica {
	position: absolute;
	top: calc(50% - 1.5rem);
	transform: translateY(-50%);
	z-index: 2;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 50%;
	background: rgba(11, 22, 38, .9);
	backdrop-filter: blur(6px);
	color: var(--wp--preset--color--text);
	cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}

.tba-gallery-strelica:hover { border-color: var(--wp--preset--color--accent); }
.tba-gallery-strelica[disabled] { opacity: .25; cursor: default; }
.tba-gallery-strelica--prije { left: -14px; }
.tba-gallery-strelica--poslije { right: -14px; }
.tba-gallery-strelica svg { width: 20px; height: 20px; }

@media (max-width: 782px) {
	.tba-gallery-strelica { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-gallery.tba-gallery { scroll-behavior: auto; }
}

/* --- Poveznice na povezane usluge unutar teksta ------------------------- */

.tba-povezano { margin-top: .35rem; }

.tba-povezano a {
	font-weight: 700;
	color: var(--wp--preset--color--accent-light);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.tba-povezano a::after { content: " →"; }

.tba-povezano a:hover,
.tba-povezano a:focus-visible { color: var(--wp--preset--color--white); }
