/* Drobne zachowania, których nie da się wyrazić samymi klasami z projektu. */

:root {
  --header-bar: 4.75rem;
  --header-gap: 0.875rem;
  --header-offset: calc(var(--header-bar) + var(--header-gap) + env(safe-area-inset-top, 0px));
}

@media (min-width: 640px) {
  :root {
    --header-gap: 0.375rem;
  }
}

html {
  scroll-padding-top: var(--header-offset);
}

[data-header] {
  padding-top: env(safe-area-inset-top, 0px);
}

[data-header-spacer] {
  block-size: var(--header-offset);
}

.page-hero {
  padding-top: 0.75rem;
  padding-bottom: 3rem;
}

@media (min-width: 640px) {
  .page-hero {
    padding-top: 1.25rem;
    padding-bottom: 3rem;
  }
}

@media (min-width: 1024px) {
  .page-hero {
    padding-top: 2.5rem;
  }
}

.acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease-out;
}

.acc-panel.is-open {
  grid-template-rows: 1fr;
}

.acc-panel > div {
  min-height: 0;
  overflow: hidden;
}

[data-slider-thumb] {
  position: absolute;
  top: 50%;
  z-index: 1;
  translate: -50% -50%;
  touch-action: none;
}

[data-slider] {
  touch-action: none;
  cursor: pointer;
}

[data-dialog] [role="dialog"] {
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
}

#cookie-banner {
  z-index: 60;
}

/* Hero: przyklejone tło na tablecie i desktopie; treść i kolejne sekcje przewijają się nad obrazem. */
[data-hero-home] {
  position: relative;
  z-index: 1;
  margin-top: calc(-1 * var(--header-offset));
}

[data-hero-media] {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

[data-hero-media] img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

[data-hero-after] {
  position: relative;
  z-index: 2;
}

@media (min-width: 768px) {
  [data-hero-media] {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100svh;
    z-index: 0;
    transition: opacity 0.35s ease, visibility 0.35s ease;
  }

  [data-hero-media].is-off {
    visibility: hidden;
    opacity: 0;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
  [data-hero-media] {
    position: absolute;
    inset: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
  }
}

/* —— Artykuły (wspólny układ PL/EN) —— */
.article-page {
  padding-bottom: clamp(5rem, 10vw, 8rem);
}

.article-page__crumb {
  padding-top: calc(var(--header-offset) + 0.5rem);
  padding-bottom: 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  line-height: 1.5;
}

.article-page__crumb a {
  transition: color 0.15s ease;
}

.article-page__crumb [aria-current="page"] {
  display: inline-block;
  max-width: 100%;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.article-page__header {
  max-width: 46rem;
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.article-page__header .eyebrow {
  margin-bottom: 0.75rem;
}

.article-page__title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.article-page__lead {
  margin-top: 1.25rem;
  max-width: 42rem;
  font-size: 1.125rem;
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
}

.article-page__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.article-page__meta-sep {
  opacity: 0.45;
  user-select: none;
}

.article-page__figure {
  margin: 0;
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 4px 24px hsl(0 0% 0% / 0.06);
}

.article-page__figure img {
  display: block;
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
}

.article-page__layout {
  display: grid;
  gap: 2.5rem;
  margin-top: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 1024px) {
  .article-page__layout {
    grid-template-columns: minmax(14rem, 17.5rem) minmax(0, 1fr);
    gap: 3rem 3.5rem;
    align-items: start;
  }
}

.article-page__toc {
  border-radius: 1.25rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--surface));
  padding: 1.25rem 1.5rem;
}

@media (min-width: 1024px) {
  .article-page__toc {
    position: sticky;
    top: 5.5rem;
    max-height: calc(100svh - 7rem);
    overflow: auto;
  }
}

.article-page__toc-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}

.article-page__toc ol {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.article-page__toc a {
  display: block;
  font-size: 0.875rem;
  line-height: 1.45;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: color 0.15s ease;
}

.article-page__toc a:hover {
  color: hsl(var(--brand));
}

.article-prose {
  max-width: 44rem;
}

@media (min-width: 1024px) {
  .article-prose {
    max-width: none;
  }
}

.article-prose__section {
  padding-top: 2.25rem;
  margin-top: 2.25rem;
  border-top: 1px solid hsl(var(--border));
}

.article-prose__section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-prose h2 {
  scroll-margin-top: 6rem;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

.article-prose p {
  margin-top: 1rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: hsl(var(--muted-foreground));
}

.article-prose p:first-child {
  margin-top: 0;
}

.article-prose h2 + p {
  margin-top: 0.875rem;
}

.article-prose ul {
  margin-top: 1.125rem;
  padding-left: 1.35rem;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.article-prose li {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
  padding-left: 0.25rem;
}

.article-page__related {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid hsl(var(--border));
}

.article-page__related-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.article-page__service-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: 1rem;
}

.article-page__service-links a {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: hsl(var(--surface));
  box-shadow: 0 1px 3px hsl(0 0% 0% / 0.06);
  transition: color 0.15s ease, box-shadow 0.15s ease;
}

.article-page__service-links a:hover {
  color: hsl(var(--brand));
  box-shadow: 0 4px 12px hsl(0 0% 0% / 0.08);
}

.article-page__related-articles {
  margin-top: 2rem;
}

.article-page__related-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

@media (min-width: 640px) {
  .article-page__related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.article-page__related-card {
  display: block;
  height: 100%;
  border-radius: 1.25rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--surface));
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.article-page__related-card:hover {
  border-color: hsl(var(--brand) / 0.35);
  color: hsl(var(--brand));
  box-shadow: 0 4px 16px hsl(0 0% 0% / 0.06);
}

.article-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
  padding: 1.5rem;
  border-radius: 1.25rem;
  background: hsl(var(--surface));
  border: 1px solid hsl(var(--border));
}

@media (min-width: 640px) {
  .article-page__actions {
    padding: 1.75rem 2rem;
    gap: 1rem;
  }
}
