/* Agru-Frank — base styles. Reset + tokens + container + section rhythm.
   Własny reset, bez zależności od frameworka CSS (Bootstrap odpięty). */

/* IBM Plex Sans self-host, variable 100-700, subset PL. Szczegóły: docs/DESIGN-TOKENS.md §Font. */
@font-face {
	font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-display: swap;
	src: url('../fonts/ibm-plex-sans-var-latin.woff2') format('woff2');
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 100 700; font-display: swap;
	src: url('../fonts/ibm-plex-sans-var-latin-ext.woff2') format('woff2');
	unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* --- Reset (zwięzły) --- */
*, *::before, *::after { box-sizing: border-box; }
html {
	-webkit-text-size-adjust: 100%;
	tab-size: 4;
	scroll-padding-top: var(--header-height, 80px);   /* A11Y-05 — focus nie pod sticky headerem */
}
body { margin: 0; line-height: 1.6; -webkit-tap-highlight-color: transparent; }

/* A11Y — respect prefers-reduced-motion (plan wcag-aa-and-a11y-requirements). */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
}
/* Smooth-scroll skip-linku/anchorów (był z Bootstrap Reboot); reduce-wariant wyżej wyłącza. */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

/* A11Y-01 — focus-visible base (poszczególne komponenty mogą override). */
:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
}
img, svg, video { max-width: 100%; height: auto; display: block; }
/* Zdjęcia sitewide: bez natywnego ghost-dragu (wyciąganie obrazka z ramy) i zaznaczania.
   Firefox nie słucha CSS — dragstart preventDefault w main.js. */
img { user-select: none; -webkit-user-drag: none; }
a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Tokens — pełen opis: docs/DESIGN-TOKENS.md. Nazwy bez prefixu (wzór tophat-website). */
:root {
	/* Brand — z logo agru-frank (AGRU-FRANK-Polska-2.png) */
	--blue:      #1689CB;   /* primary — wordmark "agru", CTA, akcenty, linki */
	--graphite:  #3E3E3D;   /* secondary — wordmark "FRANK", body text, headings */
	--white:     #FFFFFF;   /* canvas — tło sekcji jasnych, default page bg */

	/* Utility (niebrandowe) */
	--font-body:      'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono:      'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;   /* why: warstwa danych — kody DN/PN, materiały PE/PP/PVDF, normy EN/ISO */

	/* Surfaces / tła */
	--bg-page: #FAFAFA;	/* off-white kanwa (subtelnie ciemniejsza od --white) */
	--border:  #3E3E3D1F;	/* fallback dla starszych browserów (Safari <16.2, Firefox <113) */
	--border:  color-mix(in srgb, var(--graphite) 12%, transparent); /* preferred — jedyny hairline: karty/panele/dividery */

	/* Spacing atoms (8pt grid) — pełny opis: docs/DESIGN-TOKENS.md. */
	--space-4:   0.25rem;   /*   4px — micro (ikona↔tekst), poza 8pt gridem, świadomy wyjątek */
	--space-8:   0.5rem;    /*   8px */
	--space-16:  1rem;      /*  16px */
	--space-24:  1.5rem;    /*  24px */
	--space-32:  2rem;      /*  32px */
	--space-40:  2.5rem;    /*  40px — why: hero-grid mobile row-gap; 8pt grid 5×8 */
	--space-48:  3rem;      /*  48px */
	--space-64:  4rem;      /*  64px */
	--space-96:  6rem;      /*  96px */
	--space-128: 8rem;      /* 128px */
	--space-160: 10rem;     /* 160px — hero desktop max */

	/* === Container === */
	--container-max:  1320px;             /* Bootstrap xxl native */
	--container-pad:  var(--space-16);    /* 16px gutter, uniform */
	--container-text: 800px;              /* szerokość KONTENERA prozy (wrapper: tekst+obrazy+tabele) — single post */
	--measure:        70ch;               /* why: miara AKAPITU ~70 znaków (norma UX 45-75) — bloki tekstu czytane; ch skaluje z fontem */

	/* === Section rhythm (mobile defaults, mobile-first) === */
	--section-py:         var(--space-64);    /*  64px — default sekcja */
	--section-py-hero:    var(--space-96);    /*  96px — hero/showcase */
	--section-py-compact: var(--space-48);    /*  48px — CTA/banner */

	/* === A11Y (WCAG 2.2 AA — plan 2026-05-26-wcag-aa-and-a11y-requirements) === */
	--focus-ring:      2px solid var(--blue);   /* A11Y-01 — focus-visible outline */
	--focus-offset:    2px;                     /* A11Y-01 — outline-offset */
	--tap-target-min:  44px;                    /* why: WCAG 2.2 AA touch target minimum */

	/* Brand extension (kontrast-safe warianty --blue) — tabela WCAG: docs/DESIGN-TOKENS.md §Brand extension. */
	--blue-dark:  #0D6FA8;                    /* A11Y-08 — blue text on white */
	--blue-light: #79C5EE;                    /* A11Y-08 — blue text on graphite/dark */

	/* why: muted/caption text (spec labels, footnotes) — konsoliduje 3 ad-hoc warianty (stats/breadcrumbs/base opacity) w jeden token */
	--text-muted: color-mix(in srgb, var(--graphite) 80%, transparent);

	/* === Surfaces / elevations (mega-menu, dropdown, overlay) ===
	   color-mix preferred, 8-digit HEX fallback dla Safari <16.2 / Firefox <113. */
	--shadow-mega:          0 8px 24px #3E3E3D1F;                                            /* fallback */
	--shadow-mega:          0 8px 24px color-mix(in srgb, var(--graphite) 12%, transparent); /* preferred */

	/* === Motion === */
	--transition-fast: 150ms ease;
	--transition-base: 200ms ease;
	--transition-slow: 500ms ease;   /* hero fade / większe przejścia */

	/* Typografia — skala 9 (freeze 2.0): docs/DESIGN-TOKENS.md. Lint wymusza var(--text-*). */
	--text-caption: 0.75rem;                            /* 12px    — meta, tagi, daty, captions */
	--text-label:   0.875rem;                           /* 14px    — labels, nav secondary, eyebrow */
	--text-body:    1rem;                               /* 16px    — body */
	--text-lead:    1.0625rem;                          /* 17px    — lead, opis, excerpt, hero-subtitle */
	--text-display: clamp(2rem, 5vw, 3.5rem);           /* 32→56px — hero headline (ponad h1) */
	--text-h1:      clamp(1.75rem, 5vw, 3rem);          /* 28→48px — page / single title */
	--text-h2:      clamp(1.75rem, 4vw, 2.5rem);        /* 28→40px — nagłówek sekcji */
	--text-h3:      clamp(1.25rem, 3vw, 1.75rem);       /* 20→28px — sub-heading / card title */
	--text-h4:      clamp(1.0625rem, 2.5vw, 1.375rem);  /* 17→22px — prose h3 */

	/* === Radius — kanon: ostre (0) + pill. sm/md/lg wycofane — nie używamy. === */
	--radius-pill:   100px;    /* pill / badge */

	/* === Z-index scale (introduce now, extend LATER) === */
	--z-header:   100;     /* sticky site header */
	--z-mega:     110;     /* desktop mega-menu panel (over content) */
	--z-overlay:  200;     /* mobile full-screen nav overlay */

	/* === Header height (sync ze sticky height — A11Y-05 scroll-padding) === */
	--header-height: 72px;                    /* mobile/tablet (logo 40 + padding 16+16) */

	/* === Cookie consent (CookieConsent v3, orestbida) — mapowanie na tokeny brand.
	   Kolejność hover jak .agf-btn: default --blue-dark, hover jaśniejszy --blue
	   (NIE odwrotnie — tak jest wszędzie indziej w projekcie). === */
	--cc-bg:                    var(--white);
	--cc-primary-color:         var(--graphite);
	--cc-secondary-color:       var(--text-muted);
	--cc-font-family:           var(--font-body);
	--cc-modal-border-radius:   0;
	--cc-btn-border-radius:     0;
	--cc-btn-primary-bg:        var(--blue-dark);
	--cc-btn-primary-color:     var(--white);
	--cc-btn-primary-hover-bg:  var(--blue);
	--cc-btn-secondary-bg:              transparent;
	--cc-btn-secondary-color:           var(--blue-dark);
	--cc-btn-secondary-border-color:    var(--blue-dark);
	--cc-btn-secondary-hover-bg:        color-mix(in srgb, var(--blue) 8%, transparent);
	--cc-btn-secondary-hover-color:     var(--blue-dark);
	--cc-btn-secondary-hover-border-color: var(--blue-dark);
}

@media (min-width: 992px) {
	:root {
		--header-height: 88px;                /* desktop (więcej oddechu) */
	}
}

/* Section rhythm — tablet 768+ */
@media (min-width: 768px) {
	:root {
		--section-py:         var(--space-96);    /*  96px */
		--section-py-hero:    var(--space-128);   /* 128px */
		--section-py-compact: var(--space-64);    /*  64px */
	}
}

/* Section rhythm — desktop 1200+ */
@media (min-width: 1200px) {
	:root {
		--section-py:         var(--space-128);   /* 128px */
		--section-py-hero:    var(--space-160);   /* 160px */
		--section-py-compact: var(--space-64);    /*  64px (same as tablet, capped) */
	}
}

/* --- Body / typografia bazowa --- */
body {
	font-family: var(--font-body);
	color: var(--graphite);
	background: var(--white);
}
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .75em; }
p { margin: 0 0 1em; }

/* .container — max-width + uniform gutter (własny, bez frameworka). */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--container-pad);
}

/* Section rhythm klasy — wartości: docs/DESIGN-TOKENS.md §Section rhythm. */
.section          { padding-block: var(--section-py); }
.section--hero    { padding-block: var(--section-py-hero); }
.section--compact { padding-block: var(--section-py-compact); }
/* run sekcji o jednolitym (transparent) tle — reguła bg-adjacency:
   krawędź stykająca się z sekcją o TYM SAMYM tle = 50% (calc py/2); krawędź przy INNYM tle
   (graphite industries/partners, hero, cta) = pełny --section-py (default .section).
   Top przez sąsiada (+ uniwersalny), bottom przez :has (Safari <15.4 fallback = pełny, graceful). */
.section--tight + .section--tight { padding-top: calc(var(--section-py) * 0.75); }
.section--tight:has(+ .section--tight) { padding-bottom: calc(var(--section-py) * 0.75); }
/* Wyjątkowy top: sekcja tuż pod hero medium — 96 zamiast 128 na desktopie
   (tablet/mobile już ≤96 z --section-py). Użycie: hub realizacji, archiwum bloga. */
@media (min-width: 1200px) {
	.section--top-96 { padding-top: var(--space-96); }
}

/* --- Skip link (accessibility — keyboard users) --- */
.agf-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.agf-skip-link:focus {
	position: fixed;
	top: 0;
	left: 0;
	width: auto;
	height: auto;
	padding: var(--space-8) var(--space-16);
	background: var(--graphite);
	color: var(--white);
	z-index: 999999;
}

/* --- Site header (basic layout — LATER pełen design) --- */
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-16);
	padding-block: var(--space-16);
}
.site-brand {
	font-weight: 600;
	text-decoration: none;
	font-size: var(--text-lead);
}
.site-nav__placeholder {
	color: var(--graphite);
	opacity: .6;
	font-size: var(--text-label);
}

/* --- Site footer --- */
/* tlo/border usuniete stad — kolidowaly z .site-footer w site-footer.css
   (grafit, prawdziwy design), dzialalo tylko przez kolejnosc enqueue (kruche). border-top
   na --border (jasny hairline token) i tak byl niewidoczny na grafitowym tle.
   margin-top usuniety calkowicie — footer zawsze klei sie bez odstepu,
   footer-flush byl niespojny (dzialal tylko na czesci stron). */
/* Reszta wyglądu stopki (w tym adresy) żyje w components/site-footer.css —
   line-height dla address i klasa __inner zdjęte stąd 2026-07-31: pierwszy
   rozjeżdżał rytm wierszy względem list, druga nie miała elementu w markupie. */
.site-footer {
	margin-top: 0;
}

/* --- Buttons (primitive — design system LATER) --- */
.agf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-8);
	height: 44px;                                                      /* jedna wysokość batonów CTA sitewide */
	padding: 0 var(--space-24);
	background: var(--blue-dark);
	color: var(--white);
	text-decoration: none;
	border: 0;
	font-weight: 600;
	white-space: nowrap;
	transition: background 150ms ease;
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	text-align: center;
}
@media (max-width: 767.98px) {
	.agf-btn { padding: 0 var(--space-16); }   /* mobile: ciaśniejszy poziomy pad */
}
.agf-btn:hover, .agf-btn:focus { background: var(--blue); }
.agf-btn__arrow { transition: transform var(--transition-fast); }
.agf-btn:hover .agf-btn__arrow, .agf-btn:focus-visible .agf-btn__arrow { transform: translateX(3px); }
.agf-btn--outline {
	background: transparent;
	color: var(--blue);
	border: 1px solid var(--blue);
}
.agf-btn--outline:hover, .agf-btn--outline:focus { filter: none; background: color-mix(in srgb, var(--blue) 8%, transparent); }

/* --- Filter chip-row (kontener) — flex-wrap + gap; sitewide: realizacje (div) + blog (ul); list-reset bezpieczny na div --- */
.agf-filter {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-8);
}

/* --- Chip / pill (primitive) — filter tabs sitewide: realizacje (button) + blog (link), sama klasa, bez modyfikatora --- */
.agf-chip {
	display: inline-flex;
	align-items: center;
	gap: var(--space-4);
	min-height: var(--tap-target-min);
	padding: var(--space-8) var(--space-16);
	border-radius: var(--radius-pill);
	border: 1px solid var(--blue);
	background: var(--white);
	color: var(--blue);
	font-size: var(--text-label);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.agf-chip:hover,
.agf-chip[aria-pressed="true"] {
	background: var(--blue);
	border-color: var(--blue);
	color: var(--white);
}
/* Ikona w chipie (np. strzałka na product-chip) — wzor .agf-btn__arrow */
.agf-chip svg { flex-shrink: 0; transition: transform var(--transition-fast); }
.agf-chip:hover svg, .agf-chip:focus-visible svg { transform: translateX(2px); }

/* Cookie consent — override poza --cc-* tokenami (box-shadow nie jest u vendora
   custom property, trzeba nadpisać regułę wprost). Cień --shadow-mega (reuse,
   ten sam token co mega-menu/dropdown) zamiast rgba() vendora. overflow:visible
   odkrywa krzyżyki narożne (.u-image, utilities.css) — inaczej vendor's
   overflow:hidden przycina 8px wystające poza box. Guziki wysokość/font-size
   jak .agf-btn — spójny primitive w całym projekcie. */
#cc-main .cm {
	overflow: visible;
	box-shadow: var(--shadow-mega);
}
#cc-main .cm__btn {
	height: var(--tap-target-min);
	min-height: var(--tap-target-min);
	font-size: var(--text-label);
}

/* --- Tło-siatka sitewide (blueprint grid) — pod wszystkimi
   sekcjami; sekcje z własnym nieprzezroczystym tłem (hero, cta-contact) po prostu ją zasłaniają. --- */

.site-main {
	/* header fixed (nie sticky) wyjmuje z flow — kompensacja. --header-height-measured
	   (JS, site-nav.js) mierzy realny render (treść przebija min-height o kilka px),
	   fallback --header-height dla no-JS/pierwszego malowania przed pomiarem. */
	padding-top: var(--header-height-measured, var(--header-height));
	background-color: var(--bg-page);
	background-image:
		repeating-linear-gradient(
			to right,
			color-mix(in srgb, var(--graphite) 4%, transparent) 0 1px,
			transparent 1px var(--space-96)
		),
		repeating-linear-gradient(
			to bottom,
			color-mix(in srgb, var(--graphite) 4%, transparent) 0 1px,
			transparent 1px var(--space-96)
		);
}
