/*
 * HTML sitemap (/sitemap, /sitemap/archive/…). Scoped to .xcms-sitemap so it
 * cannot touch the rest of a theme; colours and fonts come from the theme.
 * Logical properties keep it right for RTL and LTR sites.
 */
.xcms-sitemap {
  box-sizing: border-box;
  max-width: 1140px;
  margin-inline: auto;
  padding: 24px 16px 48px;
  line-height: 1.8;
}
.xcms-sitemap *,
.xcms-sitemap *::before,
.xcms-sitemap *::after {
  box-sizing: inherit;
}
.xcms-sitemap h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 8px 0 24px;
}
.xcms-sitemap h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 12px;
  padding-block-end: 8px;
  border-block-end: 1px solid rgba(127, 127, 127, 0.3);
}
.xcms-sitemap h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 16px 0 6px;
}
.xcms-sitemap section {
  margin-block-end: 36px;
}
.xcms-sitemap ul,
.xcms-sitemap ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.xcms-sitemap li {
  display: list-item;
  margin: 0 0 6px;
}
.xcms-sitemap a {
  display: inline;
  text-decoration: none;
}
.xcms-sitemap a:hover,
.xcms-sitemap a:focus-visible {
  text-decoration: underline;
}
.xcms-sitemap-count {
  font-size: 0.85em;
  opacity: 0.7;
  white-space: nowrap;
}

/* breadcrumb trail */
.xcms-sitemap-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.875rem;
}
.xcms-sitemap-breadcrumbs li {
  display: flex;
  align-items: center;
  margin: 0;
}
.xcms-sitemap-breadcrumbs li + li::before {
  content: "›";
  margin-inline-end: 8px;
  opacity: 0.5;
}
[dir="rtl"] .xcms-sitemap-breadcrumbs li + li::before {
  content: "‹";
}

/* section tree: top level in columns, children indented. A tree with one
   top-level section (a news root) puts its children in columns instead. */
.xcms-sitemap-hub section > ul,
.xcms-sitemap-hub section > ul > li:only-child > ul {
  columns: 3 220px;
  column-gap: 32px;
}
.xcms-sitemap-hub section > ul:has(> li:only-child > ul) {
  columns: auto;
}
.xcms-sitemap-hub section > ul > li,
.xcms-sitemap-hub section > ul > li:only-child > ul > li {
  break-inside: avoid;
}
.xcms-sitemap li > ul {
  margin-block-start: 6px;
  padding-inline-start: 16px;
  border-inline-start: 2px solid rgba(127, 127, 127, 0.2);
}

/* latest news: one block per section */
.xcms-sitemap-latest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px 32px;
}
.xcms-sitemap-latest-grid h3 {
  margin-top: 8px;
}
.xcms-sitemap-latest-grid ul {
  columns: auto;
}

/* months of the archive: a wrapping row per year */
.xcms-sitemap-months {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
}
.xcms-sitemap-hub section > ul.xcms-sitemap-months {
  columns: auto;
}

/* month and day pages */
.xcms-sitemap-month ul,
.xcms-sitemap-day ul {
  columns: 2 320px;
  column-gap: 32px;
}
.xcms-sitemap-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-block-start: 24px;
  padding-block-start: 12px;
  border-block-start: 1px solid rgba(127, 127, 127, 0.3);
}
.xcms-sitemap-pager [aria-current] {
  font-weight: 700;
}
