/*
Theme Name: Naprawiamy AGD
Theme URI: https://mathyhouse.com
Author: Mathyhouse.com
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; }
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;
}
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-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; }

/* ---------- hero (front page) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}
.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; }

.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; }
.schematic svg { width: 56%; height: 56%; color: var(--ink); }
.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;
}
.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; }

/* ---------- 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; }

/* ---------- 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-rule {
  margin-top: 24px;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
}

/* ---------- 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; }

/* ---------- 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.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;
}

/* ---------- 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.4fr 1fr 1fr 1fr; gap: 40px; 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); }

@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; }
}

/*
 * 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; }
}
