/*
Theme Name: Naprawiamy AGD
Theme URI: https://mathyhouse.pl
Author: Mathyhouse.pl
Description: Dedykowany motyw dla serwisu rezerwacji napraw AGD. Zaprojektowany razem z wtyczką SerwisAGD Booking.
Version: 1.0.2
Requires PHP: 7.4
Text Domain: naprawiamy-theme
*/

:root {
  --paper: #edeff0;
  --paper-raised: #ffffff;
  --card: #ffffff;
  --ink: #14181c;
  --ink-soft: #4b535c;
  --ink-faint: #7b838b;
  --line: #c9cfd3;
  --line-soft: #dde1e3;
  --accent: #f5a300;
  --accent-ink: #4a2c00;
  --accent-soft: #fdecc9;
  --blue: #2f5fe0;
  --blue-soft: #e4eafc;
  --shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 8px 24px rgba(20, 24, 28, 0.06);
  --radius: 10px;

  --font-display: "Arial Narrow", "Helvetica Neue Condensed Bold", "Roboto Condensed", "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171a;
    --paper-raised: #1b1f23;
    --card: #1b1f23;
    --ink: #edeff0;
    --ink-soft: #aab1b7;
    --ink-faint: #7b838b;
    --line: #313842;
    --line-soft: #262c34;
    --accent: #f5a300;
    --accent-ink: #2a1800;
    --accent-soft: #3a2c0f;
    --blue: #7c9bff;
    --blue-soft: #1c2540;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --paper: #14171a;
  --paper-raised: #1b1f23;
  --card: #1b1f23;
  --ink: #edeff0;
  --ink-soft: #aab1b7;
  --ink-faint: #7b838b;
  --line: #313842;
  --line-soft: #262c34;
  --accent: #f5a300;
  --accent-ink: #2a1800;
  --accent-soft: #3a2c0f;
  --blue: #7c9bff;
  --blue-soft: #1c2540;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] {
  --paper: #edeff0;
  --paper-raised: #ffffff;
  --card: #ffffff;
  --ink: #14181c;
  --ink-soft: #4b535c;
  --ink-faint: #7b838b;
  --line: #c9cfd3;
  --line-soft: #dde1e3;
  --accent: #f5a300;
  --accent-ink: #4a2c00;
  --accent-soft: #fdecc9;
  --blue: #2f5fe0;
  --blue-soft: #e4eafc;
  --shadow: 0 1px 2px rgba(20, 24, 28, 0.04), 0 8px 24px rgba(20, 24, 28, 0.06);
}

* { box-sizing: border-box; }
html { color-scheme: light dark; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*
 * Native cross-document View Transitions — same-origin navigations (menu
 * links, "Zarezerwuj termin" etc.) crossfade instead of hard-cutting to a
 * blank page while the next one loads. Pure CSS, no JS router needed:
 * supporting browsers (Chrome/Edge 126+) opt in automatically; everywhere
 * else this is simply ignored and navigation works exactly as before.
 */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.22s;
  animation-timing-function: ease;
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
::view-transition-old(root) { animation: naprawiamy-vt-old .28s ease both; }
::view-transition-new(root) { animation: naprawiamy-vt-new .32s ease both; }
@keyframes naprawiamy-vt-old { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.98); } }
@keyframes naprawiamy-vt-new { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: scale(1); } }

/*
 * Pointer-driven "premium" flourishes (see assets/js/premium-fx.js) — a
 * subtle 3D tilt on the blueprint panels and a cursor-following glow on
 * service cards. JS only applies these on fine-pointer, hover-capable
 * devices and skips them under prefers-reduced-motion, so touch/keyboard
 * visitors just see the plain hover states already defined elsewhere.
 */
.schematic, .split-panel { transition: transform .15s ease-out; will-change: transform; }
.service-card { position: relative; overflow: hidden; }
.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 50%), color-mix(in srgb, var(--blue) 16%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.service-card:hover::before, .service-card:focus-within::before { opacity: 1; }
.service-card > * { position: relative; z-index: 1; }

/*
 * Scroll-reveal utility — animations.js adds .reveal to marketing content
 * blocks (service cards, steps, FAQ items, etc.) at runtime and flips
 * .is-visible on once each scrolls into view. Skipped entirely (elements
 * never get .reveal in the first place) when prefers-reduced-motion is set
 * or IntersectionObserver isn't available, so there's no motion and no
 * "stuck invisible" fallback to worry about either.
 */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
/* Smooth crossfade for the theme-toggle switch (see .theme-toggle below) —
   only the surfaces that visibly change color need it, not everything. */
header.site-header, footer.site-footer, .sagd-card, .booking-panel,
.service-card, .price-panel, .price-panel-head, .price-panel-foot,
.area-chip, .price-note, .callout, table.price-table td {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.98;
}

/* ---------- header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.logo .dot { color: var(--accent); }
nav.primary {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* wp_nav_menu() still wraps each link in <li>; unwrap it so a registered
   WP menu lays out identically to the hardcoded <a> fallback below. */
nav.primary ul { display: contents; list-style: none; margin: 0; padding: 0; }
nav.primary li { display: contents; list-style: none; margin: 0; padding: 0; }
nav.primary a {
  padding: 10px 16px;
  font-size: 15px;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
nav.primary a:hover { color: var(--ink); background: var(--line-soft); }
nav.primary a[aria-current="page"] { color: var(--ink); background: var(--line-soft); font-weight: 600; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: color-mix(in srgb, var(--accent) 88%, black 4%); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-dark { background: var(--ink); color: var(--paper); }

.menu-toggle { display: none; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, transform .1s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-soft); }
.theme-toggle:active { transform: scale(.93); }
.theme-toggle svg { position: absolute; transition: opacity .25s ease, transform .35s ease; }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg) scale(.5); }
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0) scale(1); }
:root[data-theme="dark"] .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="dark"] .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg) scale(.5); }
  :root:not([data-theme]) .theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }
}

/* ---------- hero (front page) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
/*
 * Ambient "blueprint grid" drift behind the hero content — same repeating-
 * gradient technique .schematic/.split-panel already use for their grid
 * background, just slowly panning. Purely decorative (inset well past the
 * viewport so it never needs a hard edge), so it sits behind everything at
 * z-index:0 and never intercepts clicks.
 */
.hero::before {
  content: '';
  position: absolute;
  inset: -20%;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, color-mix(in srgb, var(--line) 55%, transparent) 39px, color-mix(in srgb, var(--line) 55%, transparent) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, color-mix(in srgb, var(--line) 55%, transparent) 39px, color-mix(in srgb, var(--line) 55%, transparent) 40px);
  opacity: .4;
  animation: hero-grid-drift 44s linear infinite;
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
@keyframes hero-grid-drift { from { transform: translate(0, 0); } to { transform: translate(40px, 40px); } }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  /* Longhand on purpose — this element is also .wrap (see front-page.php),
     and a "72px 0 88px" shorthand here would zero out .wrap's own left/right
     padding instead of just adding vertical spacing, gluing the hero text
     to the screen edges. */
  padding-top: 72px;
  padding-bottom: 88px;
}
.hero-copy .eyebrow { margin-bottom: 18px; display: block; }
.hero h1 { font-size: clamp(40px, 5.4vw, 68px); }
.hero h1 .accent-line { color: var(--accent); }
.hero p.lede {
  margin-top: 22px;
  max-width: 46ch;
  font-size: 18px;
  color: var(--ink-soft);
}
.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.hero-actions .btn { padding: 14px 26px; font-size: 16px; }

/*
 * Server-rendered from naprawiamy_next_available_slot() in functions.php
 * (see front-page.php) — same sagd_find_next_available_slot() logic the
 * booking wizard's own "Najbliższy wolny termin" banner uses, so it's a
 * real, live value rather than a fabricated one.
 */
.hero-next-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease;
}
.hero-next-slot:hover { border-color: var(--blue); color: var(--ink); }
.hero-next-slot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43a047;
  flex-shrink: 0;
  animation: hero-dot-pulse 2s ease infinite;
}
@keyframes hero-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 160, 71, .4); }
  50% { box-shadow: 0 0 0 4px rgba(67, 160, 71, 0); }
}

.hero-meta {
  display: flex;
  gap: 22px;
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.hero-meta-item { font-family: var(--font-mono); font-size: 13px; color: var(--ink-faint); }
.hero-meta-item b {
  display: block;
  font-family: var(--font-body);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.schematic, .split-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 27px, var(--line-soft) 27px, var(--line-soft) 28px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, var(--line-soft) 27px, var(--line-soft) 28px),
    var(--paper-raised);
  display: grid;
  place-items: center;
}
.schematic { aspect-ratio: 1 / 1; }
.split-panel { aspect-ratio: 4 / 3; }
/*
 * "Booting up" reveal fitting the blueprint aesthetic (MOD./SCH./SKALA tags,
 * corner brackets) — panel fades in first, then the corner brackets snap in
 * one by one, then the tag labels, then the icon itself. Plays once on
 * page load; there's normally only one of these above the fold (the hero's
 * .schematic), so a scroll-triggered replay isn't worth the added JS for
 * any .split-panel further down a page.
 */
@keyframes hero-panel-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@keyframes hero-corner-in { from { opacity: 0; } to { opacity: 1; } }
.schematic, .split-panel { animation: hero-panel-in .5s ease both; }
.schematic .corner, .split-panel .corner { animation: hero-corner-in .3s ease both; }
.schematic .corner.tl, .split-panel .corner.tl { animation-delay: .15s; }
.schematic .corner.tr, .split-panel .corner.tr { animation-delay: .25s; }
.schematic .corner.bl, .split-panel .corner.bl { animation-delay: .35s; }
.schematic .corner.br, .split-panel .corner.br { animation-delay: .45s; }
.schematic svg, .split-panel svg { animation: hero-panel-in .4s ease both .55s; }
.schematic svg { width: 56%; height: 56%; color: var(--ink); }

/*
 * Interactive washing-machine diagram (see [data-appliance-diagram] in
 * front-page.php and assets/js/appliance-diagram.js) — bigger than the
 * plain equipment icon it replaces, since it's the main content of the
 * panel rather than a small centered glyph.
 */
.schematic svg.diagram-svg { width: 62%; height: 84%; color: var(--ink-soft); }
/* Small wrench cursor instead of the default pointer — falls back to `pointer` automatically if the data-URI ever fails to parse. */
.diagram-hotspot {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 48 48'%3E%3Cpath d='M33 7a9 9 0 0 0-11.6 11.6L7 33l6 6 14.6-14.6A9 9 0 0 0 39 13l-6.5 6.5-5-5L33 7Z' fill='white' stroke='%232f5fe0' stroke-width='3' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 4 4, pointer;
}
.diagram-hotspot-dot { fill: var(--accent); transition: r .15s ease; }
.diagram-hotspot:hover .diagram-hotspot-dot,
.diagram-hotspot:focus .diagram-hotspot-dot { r: 6; }
.diagram-hotspot:focus { outline: none; }
.diagram-hotspot:focus-visible .diagram-hotspot-dot { stroke: var(--blue); stroke-width: 2; }
.diagram-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper-raised) 92%, transparent);
  backdrop-filter: blur(4px);
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 16px 16px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.diagram-info.is-visible { opacity: 1; transform: translateY(0); }
.split-panel svg { width: 40%; height: 40%; color: var(--ink); }
.schematic .tag, .split-panel .tag {
  position: absolute;
  top: 18px;
  left: 18px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  animation: hero-corner-in .3s ease both .65s;
}
.schematic .tag.br, .split-panel .tag.br { top: auto; left: auto; bottom: 18px; right: 18px; text-align: right; }
.schematic .corner, .split-panel .corner { position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--ink-faint); }
.schematic .corner.tl, .split-panel .corner.tl { top: 14px; left: 14px; border-right: none; border-bottom: none; }
.schematic .corner.tr, .split-panel .corner.tr { top: 14px; right: 14px; border-left: none; border-bottom: none; }
.schematic .corner.bl, .split-panel .corner.bl { bottom: 14px; left: 14px; border-right: none; border-top: none; }
.schematic .corner.br, .split-panel .corner.br { bottom: 14px; right: 14px; border-left: none; border-top: none; }

/* ---------- breadcrumbs (subpages) ---------- */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-bottom: 26px;
}
.breadcrumbs a { color: var(--ink-faint); transition: color 0.15s ease; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs [aria-current="page"] { color: var(--ink-soft); }
.breadcrumbs .sep { color: var(--line); }

/* ---------- page hero (subpages) ---------- */
.page-hero {
  position: relative;
  border-bottom: 1px solid var(--line-soft);
  padding: 72px 0 64px;
}
.page-hero .eyebrow { display: block; margin-bottom: 18px; }
.page-hero h1 { font-size: clamp(38px, 5vw, 60px); max-width: 20ch; }
.page-hero p.lede { margin-top: 22px; max-width: 56ch; font-size: 18px; color: var(--ink-soft); }

/* ---------- section shell ---------- */
section.block { padding: 96px 0; }
section.block.tight { padding: 72px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.section-head .desc { max-width: 52ch; color: var(--ink-soft); font-size: 16px; margin-top: 10px; }

/* ---------- card grid (services / values) ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.service-card {
  background: var(--card);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background 0.15s ease;
}
.service-card:hover { background: var(--paper); }
.service-card .icon-wrap {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
}
.service-card .icon-wrap svg { width: 26px; height: 26px; }
.service-card h3 { font-size: 18px; font-weight: 700; }
.service-card p { color: var(--ink-soft); font-size: 14.5px; }
.service-card h3 a { color: inherit; }
.service-card h3 a:hover { color: var(--blue); }
.service-card p a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.service-card p a:hover { color: var(--ink); }

/* ---------- area map (obszar działania) ---------- */
.area-map-wrap {
  aspect-ratio: 1 / 1;
  max-width: 640px;
  margin: 0 auto 56px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 27px, var(--line-soft) 27px, var(--line-soft) 28px),
    repeating-linear-gradient(90deg, transparent, transparent 27px, var(--line-soft) 27px, var(--line-soft) 28px),
    var(--paper-raised);
}
.area-map { display: block; width: 100%; height: 100%; }
.area-map-frame path { stroke: var(--ink-faint); stroke-width: 1.5; fill: none; }
.area-map-tag { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; fill: var(--ink-faint); }
.area-map-ring { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 6; }
.area-map-spoke { stroke: var(--line-soft); stroke-width: 1; }
.area-map-dot { fill: var(--blue); stroke: var(--paper-raised); stroke-width: 1.5; }
.area-map-dot--town { fill: var(--ink-soft); }
.area-map-label { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-soft); }
.area-map-label--town { fill: var(--ink-faint); font-size: 11.5px; }
.area-map-hub { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.area-map-hub-label { font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; fill: var(--ink); }
.area-map-legend-label { font-family: var(--font-mono); font-size: 12px; fill: var(--ink-faint); }

/*
 * Hover/search highlighting (see assets/js/area-map.js) — dimming everyone
 * else reads more clearly than just bolding the match, especially with 23
 * labels crowded around one schematic circle.
 */
.area-map-dot, .area-map-spoke, .area-map-label { transition: opacity .2s ease, fill .2s ease, stroke .2s ease; }
.area-map-dot.is-highlighted { fill: var(--blue); r: 6; }
.area-map-label.is-highlighted { fill: var(--blue); font-weight: 700; }
.area-map-spoke.is-highlighted { stroke: var(--blue); }
.is-dimmed { opacity: .25; }
.area-map-search {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s ease;
}
.area-map-search:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* ---------- area chips (obszar działania) ---------- */
.area-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.area-chip {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 600;
  cursor: default;
  transition: border-color .15s ease, color .15s ease;
}
.area-chip:hover { border-color: var(--blue); color: var(--ink); }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; position: relative; }
.step { position: relative; padding-top: 8px; }
.step .step-num { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.08em; }
.step h3 { margin-top: 14px; font-size: 21px; font-weight: 700; }
.step p { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }
.step p a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.step p a:hover { color: var(--ink); }
.step-rule {
  margin-top: 24px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
  transform: scaleX(0);
  transform-origin: left;
}
/* Draws in once its own .step has faded in (animations.js adds .is-visible via the generic scroll-reveal — no dedicated JS needed for this). */
.step.is-visible .step-rule { animation: step-rule-grow .5s ease forwards .15s; }
@keyframes step-rule-grow { to { transform: scaleX(1); } }

/* ---------- split panel (approach / coverage) ---------- */
.split { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center; }
.split.reverse { grid-template-columns: 1.15fr 0.85fr; }
.split.reverse .split-panel { order: 2; }
.split-copy h2 { font-size: clamp(26px, 3vw, 34px); }
.split-copy p { margin-top: 18px; color: var(--ink-soft); font-size: 16px; max-width: 52ch; }
.split-copy p + p { margin-top: 14px; }
.split-copy p a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.split-copy p a:hover { color: var(--ink); }

/* ---------- pricing panel ---------- */
.price-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
}
.price-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.price-panel-head .eyebrow { margin: 0; }
table.price-table { width: 100%; border-collapse: collapse; }
table.price-table td { padding: 18px 28px; border-bottom: 1px solid var(--line-soft); font-size: 15.5px; vertical-align: top; }
table.price-table tr:last-child td { border-bottom: none; }
table.price-table td.svc { color: var(--ink); }
table.price-table td.svc > a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
table.price-table td.svc > a:hover { color: var(--ink); }
table.price-table td.desc-cell { color: var(--ink-faint); font-size: 13.5px; margin-top: 4px; }
table.price-table td.amount {
  font-family: var(--font-mono);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 600;
}
.price-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--paper);
  flex-wrap: wrap;
  gap: 14px;
}
.price-panel-foot p { color: var(--ink-faint); font-size: 13.5px; }

.price-note {
  margin-top: 20px;
  padding: 16px 20px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-size: 14.5px;
}

/* ---------- cta banner ---------- */
.cta-banner {
  background: var(--ink);
  color: var(--paper);
  border-radius: 20px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.cta-banner h2 { font-size: clamp(26px, 3vw, 36px); color: var(--paper); max-width: 22ch; }
.cta-banner p { color: color-mix(in srgb, var(--paper) 70%, transparent); margin-top: 10px; }
.cta-banner .btn-accent { padding: 15px 28px; font-size: 16px; }

/* ---------- booking embed wrapper (SerwisAGD Booking plugin) ---------- */
.booking-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  padding: 40px clamp(20px, 4vw, 48px);
}

/* ---------- generic content page (privacy policy etc.) ---------- */
.prose { max-width: 74ch; }
.prose h2 { font-size: 24px; margin-top: 44px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 18px; margin-top: 28px; }
.prose p, .prose li { color: var(--ink-soft); font-size: 15.5px; margin-top: 14px; }
.prose ul, .prose ol { margin-top: 14px; padding-left: 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 8px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.callout {
  margin-top: 20px;
  margin-bottom: 40px;
  padding: 16px 20px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  /* --accent-ink is tuned for dark text on the bright --accent button
     background (.btn-accent); against --accent-soft's much darker dark-mode
     tint it's nearly unreadable, so this uses --ink instead, which contrasts
     correctly against --accent-soft in both themes. */
  color: var(--ink);
  font-size: 14.5px;
}

/* ---------- FAQ (native details/summary, no JS) ---------- */
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.faq-item:first-child { padding-top: 0; }
.faq-item summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 15px;
  color: var(--ink-soft);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: 14px; color: var(--ink-soft); font-size: 15px; }

/* ---------- footer ---------- */
footer.site-footer { border-top: 1px solid var(--line-soft); background: var(--paper-raised); }
/* Longhand — this element is also .wrap (see footer.php), and a 3-value
   shorthand here would zero out .wrap's own left/right padding. */
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr; gap: 32px; padding-top: 64px; padding-bottom: 40px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-brand p { color: var(--ink-faint); font-size: 14px; max-width: 32ch; }
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col span { font-size: 14.5px; color: var(--ink-soft); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  border-top: 1px solid var(--line-soft);
  /* Longhand for the same reason as .footer-grid above — also .wrap. */
  padding-top: 22px;
  padding-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-bottom .legal-links { display: flex; gap: 20px; }
.footer-bottom a { font-size: 13.5px; color: var(--ink-faint); }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; }
.footer-bottom .copy { font-size: 13.5px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ---------- back to top ---------- */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink-soft);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease, color .15s ease;
}
.back-to-top:hover { color: var(--ink); border-color: var(--ink-soft); }
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* ---------- sticky mobile call/book bar ---------- */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 44;
  display: none;
  gap: 10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 96%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.sticky-cta.is-visible { transform: translateY(0); }
.sticky-cta .btn { flex: 1; }

@media (max-width: 880px) {
  .sticky-cta { display: flex; }
  /* The back-to-top button would otherwise sit right on top of the sticky
     call/book bar on phones. */
  .back-to-top { bottom: 84px; }
}

@media (max-width: 880px) {
  .wrap { padding: 0 20px; }
  nav.primary { display: none; }
  /*
   * The header CTA + hamburger together next to the (non-shrinking, single-
   * word) logo don't fit any phone width — verified: at 375px the row
   * overflows by 116px, at 320px by 171px, pushing the hamburger itself off
   * the visible screen and giving the whole page unwanted horizontal scroll.
   * Dropping the header CTA on mobile is the fix: "Zarezerwuj termin" is
   * already prominent in the hero immediately below, so nothing is lost.
   */
  .nav-row .btn-accent { display: none; }
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
  }
  .hero-grid { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; }
  .schematic { order: -1; max-width: 360px; margin: 0 auto; }
  .services-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .split, .split.reverse { grid-template-columns: 1fr; }
  .split.reverse .split-panel { order: -1; }
  .split-panel { max-width: 420px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-banner { padding: 40px 28px; }
  table.price-table td.desc-cell { display: block; }
  /* At phone widths the 640-unit viewBox shrinks past the point where mono
     12px labels stay legible — the full district/town names are already
     listed as chips right below the map, so the diagram can drop to a plain
     radial pattern here without losing any information. */
  .area-map-label, .area-map-hub-label, .area-map-legend-label { display: none; }
}

/*
 * The 2-column footer above is fine down to ~560px — below that, the
 * unbreakable "MATHYHOUSE" logo in the first column forces itself a
 * ~239px minimum width regardless of grid-template-columns, squeezing the
 * sibling nav column to as little as ~80px on a 375px phone. Stacking to a
 * single column on phones sidesteps the imbalance entirely instead of
 * shrinking or word-breaking the brand name.
 */
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/*
 * Even with the header CTA hidden above, the logo (~239px, can't shrink —
 * see .logo's flex-shrink: 0) plus the 42px hamburger button still land
 * ~5px over budget at the narrowest common phone width (320px, e.g. iPhone
 * SE). Trimming .wrap's own padding by 4px a side at that width closes the
 * gap without touching the logo or button sizing.
 */
@media (max-width: 360px) {
  .wrap { padding: 0 16px; }
}
