/* ==========================================================================
   Gulajski — arkusz uzupełniający (współpracuje z theme.json)
   Zmienne --wp--preset--* pochodzą z theme.json.
   ========================================================================== */

:root {
  --gk-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gk-radius: 8px;
  --gk-radius-lg: 14px;
  --gk-header-h: 76px;
}

/* --------------------------------------------------------------------------
   Podstawy / dostępność
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
}

/* Widoczny, spójny focus dla klawiatury (WCAG 2.4.7) */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--wp--preset--color--primary-strong);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Ukrycie tekstu tylko dla czytników */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; padding: 0;
  overflow: hidden; position: absolute !important; word-wrap: normal !important;
}

/* Link „Przejdź do treści” */
.skip-link {
  position: fixed; top: 0; left: 0; z-index: 1000;
  transform: translateY(-120%);
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--white) !important;
  padding: 0.85rem 1.4rem;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  text-decoration: none;
  border-bottom-right-radius: var(--gk-radius);
  transition: transform 0.2s var(--gk-ease);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--wp--preset--color--primary);
  outline-offset: -3px;
}

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

/* --------------------------------------------------------------------------
   Element sygnaturowy: „eyebrow” — techniczna etykieta z bursztynowym znacznikiem
   Użycie: dodaj klasę CSS „eyebrow” do akapitu w edytorze.
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--wp--preset--font-family--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 3px;
  background: var(--wp--preset--color--primary);
  display: inline-block;
  flex: 0 0 auto;
}
/* Wariant na ciemnym tle */
.has-contrast-2-background-color .eyebrow,
.has-contrast-background-color .eyebrow,
.eyebrow.is-light { color: rgba(255,255,255,0.72); }

/* --------------------------------------------------------------------------
   Element sygnaturowy: pasek ostrzegawczy (safety tape) — subtelny akcent
   Użycie: grupa/separator z klasą „hazard-rule”.
   -------------------------------------------------------------------------- */
.hazard-rule {
  height: 8px;
  border: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--wp--preset--color--primary) 0 14px,
    var(--wp--preset--color--contrast) 14px 28px
  );
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Nagłówek
   -------------------------------------------------------------------------- */
.wp-block-template-part.site-header,
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--wp--preset--color--base) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-top: 4px solid var(--wp--preset--color--primary);
  border-bottom: 1px solid var(--wp--preset--color--border);
}
.site-header .wp-block-site-logo img { max-height: 46px; width: auto; }
/* Gdy ustawione jest logo graficzne — ukryj tekstowy tytuł (bez dublowania) */
body.wp-custom-logo .site-header .wp-block-site-title { display: none; }

/* Nawigacja */
.site-header .wp-block-navigation {
  --wp--style--block-gap: 0;
}
.site-header .wp-block-navigation-item__content {
  padding: 0.5rem 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.18s var(--gk-ease), background 0.18s var(--gk-ease);
}
.site-header .wp-block-navigation-item__content:hover {
  color: var(--wp--preset--color--contrast);
  background: var(--wp--preset--color--surface);
}
.site-header .current-menu-item > .wp-block-navigation-item__content {
  color: var(--wp--preset--color--contrast);
}
.site-header .current-menu-item > .wp-block-navigation-item__content::after {
  content: ""; display: block; height: 2px; margin-top: 3px;
  background: var(--wp--preset--color--primary);
}

/* Podmenu */
.site-header .wp-block-navigation .wp-block-navigation-submenu__toggle,
.site-header .wp-block-navigation-item__content { font-family: var(--wp--preset--font-family--body); }
.site-header .wp-block-navigation__submenu-container {
  border: 1px solid var(--wp--preset--color--border) !important;
  border-radius: var(--gk-radius) !important;
  box-shadow: var(--wp--preset--shadow--lifted);
  padding: 0.4rem !important;
  background: var(--wp--preset--color--white) !important;
}
.site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
  border-radius: 5px;
}

/* Przycisk telefonu w nagłówku */
.header-cta .wp-block-button__link {
  display: inline-flex; align-items: center; gap: 0.55em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

/* --------------------------------------------------------------------------
   Sekcje / rytm
   -------------------------------------------------------------------------- */
.wp-block-group.section {
  padding-block: var(--wp--preset--spacing--70);
}
.wp-block-group.section-tight {
  padding-block: var(--wp--preset--spacing--50);
}

/* Nagłówek sekcji z akcentem pod spodem */
.section-title {
  position: relative;
}

/* --------------------------------------------------------------------------
   Karty (grupy z klasą „card”)
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Sygnatura marki: ukośny akcent (jak łamania na wizytówce) + akcenty amber
   -------------------------------------------------------------------------- */
.has-contrast-2-background-color,
.has-contrast-background-color {
  position: relative;
  overflow: hidden;
}
/* Amber trójkąt w narożniku ciemnych sekcji (echo diagonalnego łamania z wizytówki) */
.has-contrast-2-background-color::before,
.has-contrast-background-color::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 84px 84px 0 0;
  border-color: var(--wp--preset--color--primary) transparent transparent transparent;
  pointer-events: none;
}
/* Delikatny błękitny akcent (kolor „nieba” z palety) po przeciwnej stronie */
.has-contrast-2-background-color::after,
.has-contrast-background-color::after {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: 46%; height: 4px;
  background: linear-gradient(90deg, transparent, var(--wp--preset--color--sky));
  opacity: 0.7;
  pointer-events: none;
}
.site-footer::before,
.site-footer::after { display: none; } /* stopka bez trójkąta */

/* Amber „tick” nad nagłówkami sekcji w treści (spójne z eyebrow) */
.entry-content h2 {
  position: relative;
  padding-top: 0.6rem;
}
.entry-content h2::before {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--wp--preset--color--primary);
  margin-bottom: 0.9rem;
  border-radius: 2px;
}

/* Galeria realizacji */
.entry-content .wp-block-gallery.is-cropped img { border-radius: 8px; }
.entry-content .wp-block-gallery figure { margin: 0; }

.card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--gk-radius-lg);
  padding: var(--wp--preset--spacing--40);
  height: 100%;
  transition: transform 0.28s var(--gk-ease), box-shadow 0.28s var(--gk-ease), border-color 0.28s var(--gk-ease);
}
/* Nagłówki w kartach: normalne zawijanie słów (bez łamania litera po literze) */
.card :is(h2,h3,h4),
.product-card :is(h2,h3,h4) {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
.card h3 { font-size: 1.3rem; line-height: 1.15; }
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--wp--preset--shadow--lifted);
  border-color: color-mix(in srgb, var(--wp--preset--color--primary) 60%, var(--wp--preset--color--border));
}

/* Karta produktu — z obrazem u góry i strzałką */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--border);
  border-radius: var(--gk-radius-lg);
  overflow: hidden;
  height: 100%;
  transition: transform 0.28s var(--gk-ease), box-shadow 0.28s var(--gk-ease), border-color 0.28s var(--gk-ease);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--wp--preset--shadow--lifted);
  border-color: color-mix(in srgb, var(--wp--preset--color--primary) 70%, var(--wp--preset--color--border));
}
.product-card .wp-block-image { margin: 0; }
.product-card .wp-block-image img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  transition: transform 0.5s var(--gk-ease);
}
.product-card:hover .wp-block-image img { transform: scale(1.04); }

/* Numer statystyki */
.stat-number {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--wp--preset--color--contrast);
  margin: 0;
}
.has-contrast-2-background-color .stat-number { color: var(--wp--preset--color--primary); }

/* --------------------------------------------------------------------------
   Sekcje na ciemnym tle — inwersja kolorów tekstu i linków
   -------------------------------------------------------------------------- */
.has-contrast-2-background-color,
.has-contrast-background-color {
  color: rgba(255,255,255,0.86);
}
.has-contrast-2-background-color :is(h1,h2,h3,h4,h5),
.has-contrast-background-color :is(h1,h2,h3,h4,h5) {
  color: #fff;
}
.has-contrast-2-background-color a:not(.wp-block-button__link),
.has-contrast-background-color a:not(.wp-block-button__link) {
  color: var(--wp--preset--color--primary);
}

/* Przycisk „outline” (wariant obrysowany) */
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--contrast);
  border: 2px solid var(--wp--preset--color--contrast);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--white);
}
.has-contrast-2-background-color .wp-block-button.is-style-outline .wp-block-button__link,
.has-contrast-background-color .wp-block-button.is-style-outline .wp-block-button__link {
  color: #fff; border-color: rgba(255,255,255,0.5);
}
.has-contrast-2-background-color .wp-block-button.is-style-outline .wp-block-button__link:hover,
.has-contrast-background-color .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: #fff; color: var(--wp--preset--color--contrast); border-color: #fff;
}

/* --------------------------------------------------------------------------
   Treść wpisu / strony
   -------------------------------------------------------------------------- */
.entry-content > * { margin-block: 1.4rem; }
.entry-content :is(h2, h3) { margin-block: 2.2rem 0.8rem; }
.entry-content a:not(.wp-block-button__link) {
  text-decoration: underline;
  text-decoration-color: var(--wp--preset--color--primary);
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}
.entry-content img { border-radius: var(--gk-radius); }

/* Lista z akcentem */
.entry-content ul { list-style: none; padding-left: 0; }
.entry-content ul li {
  position: relative; padding-left: 1.75rem; margin-block: 0.55rem;
}
.entry-content ul li::before {
  content: ""; position: absolute; left: 0; top: 0.55em;
  width: 9px; height: 9px; border-radius: 2px;
  background: var(--wp--preset--color--primary);
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   Menu mobilne (przycisk hamburger dodawany przez JS jeśli natywne WP nie wystarcza)
   Style bazują na natywnym overlayu nawigacji WP.
   -------------------------------------------------------------------------- */
.wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--base);
  padding: 1.5rem;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  font-size: 1.25rem; font-weight: 600; padding: 0.6rem 0;
}
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
  color: var(--wp--preset--color--contrast);
}

/* --------------------------------------------------------------------------
   Stopka
   -------------------------------------------------------------------------- */
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Paginacja / nawigacja wpisów
   -------------------------------------------------------------------------- */
.wp-block-query-pagination { gap: 0.4rem; }
.wp-block-query-pagination .wp-block-query-pagination-numbers a,
.wp-block-query-pagination > a,
.wp-block-query-pagination .wp-block-query-pagination-numbers .current {
  padding: 0.5rem 0.85rem; border: 1px solid var(--wp--preset--color--border);
  border-radius: 6px; text-decoration: none;
}
.wp-block-query-pagination .current {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--primary-ink);
  border-color: var(--wp--preset--color--primary);
}

/* --------------------------------------------------------------------------
   Animacja odsłaniania (klasa „reveal”; JS dodaje „is-visible”)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--gk-ease), transform 0.6s var(--gk-ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* Nagłówek po przewinięciu */
.site-header.is-scrolled {
  box-shadow: 0 1px 0 var(--wp--preset--color--border), 0 8px 24px rgba(0,0,0,0.06);
}

/* --------------------------------------------------------------------------
   Drobne poprawki responsywne
   -------------------------------------------------------------------------- */
@media (max-width: 781px) {
  :root { --gk-header-h: 64px; }
  .site-header .wp-block-site-logo img { max-height: 38px; }
}
