/* ═══════════════════════════════════════════════
   LAW LAW FIRM – style.css (Optyamlizowany RWD & UX)
   Podejście: Mobile-First
   ═══════════════════════════════════════════════ */

:root {
  /* Paleta barw - ujednolicona */
  --navy:         #1A2744;
  --navy-light:   #253360;
  --gold:         #B59A5E;
  --gold-light:   #C8B07A;
  --white:        #FAF8F5; /* Główny background */
  --off-white:    #F3F0EC; /* Sekcje light */
  --mid-gray:     #8A8378; /* Teksty lead */
  --dark-text:    #111827; /* Teksty główne */
  --border-color: #E2DDD6;
  
  /* UX Elements */
  --shadow-prestige: 0 10px 40px rgba(26,39,68,.06);
  --ff-head:      'Cormorant Garamond', Georgia, serif;
  --ff-body:      'Jost', 'Helvetica Neue', sans-serif;
  --ff-acc:       'Jost', sans-serif; /* Dla mniejszych elementów akcentowych */
  --radius:       4px;
  --ease:         cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Subtelny, profesjonalny easing */
  --trans:        0.3s var(--ease);
  
  /* Płynna Typografia & Odstępy (clamp) - UX */
  --section-padding: clamp(60px, 10vw, 120px); /* Oddech między sekcjami */
}

/* ── 1. RESET & FUNDAMENTY ── */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html { 
  scroll-behavior: auto; /* Obsługiwane przez JS dla lepszej kontroli offsetu */
  font-size: 16px; /* Baza dla rem */
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 1rem; /* 16px */
  line-height: 1.8; /* Zwiększona interlinią dla czytelności UX */
  color: var(--dark-text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* Bezpieczeństwo RWD */
}

/* SEO/UX Accessibility helper */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

img { 
  display: block; 
  max-width: 100%; 
  height: auto; 
}

a { 
  text-decoration: none; 
  color: inherit; 
  transition: var(--trans);
}

button { 
  font-family: inherit; 
  cursor: pointer; 
  border: none; 
  background: none; 
}

/* Focus styles dla Accessibility (klawiatura) */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ── 2. HELPERS UTILITY ── */
.container {
  width: 100%;
  max-width: 1200px; /* Lekko zwiększone dla lepszego oddechu na 4K */
  margin: 0 auto;
  padding: 0 24px; /* Marginesy bezpieczeństwa na mobile */
}

@media (min-width: 768px) {
  .container { padding: 0 40px; }
}

.section-light { background: var(--off-white); }
.section-white { background: var(--white); }

/* Automatyczny, potężny Grid RWD bez Media Queries - Złota zasada RWD */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* ── 3. TYPOGRAFIA NAZWY SEKCJI (UX/UI) ── */
.section-title {
  font-family: var(--ff-head);
  font-size: clamp(2rem, 5vw, 3rem); /* Płynny font */
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--navy);
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 70px);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px; height: 2px;
  background: var(--gold);
  margin: 16px auto 0;
}

.section-lead {
  text-align: center;
  max-width: 720px; /* UX - optymalna długość linii tekstu */
  margin: -1.5rem auto clamp(40px, 5vw, 60px);
  color: var(--mid-gray);
  font-size: clamp(1rem, 2vw, 1.125rem); /* 16-18px płynnie */
  font-weight: 300;
}

/* ── 4. PRZYCISKI (Buttons UI) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 36px;
  font-family: var(--ff-acc);
  font-size: 0.75rem; /* 12px */
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: all var(--trans);
  text-align: center;
}

.btn-gold {
  background: var(--gold);
  color: var(--white);
}

.btn-gold:hover {
  background: var(--gold-light);
  transform: translateY(-2px); /* Subtelny UX feedback */
  box-shadow: 0 5px 15px rgba(181,154,94, 0.3);
}

.btn-outline-sm {
  padding: 10px 24px;
  font-size: 0.7rem;
  border: 1px solid var(--border-color);
  color: var(--navy);
  background: transparent;
}

.btn-outline-sm:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.btn-full { width: 100%; }

/* ── 5. NAVBAR (Header UI) ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--trans), box-shadow var(--trans);
  height: 80px; /* Stała wysokość ułatwia JS offset */
  display: flex;
  align-items: center;
}

/* Stan po przeskrolowaniu */
.navbar.scrolled {
  background: rgba(26, 39, 68, 0.98); /* Navy z lekką przezroczystością */
  box-shadow: 0 2px 20px rgba(0,0,0,.15);
  height: 74px; /* Lekkie zwężenie UX */
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-family: var(--ff-head);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--white);
}

/* Menu desktopowe (ukryte na mobile w Mobile-First) */
.nav-menu {
  position: fixed;
  top: 80px; /* Wysokość navbara */
  left: 0; right: 0; bottom: 0;
  background: var(--navy);
  padding: 40px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease);
  transform: translateY(-10px);
  z-index: 999;
  overflow-y: auto; /* UX dla małych ekranów */
}

.nav-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  font-family: var(-- ff-acc);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,.9);
  padding: 10px;
  display: block;
  text-transform: uppercase;
}

.nav-links a:hover { color: var(--gold); }

/* Hamburger UI */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 30px;
  padding: 5px 0;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  transition: transform var(--trans), opacity var(--trans), background var(--trans);
  border-radius: 2px;
}

/* Animacja Hamburgera */
.hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Switch na Desktop - RWD Złota zasada */
@media (min-width: 1024px) {
  .hamburger { display: none; }
  
  .navbar { height: 100px; } /* Wyższy navbar na desktopie UI */
  .navbar.scrolled { height: 80px; }

  .nav-menu {
    position: static;
    background: transparent;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
    overflow: visible;
  }
  
  .nav-links {
    flex-direction: row;
    gap: clamp(15px, 3vw, 35px); /* Płynne odstępy UX */
  }
  
  .nav-links a {
    font-size: 0.72rem; /* Powrót do mniejszego, prestiżowego fontu */
    color: rgba(255,255,255,.8);
    padding: 5px 0;
  }
}

/* ── 6. HERO SECTION (UI/UX) ── */
.hero {
  position: relative;
  min-height: 100vh; /* Pełny ekran */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  padding-top: 100px; /* Offset dla navbara */
  padding-bottom: 60px;
}

.hero-image-wrap {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* UX Gradient - tekst zawsze czytelny */
  background: linear-gradient(to bottom, 
    rgba(17, 24, 39, 0.7) 0%,
    rgba(17, 24, 39, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-family: var(--ff-head);
  font-size: clamp(2.5rem, 8vw, 4.5rem); /* Potężna, płynna typografia hero */
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--white);
  max-width: 900px;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem); /* 16px - 20px */
  font-weight: 300;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin-bottom: 40px;
  line-height: 1.6;
}

/* Opcjonalne: poprawa tła hero dla Mobile UI, jeśli zdjęcie jest jasne */
@media (max-width: 767px) {
  .hero-title { font-weight: 400; }
  .hero-overlay { background: rgba(17, 24, 39, 0.6); }
}

/* ── 7. Sekcja O NAS & Wartości ── */
.o-nas {
  padding: var(--section-padding) 0;
}

.values-grid {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first: 1 kolumna */
  gap: 30px;
  margin-top: 50px;
}

@media (min-width: 768px) {
  .values-grid { grid-template-columns: 1fr 1fr; } /* Tablet/Desktop: 2 kolumny */
}

.value-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: clamp(30px, 5vw, 50px);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--trans);
}

.value-card:hover {
  border-color: transparent;
  box-shadow: var(--shadow-prestige); /* Subtelny prestiżowy cień UX */
  transform: translateY(-3px);
}

.value-icon {
  width: 60px; height: 60px;
  color: var(--gold);
  margin-bottom: 24px;
}

.value-icon svg { width: 100%; height: 100%; }

.value-card h3 {
  font-family: var(--ff-acc);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--navy);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.value-card p {
  font-size: 0.95rem;
  color: var(--dark-text);
  line-height: 1.7;
  font-weight: 300;
}

/* ── 8. Sekcja SPECJALIZACJE ── */
.specjalizacje {
  padding: var(--section-padding) 0;
}

.spec-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.4s var(--ease);
}

.spec-card:hover {
  border-color: var(--gold);
  background: var(--navy); /* UI inversion effect */
  box-shadow: 0 15px 40px rgba(26,39,68,.12);
  transform: translateY(-5px) scale(1.02);
}

.spec-icon {
  width: 56px; height: 56px;
  color: var(--gold);
  margin-bottom: 24px;
  transition: transform 0.4s var(--ease);
}

.spec-card:hover .spec-icon {
  transform: scale(1.1) translateY(-2px);
}

.spec-icon svg { width: 100%; height: 100%; }

.spec-card h3 {
  font-family: var(--ff-acc);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--navy);
  text-transform: uppercase;
  margin-bottom: 16px;
  transition: color 0.4s var(--ease);
}

.spec-card p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--dark-text);
  font-weight: 300;
  transition: color 0.4s var(--ease);
}

/* Stan hover dla tekstu w karcie - UI UX */
.spec-card:hover h3 { color: var(--gold); }
.spec-card:hover p { color: rgba(250,248,245,0.8); }

/* ── 9. Sekcja ZESPÓŁ ── */
.zespol {
  padding: var(--section-padding) 0;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-photo {
  width: 100%;
  aspect-ratio: 3 / 4; /* Stałe proporcje zdjęcia UX */
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.team-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease);
}

.team-card:hover .team-photo img {
  transform: scale(1.06);
}

.team-card h4 {
  font-family: var(--ff-head);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 4px;
}

.team-role {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 20px;
  text-transform: uppercase;
}

/* ── 10. STATS BAR ── */
.stats-bar {
  background: var(--navy);
  padding: clamp(50px, 8vw, 80px) 0;
  color: var(--white);
}

.stats-inner {
  display: flex;
  flex-direction: column; /* Mobile first */
  align-items: center;
  gap: 40px;
}

@media (min-width: 768px) {
  .stats-inner {
    flex-direction: row;
    justify-content: center;
    gap: clamp(40px, 10vw, 100px);
  }
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-num {
  font-family: var(--ff-head);
  font-size: clamp(3.5rem, 8vw, 6rem); /* Prestiżowe duże liczby hero */
  font-weight: 300;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-family: var(--ff-acc);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  color: rgba(255,255,255,.6);
  margin-top: 10px;
  text-transform: uppercase;
}

.stat-divider {
  width: 60px; height: 1px; /* Mobile divider */
  background: rgba(255,255,255,.15);
}

@media (min-width: 768px) {
  .stat-divider { width: 1px; height: 100px; } /* Desktop divider */
}

/* ── 11. Sekcja FAQ ── */
.faq {
  padding: var(--section-padding) 0;
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  background: var(--white);
}

.faq-item:first-child {
  border-top: 1px solid var(--border-color);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 10px;
  text-align: left;
  font-size: 1rem;
  font-weight: 400;
  color: var(--dark-text);
  transition: color var(--trans);
}

.faq-question:hover { color: var(--gold); }

.faq-chevron {
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: var(--border-color);
  transition: transform var(--trans), color var(--trans);
}

/* Stan otwarty faq Harmonijka UI UX */
.faq-item.open .faq-question {
  color: var(--navy);
  font-weight: 500;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--gold);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), visibility 0.4s;
  visibility: hidden;
}

/* Używamy JS do przełączania atrybutu hidden, ale CSS do animacji wysokości */
.faq-item.open .faq-answer {
  max-height: 1000px; /* Duża wartość bezpieczna UX */
  visibility: visible;
}

.faq-answer-inner {
  padding: 0 10px 30px;
}

.faq-answer p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--mid-gray);
  font-weight: 300;
}

/* ── 12. Sekcja KONTAKT ── */
.kontakt {
  padding: var(--section-padding) 0;
}

.kontakt-inner {
  display: grid;
  grid-template-columns: 1fr; /* Mobile First */
  gap: 50px;
  align-items: start;
}

@media (min-width: 1024px) {
  .kontakt-inner { grid-template-columns: 1fr 1fr; }
}

.map-wrap {
  width: 100%;
  aspect-ratio: 4 / 3; /* Utrzymanie proporcji mapy UX RWD */
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--off-white); /* Placeholder tło mapy */
}

/* Zapobieganie blokowaniu skrolla przez iframe mapy na mobile - UX */
.map-wrap iframe {
  pointer-events: none;
}

.map-wrap:hover iframe, .map-wrap:focus iframe {
  pointer-events: auto;
}

.contact-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: 0.95rem;
  color: var(--dark-text);
  transition: all var(--trans);
}

.form-input::placeholder { color: rgba(138,131,120, 0.7); }

.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(181,154,94, 0.1);
  outline: none;
}

.form-textarea {
  resize: vertical; /* UX - użytkownik decyduje */
  min-height: 150px;
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--mid-gray);
  font-weight: 300;
  line-height: 1.5;
}

.form-consent input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--gold); /* Kolorowanie UI UX checkoboxa */
  width: 16px; height: 16px;
}

.form-consent a {
  color: var(--gold);
  text-decoration: underline;
}

/* ── 13. STOPKA (Footer UI/UX) ── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 70px 0 30px;
  font-size: 0.9rem;
  font-weight: 300;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr; /* Mobile first */
  gap: 40px;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .footer-inner {
    grid-template-columns: repeat(3, 1fr);
    text-align: left;
  }
}

.footer-logo {
  font-family: var(--ff-head);
  font-size: 1.3rem;
  letter-spacing: 0.2em;
  color: var(--white);
  margin-bottom: 10px;
}

.footer-col.footer-right {
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .footer-col.footer-right { align-items: flex-end; text-align: right;}
}

.footer-phone {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 5px;
}

.footer-address { line-height: 1.6; }
.footer-hours {
  color: rgba(255,255,255,0.5);
  margin-top: 10px;
}

.footer-bottom {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ── 14. ANIMACJE (UI Experience) ── */

/* A. Fade In Up Load (dla Hero) */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp 0.8s var(--ease) both; }
.fade-in-up-delay-1 { animation: fadeInUp 0.8s 0.2s var(--ease) both; }
.fade-in-up-delay-2 { animation: fadeInUp 0.8s 0.4s var(--ease) both; }

/* B. Scroll Triggers Animations (Intersection Observer) - UX Experience */
.fade-up-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  will-change: transform, opacity; /* Optymalizacja wydajności RWD */
}

.fade-up-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Opcjonalne: Spowolnienie animacji, jeśli użytkownik preferuje zredukowany ruch UX a11y */
@media (prefers-reduced-motion: reduce) {
  .fade-up-scroll {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .fade-in-up, .team-card:hover .team-photo img, .spec-card:hover {
    animation: none;
    transition: none;
  }
}