/* ==========================================================================
   Sitemap page (Sitemap template). 50 Star colours and Jost.
   Hero with search and counts, sticky jump bar, sections as card grids.
   ========================================================================== */

.psm {
  --navy: #2a3775; --navy-2: #1e2a5e; --navy-3: #141c40; --red: #e21d38;
  --bg: #f6f7fb; --line: #e3e6ee; --ink: #182238; --muted: #5c6677;
  --radius: 14px;
  font-family: var(--pak-font, "Jost", system-ui, sans-serif);
  color: var(--ink);
  background: var(--bg);
}
.psm *, .psm *::before, .psm *::after { box-sizing: border-box; }
.psm-wrap { width: 100%; max-width: calc(var(--pak-container, 1272px) + 2 * var(--pak-gutter, 24px)); margin: 0 auto; padding: 0 var(--pak-gutter, 24px); }
.psm .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.psm-ico { width: 1em; height: 1em; flex: 0 0 auto; }
.psm [hidden] { display: none !important; }

/* ---------- Hero ---------- */
.psm-hero {
  position: relative;
  overflow: hidden;
  padding: 44px 0 56px;
  color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #2f3e86 0%, var(--navy-3) 55%);
}
.psm-hero::after {
  content: "";
  position: absolute;
  right: -120px; bottom: -160px;
  width: 420px; height: 420px;
  border: 60px solid rgba(255,255,255,.04);
  border-radius: 50%;
  pointer-events: none;
}
.psm-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; font-size: var(--pak-small, 14px); color: rgba(255,255,255,.55); }
.psm-crumbs a { color: rgba(255,255,255,.85); text-decoration: none; }
.psm-crumbs a:hover { color: #fff; text-decoration: underline; }
.psm-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.psm .psm-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: var(--pak-eyebrow, 13px); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #ff8a9a; }
.psm .psm-eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--red); }
.psm .psm-hero__title { margin: 0 0 12px; font-size: var(--pak-h1, 52px); font-weight: 700; line-height: var(--pak-lh-title, 1.12); letter-spacing: -.02em; color: #fff; }
.psm-hero__lead { max-width: 560px; font-size: var(--pak-lead, 18px); line-height: var(--pak-lh-body, 1.65); color: rgba(255,255,255,.75); }
.psm-hero__lead p { margin: 0; }

.psm-search { position: relative; display: block; max-width: 520px; margin-top: 26px; }
.psm-search .psm-ico { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
.psm .psm-search input {
  width: 100%;
  height: 56px;
  padding: 0 20px 0 50px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.2 var(--pak-font, "Jost", sans-serif);
  box-shadow: 0 10px 30px rgba(5, 10, 40, .25);
  outline: none;
  transition: border-color .2s;
}
.psm .psm-search input:focus { border-color: var(--red); }

.psm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.psm-stats li { margin: 0; }
.psm-stats li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.psm-stats a {
  display: flex; flex-direction: column; gap: 2px;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: #fff;
  text-decoration: none;
  transition: background .2s, border-color .2s, transform .2s;
}
.psm-stats a:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.psm-stats strong { font-size: 30px; font-weight: 700; line-height: 1.1; }
.psm-stats span { font-size: var(--pak-small, 14px); color: rgba(255,255,255,.7); }

/* ---------- Jump bar ---------- */
.psm-jump {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(20, 28, 64, .05);
}
.psm-jump__inner { display: flex; align-items: center; gap: 16px; min-height: 62px; }
.psm-jump__links { display: flex; gap: 8px; flex: 1 1 auto; min-width: 0; padding: 10px 0; overflow-x: auto; scrollbar-width: none; }
.psm-jump__links::-webkit-scrollbar { display: none; }
.psm-jump__links a {
  display: inline-flex; align-items: center; gap: 8px;
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--navy);
  font-size: var(--pak-small, 14px); font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.psm-jump__links a span { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; text-align: center; }
.psm-jump__links a:hover, .psm-jump__links a.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.psm-jump__links a:hover span, .psm-jump__links a.is-active span { background: rgba(255,255,255,.18); }
.psm .psm-toggle-all {
  flex: 0 0 auto;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 var(--pak-small, 14px)/1.3 var(--pak-font, "Jost", sans-serif);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.psm .psm-toggle-all:hover { color: var(--red); }

/* ---------- Sections ---------- */
.psm-main { padding: 36px 0 80px; }
.psm-empty { margin: 0 0 24px; padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); background: #fff; color: var(--muted); text-align: center; }
.psm-sec {
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 80px);
}
.psm-sec__head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; }
.psm-sec__icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; background: rgba(42, 55, 117, .08); color: var(--navy); font-size: 22px; }
.psm-sec__titles { display: flex; flex-direction: column; min-width: 0; }
.psm-sec__num { font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--red); }
.psm .psm-sec__title { margin: 0; font-size: clamp(20px, 1vw + 14px, 26px); font-weight: 700; line-height: 1.2; color: var(--navy); }
.psm-count { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 600; }
.psm-count--lg { height: 28px; padding: 0 10px; font-size: 13px; }
.psm-viewall { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--navy); font-size: var(--pak-small, 14px); font-weight: 600; text-decoration: none; white-space: nowrap; }
.psm-viewall:hover { color: var(--red); }
.psm-viewall .psm-ico { transition: transform .2s; }
.psm-viewall:hover .psm-ico { transform: translateX(3px); }
.psm .psm-sec__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.psm-viewall + .psm-sec__toggle { margin-left: 4px; }
.psm-count--lg + .psm-sec__toggle { margin-left: auto; }
.psm .psm-sec__toggle:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.psm-sec__toggle .psm-ico { transition: transform .25s; }
.psm-sec:not(.is-open) .psm-sec__toggle .psm-ico { transform: rotate(-90deg); }
.psm-sec__body { padding: 4px 24px 26px; border-top: 1px solid var(--line); padding-top: 22px; }
.psm-sec:not(.is-open) .psm-sec__body { display: none; }

/* ---------- Cards (category / year) ---------- */
.psm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.psm-card { padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.psm-card:hover { border-color: #cfd4e3; box-shadow: 0 10px 26px rgba(20, 28, 64, .07); }
.psm-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.psm .psm-card__title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.psm .psm-card__title a { color: inherit; text-decoration: none; }
.psm .psm-card__title a:hover { color: var(--red); }

.psm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.psm .psm-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--navy); font-size: 13px; font-weight: 500; line-height: 1.4; text-decoration: none; transition: background .2s, color .2s, border-color .2s; }
.psm .psm-chip small { font-size: 11px; color: var(--muted); }
.psm .psm-chip:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.psm .psm-chip:hover small { color: rgba(255,255,255,.75); }

/* ---------- Links ---------- */
.psm-links { margin: 0; padding: 0; list-style: none; }
.psm-link { margin: 0; padding: 0; }
.psm-link a { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; color: var(--ink); font-size: 15px; line-height: 1.45; text-decoration: none; transition: color .15s; }
.psm-link a .psm-ico { width: 14px; height: 14px; margin-top: .25em; color: #b4bacb; transition: color .15s, transform .15s; }
.psm-link a:hover { color: var(--red); }
.psm-link a:hover .psm-ico { color: var(--red); transform: translateX(2px); }
.psm-link mark { padding: 0 2px; border-radius: 3px; background: #ffe2e7; color: inherit; }

/* Link grid (styles without categories, pages, XML): tiles */
.psm-links--grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.psm-links--grid .psm-link a { height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.psm-links--grid .psm-link a:hover { border-color: var(--navy); background: var(--bg); color: var(--navy); }
.psm-links--grid .psm-link a:hover .psm-ico { color: var(--navy); }
.psm-links--tree .psm-link[data-depth] a { background: var(--bg); }
.psm-links--tree .psm-link[data-depth] a::before { content: "↳"; margin-right: -4px; color: var(--muted); }
.psm-links--tree .psm-link[data-depth] a .psm-ico { display: none; }
.psm-links--xml .psm-link a { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.psm .psm-more {
  margin: 6px 0 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 14px/1.4 var(--pak-font, "Jost", sans-serif);
  cursor: pointer;
}
.psm .psm-more:hover { color: var(--red); }

/* Blog topics */
.psm-topics { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 20px; }
.psm-topics__label { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.psm-topics .psm-chips { margin: 0; }
.psm-note { margin: 0 0 14px; font-size: var(--pak-small, 14px); color: var(--muted); }

/* Search: filtered state */
.psm.is-searching .psm-more { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .psm-links--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 991px) {
  .psm-hero__grid { grid-template-columns: 1fr; gap: 30px; }
  .psm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .psm-stats li:last-child:nth-child(odd) { grid-column: auto; }
  .psm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psm-links--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .psm-hero { padding: 30px 0 38px; }
  .psm-crumbs { margin-bottom: 18px; }
  .psm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .psm-stats li:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .psm-stats a { padding: 12px 14px; }
  .psm-stats strong { font-size: 24px; }
  .psm .psm-search input { height: 52px; font-size: 16px; }
  .psm-jump__inner { min-height: 56px; gap: 10px; }
  .psm-main { padding: 22px 0 56px; }
  .psm-sec { margin-bottom: 14px; }
  .psm-sec__head { flex-wrap: wrap; gap: 10px 12px; padding: 16px; }
  .psm-sec__icon { width: 40px; height: 40px; font-size: 19px; }
  .psm-viewall { order: 5; width: 100%; margin-left: 52px; }
  .psm-count--lg + .psm-sec__toggle, .psm-viewall + .psm-sec__toggle { margin-left: auto; }
  .psm-sec__body { padding: 18px 16px 20px; }
  .psm-cards { grid-template-columns: 1fr; gap: 12px; }
  .psm-links--grid { grid-template-columns: 1fr; gap: 8px; }
  .psm-link a { padding: 9px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .psm *, .psm *::before, .psm *::after { transition: none !important; }
}


/* Cards with more than 6 links: 6 rows high, scroll inside the card.
   (sitemap.js sets the exact height of 6 rows; this is the fallback.) */
.psm-links--scroll {
  --psm-row: 36px;
  max-height: calc(var(--psm-row) * 6 + 4px);
  margin-right: -10px;
  padding-right: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--navy) var(--line);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}
.psm-links--scroll.is-end { -webkit-mask-image: none; mask-image: none; }
.psm-links--scroll::-webkit-scrollbar { width: 6px; }
.psm-links--scroll::-webkit-scrollbar-track { background: var(--line); border-radius: 6px; }
.psm-links--scroll::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 6px; }
.psm.is-searching .psm-links--scroll { max-height: none !important; -webkit-mask-image: none; mask-image: none; }
@media (max-width: 767px) {
  .psm-links--scroll { --psm-row: 40px; }
}
