/* ==========================================================================
   tagi.css — strona tagu (/tag/<url>/) i indeks tagów (/tag/).
   Wymaga components.css (.section__panel, .testy-card, .tag-list, .tag).
   Mobile-first, tokeny z global.css. Hero w tym samym stylu co .cmp-hero.
   ========================================================================== */

[hidden]{ display: none !important; }
.no-js [data-requires-js]{ display: none !important; }

/* ---------- Hero ---------- */

.tag-hero{
  background: var(--main-color);
  color: #fff;
  padding: 22px 0 26px;
}
.tag-hero__back{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #cdd8e4;
  transition: color .15s ease;
}
.tag-hero__back svg{ width: 14px; height: 14px; transition: transform .2s ease; }
.tag-hero__back:hover{ color: #fff; }
.tag-hero__back:hover svg{ transform: translateX(-3px); }

.tag-hero__title{
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 26px;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 10px;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.tag-hero__hash{
  color: var(--accent);
  font-weight: 400;
}
.tag-hero__lead{
  margin: 0 0 12px;
  max-width: 70ch;
  font-size: 15px;
  line-height: 1.55;
  color: #cdd8e4;
}
.tag-hero__lead a{ color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.tag-hero__lead a:hover{ color: var(--accent); }
.tag-hero__count{
  margin: 0;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.tag-hero__page{ font-weight: 400; color: #cdd8e4; }

@media (min-width: 900px){
  .tag-hero{ padding: 32px 0 38px; }
  .tag-hero__title{ font-size: 36px; }
  .tag-hero__lead{ font-size: 16px; }
}

/* ---------- Lista artykułów ---------- */

/* bez autora w stopce karty — "Czytaj" do prawej */
.tag-page .testy-card__footer{ justify-content: flex-end; }

.tag-empty{ padding: 28px 20px; text-align: center; }
.tag-empty p{ margin: 0 0 12px; color: var(--ink-soft); }

/* ---------- Paginacja ---------- */

.pager{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  font-family: var(--font-heading);
}
.pager__list{
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pager__num,
.pager__step{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--main-color);
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.7);
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.pager__num:hover,
.pager__step:hover{
  background: #fff;
  border-color: var(--accent);
  color: var(--accent-dark);
}
.pager__num:focus-visible,
.pager__step:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
.pager__num.is-current{
  color: #fff;
  background: var(--main-color);
  border-color: var(--main-color);
}
.pager__step svg{ width: 15px; height: 15px; flex: 0 0 auto; }
.pager__gap{ padding: 0 2px; color: var(--ink-soft); }

@media (max-width: 479px){
  .pager__step-text{ position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .pager__step{ padding: 0; width: 40px; }
}

/* ---------- Indeks tagów ---------- */

.tag__count{
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.tag:hover .tag__count{
  color: #fff;
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.3);
}

/* Najpopularniejsze — jedyny "głośniejszy" element strony: większe pigułki */
.tag--lg{
  padding: 11px 18px;
  font-size: 15px;
  font-family: var(--font-heading);
}
.tag--lg svg{ color: var(--accent-dark); }

/* A–Ż: narzędzia (litery + filtr) */
.tags-az__tools{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.tags-az__letters{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tags-az__letter-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--main-color);
  transition: background-color .15s ease, color .15s ease;
}
.tags-az__letter-link:hover{ background: var(--main-color); color: #fff; }
.tags-az__letter-link:focus-visible{ outline: 2px solid var(--accent); outline-offset: 1px; }

.tags-az__filter{
  position: relative;
  max-width: 360px;
}
.tags-az__filter svg{
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}
.tags-az__input{
  width: 100%;
  height: 42px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.tags-az__input:focus{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(101,149,202,.2); }

/* A–Ż: grupy */
.tags-az{ padding: 8px 20px 20px; }
.section__panel .tags-az .tag-list{ padding: 0; }

.tags-az__group{
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px; /* pod sticky headerem */
}
.tags-az__group:last-of-type{ border-bottom: none; }
.tags-az__letter{
  margin: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}
.tags-az__empty{ margin: 16px 0 0; color: var(--ink-soft); }

@media (min-width: 700px){
  .tags-az__tools{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .tags-az__letters{ flex: 1 1 auto; }
  .tags-az__filter{ flex: 0 0 300px; }

  .tags-az__group{
    grid-template-columns: 56px 1fr;
    gap: 16px;
    align-items: start;
  }
  .tags-az__letter{ font-size: 28px; padding-top: 4px; }
}
