/*
 * Fundusz Petycje – wygląd według funduszobywatelski.pl.
 *
 * 1. Kroje pisma i zmienne  2. Podstawy  3. Nagłówek  4. Treść  5. Stopka  6. Wtyczka „Petycje”
 *
 * Kolejność arkuszy motywu i wtyczki bywa różna (części wtyczki dołączają style przy renderowaniu),
 * dlatego nadpisania klas `.pty-*` mają przedrostek `body`.
 */

/* 1. Kroje pisma i zmienne. Work Sans: krój zmienny, SIL OFL 1.1 (assets/fonts/OFL.txt). */

@font-face {
	font-family: "Work Sans";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/work-sans-latin-ext.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: "Work Sans";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/work-sans-latin.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: "Work Sans";
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/work-sans-italic-latin-ext.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: "Work Sans";
	font-style: italic;
	font-weight: 100 900;
	font-display: swap;
	src: url("../fonts/work-sans-italic-latin.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;
}

:root {
	--fo-red: #e40524;
	--fo-red-nav: #dd3333;
	--fo-black: #000000;
	--fo-text: #292929;
	--fo-nav: #1e1e1e;
	--fo-link: #020000;
	--fo-band: #f6f6f6;
	--fo-line: rgba(122, 122, 122, 0.27);
	--fo-font: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Zmienne wtyczki „Petycje”. Wygrywają z wartościami z panelu (tam `:where(:root)`). */
	--pty-accent: #e40524;
	--pty-accent-contrast: #ffffff;
	--pty-text: #222222;
	--pty-bg: #ffffff;
	--pty-radius: 4px;
	--pty-font: var(--fo-font);
}

/* 2. Podstawy. */

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

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

body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	margin: 0;
	font-family: var(--fo-font);
	font-size: 16px;
	line-height: 1.5;
	color: var(--fo-text);
	background: #ffffff;
}

img,
video,
iframe,
embed,
object {
	max-width: 100%;
}

img,
video {
	height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 1.4em 0 0.6em;
	font-weight: 600;
	line-height: 1.2;
	color: var(--fo-black);
	overflow-wrap: break-word;
}

h1 {
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
	font-weight: 500;
	line-height: 1.1;
}

h2 {
	font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.25rem);
	font-weight: 500;
	line-height: 1.15;
}

h3 {
	font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.75rem);
}

h4 {
	font-size: 1.25rem;
}

h5,
h6 {
	font-size: 1rem;
}

p {
	margin: 10px 0;
}

a {
	color: var(--fo-link);
}

:where(a):hover {
	color: var(--fo-red);
}

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

button,
input,
select,
textarea {
	font: inherit;
}

/* Przyciski jak na stronie Funduszu: czerwone „pigułki”, po najechaniu czarne. */

.button,
.wp-element-button,
input[type="submit"]:where(:not([class*="pty-"])) {
	display: inline-block;
	padding: 14px 35px;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	color: #ffffff;
	background: var(--fo-red);
	border: 2px solid var(--fo-red);
	border-radius: 50px;
	cursor: pointer;
}

.button:hover,
.wp-element-button:hover,
input[type="submit"]:where(:not([class*="pty-"])):hover {
	color: #ffffff;
	background: var(--fo-black);
	border-color: var(--fo-black);
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: 8px;
	left: -10000px;
	z-index: 1000;
	padding: 12px 18px;
	font-weight: 600;
	color: #ffffff;
	background: var(--fo-black);
	border-radius: 4px;
}

.skip-link:focus,
.skip-link:hover {
	left: 8px;
	color: #ffffff;
}

/* 3. Nagłówek. Najpierw telefon i tablet, pełne menu od 1280 px. */

.site-header {
	position: relative;
	z-index: 100;
	background: #ffffff;
}

.site-header__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	min-height: 70px;
	padding-inline: clamp(20px, 12.8vw, 50px);
}

.site-logo {
	display: block;
	line-height: 0;
}

.site-logo__image {
	display: block;
	width: auto;
	height: 70px;
}

.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -8px;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.js .menu-toggle {
	display: flex;
}

/* Czerwony prostokąt z trzema białymi kreskami. */
.menu-toggle__icon {
	display: block;
	width: 27px;
	height: 20px;
	background:
		linear-gradient(#ffffff, #ffffff) center 4px / 21px 2px no-repeat,
		linear-gradient(#ffffff, #ffffff) center 9px / 21px 2px no-repeat,
		linear-gradient(#ffffff, #ffffff) center 14px / 21px 2px no-repeat,
		var(--fo-red);
}

.site-nav {
	flex-basis: 100%;
	padding-block: 24px 28px;
}

.js .site-nav {
	display: none;
}

.js .site-nav--open {
	display: block;
}

.site-nav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-nav__list a {
	display: block;
	padding-block: 9px;
	font-size: 17px;
	font-weight: 500;
	line-height: 25px;
	text-decoration: none;
	color: var(--fo-nav);
}

.site-nav__list a:hover,
.site-nav__list a:focus-visible,
.site-nav__list .current-menu-item > a,
.site-nav__list .current-menu-ancestor > a {
	color: var(--fo-red-nav);
	text-decoration: underline;
}

.site-nav__list .menu-button {
	margin-top: 20px;
}

.site-nav__list .menu-button > a {
	padding: 20px 60px;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	background: var(--fo-red);
	border-radius: 50px;
}

.site-nav__list .menu-button > a:hover,
.site-nav__list .menu-button > a:focus-visible {
	text-decoration: none;
	color: #ffffff;
	background: var(--fo-black);
}

@media (min-width: 1280px) {
	html {
		/* Kotwice (np. #pty-form) i fokus nie chowają się pod przyklejonym nagłówkiem. */
		scroll-padding-top: 106px;
	}

	.site-header {
		position: sticky;
		top: 0;
		transition: box-shadow 0.2s;
	}

	.admin-bar .site-header {
		top: 32px;
	}

	.site-header--scrolled {
		box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
	}

	.site-header__inner {
		flex-wrap: nowrap;
		gap: 16px;
		min-height: 90px;
		padding-inline: clamp(20px, 10vw - 108px, 50px);
	}

	.site-logo {
		flex: none;
	}

	.site-logo__image {
		height: 65px;
	}

	.menu-toggle,
	.js .menu-toggle {
		display: none;
	}

	.site-nav,
	.js .site-nav {
		display: block;
		flex: 1 1 auto;
		padding: 0;
	}

	.site-nav__list {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		column-gap: clamp(0px, 2vw - 25.6px, 10px);
	}

	.site-nav__list a {
		padding: 8px clamp(6px, 2.5vw - 26px, 10px);
		font-size: 13px;
		line-height: 20px;
		text-transform: uppercase;
	}

	/* Przy wąskim menu obrys fokusu nie może wchodzić na sąsiednią pozycję. */
	.site-nav__list a:focus-visible {
		outline-offset: -2px;
	}

	.site-nav__list .menu-button > a:focus-visible {
		outline-offset: 2px;
	}

	.site-nav__list .menu-button {
		margin: 0 0 0 5px;
	}

	.site-nav__list .menu-button > a {
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 154px;
		min-height: 55px;
		padding: 10px 30px;
	}
}

/* 4. Treść. */

.site-content {
	flex: 1 0 auto;
}

/* Cel odnośnika „Przejdź do treści”: bez obrysu wokół całej strony. */
.site-content:focus {
	outline: none;
}

.page-title {
	padding: 28px max(20px, (100% - 75rem) / 2 + 20px);
	background: var(--fo-band);
}

.page-title__heading {
	margin: 0;
	font-size: clamp(1.75rem, 1.5rem + 0.8vw, 2rem);
}

.entry {
	width: 100%;
	max-width: 75rem;
	margin-inline: auto;
	padding: 32px 20px 64px;
	overflow-wrap: break-word;
}

.entry .entry-title {
	margin-top: 1.5em;
}

.entry-content > :first-child,
.entry > article:first-child .entry-title {
	margin-top: 0;
}

:where(.entry-content) table {
	width: 100%;
	border-collapse: collapse;
}

:where(.entry-content) :where(th, td) {
	padding: 8px;
	text-align: left;
	border: 1px solid var(--fo-line);
}

:where(.entry-content) blockquote {
	margin: 1.5em 0;
	padding-left: 20px;
	border-left: 4px solid var(--fo-red);
}

:where(.entry-content) .aligncenter {
	display: block;
	margin-inline: auto;
}

:where(.entry-content) .alignleft {
	float: left;
	margin: 0 20px 20px 0;
}

:where(.entry-content) .alignright {
	float: right;
	margin: 0 0 20px 20px;
}

.post-password-form input[type="password"] {
	padding: 10px 12px;
	border: 1px solid #6e7075;
	border-radius: 4px;
}

/* 5. Stopka. */

.site-footer {
	background: #ffffff;
	border-top: 1px solid var(--fo-line);
}

.site-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 30px;
	padding: 64px clamp(20px, 12.8vw, 50px) 58px;
}

@media (min-width: 769px) {
	.site-footer__inner {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		padding: 112px 70px 58px;
	}
}

.site-footer__title {
	margin: 0 0 20px;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
}

.site-footer__menu {
	margin: 10px 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	text-decoration: none;
	overflow-wrap: anywhere;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	text-decoration: underline;
}

/* Odnośniki w tekście rozpoznawalne nie tylko po kolorze. */
.site-footer p a:not(.site-footer__phone) {
	text-decoration: underline;
}

/* 6. Wtyczka „Petycje”. Układ i ramki daje wtyczka; tu tylko charakter strony Funduszu. */

body .pty-petition__title,
body .pty-archive__title,
body .pty-thanks__title {
	font-weight: 500;
	line-height: 1.15;
	color: var(--fo-black);
}

body .pty-petition__title {
	margin-top: 0;
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem);
}

/* Archiwum: tytuł na jasnym pasie przez całą szerokość, jak tytuły podstron. */
body .pty-archive {
	padding-top: 0;
}

body .pty-archive__title {
	margin-bottom: 2rem;
	padding-block: 28px;
	font-size: clamp(1.75rem, 1.5rem + 0.8vw, 2rem);
	background: var(--fo-band);
	box-shadow: 0 0 0 100vmax var(--fo-band);
	clip-path: inset(0 -100vmax);
}

body .pty-archive__heading {
	font-size: 1.5rem;
}

body .pty-thanks {
	padding-block: 3rem;
}

body .pty-counter__count {
	color: var(--fo-red);
	font-size: 2.5rem;
	font-weight: 600;
}

body .pty-form,
body .pty-donate {
	border-color: var(--fo-red);
}

body .pty-form__submit,
body .pty-donate .pty-donate__button,
body .pty-petition .pty-petition__jump-link,
body .pty-petition-text__toggle,
body .pty-signature-list__button,
body .pty-social .pty-social__link,
body .pty-social .pty-social__profile {
	font-size: 0.875rem;
	font-weight: 500;
	text-transform: uppercase;
	border-radius: 50px;
}

body .pty-form__submit,
body .pty-donate .pty-donate__button,
body .pty-petition .pty-petition__jump-link {
	padding: 15px 30px;
	font-size: 1rem;
}

body .pty-form__submit:hover:not(:disabled),
body .pty-donate .pty-donate__button:hover,
body .pty-petition .pty-petition__jump-link:hover {
	color: #ffffff;
	background: var(--fo-black);
	border-color: var(--fo-black);
	filter: none;
}

body .pty-petition-text__toggle,
body .pty-signature-list__button,
body .pty-social .pty-social__link,
body .pty-social .pty-social__profile {
	padding: 10px 24px;
	border: 2px solid var(--fo-red);
}

body .pty-petition-text__toggle:hover,
body .pty-signature-list__button:hover:not(:disabled),
body .pty-social .pty-social__link:hover,
body .pty-social .pty-social__profile:hover {
	color: #ffffff;
	background: var(--fo-red);
}

/* Czerwony obrys wokół czerwonego przycisku jest słabo widoczny. */
body .pty-form__submit:focus-visible,
body .pty-donate .pty-donate__button:focus-visible,
body .pty-petition .pty-petition__jump-link:focus-visible {
	outline: 3px solid var(--fo-black);
	outline-offset: 2px;
}

/* Elementy wstawione shortcodem lub blokiem w treść strony nie stykają się ramkami. */
body .entry-content > :is(.pty-counter, .pty-form, .pty-petition-text, .pty-closed-notice, .pty-donate) {
	margin-block: 1.5rem;
}

/* Stopka organizacji z wtyczki stoi tuż nad stopką serwisu. */
body .pty-footer-org {
	padding-block: 1.5rem;
}
