/* Kancelarie Wałowa — styles.css v3 */
/* Ulepszenia: mobilne, sticky CTA, trust-row, lepsze karty, dostępność */

:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --muted: #6b7280;
  --text: #0e0f12;
  --brand: #b08a2e;
  --brand-ink: #0c0903;
  --accent: #c9a640;
  --border: #e5e7eb;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.06);
  --radius: 14px;
  --maxw: 1200px;
  --font-sans: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Arial, sans-serif;
  --font-serif: "Playfair Display", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; font: 16px/1.65 var(--font-sans); background: var(--bg); color: var(--text); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding: 0 20px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: var(--font-serif); letter-spacing: .2px; line-height: 1.2; }
h1 { font-weight: 700; }
h2 { font-size: clamp(22px, 2.6vw, 34px); margin: 0 0 14px; }
h3 { font-size: clamp(18px, 1.8vw, 22px); margin: 0 0 10px; }
h4 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }

/* ===== HEADER ===== */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.bar { display: flex; align-items: center; gap: 20px; padding: 14px 0; width: 100%; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo-svg { width: 42px; height: 42px; flex: 0 0 42px; display: block; }
.logo-svg .mark-stroke { stroke: var(--brand); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }

nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav a { padding: 9px 12px; border-radius: 10px; color: var(--text); font-size: 15px; transition: background .15s; }
nav a:hover { background: #f7f7f8; text-decoration: none; }
nav a.active { font-weight: 700; color: var(--brand); }

/* CTA button */
.cta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(176,138,46,.3);
  letter-spacing: .2px;
  transition: filter .15s, box-shadow .15s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: inherit;
}
.cta:hover { filter: brightness(1.05); box-shadow: 0 4px 16px rgba(176,138,46,.4); text-decoration: none; }
.cta-small { padding: 8px 14px; border-radius: 10px; font-weight: 700; box-shadow: var(--shadow-sm); }

/* Mobile hamburger */
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  margin-left: auto;
}

/* ===== IMAGES ===== */
.img-frame {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fafafa;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.img-fit { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
.ratio-4-3 { aspect-ratio: 4/3; }
.ratio-16-9 { aspect-ratio: 16/9; }
.ratio-1-1 { aspect-ratio: 1/1; }

/* ===== SECTIONS & GRID ===== */
section { padding: 56px 0; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { padding: 18px; }
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 20px; color: var(--muted); font-size: 13px; }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.list { padding-left: 18px; }
.list li { margin: 7px 0; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }

/* ===== HERO ===== */
.hero { position: relative; padding: 80px 0; overflow: hidden; }
.hero .bg-ambient {
  position: absolute; inset: -10%; pointer-events: none;
  background: radial-gradient(1200px 420px at 80% -50%, rgba(185,149,44,.10), transparent),
              radial-gradient(800px 300px at 10% -20%, rgba(201,166,64,.06), transparent);
}
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .12; filter: grayscale(.1) contrast(1.05); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,.85)); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.gold-line { height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); border-radius: 10px; margin: 0 0 16px; }
.typewrap { min-height: 3.2em; }
.type-main { font-family: var(--font-serif); font-size: clamp(28px, 3.6vw, 50px); line-height: 1.1; margin: .1em 0 .25em; }
.type-sub { color: var(--muted); font-size: clamp(16px, 1.4vw, 18px); margin: 0 0 12px; }
.cursor { display: inline-block; width: 1ch; border-right: 2px solid var(--brand); margin-left: 2px; animation: blink 1s steps(2,end) infinite; }
@keyframes blink { 50% { border-color: transparent; } }

/* Hero buttons */
.hero-btns { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.tel-hero {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--brand); font-weight: 700; font-size: 17px;
  padding: 10px 16px; border-radius: 10px;
  border: 1.5px solid rgba(176,138,46,.3);
  transition: background .15s, border-color .15s;
}
.tel-hero:hover { background: rgba(176,138,46,.05); border-color: var(--brand); text-decoration: none; }

/* Trust row */
.trust-row {
  display: flex; align-items: center; gap: 20px;
  margin-top: 28px; flex-wrap: wrap;
}
.trust-item { display: flex; flex-direction: column; }
.trust-item strong { font-family: var(--font-serif); font-size: 28px; color: var(--brand); line-height: 1; }
.trust-item span { font-size: 13px; color: var(--muted); margin-top: 2px; }
.trust-sep { width: 1px; height: 36px; background: var(--border); }

/* ===== PRACTICE CARDS ===== */
.ico { width: 28px; height: 28px; flex: 0 0 28px; }
.ico * { stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.practice-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; transition: transform .18s, box-shadow .18s, border-color .18s;
  text-decoration: none; color: var(--text);
}
.practice-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.09); border-color: var(--accent); text-decoration: none; }
.practice-card:focus-visible { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: var(--radius); }
.practice-card h3 { font-size: 17px; margin: 0 0 6px; }
.practice-card p { font-size: 14px; color: var(--muted); margin: 0; }
@keyframes nudge { from { transform: translateY(0); } 50% { transform: translateY(-2px); } to { transform: translateY(0); } }
@keyframes dash { to { stroke-dashoffset: -28; } }
@media (hover: hover) {
  .practice-card:hover .ico { animation: nudge 900ms ease-in-out; }
  .practice-card:hover .ico * { stroke-dasharray: 6 6; animation: dash 1200ms linear infinite; }
}
.practice-card:focus-visible .ico { animation: nudge 900ms ease-in-out; }

/* ===== TEAM BANNER ===== */
.team-banner {
  position: relative; display: grid;
  grid-template-columns: 1fr .8fr; gap: 24px; align-items: center;
  padding: 28px; background: rgba(185,149,44,.05);
  border: 1px solid #eadfbe; border-radius: var(--radius);
}
.team-banner > div:first-child { position: relative; z-index: 2; }

/* ===== LAWYERS / TEAM ===== */
.lawyers .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.person { display: flex; flex-direction: column; padding: 20px; gap: 12px; }
.avatar-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: #fafafa; min-height: 260px; }
.person-name { font-family: var(--font-serif); font-weight: 700; font-size: clamp(18px, 2vw, 24px); margin: 2px 0 0; }
.person .meta { color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.person p { margin: 4px 0; font-size: 14px; }
.person-actions { margin-top: auto; display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.mail-plain { color: var(--muted); font-style: italic; font-size: 13px; word-break: break-all; }
.tel-link { color: var(--brand); font-weight: 600; }

/* ===== FORM ===== */
form { display: grid; gap: 14px; }
label { font-size: 14px; font-weight: 600; margin-bottom: 4px; display: block; }
input, textarea, select {
  background: #fff; border: 1.5px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; width: 100%; font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(176,138,46,.15);
}
textarea { min-height: 140px; resize: vertical; }
.consent { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.consent input[type="checkbox"] { width: auto; margin-top: 2px; flex-shrink: 0; accent-color: var(--brand); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.submit { display: flex; gap: 10px; align-items: center; }

/* ===== CONTACT DATA ===== */
.contact-row { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.contact-row svg { flex-shrink: 0; color: var(--brand); margin-top: 2px; }
.badges { display: flex; gap: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); padding: 12px 16px; border-radius: 12px;
  background: #fff; transition: box-shadow .15s, border-color .15s; text-decoration: none; color: var(--text);
}
.badge:hover { box-shadow: var(--shadow); border-color: var(--accent); text-decoration: none; }
.b-ico { width: 22px; height: 22px; border-radius: 6px; background: var(--brand); display: inline-block; flex-shrink: 0; }

/* ===== FOOTER ===== */
footer { margin-top: 40px; padding: 40px 0; border-top: 1px solid var(--border); color: var(--muted); }
.footgrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; align-items: start; }
.footgrid p { margin: 6px 0; font-size: 14px; }
.footgrid a { color: var(--muted); font-size: 14px; }
.footgrid a:hover { color: var(--brand); }
.footgrid h4 { color: var(--text); font-size: 15px; margin-bottom: 12px; }

/* ===== STICKY CTA BAR ===== */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 55; background: var(--brand);
  padding: 12px 20px; box-shadow: 0 -4px 20px rgba(0,0,0,.15);
}
.sticky-cta__inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.sticky-cta__text { color: var(--brand-ink); font-weight: 700; flex: 1; font-size: 15px; }
.sticky-cta__btns { display: flex; gap: 10px; }
.sticky-cta .btn {
  padding: 9px 18px; border-radius: 8px; font-weight: 700;
  font-size: 14px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s;
}
.sticky-cta .btn.call { background: var(--brand-ink); color: #fff; }
.sticky-cta .btn.call:hover { background: #1a1a1a; }
.sticky-cta .btn.msg { background: rgba(255,255,255,.25); color: var(--brand-ink); border: 1px solid rgba(0,0,0,.1); }
.sticky-cta .btn.msg:hover { background: rgba(255,255,255,.4); }
.sticky-cta__close {
  background: none; border: none; color: var(--brand-ink);
  font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
  opacity: .7; transition: opacity .15s;
}
.sticky-cta__close:hover { opacity: 1; }

/* ===== ACCESSIBILITY PANEL ===== */
.a11y-fab { position: fixed; right: 16px; bottom: 16px; z-index: 70; }
.a11y-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand); border: none; color: var(--brand-ink);
  font-weight: 700; border-radius: 999px; padding: 12px 16px;
  box-shadow: var(--shadow); cursor: pointer; font-family: inherit; font-size: 14px;
}
.a11y-btn:focus-visible { outline: 3px solid #000; outline-offset: 2px; }
.a11y-panel {
  position: fixed; right: 16px; bottom: 76px; z-index: 70;
  width: min(380px, 92vw); background: #fff; border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.12);
  transform: translateY(14px) scale(.98); opacity: 0;
  pointer-events: none; transition: transform .18s ease, opacity .18s ease;
}
.a11y-panel.show { transform: none; opacity: 1; pointer-events: auto; }
.a11y-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.a11y-title { font-weight: 800; }
.a11y-close { background: #fff; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.a11y-body { padding: 12px 16px; display: grid; gap: 12px; }
.a11y-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.a11y-row .desc { color: var(--muted); font-size: 13px; }
.switch { position: relative; display: inline-flex; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider { width: 48px; height: 28px; background: #f3f4f6; border: 1px solid var(--border); border-radius: 999px; position: relative; transition: .2s; cursor: pointer; }
.slider::after { content: ""; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: #e5e7eb; transition: .2s; }
.switch input:checked + .slider { background: var(--brand); border-color: #d9c37b; }
.switch input:checked + .slider::after { transform: translateX(20px); background: var(--brand-ink); }
.a11y-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.a11y-actions button { border: 1px solid var(--border); background: #fff; color: var(--text); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-family: inherit; }
.a11y-actions .primary { background: var(--brand); color: var(--brand-ink); border-color: #d9c37b; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ===== HOME SEO / FAQ ===== */
.home-seo { background: #f9fafb; border-radius: var(--radius); margin: 0 20px; padding: 48px 40px; }
.home-seo .grid { margin-top: 20px; }
.home-seo details, .tile details {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin: 8px 0; background: #fff;
  transition: background .15s;
}
.home-seo details[open], .tile details[open] { background: #faf9f7; }
.home-seo details summary, .tile details summary {
  cursor: pointer; font-weight: 700; list-style: none; user-select: none;
  display: flex; justify-content: space-between; align-items: center;
}
.home-seo details summary::after, .tile details summary::after {
  content: "+"; font-size: 20px; color: var(--brand); line-height: 1;
}
.home-seo details[open] summary::after, .tile details[open] summary::after { content: "–"; }
.home-seo details p, .tile details p { margin-top: 10px; color: var(--muted); font-size: 15px; }

/* ===== IMAGE BACKGROUNDS ===== */
.img-case { background-image: url("images/main.jpg"); }
.img-team { background-image: url("images/zespol.jpg"); }
.img-dzial.prawo-rodzinne { background-image: url("images/prawo-rodzinne.png"); }
.img-dzial.prawo-karne { background-image: url("images/prawo-karne.png"); }
.img-dzial.prawo-pracy { background-image: url("images/prawo-pracy.png"); }
.img-dzial.prawo-gospodarcze { background-image: url("images/prawo-gospodarcze.png"); }
.img-dzial.nieruchomosci-budowlane { background-image: url("images/nieruchomosci-budowlane.png"); }
.img-dzial.spadki-darowizny { background-image: url("images/spadki-darowizny.png"); }
.img-dzial.odszkodowania-ubezpieczenia { background-image: url("images/odszkodowania-ubezpieczenia.png"); }
.img-dzial.prawo-administracyjne { background-image: url("images/prawo-administracyjne.png"); }
.img-dzial.prawo-cywilne { background-image: url("images/prawo-cywilne.png"); }

/* ===== FORM MESSAGES ===== */
.contact-message { padding: 14px 18px; margin-bottom: 16px; border-radius: 12px; font-weight: 600; animation: slideIn .3s ease; }
.contact-message.success, .contact-success { background: #e6ffed; color: #065f46; border: 1.5px solid #10b981; padding: 14px 18px; border-radius: 10px; font-weight: 600; margin-bottom: 16px; }
.contact-message.error { background: #fef2f2; color: #991b1b; border: 1.5px solid #ef4444; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== ACCESSIBILITY MODES ===== */
.a11y-lgtext { font-size: 112%; }
.a11y-contrast {
  --bg: #0b0b0c; --panel: #111213; --text: #ffffff; --muted: #d1d5db;
  --border: #2b2f36; --brand: #ffd24a; --brand-ink: #111;
  background: var(--bg); color: var(--text);
}
.a11y-contrast a { color: #ffd24a; text-decoration: underline; }
.a11y-reduce * { animation: none !important; transition: none !important; }
.a11y-links a { text-decoration: underline; }
.a11y-spacing { letter-spacing: .2px; }
.a11y-readable p, .a11y-readable li { max-width: 72ch; }

/* ===== FOCUS ===== */
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

/* ===== MOBILE TYPEWRITER ===== */
@media (max-width: 768px) {
  .typewrap .cursor { display: none !important; }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-video { display: none; }
  .cursor { border-right: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1080px) {
  .lawyers .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  /* Mobile nav */
  nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
  }
  nav.show { display: flex; }
  nav a { padding: 12px 16px; font-size: 16px; border-radius: 10px; }
  .menu-btn { display: flex; }

  /* Grids */
  .hero-grid, .grid.cols-3, .grid.cols-2, .team-banner { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .footgrid { grid-template-columns: 1fr 1fr; }

  /* Hero */
  .hero { padding: 48px 0 40px; }
  .hero-grid { gap: 24px; }
  .img-frame.img-case { display: none; } /* hide image on mobile hero */

  /* Trust row */
  .trust-row { gap: 16px; }
  .trust-item strong { font-size: 24px; }

  /* Home SEO */
  .home-seo { margin: 0; border-radius: 0; padding: 40px 20px; }
}

@media (max-width: 640px) {
  section { padding: 40px 0; }
  .lawyers .grid { grid-template-columns: 1fr; }
  .avatar-frame { min-height: 220px; }
  .footgrid { grid-template-columns: 1fr; gap: 20px; }
  .two { grid-template-columns: 1fr; }
  .hero-btns { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Sticky CTA adjustments */
  .sticky-cta__text { display: none; }
  .sticky-cta__inner { justify-content: center; }
  .sticky-cta .btn { flex: 1; text-align: center; }

  /* A11y FAB on mobile – move up if sticky CTA visible */
  .a11y-fab { bottom: 80px; }
}

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 80px; right: 20px; background: #fff; border: 1px solid var(--border); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); display: none; z-index: 65; }
.toast.show { display: block; }

/* ===== BTN OUT OF HOURS ===== */
.btn-outofhours { background: var(--brand); color: var(--brand-ink); }
