/* Wpisy — karta, siatka, wyróżniony wpis, filtry i paginacja */
.ax-news {
  padding: var(--ax-sec-pad-m) 0;
  background: var(--ax-paper);
  color: var(--ax-navy);
  /* Skok z filtra i numeru strony ma zostawić nagłówek pod belką nawigacji. */
  scroll-margin-top: calc(var(--ax-navh, 84px) + 24px);
}

.ax-news--tight-top { padding-top: clamp(30px, 3.4vw, 54px); }
.ax-news--tight-bottom { padding-bottom: clamp(30px, 3.4vw, 54px); }

.ax-news__inner {
  max-width: var(--ax-maxw);
  margin: 0 auto;
  padding: 0 var(--ax-gutter);
}

.ax-news__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(16px, 2.4vw, 40px);
  margin-bottom: clamp(24px, 3vw, 44px);
}

.ax-news__head-col { flex: 1 1 460px; max-width: min(100%, 640px); }

/* Standard eyebrow sekcji: znak X + label (jak na inwestycjach i O nas). */
.ax-news__eyebrow {
  display: block;
  margin-bottom: var(--ax-label-gap);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ax-steel);
}

.ax-news__eyebrow-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  vertical-align: -1px;
  margin-right: 9px;
}

.ax-news__eyebrow-mark svg {
  width: 9px;
  height: 7.2px;
  flex: 0 0 auto;
  display: block;
  fill: currentColor;
}

.ax-news__heading {
  margin: 0;
  font-weight: 300;
  font-size: clamp(30px, 4vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: pretty;
}

.ax-news__head-link {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ax-navy);
  text-decoration: none;
  border-bottom: 1px solid rgba(53, 59, 102, 0.3);
  padding-bottom: 4px;
  transition: color 320ms ease, border-color 320ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__head-link:hover { color: var(--ax-steel); border-color: var(--ax-steel); }
}

/* Filtry kategorii — zwykłe linki, więc działają bez JS i są indeksowalne. */
.ax-news__filters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(14px, 2vw, 30px);
  margin-bottom: clamp(22px, 2.6vw, 36px);
  border-bottom: 1px solid rgba(53, 59, 102, 0.14);
}

.ax-news__filter {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 0 0 12px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(53, 59, 102, 0.45);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 320ms ease, border-color 320ms ease;
}

.ax-news__filter.is-active {
  color: var(--ax-navy);
  border-bottom-color: var(--ax-navy);
}

/* Licznik jest przypisem do etykiety, więc mniejszy i o ton jaśniejszy. */
.ax-news__filter-count {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(53, 59, 102, 0.38);
}

.ax-news__filter.is-active .ax-news__filter-count {
  color: var(--ax-steel);
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__filter:hover { color: var(--ax-navy); }
}

.ax-news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(24px, 3vw, 52px) clamp(18px, 2.2vw, 36px);
}

/* --- Szyna wpisow (mode=rail) ---------------------------------------------
 * Tor jest szerszy od kolumny tresci: zaczyna sie przy rynnie, a konczy poza
 * krawedzia okna, wiec kolejna karta zawsze jest przycieta. Mechanika taka
 * jak w szynach inwestycji: natywny overflow ze snapem, nie transform.
 */
.ax-news--rail {
  overflow-x: clip;
}

.ax-news__rail {
  display: flex;
  align-items: stretch;
  gap: clamp(18px, 2.2vw, 36px);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-left: var(--ax-gutter);
  padding: 0 var(--ax-gutter) 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}

.ax-news__rail::-webkit-scrollbar {
  display: none;
}

.ax-news__rail.is-drag {
  cursor: grabbing;
}

.ax-news__rail .ax-news__card {
  flex: 0 0 clamp(276px, 25vw, 372px);
  scroll-snap-align: start;
}

/* Pasek postepu, licznik i strzalki - jeden wiersz pod torem. */
.ax-news__rail-foot {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  margin-top: clamp(22px, 2.6vw, 38px);
}

.ax-news__rail-bar {
  position: relative;
  flex: 1 1 auto;
  height: 1px;
  background: rgba(53, 59, 102, 0.16);
  overflow: hidden;
}

.ax-news__rail-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 22%;
  background: var(--ax-navy);
  transition: width 320ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ax-news__rail-count {
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: rgba(53, 59, 102, 0.5);
  font-variant-numeric: tabular-nums;
}

.ax-news__rail-nav {
  flex: 0 0 auto;
  display: inline-flex;
  gap: 10px;
}

.ax-news__rail-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(53, 59, 102, 0.28);
  background: none;
  color: var(--ax-navy);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background-color 380ms ease, border-color 380ms ease, opacity 380ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__rail-btn:hover {
    background: var(--ax-sand);
    border-color: var(--ax-navy);
  }
}

/* Koniec toru: przycisk zostaje w ukladzie, ale nie udaje, ze cos zrobi. */
.ax-news__rail-btn[aria-disabled='true'] {
  opacity: 0.34;
  cursor: default;
}

/* Karta wpisu */
.ax-news__card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

/* Rośnie do wysokości karty, żeby "Czytaj wpis" trzymał się dołu w siatce. */
.ax-news__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.ax-news__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: var(--ax-radius);
  background: var(--ax-sand-deep);
  margin-bottom: 18px;
}

.ax-news__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__card:hover .ax-news__thumb img { transform: scale(1.06); }
}

/* Kadr bez fotografii: rysunek na piasku zamiast pustego prostokąta. */
.ax-news__thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(53, 59, 102, 0.1);
}

.ax-news__mark {
  color: rgba(53, 59, 102, 0.24);
  transition: color 420ms ease;
}

.ax-news__mark svg {
  display: block;
  width: clamp(56px, 5vw, 76px);
  height: auto;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__card:hover .ax-news__mark { color: rgba(53, 59, 102, 0.36); }
}

.ax-news__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  border-radius: 6px;
  background: var(--ax-glass-photo-badge-dark-bg);
  backdrop-filter: var(--ax-glass-photo-badge-dark-blur);
  -webkit-backdrop-filter: var(--ax-glass-photo-badge-dark-blur);
  border: 1px solid rgba(244, 241, 235, 0.2);
  padding: 8px 13px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ax-paper);
}

.ax-news__meta {
  display: block;
  margin-bottom: 10px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(53, 59, 102, 0.45);
}

.ax-news__title {
  margin: 0 0 10px;
  font-weight: 500;
  font-size: clamp(21px, 2vw, 31px);
  line-height: 1.12;
  letter-spacing: -0.024em;
  text-wrap: pretty;
}

.ax-news__excerpt {
  margin: 0 0 16px;
  font-size: 14.5px;
  line-height: 1.62;
  color: rgba(53, 59, 102, 0.66);
  text-wrap: pretty;
}

.ax-news__more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(53, 59, 102, 0.16);
  padding-top: 14px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ax-steel);
  width: 100%;
  justify-content: space-between;
  transition: color 320ms ease;
}

.ax-news__more svg { transition: transform 520ms cubic-bezier(0.16, 1, 0.3, 1); }

@media (hover: hover) and (pointer: fine) {
  .ax-news__card:hover .ax-news__more svg { transform: translateX(10px); }
}

/* Wyróżniony wpis — zdjęcie po jednej stronie, treść po drugiej. */
.ax-news__card--featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: clamp(20px, 3vw, 56px);
  align-items: center;
}

.ax-news__card--featured .ax-news__thumb {
  aspect-ratio: 16 / 11;
  margin-bottom: 0;
}

.ax-news__card--featured .ax-news__body {
  gap: clamp(13px, 1.5vw, 20px);
}

.ax-news__card--featured .ax-news__meta,
.ax-news__card--featured .ax-news__title,
.ax-news__card--featured .ax-news__excerpt {
  margin: 0;
}

.ax-news__card--featured .ax-news__title {
  font-size: clamp(30px, 3.6vw, 58px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.ax-news__card--featured .ax-news__excerpt {
  font-weight: 300;
  font-size: 17.5px;
  line-height: 1.66;
  max-width: 56ch;
}

/* W projekcie wyróżniony wpis kończy się przyciskiem, nie linkiem tekstowym. */
.ax-news__card--featured .ax-news__more {
  align-self: flex-start;
  width: auto;
  justify-content: flex-start;
  border-top: 0;
  border-radius: 10px;
  padding: 17px 26px;
  background: var(--ax-navy);
  color: var(--ax-paper);
  transition: background 380ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__card--featured:hover .ax-news__more { background: var(--ax-ink); }
}

/* Paginacja */
.ax-news__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-top: clamp(28px, 3.4vw, 52px);
  border-top: 1px solid rgba(53, 59, 102, 0.16);
  padding-top: clamp(18px, 2vw, 26px);
}

.ax-news__pager-info {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(53, 59, 102, 0.45);
}

.ax-news__pager-nav {
  display: flex;
  align-items: center;
  gap: 9px;
}

/* Numery stron: kwadratowe pola między pigułkami „poprzednia” i „następna”. */
.ax-news__pager-pages {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 4px;
}

.ax-news__pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(53, 59, 102, 0.6);
  text-decoration: none;
  transition: background 300ms ease, color 300ms ease, border-color 300ms ease;
}

.ax-news__pager-num.is-active {
  background: var(--ax-navy);
  border-color: var(--ax-navy);
  color: var(--ax-paper);
}

@media (hover: hover) and (pointer: fine) {
  a.ax-news__pager-num:hover {
    border-color: rgba(53, 59, 102, 0.26);
    color: var(--ax-navy);
  }
}

.ax-news__pager-gap {
  padding: 0 2px;
  font-size: 12px;
  color: rgba(53, 59, 102, 0.35);
}

/* Na telefonie numery zostają, a pigułki tracą etykiety słowne przez zawijanie
   całego paska - kolejność w DOM jest już czytelna od lewej. */
@media (max-width: 560px) {
  .ax-news__pager-nav {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
  }

  .ax-news__pager-pages {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

.ax-news__pager-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(53, 59, 102, 0.24);
  border-radius: var(--ax-pill);
  min-height: 44px;
  padding: 0 22px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ax-navy);
  text-decoration: none;
  transition: background 320ms ease, color 320ms ease, border-color 320ms ease;
}

.ax-news__pager-link[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__pager-link:hover {
    background: var(--ax-navy);
    border-color: var(--ax-navy);
    color: var(--ax-paper);
  }
}

.ax-news__empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(28px, 3vw, 48px) 0;
}

.ax-news__empty-text {
  margin: 0;
  font-size: 16px;
  color: rgba(53, 59, 102, 0.6);
}

.ax-news__empty-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(53, 59, 102, 0.24);
  border-radius: var(--ax-pill);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ax-navy);
  text-decoration: none;
  transition: background 320ms ease, color 320ms ease, border-color 320ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .ax-news__empty-link:hover {
    background: var(--ax-navy);
    border-color: var(--ax-navy);
    color: var(--ax-paper);
  }
}

@media (max-width: 900px) {
  .ax-news__head { align-items: flex-start; margin-bottom: 16px; }
  .ax-news__grid { grid-template-columns: 1fr; }

  /* Pola dotyku - odnosnik naglowka mial 22 px, numery stron 38 px. */
  .ax-news__head-link { min-height: 44px; align-items: flex-end; }
  .ax-news__pager-num,
  .ax-news__pager-arrow { min-width: 44px; min-height: 44px; }

  /* Na telefonie szyne prowadzi palec, wiec strzalki tylko zabieraly miejsce. */
  .ax-news__rail .ax-news__card { flex-basis: min(78vw, 320px); }
  .ax-news__rail-nav { display: none; }
  .ax-news__rail-foot { margin-top: 22px; }
  .ax-news__card--featured { grid-template-columns: 1fr; }
  .ax-news__card--featured .ax-news__more { width: 100%; justify-content: center; min-height: 44px; box-sizing: border-box; }

  /* Ten sam pasek co przy filtrach realizacji: przewijany w poziomie, z
     wygaszoną prawą krawędzią, żeby było widać, że kategorie idą dalej. */
  .ax-news__filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 48px), transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 48px), transparent 100%);
  }

  .ax-news__filters::-webkit-scrollbar { display: none; }

  .ax-news__filter { white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }

  .ax-news__pager-link { flex: 1 1 auto; justify-content: center; }
}
