/*
Theme Name: Hermet System
Theme URI:
Author: Gogler
Description: Motyw strony firmy Hermet System: hydroizolacje i osuszanie budynków.
Version: 0.3.0
Requires at least: 6.3
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: hermetsystem-theme
*/

/* ═══ 0. FONTY (lokalnie, OFL - licencje w assets/fonts/) ═════════════════════
   Jeden plik woff2 na krój, przycięty do znaków strony (assets/fonts/README.md). Archivo zawężone do osi,
   których używa motyw (wght 700-900, wdth 100-125) - lżejsza waga z tego kroju spadnie do 700.
   Plik nagłówków dostaje preload w hermetsystem_preload_fontu() (inc/enqueue.php). */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 700 900; font-stretch: 100% 125%; font-display: swap; src: url(assets/fonts/archivo-pl.woff2) format("woff2"); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(assets/fonts/source-sans-3-pl.woff2) format("woff2"); }

/* ═══════════════════════════════════════════════════════════════════════════
   1. TOKENY - kierunek z KROKU 3 (docs/design.md v2, zaakceptowany 2026-10-08)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
	--biel: #FFFFFF;
	--beton: #F1F3F4;          /* sekcje naprzemienne: chłodna betonowa szarość */
	--rysa: #D8DDE0;           /* obramowania, linie */
	--grafit: #1E2326;         /* tekst 15,9:1, stopka, nagłówki tabel */
	--grafit-2: #4A535A;       /* tekst drugiego planu 7,9:1 */
	--czerwien: #CD2122;       /* akcent z wytycznych: przyciski, ikony, znacznik (5,5:1) */
	--czerwien-ciemna: #A8181A;
	--czerwien-tlo: #FBE9E9;
	--stopka-tekst: #C9D0D4;

	--font-display: 'Archivo', 'Arial Narrow', Arial, sans-serif;
	--font-tekst: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;

	--promien: 14px;
	--promien-duzy: 18px;
	--promien-maly: 10px;
	--kontener: 1240px;
	--margines: clamp(16px, 4vw, 40px);
	--odstep-sekcji: clamp(48px, 7vw, 96px);
	--brzeg-hero: clamp(16px, 4.5vw, 72px);
	--wysokosc-naglowka: 76px;
	--cien: 0 12px 34px rgba(30, 35, 38, .12);
	--cien-duzy: 0 24px 60px rgba(30, 35, 38, .22);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. BAZA I TYPOGRAFIA
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--wysokosc-naglowka) + 16px); }
body { margin: 0; background: var(--biel); color: var(--grafit); font: 400 1.125rem/1.6 var(--font-tekst); }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--czerwien); outline-offset: 3px; border-radius: 4px; }
.kontener { width: min(100% - 2 * var(--margines), var(--kontener)); margin-inline: auto; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--grafit); margin: 0; font-variation-settings: 'wdth' 100; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4.2rem); font-weight: 820; font-variation-settings: 'wdth' 106; line-height: .98; letter-spacing: -.015em; }
h2 { font-size: clamp(1.7rem, 3.1vw, 2.5rem); font-weight: 780; line-height: 1.06; letter-spacing: -.01em; }
h3 { font-size: 1.25rem; font-weight: 720; line-height: 1.22; }
.etykieta { font-family: var(--font-display); font-variation-settings: 'wdth' 125; font-weight: 700; font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; }

.tresc > * + * { margin-top: 1em; }
.tresc p, .tresc ul, .tresc ol { margin: 0; }
.tresc * + h3 { margin-top: 1.6em; }
.tresc h3 + * { margin-top: .5em; }
.tresc ul, .tresc ol { padding-left: 1.3em; }
.tresc li + li { margin-top: .45em; }
.tresc li::marker { color: var(--czerwien); }
.tresc a, .lead-sekcji a { color: var(--czerwien-ciemna); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tresc a:hover, .lead-sekcji a:hover { color: var(--czerwien); }
.tresc strong { font-weight: 700; }
.lead-sekcji { margin: 12px 0 0; color: var(--grafit-2); font-size: 1.12rem; }

.tylko-dla-czytnikow { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pomin-do-tresci { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--grafit); color: #fff; padding: 10px 16px; border-radius: var(--promien-maly); }
.pomin-do-tresci:focus { top: 12px; }

.ikona { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── przyciski ────────────────────────────────────────────────────────────── */
.przyciski { display: flex; flex-wrap: wrap; gap: 12px; }
.przycisk { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: var(--promien-maly); font: 700 1rem/1.1 var(--font-tekst); text-decoration: none; text-align: center; border: 2px solid transparent; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.przycisk--glowny { background: var(--czerwien); color: #fff; }
.przycisk--glowny:hover { background: var(--czerwien-ciemna); }
.przycisk--obrys { border-color: var(--grafit); color: var(--grafit); background: transparent; }
.przycisk--obrys:hover { border-color: var(--czerwien); color: var(--czerwien); }

/* ═══════════════════════════════════════════════════════════════════════════
   3. NAGŁÓWEK I MENU
   ═══════════════════════════════════════════════════════════════════════════ */
.naglowek { position: sticky; top: 0; z-index: 50; background: var(--biel); border-bottom: 1px solid var(--rysa); }
.admin-bar .naglowek { top: 32px; }
.naglowek__wnetrze { display: flex; align-items: center; gap: 24px; min-height: var(--wysokosc-naglowka); padding-inline: var(--brzeg-hero); }
.marka { flex: none; display: block; text-decoration: none; }
.marka__logo { width: clamp(150px, 15vw, 210px); height: auto; }
.marka__wordmark { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.nawigacja { flex: 1; }
.nawigacja__lista { display: flex; gap: clamp(14px, 2vw, 28px); list-style: none; margin: 0; padding: 0; font-weight: 600; }
.nawigacja__lista > li > a { display: flex; align-items: center; min-height: var(--wysokosc-naglowka); text-decoration: none; }
.nawigacja__lista > li > a:hover, .nawigacja__lista > .current-menu-item > a, .nawigacja__lista > .current-menu-ancestor > a { color: var(--czerwien); }
.nawigacja__lista > .menu-item-has-children > a::after { content: ''; width: 7px; height: 7px; margin: -4px 0 0 8px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.nawigacja .sub-menu { list-style: none; margin: 0; padding: 0; }
.podmenu-przelacznik { display: none; }

.naglowek__kontakt { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.naglowek__telefon { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.naglowek__ikona { width: 40px; height: 40px; border-radius: 50%; background: var(--czerwien-tlo); color: var(--czerwien); display: grid; place-items: center; }
.naglowek__numer { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; white-space: nowrap; }
.menu-przycisk { display: none; }

/* desktop: mega-menu „Oferta” - panel na całą szerokość, 4 kolumny (problemy + 3 silosy) */
@media (min-width: 961px) {
	.nawigacja__lista > li { position: static; }
	.nawigacja__lista > li > .sub-menu { position: absolute; left: 0; right: 0; top: 100%; background: var(--biel); border-top: 1px solid var(--rysa); box-shadow: 0 24px 40px rgba(30, 35, 38, .12); padding: 28px var(--brzeg-hero) 32px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility 0s .18s; }
	.nawigacja__lista > li:hover > .sub-menu, .nawigacja__lista > li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
	.mega-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 36px; font-weight: 400; font-size: 1rem; }
	.mega-menu > li > a, .mega-menu__naglowek { display: block; font-family: var(--font-display); font-weight: 760; font-size: 1.05rem; text-decoration: none; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 2px solid var(--czerwien); }
	.mega-menu > li > a:hover { color: var(--czerwien); }
	.mega-menu .sub-menu li a { display: block; padding: 5px 0; text-decoration: none; line-height: 1.3; }
	.mega-menu .sub-menu li a:hover, .mega-menu .current-menu-item > a { color: var(--czerwien); }
	.mega-menu__problemy { background: var(--beton); border-radius: var(--promien); padding: 16px 18px; margin: -16px 0; }
}

/* telefon i tablet: hamburger, akordeon („Jaki masz problem?” jako pierwsza sekcja podmenu) */
@media (max-width: 960px) {
	.naglowek__wnetrze { gap: 12px; }
	.naglowek__cta, .naglowek__numer { display: none; }
	.menu-przycisk { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--rysa); border-radius: var(--promien-maly); background: var(--biel); cursor: pointer; }
	.menu-przycisk__kreski, .menu-przycisk__kreski::before, .menu-przycisk__kreski::after { display: block; width: 20px; height: 2px; background: var(--grafit); position: relative; }
	.menu-przycisk__kreski::before, .menu-przycisk__kreski::after { content: ''; position: absolute; left: 0; }
	.menu-przycisk__kreski::before { top: -6px; }
	.menu-przycisk__kreski::after { top: 6px; }
	.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski { background: transparent; }
	.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski::before { top: 0; transform: rotate(45deg); }
	.menu-przycisk[aria-expanded="true"] .menu-przycisk__kreski::after { top: 0; transform: rotate(-45deg); }
	.nawigacja { position: fixed; inset: var(--wysokosc-naglowka) 0 0 0; background: var(--biel); overflow-y: auto; padding: 12px var(--margines) 96px; display: none; }
	.nawigacja.jest-otwarte { display: block; }
	.nawigacja__lista { flex-direction: column; gap: 0; }
	.nawigacja__lista > li { position: relative; border-bottom: 1px solid var(--rysa); }
	.nawigacja__lista > li > a { min-height: 54px; padding-right: 56px; }
	.nawigacja__lista > .menu-item-has-children > a::after { display: none; }
	.podmenu-przelacznik { display: grid; place-items: center; position: absolute; right: 0; top: 3px; width: 48px; height: 48px; border: 0; background: none; cursor: pointer; }
	.podmenu-przelacznik span { width: 9px; height: 9px; border: solid var(--grafit); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
	.is-otwarte > .podmenu-przelacznik span { transform: rotate(-135deg); margin-top: 4px; }
	.nawigacja__lista > li > .sub-menu { display: none; padding: 0 0 14px; }
	.nawigacja__lista > li.is-otwarte > .sub-menu { display: block; }
	.mega-menu > li { padding: 8px 0; }
	.mega-menu > li > a, .mega-menu__naglowek { display: block; font-family: var(--font-display); font-weight: 760; padding: 6px 0; text-decoration: none; }
	.mega-menu .sub-menu a { display: block; padding: 7px 0 7px 14px; text-decoration: none; font-weight: 400; }
	.mega-menu__problemy { background: var(--beton); border-radius: var(--promien); padding: 10px 14px !important; }
}
@media (max-width: 782px) { .admin-bar .naglowek { top: 0; } }

/* ═══════════════════════════════════════════════════════════════════════════
   4. OKRUSZKI
   ═══════════════════════════════════════════════════════════════════════════ */
.okruszki { font-size: .92rem; color: var(--grafit-2); padding: 14px 0; }
.okruszki__lista { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.okruszki__pozycja + .okruszki__pozycja::before { content: '/'; margin: 0 8px; color: var(--rysa); }
.okruszki a { text-decoration: none; }
.okruszki a:hover { color: var(--czerwien); text-decoration: underline; }
.okruszki--w-ramce { padding: 0 0 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   5. STOPKA I PASEK KONTAKTU
   ═══════════════════════════════════════════════════════════════════════════ */
.stopka { background: var(--grafit); color: var(--stopka-tekst); padding: 64px 0 28px; font-size: 1rem; }
.stopka a { color: #fff; text-decoration: none; }
.stopka a:hover { text-decoration: underline; }
.stopka__siatka { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.stopka__logo { width: 180px; margin-bottom: 18px; }
.stopka__tytul-kolumny { margin: 0 0 14px; color: #fff; font-family: var(--font-display); font-variation-settings: 'wdth' 125; font-weight: 700; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
.stopka__adres { font-style: normal; margin: 0 0 12px; line-height: 1.55; }
.stopka__etykieta { display: block; color: #fff; font-weight: 600; }
.stopka ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.stopka__kontakt { margin: 14px 0 !important; }
.stopka__kontakt li, .stopka__godziny { display: flex; align-items: flex-start; gap: 10px; }
.stopka__kontakt .ikona, .stopka__godziny .ikona { margin-top: 4px; color: var(--stopka-tekst); }
.stopka__godziny { margin: 0 0 10px; line-height: 1.55; }
.stopka__nip { margin: 0; }
.stopka__profile { display: flex !important; gap: 10px !important; margin-top: 16px !important; }
.stopka__profile a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #3A4146; border-radius: 50%; }
.stopka__profile a:hover { border-color: #fff; }
.stopka__dol { border-top: 1px solid #3A4146; margin-top: 44px; padding-top: 20px; font-size: .9rem; }
.stopka__dol p { margin: 0; }
.pasek-kontaktu { display: none; }
@media (max-width: 960px) { .stopka__siatka { grid-template-columns: 1fr 1fr; } .stopka__kolumna--dane { grid-column: 1 / -1; } }
@media (max-width: 640px) {
	.stopka__siatka { grid-template-columns: 1fr; }
	.pasek-kontaktu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: fixed; inset: auto 0 0 0; z-index: 40; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--biel); border-top: 1px solid var(--rysa); box-shadow: 0 -6px 20px rgba(30, 35, 38, .08); }
	.pasek-kontaktu .przycisk { padding: 0 12px; }
	body { padding-bottom: 72px; }
}
