/* Baza wiedzy / Case studies – styl zgodny ze stroną główną AI ESTATE */
.aie-kb {
  --aie-bg: #050505;
  --aie-bg-2: #12131d;
  --aie-text: #c6cbd6;
  --aie-heading: #ffffff;
  --aie-label: #5b78f0;
  --aie-blue: #1e6cff;
  --aie-blue-hover: #0b57e6;
  --aie-border: rgba(30, 108, 255, 0.37);
  background: var(--aie-bg);
  color: var(--aie-text);
  font-family: Inter, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}
.aie-kb *, .aie-kb *::before, .aie-kb *::after { box-sizing: border-box; }
.aie-kb h1, .aie-kb h2, .aie-kb h3, .aie-kb h4 {
  font-family: Inter, sans-serif;
  color: var(--aie-heading);
  margin: 0 0 16px;
  text-transform: none;
  letter-spacing: normal;
  text-wrap: balance;
}
.aie-kb h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.15; font-weight: 700; }
.aie-kb h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.2; font-weight: 700; }
.aie-kb h3 { font-size: clamp(21px, 2.4vw, 26px); line-height: 1.3; font-weight: 600; margin-top: 56px; display: flex; gap: 14px; align-items: center; }
.aie-kb h4 { font-size: 20px; line-height: 1.35; font-weight: 600; }
.aie-kb p { margin: 0 0 16px; }
.aie-kb a { color: inherit; }
.aie-kb img { max-width: 100%; height: auto; display: block; }

.aie-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.aie-section { padding: 48px 0; }
.aie-hero {
  /* nagłówek strony (80 px) leży nad tą sekcją, tak jak na stronie głównej */
  padding: 120px 0 40px;
  background: linear-gradient(180deg, #083985 0%, var(--aie-bg) 70%);
}
.aie-label { color: var(--aie-label); font-weight: 600; font-size: 16px; margin-bottom: 12px !important; }
.aie-lead { font-size: 19px; max-width: 760px; }

.aie-crumbs { font-size: 14px; margin-bottom: 28px; color: #9aa3b5; }
.aie-crumbs a { color: #c6cbd6; text-decoration: none; }
.aie-crumbs a:hover { color: #fff; text-decoration: underline; }
.aie-crumbs span[aria-hidden] { margin: 0 6px; }

/* Karty */
.aie-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 32px 0; padding: 0; list-style: none; }
.aie-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.aie-card {
  border: 1px solid var(--aie-border);
  border-radius: 24px;
  padding: 28px;
  background: rgba(18, 19, 29, 0.6);
}
.aie-card p:last-child { margin-bottom: 0; }
.aie-card-link { display: block; text-decoration: none; transition: border-color .2s, transform .2s; }
.aie-card-link:hover { border-color: var(--aie-blue); transform: translateY(-2px); }
.aie-card-feature { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: start; }
.aie-card-feature img { width: 140px; height: 180px; object-fit: cover; object-position: top; border-radius: 16px; }
.aie-more { color: #fff; font-weight: 600; display: inline-block; margin-top: 8px; }

/* Kafelki case studies (lista na /baza-wiedzy/case-studies/) */
.aie-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.aie-tile {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  border: 1px solid var(--aie-border); border-radius: 24px; overflow: hidden;
  background: rgba(18, 19, 29, 0.6); transition: border-color .2s, transform .2s;
}
.aie-tile:hover { border-color: var(--aie-blue); transform: translateY(-3px); }
.aie-tile img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.aie-tile-body { padding: 24px 24px 28px; display: flex; flex-direction: column; flex: 1; }
.aie-kb .aie-tile h2 { font-size: 22px; line-height: 1.3; font-weight: 600; margin-bottom: 10px; }
.aie-tile-body p { font-size: 16px; line-height: 1.55; }
.aie-tile .aie-more { margin-top: auto; padding-top: 8px; }

/* Podstrona pojedynczego case study */
.aie-hero-case { padding-bottom: 0; }
.aie-hero-case .aie-crumbs { margin-bottom: 0; }
.aie-back { margin-top: 48px; }
.aie-back a { color: #fff; font-weight: 600; text-decoration: none; }
.aie-back a:hover { text-decoration: underline; }

/* Nagłówek case study */
.aie-case-head { display: grid; grid-template-columns: 320px 1fr; gap: 48px; align-items: center; }
.aie-case-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; border-radius: 24px; border: 1px solid var(--aie-border); }
.aie-stats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.aie-stats li { border: 1px solid var(--aie-border); border-radius: 16px; padding: 16px 18px; }
.aie-stats strong { display: block; color: #fff; font-size: 24px; line-height: 1.2; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.aie-stats span { font-size: 15px; line-height: 1.45; display: block; }

.aie-case-body { max-width: 900px; margin: 0 auto; }
.aie-num {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: var(--aie-blue); color: #fff; font-size: 18px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Oś czasu */
.aie-timeline { list-style: none; padding: 0; margin: 32px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; }
.aie-timeline li { border-top: 3px solid var(--aie-blue); padding-top: 14px; }
.aie-timeline time { display: block; color: #fff; font-weight: 700; margin-bottom: 4px; }
.aie-timeline span { font-size: 15px; line-height: 1.5; display: block; }

.aie-list { padding-left: 20px; margin: 0; }
.aie-list li { margin-bottom: 10px; }
.aie-list strong { color: #fff; }

/* Wynik */
.aie-result {
  margin: 24px 0; padding: 28px; border-radius: 24px;
  background: linear-gradient(135deg, #0b3c8f 0%, #12131d 100%);
  border: 1px solid var(--aie-border);
}
.aie-result strong { display: block; color: #fff; font-size: clamp(34px, 5vw, 48px); line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.aie-result span { display: block; margin-top: 6px; }

/* Cytat */
.aie-quote { margin: 24px 0; padding: 28px 32px; border-left: 4px solid var(--aie-blue); background: var(--aie-bg-2); border-radius: 0 24px 24px 0; }
.aie-quote p { color: #fff; font-size: 19px; font-style: italic; }
.aie-quote footer { color: var(--aie-label); font-weight: 600; font-size: 16px; }

/* Wnioski */
.aie-takeaways { counter-reset: tk; }
.aie-takeaways li { counter-increment: tk; }
.aie-takeaways li::before { content: counter(tk); display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: var(--aie-blue); color: #fff; font-weight: 700; align-items: center; justify-content: center; margin-bottom: 14px; }

/* CTA */
.aie-cta { padding: 64px 0 96px; }
.aie-cta-box { text-align: center; border: 1px solid var(--aie-border); border-radius: 24px; padding: 56px 32px; background: linear-gradient(180deg, #12131d 0%, #083985 140%); }
.aie-cta-box p:not(.aie-label) { max-width: 640px; margin-left: auto; margin-right: auto; }
.aie-btn {
  display: inline-block; margin-top: 12px; background: var(--aie-blue); color: #fff !important;
  font-family: Inter, sans-serif; font-weight: 500; font-size: 16px; line-height: 24px;
  padding: 15px 30px; border-radius: 8px; text-decoration: none; transition: background .2s;
}
.aie-btn:hover { background: var(--aie-blue-hover); }
.aie-kb a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

@media (max-width: 900px) {
  .aie-case-head { grid-template-columns: 1fr; gap: 28px; }
  .aie-case-photo { max-width: 320px; }
  .aie-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aie-grid-3 { grid-template-columns: 1fr; }
  .aie-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .aie-kb { font-size: 16px; }
  .aie-wrap { padding: 0 16px; }
  .aie-hero { padding: 104px 0 24px; }
  .aie-grid, .aie-stats, .aie-tiles { grid-template-columns: 1fr; }
  .aie-card-feature { grid-template-columns: 1fr; }
  .aie-card-feature img { width: 100%; height: 260px; }
  .aie-timeline { grid-template-columns: 1fr; }
  .aie-cta-box { padding: 40px 20px; }
}
@media (prefers-reduced-motion: reduce) { .aie-card-link, .aie-btn, .aie-tile { transition: none; } }
