:root {
  --green-dark: #1d3125;
  --green: #2b4535;
  --green-book: #2f4a38;
  --cream: #f4f2ea;
  --cream-2: #ebe8dc;
  --gold: #b9a77a;
  --tree: #cfc9b4;
  --ink: #1b1b1b;
  --muted: #4a4a46;
  --panel-dark: #232624;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Roboto", "Segoe UI", Arial, sans-serif;
  background: var(--green-dark);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ---------- Nagłówek ---------- */
.site-header {
  background: var(--cream);
  border-bottom: 1px solid #d9d5c6;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo svg { width: 46px; height: 46px; }
.logo-text { line-height: 1.15; text-transform: uppercase; }
.logo-text strong { display: block; font-weight: 500; font-size: 1.05rem; letter-spacing: .02em; }
.logo-text span { font-size: 1.14rem; letter-spacing: .02em; white-space: nowrap; }

.main-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.main-nav a {
  text-transform: uppercase;
  font-weight: 500;
  font-size: .95rem;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background .2s, color .2s;
}
.main-nav a:hover { background: var(--green-dark); color: var(--cream); }
.main-nav a.active { background: var(--green-dark); color: var(--cream); }

/* ---------- Układ ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: grid;
  gap: 22px;
}

.card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  align-items: center;
  min-height: 300px;
  padding: 28px 36px;
}
.hero .books { width: 100%; max-width: 360px; position: relative; z-index: 1; }
.hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
  letter-spacing: .01em;
}

/* ---------- Kafelki ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.tile {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr;
  column-gap: 12px;
  transition: transform .2s, box-shadow .2s;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.tile h2 {
  grid-column: 1 / -1;
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  line-height: 1.25;
  margin-bottom: 10px;
}
.tile h2 small {
  font-size: 1.05rem;
  text-transform: none;
  font-weight: 400;
}
.tile p { font-size: .88rem; color: var(--muted); align-self: end; }
.tile svg { width: 78px; height: 78px; align-self: end; }
.tile .more {
  grid-column: 1 / -1;
  margin-top: 12px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--green);
}

/* ---------- Dolny rząd ---------- */
.bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.about { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.photo-placeholder {
  width: 110px;
  height: 120px;
  border-radius: 6px;
  background: var(--cream-2);
  border: 2px dashed #b9b4a0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .75rem;
  color: #7a7564;
  padding: 6px;
}
.about h2 { font-size: 1.35rem; font-weight: 500; text-transform: uppercase; margin-bottom: 6px; }
.about p { font-size: .9rem; color: var(--muted); }

.contact-panel {
  background: var(--panel-dark);
  color: #d8d6cf;
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
  align-content: start;
  font-size: .92rem;
}
.contact-panel h3 { font-size: .9rem; font-weight: 500; text-transform: uppercase; color: #fff; margin-bottom: 4px; }
.contact-panel .note { grid-column: 1 / -1; font-size: .78rem; color: #9a988f; margin-top: 10px; }
.contact-panel a:hover { color: var(--gold); }

/* ---------- Podstrony ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  padding: 40px 36px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.page-hero .breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 8px; position: relative; z-index: 1; }
.page-hero .breadcrumb a:hover { text-decoration: underline; }
.page-hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.2;
}
.page-hero .subtitle { position: relative; z-index: 1; font-size: 1.15rem; margin-top: 6px; color: var(--muted); }
.page-hero .icon { position: absolute; right: 36px; top: 50%; transform: translateY(-50%); width: 90px; height: 90px; z-index: 1; } /* ikona podstrony wyrównana do prawej krawędzi okienka */

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
  align-items: start;
}
.content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  text-transform: uppercase;
  margin: 6px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold);
}
.content section + section { margin-top: 28px; }

/* Miejsce na tekst */
.text-placeholder {
  min-height: 140px;
  border: 2px dashed #c4bfaa;
  border-radius: 8px;
  background: #fbfaf5;
  padding: 18px;
  color: #8a8572;
  font-size: .92rem;
  font-style: italic;
}

.sidebar { display: grid; gap: 22px; }
.sidebar .card h3 { font-size: 1rem; font-weight: 500; text-transform: uppercase; margin-bottom: 10px; }
.sidebar ul { list-style: none; display: grid; gap: 6px; }
.sidebar ul a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--cream-2);
  font-size: .92rem;
  transition: background .2s, color .2s;
}
.sidebar ul a:hover, .sidebar ul a.active { background: var(--green-dark); color: var(--cream); }

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--green-dark);
  color: var(--cream);
  font-weight: 500;
  font-size: .9rem;
  text-transform: uppercase;
  transition: background .2s;
}
.btn:hover { background: var(--green); }

/* Kontakt */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.contact-cards .card h3 { font-size: 1rem; font-weight: 500; text-transform: uppercase; margin-bottom: 8px; }
.contact-cards .card p { color: var(--muted); }
.map-placeholder {
  min-height: 260px;
  border: 2px dashed #c4bfaa;
  border-radius: 8px;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a8572;
  font-style: italic;
}

/* ---------- Stopka ---------- */
.site-footer {
  background: var(--panel-dark);
  color: #9a988f;
  font-size: .82rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-inner a:hover { color: var(--gold); }

/* ---------- Responsywność ---------- */
@media (max-width: 900px) {
  .tiles, .contact-cards { grid-template-columns: 1fr; }
  .bottom-row, .content-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero .books { margin: 0 auto 10px; max-width: 260px; }
  .page-hero .icon { display: none; }
}
@media (max-width: 520px) {
  .header-inner { justify-content: center; }
  .main-nav { justify-content: center; }
  .main-nav a { font-size: .82rem; padding: 6px 8px; }
  .logo-text span { font-size: clamp(.7rem, calc((100vw - 96px) / 20), .98rem); } /* zmniejsza się na wąskich ekranach, żeby zmieścić się w jednej linii */
  .about { grid-template-columns: 1fr; }
  .contact-panel { grid-template-columns: 1fr; }
  .hero, .page-hero { padding: 24px 20px; }
}

/* ---------- O kancelarii ---------- */
.about-link { transition: transform .2s, box-shadow .2s; }
.about-link:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.about .more { display: inline-block; margin-top: 10px; font-size: .85rem; font-weight: 500; color: var(--green); }
.team { display: grid; gap: 18px; }
.team-member { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.team-member .text-placeholder { min-height: 120px; }
@media (max-width: 520px) { .team-member { grid-template-columns: 1fr; } }

/* ---------- Strona startowa: 2 kafelki, pełna szerokość dołu ---------- */
.tiles.tiles-2 { grid-template-columns: repeat(2, 1fr); }
.bottom-row.bottom-full { grid-template-columns: 1fr; }
.bottom-full .contact-panel { grid-template-columns: repeat(3, 1fr); padding: 26px 30px; }
.bottom-full .contact-panel .note { grid-column: auto; margin-top: 0; font-size: .85rem; }
@media (max-width: 900px) {
  .tiles.tiles-2 { grid-template-columns: 1fr; }
  .bottom-full .contact-panel { grid-template-columns: 1fr; }
}

main { align-content: start; }

/* ---------- Podstrony bez panelu bocznego ---------- */
.content-grid.single { grid-template-columns: 1fr; }
.contact-cards.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .contact-cards.two { grid-template-columns: 1fr; } }

/* Kontakt: puste pole na adres */
.contact-cards .card .address-text { min-height: 3em; }

/* Kafelek Usługi: przyciski usług */
.tile .service-links {
  align-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tile .service-links a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 6px;
  background: var(--cream-2);
  border: 1px solid #d9d5c6;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.tile .service-links a:hover { background: var(--green-dark); color: var(--cream); border-color: var(--green-dark); }
.tile .more:hover { text-decoration: underline; }
section[id] { scroll-margin-top: 20px; }

/* Strona startowa: kafelek Usługi o 25% szerszy niż O mnie */
.tiles.tiles-2 { grid-template-columns: 1fr 1.25fr; }
@media (max-width: 900px) { .tiles.tiles-2 { grid-template-columns: 1fr; } }

/* Kafelek Usługi: cały kafelek klikalny (link „Wszystkie usługi” rozciągnięty), przyciski usług nad nim */
.tile-stretch { position: relative; }
.tile-stretch .more::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.tile-stretch .service-links { position: relative; z-index: 2; }

/* Strona startowa: panel kontaktowy – Kontakt (w poziomie) */
.bottom-full .contact-panel { grid-template-columns: 1fr; }
.contact-panel .contact-row { display: flex; flex-wrap: wrap; gap: 6px 36px; }
@media (max-width: 900px) {
  .bottom-full .contact-panel { grid-template-columns: 1fr; gap: 18px; }
  .contact-panel .contact-row { flex-direction: column; }
}

/* Kontakt: kod QR z wizytówką (vCard) */
.contact-qr-card { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.qr { margin: 0; text-align: center; }
.qr svg { display: block; width: 205px; height: 205px; padding: 10px; background: var(--cream); border: 1px solid #d9d5c6; border-radius: 6px; }
.qr figcaption { margin-top: 6px; font-size: .85rem; font-weight: 500; text-transform: uppercase; color: var(--green); }

/* Kontakt: Adres : Telefon i e-mail = 1 : 1,25 (jak O mnie : Usługi na stronie głównej) */
.contact-cards.two { grid-template-columns: 1fr 1.25fr; }
@media (max-width: 900px) { .contact-cards.two { grid-template-columns: 1fr; } }

/* Kontakt: przycisk „Dodaj kontakt” (pobiera wizytówkę .vcf – Kontakty macOS, Outlook, telefony) */
.qr figcaption .btn-contact { margin-top: 4px; padding: 8px 14px; font-size: .82rem; color: var(--cream); }

/* Kontakt: jedno okienko „Dane kontaktowe” na całą szerokość */
.contact-cards.one { grid-template-columns: 1fr; }

/* Kontakt: okienko „Dane kontaktowe” – dane po lewej, QR po prawej, LinkedIn w lewym dolnym rogu */
.contact-qr-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "main qr" "li qr";
  gap: 14px 18px;
}
.contact-qr-card .contact-main { grid-area: main; }
.contact-qr-card .qr { grid-area: qr; }
.contact-qr-card .btn-linkedin { grid-area: li; justify-self: start; align-self: end; line-height: 0; transition: opacity .2s; }
.contact-qr-card .btn-linkedin:hover { opacity: .8; }
.contact-qr-card .btn-linkedin img { display: block; height: 41px; width: auto; }
@media (max-width: 600px) {
  .contact-qr-card { grid-template-columns: 1fr; grid-template-areas: "main" "qr" "li"; }
  .contact-qr-card .qr { justify-self: start; }
}

/* Strona startowa: przycisk LinkedIn w panelu Kontakt, wyrównany do prawej */
.bottom-full .contact-panel { grid-template-columns: 1fr auto; align-items: center; }
.contact-panel .panel-linkedin { justify-self: end; line-height: 0; transition: opacity .2s; }
.contact-panel .panel-linkedin:hover { opacity: .8; }
.contact-panel .panel-linkedin img { display: block; height: 41px; width: auto; }
@media (max-width: 900px) { .bottom-full .contact-panel { grid-template-columns: 1fr; } }

/* Nagłówek: symbol Adwokatury Polskiej na lewo od nazwy (kolor: szarość 90% czerni – zgodnie z Księgą Znaku AP) */
.logo .ap-symbol { height: 42px; width: auto; flex-shrink: 0; margin-right: 4px; }
@media (max-width: 520px) { .logo .ap-symbol { height: 34px; } }

/* Strona startowa: ikona książek (styl jak pozostałe ikony) obok hasła */
.hero .books.hero-icon { max-width: 170px; justify-self: start; margin: 0; }
@media (max-width: 900px) { .hero .books.hero-icon { max-width: 120px; justify-self: center; margin: 0 auto 10px; } }

/* Strona startowa: hasło w jednej linii, gdy jest miejsce; przy zawijaniu – równe linie */
.hero { grid-template-columns: auto 1fr; column-gap: 40px; }
.hero h1 { text-wrap: balance; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
