/* =====================================================================
   Dječji vrtić Dekanovec - Joomla 6 template
   ===================================================================== */

/* ---------- 1. Tema / varijable ---------- */
:root {
	--c-primary: #FF7A59;
	--c-secondary: #2EC4B6;
	--c-accent: #FFC93C;
	--c-pink: #FF6FB5;

	--c-ink: #353a5a;
	--c-ink-soft: #5b607a;
	--c-muted: #8a8fa6;
	--c-line: #ece8f0;
	--c-bg: #ffffff;
	--c-cream: #fff8f0;

	--container-w: 1200px;
	--radius-sm: 10px;
	--radius: 18px;
	--radius-lg: 28px;
	--shadow-sm: 0 4px 14px rgba(53, 58, 90, .08);
	--shadow: 0 14px 40px rgba(53, 58, 90, .12);
	--shadow-color: 0 10px 24px rgba(255, 122, 89, .35);

	--font-head: "Fredoka", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
	--font-body: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;

	--header-h: 84px;
}

/* ---------- 2. Reset / baza ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	color: var(--c-ink);
	background: var(--c-bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--c-primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--c-pink); }

ul, ol { padding-left: 1.2em; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	color: var(--c-ink);
	line-height: 1.2;
	margin: 0 0 .6em;
	font-weight: 600;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }

p { margin: 0 0 1.1em; }

/* ---------- 3. Layout helpers ---------- */
.container {
	width: 100%;
	max-width: var(--container-w);
	margin-inline: auto;
	padding-inline: 20px;
}

.grid-auto { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.site-main { padding: 56px 0; min-height: 40vh; }

/* ---------- 4. Gumbi ---------- */
.btn,
.btn-cta,
button.button,
.item-page a.btn,
input[type="submit"],
.readmore a,
a.readmore {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	padding: 14px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--c-primary);
	color: #fff;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
	box-shadow: var(--shadow-color);
	text-decoration: none;
}
.btn:hover,
.btn-cta:hover,
input[type="submit"]:hover,
a.readmore:hover {
	color: #fff;
	transform: translateY(-2px);
	background: var(--c-pink);
}
.btn-secondary { background: var(--c-secondary); box-shadow: 0 10px 24px rgba(46,196,182,.32); }
.btn-ghost { background: transparent; color: var(--c-primary); box-shadow: none; border: 2px solid var(--c-primary); }
.btn-ghost:hover { background: var(--c-primary); color: #fff; }

/* ---------- 5. Pristupačnost ---------- */
.skip-link {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 2000;
	background: var(--c-ink);
	color: #fff;
	padding: 10px 18px;
	border-radius: 0 0 12px 12px;
	transition: top .2s ease;
}
.skip-link:focus { top: 0; color: #fff; }

:focus-visible { outline: 3px solid var(--c-secondary); outline-offset: 2px; border-radius: 4px; }

/* ---------- 6. Gornja traka ---------- */
.topbar {
	background: var(--c-ink);
	color: #fff;
	font-size: .9rem;
}
.topbar a { color: #fff; }
.topbar a:hover { color: var(--c-accent); }
.topbar-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	align-items: center;
	justify-content: space-between;
	padding-block: 8px;
}
.topbar-contact { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.topbar-item { display: inline-flex; align-items: center; gap: 6px; }
.topbar-extra { display: flex; align-items: center; gap: 14px; }
.topbar-social { display: inline-flex; gap: 8px; }
.topbar-social a {
	width: 26px; height: 26px;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.15);
	border-radius: 50%;
	font-size: .72rem; font-weight: 700; text-transform: uppercase;
}
.topbar-social a:hover { background: var(--c-primary); }

/* ---------- 7. Zaglavlje + navigacija ---------- */
.site-header {
	background: rgba(255,255,255,.95);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--c-line);
	z-index: 1000;
}
.has-sticky .site-header { position: sticky; top: 0; }
.site-header.is-stuck { box-shadow: var(--shadow-sm); }

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: var(--header-h);
}

.site-logo { display: inline-flex; align-items: center; gap: 12px; }
.site-logo-img { width: 56px; height: 56px; }
.site-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-logo-title { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--c-ink); }
.site-logo-sub { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--c-primary); font-weight: 700; }

/* Navigacija */
.primary-nav { display: flex; align-items: center; gap: 18px; }
.primary-nav .nav-close { display: none; }

.primary-nav ul,
.primary-nav .mod-menu {
	list-style: none;
	margin: 0; padding: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}
.primary-nav li { position: relative; }
.primary-nav a,
.primary-nav .mod-menu > li > a,
.primary-nav span.nav-header {
	display: block;
	font-family: var(--font-head);
	font-weight: 500;
	color: var(--c-ink);
	padding: 10px 16px;
	border-radius: 999px;
	white-space: nowrap;
}
.primary-nav a:hover { background: var(--c-cream); color: var(--c-primary); }
.primary-nav .current > a,
.primary-nav .active > a,
.primary-nav li.active > a { background: var(--c-primary); color: #fff; }

/* Dropdown podizbornici */
.primary-nav li ul {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 220px;
	background: #fff;
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 8px;
	flex-direction: column;
	gap: 2px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
	z-index: 50;
}
.primary-nav li:hover > ul,
.primary-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.primary-nav li ul a { color: var(--c-ink-soft); }
.primary-nav li ul li { width: 100%; }
.primary-nav li.parent > a::after { content: "▾"; margin-left: 6px; font-size: .75em; opacity: .6; }

.nav-cta { margin-left: 8px; }

/* Hamburger */
.nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	width: 46px; height: 46px;
	padding: 11px;
	background: var(--c-cream);
	border: 0;
	border-radius: 12px;
	cursor: pointer;
}
.nav-toggle span { display: block; height: 3px; border-radius: 3px; background: var(--c-ink); transition: transform .25s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.nav-backdrop { position: fixed; inset: 0; background: rgba(53,58,90,.5); z-index: 998; }

/* ---------- 8. Hero ---------- */
.hero {
	position: relative;
	background:
		radial-gradient(1100px 380px at 85% -10%, rgba(255,201,60,.35), transparent 60%),
		radial-gradient(900px 360px at 10% 0%, rgba(46,196,182,.25), transparent 55%),
		var(--c-cream);
	padding: 64px 0 96px;
	overflow: hidden;
	text-align: center;
}
.hero .container { position: relative; z-index: 2; }
.hero h1 { margin-bottom: .3em; }
.hero p { font-size: 1.15rem; color: var(--c-ink-soft); max-width: 680px; margin-inline: auto; }

.hero-decoration span {
	position: absolute;
	border-radius: 50%;
	opacity: .5;
	animation: floaty 7s ease-in-out infinite;
}
.hero-decoration span:nth-child(1) { width: 90px; height: 90px; background: var(--c-pink); top: 18%; left: 8%; }
.hero-decoration span:nth-child(2) { width: 60px; height: 60px; background: var(--c-secondary); top: 60%; left: 14%; animation-delay: 1.5s; }
.hero-decoration span:nth-child(3) { width: 110px; height: 110px; background: var(--c-accent); top: 24%; right: 7%; animation-delay: .8s; }

@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-22px); } }

.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; line-height: 0; z-index: 1; }
.hero-wave svg { width: 100%; height: 80px; }
.hero-wave path { fill: var(--c-bg); }

/* ---------- 9. Kartice / moduli ---------- */
.card-module {
	background: #fff;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	padding: 26px;
	box-shadow: var(--shadow-sm);
	transition: transform .2s ease, box-shadow .2s ease;
}
.row-top .card-module:hover,
.row-bottom .card-module:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-module-title {
	margin-top: 0;
	margin-bottom: 18px;
	position: relative;
	padding-bottom: 12px;
}
.card-module-title::after {
	content: "";
	position: absolute;
	left: 0; bottom: 0;
	width: 46px; height: 4px;
	border-radius: 4px;
	background: var(--c-accent);
}
.card-module-body > :last-child { margin-bottom: 0; }
.card-module ul { list-style: none; padding: 0; }
.card-module ul li { padding: 8px 0; border-bottom: 1px dashed var(--c-line); }
.card-module ul li:last-child { border-bottom: 0; }

.row-top { padding: 56px 0; }
.row-bottom { padding: 56px 0; background: var(--c-cream); }

/* ---------- 10. Glavni grid / sidebar ---------- */
.main-grid { display: grid; gap: 36px; grid-template-columns: 1fr; }
.main-grid.has-left { grid-template-columns: 300px 1fr; }
.main-grid.has-right { grid-template-columns: 1fr 300px; }
.main-grid.has-left.has-right { grid-template-columns: 280px 1fr 280px; }
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.content-area { min-width: 0; }
.content-area > * + * { margin-top: 28px; }

/* ---------- 11. Breadcrumbs ---------- */
.breadcrumbs-wrap { background: var(--c-cream); padding: 14px 0; border-bottom: 1px solid var(--c-line); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); }
.breadcrumb .divider { color: var(--c-muted); }

/* ---------- 12. Footer ---------- */
.site-footer { color: #e8eaf2; background: var(--c-ink); margin-top: auto; }
.footer-top { padding: 60px 0 40px; }
.grid-footer {
	display: grid;
	gap: 36px;
	grid-template-columns: 1.4fr 1fr 1.2fr;
}
.footer-title { color: #fff; font-size: 1.2rem; margin-bottom: 18px; }
.footer-logo .site-logo-img { width: 64px; height: 64px; background: #fff; border-radius: 18px; padding: 6px; }
.footer-tagline { color: #b9bdce; margin-top: 16px; max-width: 32ch; }
.footer-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.footer-contact li { display: flex; gap: 10px; color: #d7dae6; }
.footer-contact a { color: #d7dae6; }
.footer-contact a:hover { color: var(--c-accent); }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.footer-social a {
	padding: 8px 16px;
	background: rgba(255,255,255,.08);
	border-radius: 999px;
	color: #fff;
	font-weight: 600;
	font-size: .9rem;
}
.footer-social a:hover { background: var(--c-primary); }
.map-frame { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 11; box-shadow: var(--shadow-sm); }
.map-frame iframe { width: 100%; height: 100%; border: 0; }
.footer-modules .card-module { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #e8eaf2; box-shadow: none; }
.footer-modules .card-module-title { color: #fff; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; }
.footer-bottom-inner { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; font-size: .9rem; color: #aab0c4; }
.footer-bottom a { color: var(--c-accent); }

/* ---------- 13. Natrag na vrh ---------- */
.back-to-top {
	position: fixed;
	right: 22px; bottom: 22px;
	width: 50px; height: 50px;
	border: 0; border-radius: 50%;
	background: var(--c-primary);
	color: #fff; font-size: 1.3rem;
	cursor: pointer;
	box-shadow: var(--shadow-color);
	opacity: 0; transform: translateY(16px);
	transition: opacity .25s ease, transform .25s ease, background .2s;
	z-index: 900;
}
.back-to-top.is-visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--c-pink); }

/* ---------- 14. Joomla sadržaj ---------- */
.item-page, .blog, .com-content-category-blog { font-size: 1.02rem; }
.page-header h1, .page-header h2 { margin-bottom: .2em; }
.article-info { color: var(--c-muted); font-size: .9rem; margin-bottom: 1.2em; }
.article-info dd { display: inline-block; margin: 0 14px 0 0; }
.item-image img, .article-img img, .item-page img { border-radius: var(--radius); }
.item-page figure { margin: 0 0 1.2em; }
blockquote {
	margin: 1.5em 0; padding: 18px 24px;
	background: var(--c-cream);
	border-left: 5px solid var(--c-secondary);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
hr { border: 0; border-top: 1px solid var(--c-line); margin: 2em 0; }

.blog-items { display: grid; gap: 30px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.blog-items .item {
	background: #fff;
	border: 1px solid var(--c-line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform .2s ease, box-shadow .2s ease;
}
.blog-items .item:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.blog-items .item > * { padding-inline: 22px; }
.blog-items .item .item-image, .blog-items .item > img:first-child { padding: 0; }
.blog-items .item h2 { margin-top: 18px; font-size: 1.3rem; }
.blog-items .item .readmore { padding-bottom: 22px; }

/* Sustavne poruke */
#system-message-container { margin-bottom: 24px; }
.alert {
	border-radius: var(--radius-sm);
	padding: 14px 18px;
	margin-bottom: 14px;
	border: 1px solid transparent;
	display: flex; gap: 12px; align-items: flex-start;
}
.alert-success { background: #e6f8f1; color: #146c43; border-color: #b6e6d2; }
.alert-info    { background: #e7f4fb; color: #1c6390; border-color: #bfe2f3; }
.alert-warning { background: #fff6e0; color: #8a5a00; border-color: #ffe2a8; }
.alert-danger, .alert-error { background: #fdeaea; color: #b32430; border-color: #f6c4c8; }
.alert .btn-close, .alert .close { margin-left: auto; background: none; border: 0; font-size: 1.2rem; cursor: pointer; opacity: .6; }

/* Paginacija */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 30px 0 0; justify-content: center; }
.pagination .page-link {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 12px;
	border-radius: 12px; border: 1px solid var(--c-line);
	color: var(--c-ink); font-weight: 600;
}
.pagination .page-link:hover { background: var(--c-cream); }
.pagination .active .page-link { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pagination .disabled .page-link { opacity: .4; pointer-events: none; }

/* Obrasci */
label { font-weight: 600; }
input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
textarea, select, .form-control {
	width: 100%;
	max-width: 100%;
	padding: 12px 16px;
	font: inherit;
	color: var(--c-ink);
	background: #fff;
	border: 2px solid var(--c-line);
	border-radius: var(--radius-sm);
	transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus, select:focus, .form-control:focus {
	outline: 0;
	border-color: var(--c-secondary);
	box-shadow: 0 0 0 4px rgba(46,196,182,.18);
}
.control-group { margin-bottom: 18px; }
.control-label { display: block; margin-bottom: 6px; }

/* Tablice */
table.table, .item-page table {
	width: 100%; border-collapse: collapse; margin: 1.2em 0;
}
table.table th, table.table td, .item-page table th, .item-page table td {
	padding: 12px 14px; border-bottom: 1px solid var(--c-line); text-align: left;
}
table.table thead th { background: var(--c-cream); font-family: var(--font-head); }

/* ---------- 15. Error / Offline ---------- */
.error-page, .offline-page {
	min-height: 100vh; margin: 0;
	display: grid; place-items: center;
	background:
		radial-gradient(800px 300px at 80% 0%, rgba(255,201,60,.35), transparent 60%),
		radial-gradient(700px 300px at 10% 10%, rgba(46,196,182,.25), transparent 55%),
		var(--c-cream);
	padding: 24px;
}
.error-card, .offline-card {
	background: #fff; text-align: center;
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow);
	padding: 48px 40px; max-width: 520px; width: 100%;
}
.error-logo, .offline-logo { width: 88px; height: 88px; margin: 0 auto 18px; }
.error-code { font-family: var(--font-head); font-weight: 700; font-size: 4.5rem; color: var(--c-primary); line-height: 1; }
.error-message, .offline-message { color: var(--c-ink-soft); font-size: 1.1rem; margin: 12px 0 26px; }
.error-debug { text-align: left; background: var(--c-cream); border-radius: 12px; padding: 16px; font-size: .85rem; margin-bottom: 22px; overflow:auto; }
.offline-form { text-align: left; display: grid; gap: 14px; max-width: 320px; margin: 0 auto; }
.offline-form .btn-cta { justify-content: center; }

/* ---------- 16. Responsive ---------- */
@media (max-width: 991px) {
	.main-grid.has-left, .main-grid.has-right, .main-grid.has-left.has-right { grid-template-columns: 1fr; }
	.grid-footer { grid-template-columns: 1fr 1fr; }
	.topbar-hours { display: none; }
}

@media (max-width: 860px) {
	.nav-toggle { display: flex; }
	.primary-nav {
		position: fixed;
		top: 0; right: 0; bottom: 0;
		width: min(86vw, 340px);
		background: #fff;
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
		padding: 84px 22px 30px;
		box-shadow: -10px 0 40px rgba(53,58,90,.2);
		transform: translateX(105%);
		transition: transform .3s ease;
		overflow-y: auto;
		z-index: 999;
	}
	body.nav-open .primary-nav { transform: translateX(0); }
	body.nav-open { overflow: hidden; }
	.primary-nav .nav-close {
		display: block; position: absolute; top: 18px; right: 18px;
		width: 42px; height: 42px; border: 0; border-radius: 12px;
		background: var(--c-cream); font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--c-ink);
	}
	.primary-nav ul, .primary-nav .mod-menu { flex-direction: column; align-items: stretch; gap: 2px; width: 100%; }
	.primary-nav a { padding: 12px 16px; }
	.primary-nav li ul {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; padding: 0 0 0 14px; min-width: 0;
		max-height: 0; overflow: hidden; transition: max-height .3s ease;
	}
	.primary-nav li.is-open > ul { max-height: 600px; }
	.primary-nav li.parent > a::after { float: right; }
	.nav-cta { margin: 10px 0 0; justify-content: center; }
	.nav-search { margin-top: 10px; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.grid-footer { grid-template-columns: 1fr; }
	.site-main { padding: 40px 0; }
	.row-top, .row-bottom { padding: 40px 0; }
	.hero { padding: 44px 0 80px; }
	.site-logo-img { width: 48px; height: 48px; }
	.footer-bottom-inner { justify-content: center; text-align: center; }
}

/* ---------- 17. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
