/* Strony o imionach (/imiona/…) — dodatek do styles.css. Strony generuje tools/name-pages. */

.names-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}

/* Okruszki */

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
  font-size: 14px;
  color: var(--muted);
}

.crumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--muted);
}

.crumbs a {
  color: var(--muted);
}

.crumbs [aria-current] {
  color: var(--ink);
  font-weight: 700;
}

/* Nagłówki stron */

.name-head,
.hub-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.name-head h1,
.hub-head h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.hub-head .lead {
  max-width: 720px;
}

.hub-head p:not(.lead) {
  max-width: 720px;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface);
}

.facts span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.facts strong {
  font-size: 17px;
}

/* Układ */

.name-page,
.hub {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.name-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
}

.name-col,
.name-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
  gap: 20px;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 24px;
  background: var(--surface);
}

.block h2 {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.block h2 a {
  color: var(--ink);
  text-decoration: none;
}

.block p {
  max-width: 68ch;
}

.block small,
.top-list small {
  color: var(--muted);
}

.plain {
  color: var(--muted);
}

/* Popularność: wykres i tabela */

.pop {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  align-items: center;
  gap: 16px 24px;
}

.chart {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

.chart text {
  font-family: var(--text);
  font-size: 15px;
  fill: var(--ink);
}

.chart__year {
  font-weight: 700;
}

.chart__track {
  fill: var(--outline-variant);
}

.chart__bar {
  fill: var(--primary);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table caption {
  margin-bottom: 8px;
  font-weight: 700;
  text-align: left;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--outline-variant);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  font-size: 13px;
  color: var(--muted);
}

.table tbody th {
  font-weight: 700;
}

.table td:last-child,
.table th:last-child {
  text-align: right;
}

.table--ranking td:first-child {
  width: 3.5em;
  color: var(--muted);
}

.delta {
  white-space: nowrap;
  color: var(--muted);
}

.delta--up {
  color: #1a7f37;
}

.delta--down {
  color: #b42318;
}

.delta--new {
  color: var(--primary);
  font-weight: 700;
}

/* Listy imion */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.chips li {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg);
}

.similar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px 16px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.similar li,
.name-list li {
  display: flex;
  flex-direction: column;
}

.similar a,
.name-list a,
.more a,
.top-list a {
  font-weight: 700;
}

.more,
.bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 20px;
  margin: 0;
}

.top-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  padding-left: 28px;
  margin: 0;
}

.name-list {
  columns: 170px;
  column-gap: 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.name-list li {
  break-inside: avoid;
  padding: 4px 0;
}

.letters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.letters a,
.letters span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-container);
  color: var(--on-primary-container);
  font-weight: 700;
  text-decoration: none;
}

.letters a:hover {
  background: var(--primary);
  color: #fff;
}

.letters [aria-current] {
  background: var(--primary);
  color: #fff;
}

/* Wezwanie do aplikacji i stopka strony */

.names-cta {
  margin-top: 16px;
  padding-bottom: 0;
}

.updated {
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .name-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .block {
    padding: 18px 16px;
  }

  .table {
    font-size: 14px;
  }

  .table th,
  .table td {
    padding: 8px 6px;
  }

  .top-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Najwęższe telefony (320 px): tabela rankingu mieści się bez przewijania w bok. */
@media (max-width: 360px) {
  .table {
    font-size: 13px;
  }

  .table th,
  .table td {
    padding: 8px 4px;
  }

  .table--ranking td:first-child {
    width: 2.5em;
  }

  .table tbody th {
    overflow-wrap: anywhere;
  }
}
