/*
Theme Name: OSP Radocza
Theme URI: https://ospradocza.pl
Author: Sebastian Gołąb, Nikodem Hajost
Description: Motyw strony Ochotniczej Straży Pożarnej w Radoczy.
Version: 2.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: ospradocza
*/

/* ==========================================================================
   Czcionka Lato (hostowana lokalnie)
   ========================================================================== */
@font-face {
	font-family: "Lato";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/lato-latin-ext-400-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Lato";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("assets/fonts/lato-latin-400-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Lato";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/lato-latin-ext-700-normal.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
	font-family: "Lato";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("assets/fonts/lato-latin-700-normal.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ==========================================================================
   Zmienne i baza
   ========================================================================== */
:root {
	--red: #c81f1f;
	--red-dark: #a11717;
	--text: #333;
	--muted: #666;
	--line: #eee;
	--max: 1260px;
	--gutter: 15px;
	--gap: 30px;
}

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

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

body {
	margin: 0;
	font: 400 16px/1.6 "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--text);
	background: #fff;
}

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

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

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

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed !important;
	top: 8px; left: 8px;
	width: auto; height: auto;
	margin: 0; padding: 10px 16px;
	clip-path: none;
	background: #fff; color: var(--red);
	z-index: 100000;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.icon { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -.125em; }

/* ==========================================================================
   Nagłówek i nawigacja
   ========================================================================== */
.site-header { position: relative; }

.site-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 15px;
	color: var(--text);
}
.site-brand:hover { color: var(--text); text-decoration: none; }
.site-brand img { width: 60px; height: 60px; }
.site-brand span { font-size: 35px; line-height: 1; }

.primary-nav .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0 65px;
	margin: 20px 0 15px;
	padding: 0;
	list-style: none;
}
.primary-nav li { position: relative; }
.primary-nav a { display: inline-block; color: var(--text); font-size: 19px; }
.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a { color: var(--red); }

.primary-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: .45em;
	border: .28em solid transparent;
	border-top-color: currentColor;
	border-bottom: 0;
	vertical-align: .15em;
}

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	min-width: 190px;
	margin: 0;
	padding: 20px 15px 0;
	list-style: none;
	background: var(--red);
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: block; }
.primary-nav .sub-menu li { margin-bottom: 25px; }
.primary-nav .sub-menu a { color: #fff; font-size: 18px; }
.primary-nav .sub-menu a:hover { color: #fff; text-decoration: underline; }

.nav-toggle {
	display: none;
	position: absolute;
	top: 10px; right: var(--gutter);
	padding: 8px;
	border: 0;
	background: none;
	color: var(--red);
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: inline-block; }

/* ==========================================================================
   Nagłówki, tytuły sekcji
   ========================================================================== */
h1, h2, h3 { line-height: 1.3; }

.page-title {
	margin: 20px 0 35px;
	padding-top: 20px;
	border-top: 2px solid var(--red);
	font-size: 27px;
}

.section-title {
	display: flex;
	align-items: center;
	gap: 25px;
	margin: 0 0 35px;
	font-size: 27px;
}
.section-title::after {
	content: "";
	flex: 1;
	height: 2px;
	background: var(--red);
}

/* ==========================================================================
   Strona główna
   ========================================================================== */
.front {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
	gap: var(--gap);
	margin-bottom: 35px;
}

.hero { position: relative; min-height: 340px; overflow: hidden; background: #5d1414; }
.hero__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 60%;
}
.hero__caption {
	position: absolute;
	left: 15px; bottom: 15px;
	max-width: calc(100% - 30px);
	padding: 16px 22px;
	background: rgba(200, 31, 31, .9);
	color: #fff;
}
.hero__title { margin: 0; font-size: 26px; }
.hero__sub { margin: 6px 0 0; font-size: 19px; font-weight: 700; letter-spacing: .02em; }

.aside__title {
	margin: 0 0 10px;
	padding: 10px;
	background: var(--red);
	color: #fff;
	font-size: 20px;
}
.facebook iframe { display: block; width: 100%; max-width: 500px; border: 0; }
.facebook__link { margin: 10px 0 0; text-align: right; font-weight: 700; }

.sponsors { margin-top: 10px; }
.sponsors .section-title { justify-content: center; margin-bottom: 20px; }
.sponsors .section-title::before { content: ""; flex: 1; height: 2px; background: var(--red); }
.sponsors .gallery { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.sponsors .gallery-item { flex: 0 1 calc((100% - 32px) / 3); }

/* ==========================================================================
   Karty (aktualności, galerie)
   ========================================================================== */
.cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0 var(--gap);
}
.card {
	display: flex;
	flex-direction: column;
	margin-bottom: 35px;
	border: 1px solid var(--line);
	padding-bottom: 10px;
}
.card__media { display: block; }
.card__media img,
.card__placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 390 / 240;
	object-fit: cover;
}
.card__placeholder { background: #f3f3f3; }
.card__body { display: flex; flex: 1; flex-direction: column; padding: 0 10px; }
.card__date { margin: 5px 0 10px; font-size: 15px; }
.card__title { margin: 0 0 15px; font-size: 20px; }
.card__title a { color: var(--text); }
.card__title a:hover { color: var(--red); text-decoration: none; }
.card__more { margin: auto 5px 0 0; text-align: right; }

.pagination { margin: 0 0 35px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pagination .page-numbers {
	min-width: 42px;
	padding: 6px 12px;
	border: 1px solid var(--line);
	color: var(--text);
	text-align: center;
}
.pagination a.page-numbers:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.pagination .page-numbers.current { border-color: var(--red); background: var(--red); color: #fff; }

/* ==========================================================================
   Treść wpisów i stron
   ========================================================================== */
.entry-meta {
	margin: 20px 0 7px;
	padding-top: 20px;
	border-top: 2px solid var(--red);
}
.entry-title { margin: 0 0 35px; font-size: 27px; }

.entry-content { display: flow-root; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content iframe { width: 100%; max-width: 100%; border: 0; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th,
.entry-content td { padding: .5em .75em; border: 1px solid #ddd; text-align: left; }

.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--muted); }

/* Galerie [gallery] */
.gallery {
	--cols: 3;
	display: grid;
	grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
	gap: 10px;
	margin: 1.5rem 0;
}
.gallery-columns-1 { --cols: 1; }
.gallery-columns-2 { --cols: 2; }
.gallery-columns-4 { --cols: 4; }
.gallery-columns-5 { --cols: 5; }
.gallery-columns-6 { --cols: 6; }
.gallery-columns-7 { --cols: 7; }
.gallery-columns-8 { --cols: 8; }
.gallery-columns-9 { --cols: 9; }
.gallery-item { margin: 0; }
.gallery-icon a { display: block; }
.gallery-icon img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border: 1px solid var(--line);
}
.gallery-size-full .gallery-icon img { object-fit: contain; padding: 8px; }
.gallery-caption { margin: 4px 0 0; }
.entry-content a[href$=".jpg" i],
.entry-content a[href$=".jpeg" i],
.entry-content a[href$=".png" i],
.entry-content a[href$=".webp" i] { cursor: zoom-in; }

/* Podstrony sekcji i komponenty treści */
.subnav { margin: -15px 0 30px; }
.subnav ul { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.subnav a {
	display: block;
	padding: 8px 18px;
	border: 1px solid var(--line);
	color: var(--text);
}
.subnav a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.subnav a[aria-current="page"] { border-color: var(--red); background: var(--red); color: #fff; }

.card__body > .card__title:first-child { margin-top: 14px; }
.card__excerpt { margin: 0 0 15px; }
.card__placeholder--logo {
	background: #f3f3f3 url("assets/img/logo-osp-radocza.webp") center / 96px no-repeat;
}

.lead { font-size: 19px; }

.info-box,
.cta {
	margin: 1.5rem 0;
	padding: 20px 24px;
	background: #f8f8f8;
	border-left: 4px solid var(--red);
}
.info-box > :first-child,
.cta > :first-child { margin-top: 0; }
.info-box > :last-child,
.cta > :last-child { margin-bottom: 0; }
.cta h2 { margin: 0 0 .5rem; font-size: 22px; }

.button {
	display: inline-block;
	padding: 10px 20px;
	border: 2px solid var(--red);
	background: var(--red);
	color: #fff;
	font-weight: 700;
}
.button:hover { border-color: var(--red-dark); background: var(--red-dark); color: #fff; text-decoration: none; }
.button--ghost { background: transparent; color: var(--red); }
.button--ghost:hover { border-color: var(--red); background: var(--red); }
.cta__contact { display: flex; flex-wrap: wrap; gap: 12px; }

.role-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
	margin: 1.5rem 0;
}
.role { padding: 16px 20px; border: 1px solid var(--line); border-top: 3px solid var(--red); }
.role__title { display: block; color: var(--muted); font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.role__name { display: block; font-size: 20px; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.chips li { padding: 6px 14px; background: #f3f3f3; }

.facts {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 1.5rem 0;
}
.fact { padding: 18px 16px; border: 1px solid var(--line); border-top: 3px solid var(--red); text-align: center; }
.fact__value { display: block; color: var(--red); font-size: 26px; font-weight: 700; line-height: 1.2; }
.fact__label { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; }

.two-cols { columns: 2; column-gap: 40px; }
.two-cols li { break-inside: avoid; }

.vehicle {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: 30px;
	align-items: center;
	margin: 0 0 40px;
}
.vehicle__media { margin: 0; }
.vehicle__media a { display: block; }
.vehicle__media img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.vehicle h3 { margin: 0 0 .5rem; font-size: 22px; }
.vehicle p { margin: 0; }

/* Film osadzony (Facebook) */
.video-embed { position: relative; max-width: 720px; margin: 1.25rem 0; aspect-ratio: 16 / 9; background: #111; }
.entry-content .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Kontakt */
.contact-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
	gap: 30px;
	align-items: stretch;
}
.contact-card { margin: 0; }
.contact-card h2 { margin: 0 0 .75rem; font-size: 22px; }
.contact-card p { margin: 0 0 1rem; }
.contact-card .cta__contact { margin-bottom: .75rem; }
.contact-card__note { margin-bottom: 0 !important; padding-top: 1rem; border-top: 1px solid var(--line); }
.contact-map iframe { display: block; width: 100%; height: 100%; min-height: 420px; border: 0; }

/* Oś czasu (Historia) */
.timeline { position: relative; margin: 2rem 0; padding: 0; list-style: none; }
.timeline::before {
	content: "";
	position: absolute;
	top: 12px; bottom: 12px;
	left: 129px;
	width: 2px;
	background: var(--line);
}
.timeline__item {
	position: relative;
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 0 40px;
	padding-bottom: 34px;
	scroll-margin-top: 20px;
}
.timeline__item::before {
	content: "";
	position: absolute;
	top: 11px; left: 123px;
	width: 14px; height: 14px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: var(--red);
	box-shadow: 0 0 0 1px var(--red);
}
.timeline__year { margin: 0; color: var(--red); font-size: 28px; line-height: 1.3; text-align: right; }
.timeline__body h3 { margin: 4px 0 .5rem; font-size: 21px; }
.timeline__body p { margin: 0 0 .9rem; }
.timeline__body > :last-child { margin-bottom: 0; }
.timeline__body .chips { margin-bottom: 1rem; }
.timeline__item--current .timeline__body {
	padding: 18px 24px;
	background: #f8f8f8;
	border-left: 4px solid var(--red);
}
.timeline__item--current .timeline__body h3 { margin-top: 0; }
.timeline__source { font-size: 15px; color: var(--muted); }

/* Archiwum */
.archive-note { margin: 0 0 30px; color: var(--muted); }
.archive-year { margin-bottom: 30px; }
.archive-year .section-title { margin-bottom: 15px; }
.archive-list { margin: 0; padding: 0; list-style: none; }
.archive-list li {
	display: flex;
	gap: 20px;
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
}
.archive-list time { flex: 0 0 120px; color: var(--muted); }
.archive-list a { color: var(--text); }
.archive-list a:hover { color: var(--red); }

.back-link { margin: 35px 0 0; }

.post-navigation { margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: var(--gap); }
.post-navigation .nav-next { margin-left: auto; text-align: right; }

.search-form { display: flex; gap: 8px; max-width: 520px; margin: 0 0 30px; }
.search-form input[type="search"] {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 0;
	font: inherit;
}
.search-form button {
	padding: 10px 18px;
	border: 0;
	background: var(--red);
	color: #fff;
	font: inherit;
	cursor: pointer;
}
.search-form button:hover { background: var(--red-dark); }

/* ==========================================================================
   Stopka
   ========================================================================== */
.site-footer { margin-top: 40px; }
.site-footer p {
	margin: 0;
	padding: 10px 0;
	border-top: 1px solid var(--text);
	font-size: 14px;
	text-align: center;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
	width: 100%; max-width: 100vw;
	height: 100%; max-height: 100vh;
	padding: 0; border: 0;
	background: transparent;
	color: #fff;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox__figure {
	display: grid;
	place-items: center;
	height: 100%;
	margin: 0;
	padding: 56px 16px;
}
.lightbox__img { max-width: 100%; max-height: calc(100vh - 112px); object-fit: contain; }
.lightbox__caption { color: #ddd; text-align: center; }
.lightbox__btn {
	position: fixed;
	display: grid;
	place-items: center;
	width: 48px; height: 48px;
	border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .15);
	color: #fff;
	font-size: 26px;
	cursor: pointer;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .3); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { top: 50%; left: 12px; transform: translateY(-50%); }
.lightbox__next { top: 50%; right: 12px; transform: translateY(-50%); }
.lightbox__count { position: fixed; top: 20px; left: 20px; font-size: 15px; color: #ddd; }

/* ==========================================================================
   RWD
   ========================================================================== */
@media (max-width: 993px) {
	.primary-nav .menu { gap: 0 40px; }
	.front { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 15px; }
	.hero { min-height: 0; aspect-ratio: 3 / 2; }
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gallery { --cols: 2; }
	.sponsors .gallery-item { flex-basis: calc((100% - 16px) / 2); }
}

@media (max-width: 768px) {
	.site-brand img { width: 40px; height: 40px; }
	.site-brand span { font-size: 26px; }

	.js .nav-toggle { display: block; }
	.js .primary-nav { display: none; }
	.js .primary-nav.is-open { display: block; }
	.primary-nav .menu { display: block; margin-top: 10px; }
	.primary-nav li { margin-bottom: 20px; }
	.primary-nav .menu-item-has-children > a::after { display: none; }
	.primary-nav .sub-menu {
		display: block;
		position: static;
		min-width: 0;
		margin-top: 12px;
		padding: 0 0 0 16px;
		background: none;
		border-left: 2px solid var(--red);
	}
	.primary-nav .sub-menu li { margin-bottom: 12px; }
	.primary-nav .sub-menu a { color: var(--text); font-size: 17px; }
	.primary-nav .sub-menu a:hover { color: var(--red); }

	.hero { aspect-ratio: 4 / 3; }
	.hero__caption { left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 10px 14px; }
	.hero__title { font-size: 19px; line-height: 1.3; }
	.hero__sub { margin-top: 3px; font-size: 15px; }

	.section-title { font-size: 22px; }
	.cards { grid-template-columns: minmax(0, 1fr); }
	.card__title { font-size: 18px; }
	.card__date { font-size: 14px; }
	.entry-content iframe { height: 300px; }
	.contact-layout { grid-template-columns: minmax(0, 1fr); }
	.contact-map iframe { min-height: 300px; }
	.timeline::before { left: 6px; }
	.timeline__item { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 32px; }
	.timeline__item::before { top: 9px; left: 0; }
	.timeline__year { text-align: left; font-size: 24px; }
	.timeline__item--current .timeline__body { padding: 14px 16px; }
	.facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.two-cols { columns: 1; }
	.vehicle { grid-template-columns: minmax(0, 1fr); gap: 15px; margin-bottom: 30px; }
	.lead { font-size: 17px; }
	.archive-list li { flex-direction: column; gap: 2px; }
	.archive-list time { flex: none; font-size: 14px; }
	.entry-title { line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
