/*
Theme Name: SP1 Siechnice
Theme URI: https://sp1.edusiechnice.pl/
Author: Zespół SP1 Siechnice
Author URI: https://sp1.edusiechnice.pl/
Description: Klasyczny motyw WordPress dla szkół podstawowych Gminy Siechnice. Wariant graficzny „broadsheet” (granat + złoto), przygotowany do pracy w sieci multisite, bez zależności od wtyczek, bez kroku budowania i bez zapytań do zewnętrznych domen. Zgodny z WCAG 2.2 AA oraz z ustawą z 4 kwietnia 2019 r. o dostępności cyfrowej.
Version: 1.8.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sp1-siechnice
Domain Path: /languages
Tags: education, school, accessibility-ready, custom-menu, custom-logo, translation-ready, two-columns, right-sidebar, block-patterns
*/

/* ==========================================================================
   SPIS TREŚCI
   1. Tokeny projektowe (custom properties)
   2. Reset i ustawienia dokumentu
   3. Skalowanie tekstu (panel dostępności)
   4. Typografia bazowa
   5. Odnośniki i fokus
   6. Elementy formularzy
   7. Media i osadzenia
   8. Klasy pomocnicze WordPressa
   9. Ograniczenie animacji
   ========================================================================== */

/* ==========================================================================
   1. Tokeny projektowe
   Źródło prawdy: makieta „SP1 Siechnice Strona Glowna.dc.html”.
   Wartości skorygowane pod kątem kontrastu opisano w readme.md.
   ========================================================================== */

:root {
	/* --- Kolory: granat --- */
	--sp-navy-900: #071228; /* pasek narzędziowy (sieć) */
	--sp-navy-800: #0b1a3a; /* pasek dostępności, stopka */
	--sp-navy-700: #10254f; /* kolor główny, linki, nagłówki */
	--sp-navy-600: #1c3a71; /* jaśniejszy punkt gradientu hero */
	--sp-navy-500: #1d3057; /* linia w stopce */
	--sp-navy-400: #3c4d72; /* separatory na ciemnym tle */

	/* --- Kolory: złoto --- */
	--sp-gold-500: #e0a53f; /* akcent, tło CTA */
	--sp-gold-400: #f0b955; /* hover CTA */
	--sp-gold-700: #a8741d; /* obramowania, linia dolna CTA, elementy UI */
	--sp-gold-800: #8a5f11; /* złoto jako TEKST na jasnym tle (>= 4,5:1) */

	/* --- Kolory: tekst --- */
	--sp-ink: #16233d; /* tekst podstawowy */
	--sp-ink-soft: #3c4762; /* tekst bloków treści */
	--sp-ink-excerpt: #4a5670; /* zajawki kart */
	--sp-muted: #5c6a85; /* tekst pomocniczy */
	--sp-muted-strong: #4f5b73; /* tekst pomocniczy na szarym tle */

	/* --- Kolory: tekst na ciemnym tle --- */
	--sp-on-dark: #dfe6f2;
	--sp-on-dark-soft: #b9c5db;
	--sp-on-dark-lead: #cfd8e8;
	--sp-on-dark-link: #ccd5e6;
	--sp-on-dark-label: #93a1bd;
	--sp-on-dark-faint: #8e9cb8;
	--sp-on-dark-meta: #8393b3;

	/* --- Kolory: linie i tła --- */
	--sp-line: #e3e7ee;
	--sp-line-2: #dde2ea;
	--sp-line-3: #e8ebf1;
	--sp-line-dark: #16294d;
	--sp-surface: #fbfcfd; /* tło sekcji przemiennej */
	--sp-surface-2: #f2f4f8; /* tło hover */
	--sp-surface-3: #eef1f6; /* aktywna pozycja menu */
	--sp-surface-current: #f6f0e2; /* kafel bieżącej witryny */
	--sp-placeholder-a: #e7eaf1;
	--sp-placeholder-b: #d5dbe6;
	--sp-white: #ffffff;

	/* --- Kolor akcentu sterowany z Customizera (domyślnie złoty) --- */
	--sp-accent: var(--sp-gold-500);
	--sp-accent-hover: var(--sp-gold-400);
	--sp-accent-strong: var(--sp-gold-700);
	--sp-accent-text: var(--sp-gold-800);
	--sp-accent-on: var(--sp-ink); /* tekst na tle akcentu */

	/* --- Typografia --- */
	--sp-font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--sp-font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	/* Skala nagłówków — min/max w rem, aby reagowały na przełącznik rozmiaru tekstu. */
	--sp-h1-hero: clamp(2.125rem, 5.2vw, 3.5rem); /* 34 -> 56 px */
	--sp-h1-page: clamp(1.875rem, 4.4vw, 2.875rem); /* 30 -> 46 px */
	--sp-h2: clamp(1.625rem, 3.4vw, 2.25rem); /* 26 -> 36 px */
	--sp-h2-small: clamp(1.5rem, 3vw, 2rem); /* 24 -> 32 px */
	--sp-h3: clamp(1.3125rem, 2.4vw, 1.6875rem); /* 21 -> 27 px */
	--sp-lead: clamp(1.0625rem, 1.5vw, 1.1875rem); /* 17 -> 19 px */
	--sp-lead-page: clamp(1rem, 1.4vw, 1.125rem); /* 16 -> 18 px */

	/* --- Geometria --- */
	--sp-container: 75rem; /* 1200 px */
	--sp-gutter: 1.5rem; /* 24 px */
	--sp-radius: 3px;
	--sp-section-y: clamp(2.75rem, 6vw, 5rem); /* 44 -> 80 px */
	--sp-section-y-sm: clamp(2.75rem, 6vw, 4.25rem); /* 44 -> 68 px */
	--sp-header-offset: 6rem; /* zapas na sticky header (scroll-margin-top) */

	/* --- Cienie --- */
	--sp-shadow-header: 0 1px 12px rgba(16, 37, 79, 0.05);
	--sp-shadow-card: 0 8px 24px rgba(16, 37, 79, 0.1);
	--sp-shadow-menu: 0 16px 40px rgba(7, 18, 40, 0.24);

	/* --- Ruch --- */
	--sp-transition: 140ms ease;
}

/* ==========================================================================
   2. Reset i ustawienia dokumentu
   ========================================================================== */

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

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

body {
	margin: 0;
	background-color: var(--sp-white);
	color: var(--sp-ink);
	font-family: var(--sp-font-sans);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-wrap: break-word;
}

/* Cele kotwic nie chowają się pod przyklejonym nagłówkiem (WCAG 2.4.11). */
:target,
[id] {
	scroll-margin-top: var(--sp-header-offset);
}

/* ==========================================================================
   3. Skalowanie tekstu — panel dostępności
   Trzy stopnie realizowane przez font-size na :root; całość układu w rem.
   ========================================================================== */

html {
	font-size: 100%;
}

html[data-sp-text="1"] {
	font-size: 112.5%; /* A+  = 18 px */
}

html[data-sp-text="2"] {
	font-size: 125%; /* A++ = 20 px */
}

/* ==========================================================================
   4. Typografia bazowa
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 0.75rem;
	font-family: var(--sp-font-serif);
	font-weight: 600;
	line-height: 1.2;
	color: var(--sp-navy-700);
	letter-spacing: -0.01em;
	text-wrap: pretty;
}

h1 {
	font-size: var(--sp-h1-page);
	line-height: 1.12;
	letter-spacing: -0.02em;
}

h2 {
	font-size: var(--sp-h2-small);
}

h3 {
	font-size: var(--sp-h3);
}

h4 {
	font-size: 1.1875rem;
}

h5 {
	font-size: 1rem;
}

h6 {
	font-size: 0.875rem;
}

p {
	margin: 0 0 1rem;
	text-wrap: pretty;
}

ul,
ol {
	margin: 0 0 1rem;
	padding-left: 1.5rem;
}

li + li {
	margin-top: 0.35rem;
}

blockquote {
	margin: 0 0 1.5rem;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 4px solid var(--sp-accent-strong);
	color: var(--sp-ink-soft);
	font-size: 1.0625rem;
}

blockquote cite {
	display: block;
	margin-top: 0.5rem;
	font-size: 0.875rem;
	font-style: normal;
	color: var(--sp-muted);
}

hr {
	height: 1px;
	margin: 2rem 0;
	border: 0;
	background: var(--sp-line);
}

code,
kbd,
pre,
samp {
	font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;
	font-size: 0.9375em;
}

pre {
	overflow-x: auto;
	padding: 1rem 1.25rem;
	background: var(--sp-surface);
	border: 1px solid var(--sp-line);
	border-radius: var(--sp-radius);
}

table {
	width: 100%;
	margin: 0 0 1.5rem;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

th,
td {
	padding: 0.75rem 1rem;
	text-align: left;
	border-bottom: 1px solid var(--sp-line);
	vertical-align: top;
}

th {
	font-weight: 600;
	color: var(--sp-navy-700);
}

address {
	font-style: normal;
}

::selection {
	background: var(--sp-accent);
	color: var(--sp-accent-on);
}

/* ==========================================================================
   5. Odnośniki i fokus
   ========================================================================== */

a {
	color: var(--sp-navy-700);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
	color: var(--sp-accent-text);
}

/*
 * Wskaźnik fokusu: dwupierścieniowy.
 * Wewnętrzny pierścień złoty (kontrast wobec ciemnych teł),
 * zewnętrzny granatowy (kontrast wobec jasnych teł) — co najmniej jeden
 * z nich zawsze spełnia 3:1 wobec sąsiadującego koloru (WCAG 1.4.11, 2.4.13).
 */
:focus {
	outline: none;
}

:focus-visible {
	outline: 3px solid var(--sp-navy-800);
	outline-offset: 3px;
	box-shadow: 0 0 0 3px var(--sp-gold-500);
	border-radius: var(--sp-radius);
}

/* Na ciemnych paskach kolejność pierścieni jest odwrócona. */
.sp-topbar :focus-visible,
.sp-accessbar :focus-visible,
.sp-hero :focus-visible,
.sp-pagehead :focus-visible,
.sp-footer :focus-visible {
	outline-color: var(--sp-white);
	box-shadow: 0 0 0 3px var(--sp-navy-900);
}

/* Link pomijający — widoczny wyłącznie po otrzymaniu fokusu. */
.sp-skip-link {
	position: absolute;
	top: 0;
	left: -9999px;
	z-index: 200;
	padding: 0.75rem 1.25rem;
	background: var(--sp-navy-700);
	color: var(--sp-white);
	font-weight: 600;
	text-decoration: none;
}

.sp-skip-link:focus-visible {
	left: 0.75rem;
	top: 0.75rem;
	color: var(--sp-white);
}

/* Treść wyłącznie dla czytników ekranu. */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus-visible {
	position: static !important;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	clip-path: none;
	white-space: normal;
}

/* ==========================================================================
   6. Elementy formularzy
   Minimalny cel dotykowy 24x24 px (WCAG 2.5.8) — w praktyce >= 44 px.
   ========================================================================== */

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

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
	width: 100%;
	min-height: 2.75rem;
	padding: 0.625rem 0.875rem;
	background: var(--sp-white);
	color: var(--sp-ink);
	border: 1px solid #6f7c95; /* 4,3:1 wobec bieli — pole rozpoznawalne (1.4.11) */
	border-radius: var(--sp-radius);
}

textarea {
	min-height: 9rem;
	resize: vertical;
}

::placeholder {
	color: var(--sp-muted);
	opacity: 1;
}

label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--sp-navy-700);
}

button,
input[type="submit"],
.sp-btn {
	min-height: 2.75rem;
	cursor: pointer;
}

/* ==========================================================================
   7. Media i osadzenia
   ========================================================================== */

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

img,
svg,
video {
	height: auto;
}

figure {
	margin: 0 0 1.5rem;
}

figcaption {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--sp-muted);
}

/* ==========================================================================
   8. Klasy pomocnicze WordPressa (wymagane przez wytyczne motywów)
   ========================================================================== */

.alignleft {
	float: left;
	margin: 0.35rem 1.5rem 1rem 0;
}

.alignright {
	float: right;
	margin: 0.35rem 0 1rem 1.5rem;
}

.aligncenter {
	display: block;
	margin: 0 auto 1.5rem;
}

.alignwide,
.alignfull {
	max-width: 100%;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: var(--sp-muted);
}

.gallery-caption {
	font-size: 0.875rem;
	color: var(--sp-muted);
}

.sticky .sp-card__title::after {
	content: " ★";
	color: var(--sp-accent-text);
}

.bypostauthor > article {
	border-color: var(--sp-accent-strong);
}

.clearfix::after {
	content: "";
	display: table;
	clear: both;
}

/* ==========================================================================
   9. Ograniczenie animacji (prefers-reduced-motion)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
