/* OD-LAYOUT-PRIMITIVES v1 — structure only: display, flex/grid, overflow, wrapping, ratio.
   Put this @layer first; product CSS outside the layer always wins. */
@layer od-layout {
  :where(.od-stack,.od-row,.od-row-top,.od-cluster,.od-grid,.od-field,.od-stat,.od-cell,.od-tile) > :where(*) { min-width: 0; }

  /* containers */
  .od-stack   { display: flex; flex-direction: column; gap: var(--od-gap, 8px); }
  .od-row     { display: flex; align-items: center; gap: var(--od-gap, 8px); }
  .od-row-top { display: flex; align-items: flex-start; gap: var(--od-gap, 8px); }
  .od-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--od-gap, 8px); }
  .od-fill    { flex: 1 1 0; min-width: 0; }
  .od-fixed   { flex: none; }
  .od-grid    { display: grid; gap: var(--od-gap, 12px); grid-template-columns: repeat(var(--od-cols, 3), minmax(0, 1fr)); }

  /* stacked information: each piece is its own line — never sibling inline spans */
  .od-stat, .od-field, .od-cell { display: grid; gap: var(--od-gap, 2px); }
  :where(.od-stat,.od-field,.od-cell) > :where(*) { display: block; }
  .od-tile { display: grid; grid-template-rows: auto 1fr; }
  :where(.od-tile) > :where(*) { display: block; }

  /* media keeps its intrinsic ratio by default; never a distorted or cropped
     cover by accident. height:auto lets the ratio win over an <img height="…">
     attribute. Cropping to a uniform box is an explicit opt-in: set --od-ratio
     AND add .od-media-cover together (per the core rule, only where a crop is
     deliberate — tile thumbs, decorative fills — never on full-frame content). */
  .od-media { display: block; width: 100%; height: auto; aspect-ratio: var(--od-ratio, auto); }
  .od-media-cover { object-fit: cover; }

  /* data text only — authored copy is rewritten to its budget instead */
  .od-truncate { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .od-clamp-2, .od-clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .od-clamp-2 { -webkit-line-clamp: 2; }
  .od-clamp-3 { -webkit-line-clamp: 3; }
  .od-lines-2 { min-height: calc(2 * 1.4em); }   /* block-level reservation for a shared baseline */
  .od-nowrap  { white-space: nowrap; }           /* 数字+单位 · 价格+起 · 日期+星期 */
  .od-keep    { word-break: keep-all; overflow-wrap: anywhere; } /* CJK labels break at spaces / <wbr> first */

  /* screen skeleton (optional): bars take their own space, the middle scrolls — no padding guessed for chrome */
  .od-screen { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
  .od-scroll { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }

  /* horizontal rail: the next item peeks at the edge; trailing room survives overflow */
  .od-rail { display: flex; gap: var(--od-gap, 8px); overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
             padding-inline: var(--od-rail-pad, 16px); scroll-padding-inline: var(--od-rail-pad, 16px); }
  .od-rail::-webkit-scrollbar { display: none; }
  :where(.od-rail) > :where(*) { flex: none; scroll-snap-align: start; }
  :where(.od-rail) > :where(:last-child) { margin-inline-end: var(--od-rail-pad, 16px); }

  .od-spacer { flex: none; visibility: hidden; pointer-events: none; }
  .od-touch  { min-width: 44px; min-height: 44px; }
}
/* /OD-LAYOUT-PRIMITIVES v1 */


/* ===========================================================================
   Dobrze Wiedzieć — design tokens
   Kierunek: neutralny editorial/news. Chłodna biel i grafit, atramentowy
   granat jako kolor marki, sygnałowa czerwień tylko dla etykiet redakcyjnych.
   =========================================================================== */

:root {
  /* kolory */
  --bg:         #f4f6f8;
  --surface:    #ffffff;
  --surface-2:  #eef1f4;
  --surface-3:  #e7ebef;
  --ink:        #14181d;
  --ink-2:      #39424c;
  --ink-3:      #5a646e;
  --line:       #e2e6ea;
  --line-2:     #cbd3da;
  --brand:      #163a66;
  --brand-dark: #0f2a4b;
  --brand-soft: #eaf0f8;
  --accent:     #c62828;
  --accent-soft:#fdecec;
  --focus:      #1a6fc4;

  /* typografia */
  --font-display: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-sans:    "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --t-xs:   0.8125rem;  /* 13 */
  --t-sm:   0.9375rem;  /* 15 */
  --t-base: 1.0625rem;  /* 17 */
  --t-lg:   1.25rem;    /* 20 */
  --t-xl:   1.5rem;     /* 24 */
  --t-2xl:  1.875rem;   /* 30 */
  --t-3xl:  2.375rem;   /* 38 */
  --t-4xl:  3rem;       /* 48 */

  /* rytm 4 / 8 */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* kształt */
  --r1: 4px;
  --r2: 8px;
  --shadow-1: 0 1px 2px rgba(20, 24, 29, .06);
  --shadow-2: 0 6px 24px rgba(20, 24, 29, .10);

  /* ruch */
  --dur-in:  180ms;
  --dur-out: 120ms;
  --dur-mid: 220ms;
  --ease-out: cubic-bezier(.2, .8, .3, 1);
  --ease-in:  cubic-bezier(.5, 0, .9, .4);

  /* siatka */
  --shell: 1280px;
  --gutter: var(--s4);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.65;
  font-synthesis-weight: none;
}

img, svg { max-width: 100%; }
img { border-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 600;
}

p { margin: 0; }

a { color: var(--brand); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r1);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--brand); color: #fff; padding: var(--s3) var(--s4);
  border-radius: var(--r1); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--s2); }

/* ---------------------------------------------------------------- siatka -- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.layout {
  display: grid;
  gap: var(--s6);
  align-items: start;
  padding-block: var(--s6);
}

@media (min-width: 1024px) {
  :root { --gutter: var(--s5); }
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s7); }
}

.sidebar { display: flex; flex-direction: column; gap: var(--s6); min-width: 0; }

@media (min-width: 1024px) {
  .masthead { position: sticky; top: 0; z-index: 50; }
  .sidebar--sticky { position: sticky; top: 124px; }
}

/* ---------------------------------------------------------------- nagłówek -- */

.masthead { background: var(--surface); border-bottom: 1px solid var(--line); }

.masthead__meta {
  border-bottom: 1px solid var(--line);
  font-size: var(--t-xs);
  color: var(--ink-3);
}
.masthead__meta .shell {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); min-height: 36px;
}
.masthead__meta-links { display: none; gap: var(--s4); }
@media (min-width: 640px) { .masthead__meta-links { display: flex; } }
.masthead__meta a { color: var(--ink-3); text-decoration: none; }
.masthead__meta a:hover { color: var(--brand); text-decoration: underline; }

.masthead__bar {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 64px;
}

.brand {
  display: inline-flex; align-items: center; gap: var(--s3);
  text-decoration: none; color: var(--ink);
}
.brand__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  background: var(--brand); color: #fff;
  border-radius: var(--r1);
  font-family: var(--font-display);
  font-weight: 700; font-size: 17px; letter-spacing: .02em;
}
.brand__name {
  font-family: var(--font-display);
  font-size: var(--t-xl); font-weight: 700; letter-spacing: -0.02em;
  line-height: 1;
}
.brand__tagline {
  display: none; font-size: var(--t-xs); color: var(--ink-3);
  border-left: 1px solid var(--line); padding-left: var(--s3); margin-left: var(--s1);
}
@media (min-width: 1024px) { .brand__tagline { display: block; } }

.masthead__nav { display: none; }
@media (min-width: 1024px) {
  .masthead__nav { display: flex; flex: 1 1 auto; justify-content: center; }
  .masthead__nav ul {
    display: flex; gap: var(--s5); list-style: none; margin: 0; padding: 0;
  }
  .masthead__nav a {
    display: block; padding: var(--s2) 0;
    font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
    text-decoration: none; border-bottom: 2px solid transparent;
    transition: color var(--dur-in) var(--ease-out), border-color var(--dur-in) var(--ease-out);
  }
  .masthead__nav a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }
}
@media (hover: hover) {
  .masthead__nav a:hover { color: var(--brand); border-bottom-color: var(--line-2); }
}

.masthead__tools { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }

/* pasek kategorii na wąskich ekranach */
.catrail {
  --od-gap: var(--s4);
  --od-rail-pad: var(--gutter);
  border-top: 1px solid var(--line);
  padding-block: var(--s3);
}
@media (min-width: 1024px) { .catrail { display: none; } }
.catrail a {
  font-size: var(--t-sm); font-weight: 500; color: var(--ink-2);
  text-decoration: none; white-space: nowrap; padding-block: var(--s1);
  border-bottom: 2px solid transparent;
}
.catrail a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ------------------------------------------------------------ wyszukiwarka -- */

.search { position: relative; }

.search__toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-width: 44px; min-height: 44px; padding-inline: var(--s3);
  background: transparent; border: 1px solid var(--line-2); border-radius: var(--r1);
  color: var(--ink-2); font: inherit; font-size: var(--t-sm); cursor: pointer;
  transition: background var(--dur-in) var(--ease-out), border-color var(--dur-in) var(--ease-out);
}
.search__toggle span { display: none; }
@media (min-width: 768px) { .search__toggle span { display: inline; } }
@media (hover: hover) {
  .search__toggle:hover { background: var(--surface-2); border-color: var(--ink-3); }
}

.search__panel {
  position: absolute; right: 0; top: calc(100% + var(--s2)); z-index: 60;
  width: min(92vw, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: var(--shadow-2);
  padding: var(--s4);
  display: none;
}
.search__panel[data-open="true"] { display: block; animation: pop var(--dur-in) var(--ease-out); }

@keyframes pop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.search__field { display: flex; gap: var(--s2); }
.search__label { display: block; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); margin-bottom: var(--s2); }
.search__input {
  flex: 1 1 auto; min-width: 0; min-height: 44px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line-2); border-radius: var(--r1);
  font: inherit; font-size: var(--t-sm); color: var(--ink); background: var(--surface);
}
.search__input::placeholder { color: var(--ink-3); }
.search__submit {
  flex: none; min-height: 44px; padding-inline: var(--s4);
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: var(--r1); font: inherit; font-size: var(--t-sm); font-weight: 600; cursor: pointer;
  transition: background var(--dur-in) var(--ease-out);
}
@media (hover: hover) { .search__submit:hover { background: var(--brand-dark); } }

.search__results { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s1); }
.search__results li a {
  display: grid; gap: 2px; padding: var(--s2) var(--s3);
  border-radius: var(--r1); text-decoration: none; color: var(--ink);
}
.search__results li a > span { display: block; }
.search__results .r-cat { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.search__results .r-title { font-size: var(--t-sm); line-height: 1.4; }
@media (hover: hover) { .search__results li a:hover { background: var(--surface-2); } }
.search__empty { margin-top: var(--s4); font-size: var(--t-sm); color: var(--ink-3); }

/* ------------------------------------------------------------------ sekcje -- */

.section { margin-block: var(--s7); }
.section:first-child { margin-top: 0; }

.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s4);
  padding-bottom: var(--s3); margin-bottom: var(--s5);
  border-bottom: 2px solid var(--ink);
}
.section__title { font-size: var(--t-xl); letter-spacing: -0.02em; }
.section__more { font-size: var(--t-sm); color: var(--brand); text-decoration: none; font-weight: 600; white-space: nowrap; }
@media (hover: hover) { .section__more:hover { text-decoration: underline; } }

.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow--brand { color: var(--brand); }

/* ------------------------------------------------------------------- karty -- */

.card {
  --od-gap: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: border-color var(--dur-in) var(--ease-out), box-shadow var(--dur-in) var(--ease-out), transform var(--dur-in) var(--ease-out);
}
@media (hover: hover) {
  .card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-2px); }
  .card:hover .card__title { color: var(--brand); }
}
.card__media { --od-ratio: 3 / 2; background: var(--surface-2); }
.card__body { padding: var(--s4); display: grid; gap: var(--s2); align-content: start; }
.card__title {
  font-family: var(--font-display); font-size: var(--t-lg); font-weight: 600; line-height: 1.25;
  transition: color var(--dur-in) var(--ease-out);
}
.card__lead { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55; }
.card__meta { font-size: var(--t-xs); color: var(--ink-3); }

.grid-cards { --od-cols: 1; --od-gap: var(--s5); }
@media (min-width: 640px)  { .grid-cards { --od-cols: 2; } }
@media (min-width: 1200px) { .grid-cards { --od-cols: 3; } }

/* lista numerowana — popularne */
.ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.ranked li { border-bottom: 1px solid var(--line); padding-bottom: var(--s4); }
.ranked li:last-child { border-bottom: 0; padding-bottom: 0; }
.ranked a { --od-gap: var(--s3); display: flex; align-items: flex-start; text-decoration: none; color: var(--ink); }
.ranked__num {
  flex: none; width: 28px;
  font-family: var(--font-display); font-size: var(--t-xl); font-weight: 700;
  color: var(--ink-3); line-height: 1.1;
}
.ranked__text { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.ranked__text > * { display: block; }
.ranked__title { font-size: var(--t-sm); font-weight: 600; line-height: 1.4; }
.ranked__meta { font-size: var(--t-xs); color: var(--ink-3); }
@media (hover: hover) { .ranked a:hover .ranked__title { color: var(--brand); } }

/* lista tekstowa w sidebarze */
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.linklist li { border-bottom: 1px solid var(--line); padding-bottom: var(--s3); }
.linklist li:last-child { border-bottom: 0; padding-bottom: 0; }
.linklist a { --od-gap: var(--s3); display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.linklist img { flex: none; width: 72px; border-radius: var(--r1); }
.linklist .ll-text { flex: 1 1 0; min-width: 0; display: grid; gap: 2px; }
.linklist .ll-text > * { display: block; }
.linklist .ll-title { font-size: var(--t-sm); font-weight: 600; line-height: 1.4; }
.linklist .ll-meta { font-size: var(--t-xs); color: var(--ink-3); }
@media (hover: hover) { .linklist a:hover .ll-title { color: var(--brand); } }

/* kafelek w sidebarze */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r2); padding: var(--s5);
}
.panel__title {
  font-size: var(--t-base); font-family: var(--font-sans); font-weight: 700;
  letter-spacing: .02em; text-transform: uppercase;
  padding-bottom: var(--s3); margin-bottom: var(--s4);
  border-bottom: 2px solid var(--ink);
}

/* ------------------------------------------------------------- wyróżniony -- */

.featured {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r2); overflow: hidden;
  display: grid; gap: 0;
}
@media (min-width: 900px) { .featured { grid-template-columns: 1.35fr 1fr; } }

.featured__media { --od-ratio: 16 / 10; background: var(--surface-2); }
.featured__body { padding: var(--s5); display: grid; gap: var(--s3); align-content: center; }
@media (min-width: 900px) { .featured__body { padding: var(--s7) var(--s6); } }
.featured__title {
  font-size: clamp(1.625rem, 1.1rem + 2.1vw, 2.375rem);
  line-height: 1.15; letter-spacing: -0.025em;
}
.featured__title a { color: inherit; text-decoration: none; }
@media (hover: hover) { .featured__title a:hover { color: var(--brand); } }
.featured__lead { font-size: var(--t-base); color: var(--ink-2); line-height: 1.6; }
.featured__meta { font-size: var(--t-xs); color: var(--ink-3); }

/* ------------------------------------------------------------------ pasma -- */

.byline { --od-gap: var(--s3); font-size: var(--t-sm); color: var(--ink-3); flex-wrap: wrap; }
.byline strong { color: var(--ink-2); font-weight: 600; }
.byline__dot { color: var(--line-2); }

/* ---------------------------------------------------------------- artykuł -- */

.article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.article__inner { padding: var(--s5); }
@media (min-width: 768px) { .article__inner { padding: var(--s7) var(--s6); } }

.article__title {
  font-size: clamp(1.875rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1.12; letter-spacing: -0.03em; margin-block: var(--s3) var(--s4);
}
.article__lead {
  font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem);
  line-height: 1.55; color: var(--ink-2); font-weight: 500;
  padding-bottom: var(--s4); border-bottom: 1px solid var(--line);
}

.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--s4); }
.prose h2 {
  font-size: var(--t-xl); margin-top: var(--s7); letter-spacing: -0.02em;
  scroll-margin-top: 90px;
}
.prose h3 { font-size: var(--t-lg); margin-top: var(--s6); }
.prose p { line-height: 1.7; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3em; display: grid; gap: var(--s2); }
.prose li { line-height: 1.6; }
.prose a { color: var(--brand); text-underline-offset: 3px; }
.prose figure { margin: var(--s6) 0; }
.prose figcaption { font-size: var(--t-xs); color: var(--ink-3); margin-top: var(--s2); line-height: 1.5; }
.prose strong { font-weight: 600; }

.callout {
  background: var(--brand-soft);
  border: 1px solid #d3e0f0;
  border-radius: var(--r2);
  padding: var(--s5);
  display: grid; gap: var(--s3);
}
.callout__title { font-family: var(--font-sans); font-size: var(--t-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); }
.callout ul { margin: 0; padding-left: 1.2em; display: grid; gap: var(--s2); }
.callout li { font-size: var(--t-sm); line-height: 1.55; }

.figure-full { margin: 0; }
.figure-full img { border-radius: var(--r2); }

/* pasek postępu czytania */
.progress {
  position: fixed; inset-inline: 0; top: 0; z-index: 80;
  height: 3px; background: transparent; pointer-events: none;
}
.progress__bar {
  height: 100%; width: 0; background: var(--accent);
  transform-origin: left center;
  transition: width 60ms linear;
}

/* CTA do galerii */
.gallery-cta {
  display: grid; gap: var(--s4);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r2);
  overflow: hidden;
}
@media (min-width: 640px) { .gallery-cta { grid-template-columns: 200px minmax(0, 1fr); align-items: center; gap: 0; } }
.gallery-cta__media { --od-ratio: 4 / 3; }
.gallery-cta__body { padding: var(--s5); display: grid; gap: var(--s3); justify-items: start; }
.gallery-cta__title { font-size: var(--t-lg); line-height: 1.3; }
.gallery-cta__note { font-size: var(--t-sm); color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding-inline: var(--s5);
  border-radius: var(--r1); border: 1px solid transparent;
  font: inherit; font-size: var(--t-sm); font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--dur-in) var(--ease-out), border-color var(--dur-in) var(--ease-out), color var(--dur-in) var(--ease-out);
}
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; cursor: not-allowed; }
@media (hover: hover) {
  .btn--primary:not([aria-disabled="true"]):hover { background: var(--brand-dark); border-color: var(--brand-dark); }
  .btn--ghost:not([aria-disabled="true"]):hover { background: var(--surface-2); border-color: var(--ink-3); }
}
.btn svg { flex: none; }

/* =========================================================== REKLAMY ======= */

.ad {
  --ad-w: 300;
  --ad-h: 250;
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  width: 100%;
}
.ad__label {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); line-height: 1;
}
.ad__slot {
  position: relative; overflow: hidden;
  width: 100%;
  max-width: calc(var(--ad-w) * 1px);
  aspect-ratio: var(--ad-w) / var(--ad-h);
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(135deg,
      rgba(22, 58, 102, .05) 0 10px, transparent 10px 20px);
  border: 1px dashed var(--line-2);
  border-radius: var(--r2);
  display: grid; place-items: center;
}
.ad__creative {
  display: grid; gap: var(--s1); justify-items: center; text-align: center;
  padding: var(--s3); max-width: 100%;
}
.ad__creative > * { display: block; }
.ad__format {
  font-family: var(--font-display); font-size: var(--t-base); font-weight: 600;
  color: var(--ink-2); line-height: 1.2;
}
.ad__size { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }
.ad__id {
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); white-space: nowrap;
}

/* warianty formatów */
.ad--billboard   { --ad-w: 970; --ad-h: 250; }
.ad--leaderboard { --ad-w: 728; --ad-h: 90;  }
.ad--halfpage    { --ad-w: 300; --ad-h: 600; }
.ad--rectangle   { --ad-w: 336; --ad-h: 280; }
.ad--medium      { --ad-w: 300; --ad-h: 250; }
.ad--square      { --ad-w: 250; --ad-h: 250; }
.ad--incontent   { --ad-w: 580; --ad-h: 400; }
.ad--gallerybig  { --ad-w: 640; --ad-h: 360; }

/* na wąskich formatach desktopowe kreacje zamieniamy, nie skalujemy */
@media (max-width: 767px) {
  .ad--billboard   { --ad-w: 320; --ad-h: 100; }
  .ad--leaderboard { --ad-w: 300; --ad-h: 250; }
  .ad--halfpage    { --ad-w: 300; --ad-h: 250; }
  .ad--incontent   { --ad-w: 300; --ad-h: 250; }
  .ad--gallerybig  { --ad-w: 300; --ad-h: 250; }
  .ad--rectangle   { --ad-w: 300; --ad-h: 250; }
}

/* pasma reklamowe między sekcjami */
.ad-strip {
  padding-block: var(--s6);
  border-block: 1px solid var(--line);
  margin-block: var(--s7);
  background: linear-gradient(var(--surface), var(--surface));
}
.ad-strip--flush { margin-block: 0; border-top: 0; }

/* reklama w siatce kart (in-feed) */
.ad-infeed {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2);
  padding: var(--s4); display: grid; place-items: center; align-content: center; gap: var(--s2);
  min-height: 260px;
}

/* reklama między akapitami */
.ad-inline { margin-block: var(--s7); display: grid; justify-items: center; gap: var(--s2); }
.ad-inline .ad__label { color: var(--ink-3); }

/* reklama w sidebarze */
.ad-aside { display: grid; justify-items: center; gap: var(--s2); }
@media (min-width: 1024px) {
  .ad-aside--sticky { position: sticky; top: 124px; }
}

/* odświeżanie kreacji */
.ad__slot.is-refreshing::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .75) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: adsweep 600ms var(--ease-out);
}
@keyframes adsweep { to { transform: translateX(100%); } }

.ad__slot.is-refreshing .ad__creative { animation: adfade var(--dur-mid) var(--ease-out); }
@keyframes adfade { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: none; } }

.ad-counter {
  font-size: var(--t-xs); color: var(--ink-3);
  display: inline-flex; align-items: center; gap: var(--s2);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: var(--s1) var(--s3);
}
.ad-counter strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ========================================================== GALERIA ======== */

.gallery { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; }
.gallery__inner { padding: var(--s5); }
@media (min-width: 768px) { .gallery__inner { padding: var(--s6); } }

.gallery__head { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
.gallery__kicker { --od-gap: var(--s3); }
.gallery__title { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.375rem); line-height: 1.15; letter-spacing: -0.025em; }

.frame { display: grid; gap: var(--s4); }

.frame__stage {
  position: relative;
  background: #0e1216;
  border-radius: var(--r2);
  overflow: hidden;
  display: grid; place-items: center;
  min-height: 240px;
  max-height: 72vh;
}
.frame__img {
  display: block;
  width: auto; max-width: 100%;
  height: auto; max-height: 72vh;
  object-fit: contain;
}
@supports (aspect-ratio: 1) {
  .frame__img { max-height: 100%; }
}
.frame__stage.is-swapping .frame__img { animation: frameIn var(--dur-mid) var(--ease-out); }
@keyframes frameIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }

.frame__counter {
  position: absolute; top: var(--s3); right: var(--s3);
  background: rgba(14, 18, 22, .82); color: #fff;
  font-size: var(--t-xs); font-weight: 600; font-variant-numeric: tabular-nums;
  padding: var(--s1) var(--s3); border-radius: 999px;
  white-space: nowrap;
}

.frame__caption { display: grid; gap: var(--s2); }
.frame__caption > * { display: block; }
.frame__name { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.25; font-weight: 600; }
.frame__latin { font-size: var(--t-sm); color: var(--ink-3); font-style: italic; }
.frame__desc { font-size: var(--t-base); color: var(--ink-2); line-height: 1.6; }
.frame__credit { font-size: var(--t-xs); color: var(--ink-3); }

.frame__facts { --od-cols: 2; --od-gap: var(--s3); margin-top: var(--s2); }
@media (min-width: 560px) { .frame__facts { --od-cols: 3; } }
.fact {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r1); padding: var(--s3);
  --od-gap: 2px;
}
.fact__label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.fact__value { font-size: var(--t-sm); color: var(--ink); font-weight: 600; line-height: 1.4; }

.frame__nav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding-top: var(--s4); border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.frame__nav .btn { flex: 1 1 140px; }
@media (min-width: 560px) { .frame__nav .btn { flex: 0 0 auto; } }
.frame__progress {
  flex: 1 1 100%; order: -1;
  height: 4px; background: var(--surface-3); border-radius: 999px; overflow: hidden;
}
@media (min-width: 560px) { .frame__progress { flex: 1 1 120px; order: 0; } }
.frame__progress span { display: block; height: 100%; background: var(--brand); transition: width var(--dur-mid) var(--ease-out); }

.thumbs { --od-gap: var(--s2); --od-rail-pad: 0px; padding-top: var(--s2); }
.thumbs button {
  width: 76px; padding: 0; border: 2px solid transparent; border-radius: var(--r1);
  background: var(--surface-2); cursor: pointer; overflow: hidden; line-height: 0;
  transition: border-color var(--dur-in) var(--ease-out), opacity var(--dur-in) var(--ease-out);
  opacity: .6;
}
.thumbs button[aria-current="true"] { border-color: var(--brand); opacity: 1; }
@media (hover: hover) { .thumbs button:hover { opacity: 1; } }
.thumbs img { --od-ratio: 4 / 3; }

/* ------------------------------------------------------------------ stopka -- */

.footer {
  background: var(--brand-dark); color: #d7e0ea;
  margin-top: var(--s8);
  padding-block: var(--s7) var(--s6);
}
.footer a { color: #ffffff; text-decoration: none; }
@media (hover: hover) { .footer a:hover { text-decoration: underline; } }
.footer__cols { display: grid; gap: var(--s6); }
@media (min-width: 768px) { .footer__cols { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }
.footer__title { font-family: var(--font-sans); font-size: var(--t-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #ffffff; margin-bottom: var(--s3); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); font-size: var(--t-sm); }
.footer__about { font-size: var(--t-sm); line-height: 1.6; color: #c3d0dd; max-width: 46ch; }
.footer__bottom {
  margin-top: var(--s6); padding-top: var(--s4);
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: var(--t-xs); color: #b9c7d6;
  display: flex; flex-wrap: wrap; gap: var(--s4); justify-content: space-between;
}
.footer .brand__name { color: #fff; }
.footer .brand__mark { background: #fff; color: var(--brand-dark); }

/* ------------------------------------------------------------------ breadcrumb */

.crumbs { font-size: var(--t-xs); color: var(--ink-3); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
@media (hover: hover) { .crumbs a:hover { color: var(--brand); text-decoration: underline; } }

/* ------------------------------------------------------- redukcja ruchu ---- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
}
