/* Szablon "pocztowki" 2.0 – Stary Poznań */

:root {
	--paper: #f6f3ec;
	--paper-2: #efe9dc;
	--card: #ffffff;
	--ink: #24231f;
	--ink-soft: #4a4740;
	--muted: #6b675e;
	--line: #e2dccd;
	--green: #8ebd3c;
	--green-deep: #3c5a17;
	--link: #4a7519;
	--link-hover: #2f4c0f;
	--footer: #23261f;
	--footer-ink: #e9e6dd;
	--radius: 14px;
	--shadow-sm: 0 1px 2px rgba(36, 35, 31, .06), 0 2px 8px rgba(36, 35, 31, .05);
	--shadow: 0 2px 4px rgba(36, 35, 31, .05), 0 12px 32px rgba(36, 35, 31, .09);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.7 var(--sans);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: -.005em; }

.container { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: .6em 1em; border-radius: 8px; }
.skip-link:focus { left: 8px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 30;
	background: rgba(246, 243, 236, .92);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-top: 5px solid var(--green);
	border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; }

.brand { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__stamp { color: var(--green-deep); display: grid; place-items: center; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__kicker { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.brand__title { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.25rem); font-weight: 600; margin-top: .2rem; }

.nav-toggle {
	display: none; align-items: center; gap: .55rem;
	font: 600 .95rem var(--sans); color: var(--ink);
	background: var(--card); border: 1px solid var(--line); border-radius: 999px;
	padding: .55rem 1rem; cursor: pointer; box-shadow: var(--shadow-sm);
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, opacity .2s; }
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Hero slider ---------- */
.hero { padding-top: clamp(16px, 3vw, 32px); }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--paper-2); aspect-ratio: 960 / 350; }
.slider__slide { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity 1.1s ease; }
.slider__slide.is-active { opacity: 1; }
.slider__slide a, .slider__slide img { display: block; width: 100%; height: 100%; }
.slider__slide img { object-fit: cover; }
.slider::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); border-radius: inherit; }
.slider__dots { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; padding: 6px 10px; border-radius: 999px; background: rgba(20, 20, 18, .35); }
.slider__dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; }
.slider__dot[aria-current="true"] { background: #fff; }
/* before JS: show first slide */
.slider:not(.is-ready) .slider__slide:first-child { opacity: 1; }

/* ---------- Layout ---------- */
.layout { display: grid; gap: clamp(20px, 3vw, 40px); padding-block: clamp(20px, 4vw, 48px); }
.layout.has-sidebar { grid-template-columns: 290px minmax(0, 1fr); align-items: start; }

.sidebar { position: sticky; top: 104px; max-height: calc(100vh - 124px); overflow: auto; scrollbar-width: thin; }
.sidebar__nav { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem .7rem .8rem; }
.sidebar__title { font-size: .78rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 .7rem .6rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
	display: block; padding: .55rem .75rem; border-radius: 9px;
	color: var(--ink-soft); text-decoration: none; font-size: .98rem; line-height: 1.35;
	border-left: 3px solid transparent; transition: background .15s, color .15s, border-color .15s;
}
.sidebar li a:hover { background: var(--paper); color: var(--ink); border-left-color: var(--green); }
.sidebar li.current > a, .sidebar li.active > a, .sidebar li a[aria-current="page"] { background: #eef5e2; color: var(--green-deep); font-weight: 600; border-left-color: var(--green); }

/* ---------- Content ---------- */
.content { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: clamp(20px, 4vw, 48px); }
.content:focus { outline: none; }
.content > :first-child { margin-top: 0; }
.content h1, .content .page-header h1, .content .page-header h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 1.2rem; }
.content .page-header { margin-bottom: 1.2rem; padding-bottom: .9rem; border-bottom: 2px solid var(--paper-2); }
.content .page-header h1, .content .page-header h2 { margin: 0; }
.content p { margin: 0 0 1em; }
.content img { border-radius: 6px; }
.content table { max-width: 100%; border-collapse: collapse; }
.content .item-page > [itemprop="articleBody"], .content .com-content-article__body { overflow-wrap: anywhere; }
/* Word-pasted content: keep it readable in the new layout */
.com-content-article__body [style*="font-family"] { font-family: inherit !important; }
.com-content-article__body span[style*="font-size"] { font-size: inherit !important; }
.com-content-article__body p[style*="text-align: justify"] { text-align: left !important; }
.com-content-article__body img[style*="float: left"], .com-content-article__body img[align="left"] { margin: .3em 1.4em 1em 0; }
.com-content-article__body img[style*="float: right"], .com-content-article__body img[align="right"] { margin: .3em 0 1em 1.4em; }
.com-content-article__body::after { content: ""; display: table; clear: both; }

.article-info, .com-content-article__info { font-size: .85rem; color: var(--muted); }
.pagenavigation { margin-top: 2rem; }
.pagenavigation .pagination { display: flex; justify-content: space-between; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.pagenavigation a { display: inline-flex; align-items: center; gap: .4em; padding: .55em 1em; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: var(--paper); }
.pagenavigation a:hover { border-color: var(--green); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* category list ("Mapa strony") */
.com-content-category table { width: 100%; }
.com-content-category th, .com-content-category td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.com-content-category thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* ---------- Forms (contact) ---------- */
.content fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.content legend { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin-bottom: .8rem; }
.content .control-group { margin-bottom: 1rem; }
.content label { display: inline-block; font-weight: 600; margin-bottom: .3rem; }
.content input[type="text"], .content input[type="email"], .content textarea, .content select {
	width: 100%; max-width: 640px; font: inherit; color: var(--ink);
	background: #fff; border: 1px solid #cfc8b8; border-radius: 10px; padding: .7rem .9rem;
}
.content textarea { min-height: 180px; }
.content input:focus, .content textarea:focus { border-color: var(--green); outline: 3px solid rgba(142, 189, 60, .3); outline-offset: 0; }
.btn, .content button[type="submit"], .content .btn-primary {
	display: inline-flex; align-items: center; gap: .5em; font: 600 1rem var(--sans);
	color: #fff; background: var(--green-deep); border: 0; border-radius: 999px; padding: .75rem 1.5rem; cursor: pointer;
}
.btn:hover, .content button[type="submit"]:hover { background: #2c4410; color: #fff; }
.star { color: #a4361f; }
.form-control-feedback, .invalid-feedback { color: #a4361f; font-size: .9rem; }

/* system messages */
#system-message-container joomla-alert, .alert { display: block; padding: 1rem 1.2rem; border-radius: 10px; margin-bottom: 1rem; background: #eef5e2; border: 1px solid #cfe3ab; }
.alert-danger, .alert-error, joomla-alert[type="danger"] { background: #fbeae6; border-color: #efc4b9; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: var(--footer-ink); margin-top: clamp(8px, 2vw, 24px); border-top: 5px solid var(--green); }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: clamp(20px, 4vw, 48px); padding-block: clamp(32px, 5vw, 56px); }
.footer-box__title { font-size: .8rem; font-family: var(--sans); text-transform: uppercase; letter-spacing: .14em; color: var(--green); margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 .45rem; }
.site-footer a { color: var(--footer-ink); text-decoration: none; border-bottom: 1px solid rgba(233, 230, 221, .25); }
.site-footer a:hover { color: #fff; border-bottom-color: var(--green); }
.footer-cta { display: inline-block; padding: .55rem 1.1rem; border: 1px solid rgba(142,189,60,.6) !important; border-radius: 999px; }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 1.1rem 1.4rem; border-top: 1px solid rgba(233, 230, 221, .12); font-size: .88rem; color: #b9b5aa; }
.site-footer__bottom p { margin: 0; }

/* ---------- Cookie bar ---------- */
.cookie-bar {
	position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; margin-inline: auto; max-width: 760px;
	display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: space-between;
	background: var(--ink); color: #f1eee6; padding: .9rem 1.1rem; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.25); font-size: .92rem;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar p { margin: 0; flex: 1 1 320px; }
.cookie-bar a { color: #c9e59a; }
.cookie-bar__ok { font: 600 .92rem var(--sans); background: var(--green); color: #1d2a0b; border: 0; border-radius: 999px; padding: .55rem 1.2rem; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.layout.has-sidebar { grid-template-columns: minmax(0, 1fr); }
	.nav-toggle { display: inline-flex; }
	.sidebar { position: static; max-height: none; overflow: visible; display: none; }
	.sidebar.is-open { display: block; }
	.site-footer__grid { grid-template-columns: minmax(0, 1fr); }
	.site-header__inner { min-height: 70px; }
	.brand__stamp svg { width: 36px; height: 36px; }
}
@media (max-width: 560px) {
	body { font-size: 1rem; }
	.brand__kicker { font-size: .62rem; letter-spacing: .1em; }
	.nav-toggle__label { display: none; }
	.slider__dots { bottom: 8px; }
	.content { border-radius: 12px; }
}

@media print {
	.site-header, .sidebar, .site-footer, .cookie-bar, .hero, .nav-toggle { display: none !important; }
	.layout.has-sidebar { display: block; }
	.content { border: 0; box-shadow: none; padding: 0; }
}
