/*
Theme Name: Portal Siwiałka – Herbowy
Theme URI: https://siwialka.pl/
Author: Sołectwo Siwiałka
Author URI: https://siwialka.pl/
Description: Lekki, mobilny motyw oficjalnego portalu sołectwa Siwiałka. Wariant "Herbowy" – kolorystyka nawiązująca do herbu wsi: głęboka czerwień, złoto i kremowa biel, nagłówki szeryfowe. Automatycznie tworzy strony, menu i przykładowe treści po aktywacji. Zoptymalizowany pod wytyczne Google (SEO, dane strukturalne, wydajność, dostępność).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: siwialka
Tags: one-column, custom-menu, custom-logo, featured-images, translation-ready
*/

:root {
	/* Typografia */
	--font-body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
	--font-display: "Bitter", Georgia, "Times New Roman", serif;

	/* Kształt */
	--radius: 10px;
	--radius-btn: 8px;

	/* Baza – kremowy papier, atrament */
	--bg: #FAF6EE;
	--paper: #FFFFFF;
	--ink: #2B2320;
	--heading: #6E1114;
	--muted: #6E625B;
	--muted-strong: #55483F;
	--line: #E8DFCE;
	--line-strong: #D8CBB2;

	/* Akcent herbowy */
	--accent: #A31D22;
	--accent-hover: #7F1418;
	--accent-ink: #FFF9EC;
	--link: #8C1A1F;
	--link-hover: #5F0F13;

	/* Panele / karty */
	--panel: #FFFFFF;
	--panel-alt: #F4ECDC;
	--panel-hover: #FDF9F0;

	/* Nagłówek strony */
	--header-bg: #FFFFFF;
	--header-ink: #2B2320;
	--header-muted: #7A6C60;
	--header-border: #A31D22;
	--header-divider: #F0E7D6;
	--header-hover: #FBF3E2;

	/* Kafelki na zdjęciu głównym */
	--tile-bg: rgba(110, 17, 20, 0.88);
	--tile-ink: #FFF6E3;
	--tile-border: rgba(242, 184, 7, 0.55);

	/* Baner sołtysa */
	--banner-bg: #6E1114;
	--banner-ink: #FFF6E3;
	--banner-eyebrow: #F2B807;
	--banner-ring: rgba(242, 184, 7, 0.7);

	/* Pasek CTA */
	--cta-bg: #F2B807;
	--cta-ink: #3A2C05;

	/* Stopka */
	--footer-bg: #2E1112;
	--footer-ink: #EBD9C8;
	--footer-heading: #F2B807;
	--footer-divider: rgba(242, 184, 7, 0.25);
}

/* ====================================================================
   Portal Siwiałka – warstwa wspólna (mobile-first)
   ==================================================================== */

*, *::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;
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	color: var(--ink);
	background: var(--bg);
}

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

h1, h2, h3, h4 {
	font-family: var(--font-display);
	line-height: 1.15;
	color: var(--heading);
	margin: 0 0 .5em;
	text-wrap: balance;
}
h1 { font-size: clamp(1.8rem, 5.5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: 1.2rem; }
p, ul, ol, figure { margin: 0 0 1.1em; }

.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	clip-path: inset(50%);
	overflow: hidden; white-space: nowrap;
}
.skip-link {
	position: absolute; left: -999px; top: 0;
	background: var(--heading); color: #fff;
	padding: .6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; color: #fff; }

/* ------------------------------------------------ Przyciski */
.button {
	display: inline-block;
	background: var(--accent);
	color: var(--accent-ink);
	border: 2px solid var(--accent);
	padding: .6rem 1.3rem;
	border-radius: var(--radius-btn);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	font-size: 1rem;
	font-family: var(--font-body);
	transition: background .15s ease, color .15s ease;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.button--light { background: #fff; border-color: #fff; color: var(--heading); }
.button--light:hover { background: var(--paper); border-color: var(--paper); color: var(--heading); }
.button--ghost { background: transparent; color: var(--footer-ink); border-color: currentColor; }
.button--ghost:hover { background: rgba(255,255,255,.12); color: var(--footer-ink); }

/* ------------------------------------------------ Nagłówek */
.site-header {
	background: var(--header-bg);
	color: var(--header-ink);
	border-bottom: var(--header-border);
	position: sticky; top: 0; z-index: 50;
}
.header-inner {
	display: flex; align-items: center; gap: .8rem;
	padding: .55rem 0;
	flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; margin-right: auto; }
.brand-herb { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
	font-family: var(--font-display);
	font-weight: 800; font-size: 1.25rem;
	color: var(--header-ink);
}
.brand-tag { font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; color: var(--header-muted); }

.nav-toggle {
	background: transparent; border: 2px solid var(--header-muted);
	color: var(--header-ink);
	border-radius: var(--radius-btn);
	padding: .4rem .7rem;
	display: flex; align-items: center; gap: .5rem;
	font: inherit; cursor: pointer;
}
.nav-toggle-bars { display: inline-flex; flex-direction: column; gap: 4px; }
.nav-toggle-bars span { width: 18px; height: 2px; background: currentColor; display: block; }
.nav-toggle-label { font-weight: 700; font-size: .95rem; }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: .3rem 0 .8rem; }
.site-nav li { position: relative; }
.site-nav a {
	display: block;
	padding: .65rem .4rem;
	color: var(--header-ink);
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid var(--header-divider);
}
.site-nav .sub-menu { display: none; padding-left: 1rem; }
.site-nav .menu-item-has-children.is-open > .sub-menu { display: block; }
.site-nav .sub-menu a { font-weight: 400; }
.submenu-toggle {
	position: absolute; right: 0; top: .25rem;
	background: transparent; border: 1px solid var(--header-divider);
	color: var(--header-ink);
	border-radius: 6px; width: 2.2rem; height: 2.2rem;
	cursor: pointer; font-size: 1rem;
}
.menu-item-has-children.is-open > .submenu-toggle span[aria-hidden] { display: inline-block; transform: rotate(180deg); }

@media (min-width: 960px) {
	.nav-toggle { display: none; }
	.site-nav { display: block; width: auto; }
	.site-nav ul { display: flex; gap: .1rem; padding: 0; align-items: center; }
	.site-nav a { border-bottom: 0; padding: .9rem .85rem; border-radius: var(--radius-btn); }
	.site-nav > ul > li > a:hover { background: var(--header-hover); }
	.submenu-toggle { position: static; width: 1.6rem; height: 1.6rem; border: 0; margin-left: -0.4rem; }
	.site-nav .sub-menu {
		position: absolute; left: 0; top: 100%;
		min-width: 14rem;
		background: var(--panel);
		border: 1px solid var(--line);
		border-radius: var(--radius);
		box-shadow: 0 14px 34px rgba(10, 26, 38, .16);
		padding: .4rem;
	}
	.site-nav .sub-menu a { color: var(--ink); padding: .55rem .7rem; }
	.site-nav .sub-menu a:hover { background: var(--panel-hover); }
	.site-nav .menu-item-has-children:hover > .sub-menu,
	.site-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
}

/* ------------------------------------------------ Hero + kafelki */
.hero { position: relative; }
.hero-img { width: 100%; height: min(72vh, 34rem); object-fit: cover; }
.hero-overlay {
	position: absolute; inset: 0 0 auto 0;
	padding-top: clamp(1.2rem, 6vw, 3.4rem);
	text-shadow: 0 1px 10px rgba(15, 32, 44, .45);
	color: #fff;
}
.hero-eyebrow {
	text-transform: uppercase; letter-spacing: .14em;
	font-size: .8rem; font-weight: 700; margin-bottom: .2rem;
	color: #fff;
}
.hero-title { color: #fff; margin-bottom: .15em; }
.hero-lead { font-size: clamp(1rem, 2.8vw, 1.25rem); max-width: 34ch; color: #fff; }

.hero-tiles { position: relative; margin-top: -3.4rem; padding-bottom: .4rem; }
.tiles-row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: .7rem;
}
.tile {
	display: flex; flex-direction: column; align-items: center; gap: .45rem;
	background: var(--tile-bg);
	color: var(--tile-ink);
	border: var(--tile-border);
	border-radius: var(--radius);
	padding: .8rem .5rem .7rem;
	text-decoration: none;
	font-weight: 700;
	text-align: center;
	box-shadow: 0 10px 26px rgba(12, 30, 42, .14);
	transition: transform .15s ease, box-shadow .15s ease;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(12, 30, 42, .2); color: var(--tile-ink); }
.tile img { width: 96px; height: 50px; object-fit: cover; border-radius: calc(var(--radius) - 6px); }
.tile span { font-size: .95rem; }
@media (min-width: 700px) {
	.tiles-row { grid-template-columns: repeat(5, 1fr); }
	.tile:last-child { grid-column: auto; }
}
@media (max-width: 699px) {
	.tile:last-child { grid-column: 1 / -1; }
}

/* ------------------------------------------------ Baner sołtysa */
.soltys-banner {
	background: var(--banner-bg);
	color: var(--banner-ink);
	margin-top: 2.2rem;
	padding: clamp(1.6rem, 5vw, 3rem) 0;
}
.soltys-inner { display: grid; gap: 1.2rem; justify-items: center; text-align: center; }
.soltys-photo {
	width: clamp(140px, 34vw, 220px); height: auto;
	border-radius: 50%;
	border: 5px solid var(--banner-ring);
	background: #fff;
}
.soltys-copy h2 { color: var(--banner-ink); font-size: clamp(1.3rem, 3.6vw, 1.9rem); }
.soltys-copy p { max-width: 56ch; color: var(--banner-ink); }
.section-eyebrow {
	text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
	font-size: .78rem; margin-bottom: .4rem; color: var(--banner-eyebrow);
}
@media (min-width: 760px) {
	.soltys-inner { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 2.4rem; }
}

/* ------------------------------------------------ Sekcje i karty */
.section { padding: clamp(1.8rem, 5vw, 3.2rem) 0; }
.section--alt { background: var(--panel-alt); }
.section-head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 0; }
.section-more { font-weight: 700; white-space: nowrap; }

.cards { display: grid; gap: 1.1rem; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(12, 30, 42, .12); }
.card-media { display: block; }
.card-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; }
.card-date { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.card-title { margin: .3rem 0 .4rem; font-size: 1.12rem; }
.card-title a { color: var(--heading); text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-body p { margin-bottom: 0; color: var(--muted-strong); }

/* ------------------------------------------------ Pasek CTA */
.cta-strip { background: var(--cta-bg); color: var(--cta-ink); padding: 1.6rem 0; }
.cta-inner { display: grid; gap: 1rem; justify-items: start; }
.cta-inner p { margin: 0; }
@media (min-width: 760px) { .cta-inner { grid-template-columns: 1fr auto; align-items: center; } }

/* ------------------------------------------------ Podstrony */
.page-hero { position: relative; }
.page-hero-img { width: 100%; height: clamp(11rem, 36vw, 20rem); object-fit: cover; }
.page-hero-overlay {
	position: absolute; inset: auto 0 0 0;
	background: linear-gradient(transparent, rgba(10, 24, 34, .72));
	color: #fff; padding: 2.4rem 0 1rem;
}
.page-hero-overlay .page-title { color: #fff; margin-bottom: .2em; }
.breadcrumbs { font-size: .85rem; margin-bottom: .3rem; }
.page-hero-overlay .breadcrumbs, .page-hero-overlay .breadcrumbs a { color: #eef4f8; }
.archive-hero { background: var(--panel-alt); padding: 1.6rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.archive-hero .breadcrumbs a { color: var(--link); }
.post-meta { color: var(--muted); font-size: .9rem; }

.page-layout { padding: clamp(1.4rem, 4vw, 2.6rem) 0 2.6rem; }
.entry-content { max-width: 46rem; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content ul li { margin-bottom: .35em; }
.entry-content img { border-radius: var(--radius); }
.soltys-foto { max-width: 320px; }
.soltys-foto img { border-radius: var(--radius); }
.soltys-foto figcaption { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.post-featured { border-radius: var(--radius); margin-bottom: 1.2rem; }

.related { margin-top: 2.4rem; border-top: 2px solid var(--line); padding-top: 1.4rem; }
.related-heading { font-size: 1.1rem; }
.related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
@media (min-width: 700px) { .related-list { grid-template-columns: repeat(3, 1fr); } }
.related-list a {
	display: flex; align-items: center; gap: .7rem;
	background: var(--panel); border: 1px solid var(--line);
	border-radius: var(--radius); padding: .5rem .7rem;
	text-decoration: none; font-weight: 600; color: var(--heading);
}
.related-list a:hover { background: var(--panel-hover); }
.related-list img { width: 74px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }

.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination-nav { margin-top: 1.6rem; }
.pagination-nav .nav-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.pagination-nav .page-numbers {
	display: inline-block; padding: .4rem .8rem;
	border: 1px solid var(--line); border-radius: var(--radius-btn);
	text-decoration: none;
}
.pagination-nav .page-numbers.current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ------------------------------------------------ Formularze */
.search-form { display: flex; gap: .5rem; max-width: 26rem; }
.search-form input[type="search"] { flex: 1; }
input[type="text"], input[type="email"], input[type="search"], textarea {
	width: 100%;
	font: inherit;
	padding: .6rem .75rem;
	border: 1.5px solid var(--line-strong);
	border-radius: var(--radius-btn);
	background: #fff;
	color: var(--ink);
}
input:focus, textarea:focus { border-color: var(--accent); outline: 2px solid transparent; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.contact-form { max-width: 34rem; }
.contact-form label { display: block; font-weight: 600; margin-bottom: .25rem; }
.form-consent label { font-weight: 400; font-size: .92rem; }
.req { color: var(--accent); }
.hp-field { position: absolute !important; left: -9999px; }
.form-notice { padding: .8rem 1rem; border-radius: var(--radius); font-weight: 600; }
.form-notice--ok { background: #e5f4e4; color: #22521f; border: 1px solid #9dc79a; }
.form-notice--err { background: #fbe7e7; color: #7a1c1c; border: 1px solid #dfa3a3; }

/* ------------------------------------------------ Stopka */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 2.6rem; }
.footer-grid { display: grid; gap: 1.6rem; padding: clamp(1.8rem, 4vw, 2.8rem) 0; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1.2fr; } }
.footer-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; font-family: var(--font-display); font-size: 1.15rem; }
.footer-heading { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--footer-heading); }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu a { display: inline-block; padding: .25rem 0; color: var(--footer-ink); }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: #fff; }
.site-footer address { font-style: normal; margin-bottom: .9rem; }
.footer-bottom { border-top: 1px solid var(--footer-divider); }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; font-size: .88rem; flex-wrap: wrap; }
.footer-bottom p { margin: 0; }

/* ------------------------------------------------ Drobiazgi WP */
.wp-caption { max-width: 100%; }
.alignleft { float: left; margin: 0 1rem .6rem 0; }
.alignright { float: right; margin: 0 0 .6rem 1rem; }
.aligncenter { margin-inline: auto; }
