/* Static article directories. Shared shell, typography and width stay unchanged. */
.directory-content {
  min-width: 0;
}

.directory-overview {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 22px;
  color: #777d89;
  font-size: 13px;
  line-height: 1.6;
}

.directory-overview strong {
  color: #191c26;
  font-weight: 650;
}

.directory-overview > span {
  color: #b4a9c8;
}

.directory-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 30px;
}

.directory-index a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid #ddd6e9;
  border-radius: 4px;
  background: #ffffff7a;
  color: #665277;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.directory-index a:hover {
  background: #fff;
  border-color: #b99ade;
  color: #7143cb;
}

.directory-index a > span {
  flex: none;
  color: #9d87b1;
  font-size: 10px;
}

/* Native details expose every root on initial load; names navigate separately from the toggle. */
.tree-map {
  display: grid;
  gap: 18px;
}

.tree-root {
  min-width: 0;
  border: 1px solid #fff;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
}

.tree-root > summary {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 15px;
  padding: 28px 30px;
  cursor: default;
  list-style: none;
  /* This is a toggle, not editable text. Keep native focus and keyboard activation. */
  -webkit-user-select: none;
  user-select: none;
  caret-color: transparent;
}

.tree-root > summary::-webkit-details-marker {
  display: none;
}

.tree-root > summary:hover {
  background: #faf8fe;
}

.tree-root-marker {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: #8626e8;
  box-shadow: 0 0 0 5px #8626e80e;
}

.tree-root-title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.tree-root-count {
  min-width: 34px;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f1ebfd;
  color: #8155bd;
  font-family: inherit; font-size: 11px; line-height: 20px; font-weight: 400;
  text-align: center;
}

.directory-chevron {
  justify-self: end;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #8d73b2;
  border-bottom: 1.5px solid #8d73b2;
  transform: rotate(-45deg);
}

.tree-root[open] > summary .directory-chevron {
  transform: rotate(45deg) translate(-2px, -2px);
}

.tree-root > .tree-children {
  margin: 0 30px 30px 36px;
}

.tree-children {
  list-style: none;
  margin: 10px 0 8px 5px;
  padding: 0 0 0 26px;
  border-left: 1px solid #e6deef;
}

.tree-node {
  position: relative;
  min-width: 0;
  padding: 7px 0;
}

.tree-node::before {
  position: absolute;
  top: 19px;
  left: -26px;
  width: 17px;
  height: 1px;
  background: #e6deef;
  content: "";
}

.tree-node-label {
  display: block;
  color: #68707e;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.tree-node--branch > .tree-node-label {
  color: #30283c;
  font-size: 15px;
  font-weight: 600;
}

/* Keep the original resting colors; only interactive states underline the name. */
.tree-root-title,.tree-node-label { text-decoration: none; text-underline-offset: 4px; cursor: pointer; }
.tree-root-title { color: inherit; }
.tree-map a:is(:hover,:focus-visible) { color: #7020cf; text-decoration: underline; }
.tree-map a:active { color: #6c3cdd; text-decoration: underline; }
.tree-map a:focus-visible { outline: 2px solid #8626e8; outline-offset: 3px; border-radius: 2px; }
.tree-toggle {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  caret-color: transparent;
}
.tree-toggle:hover { background: #8626e812; }
.tree-toggle:active { background: #8626e822; }
.tree-toggle:focus-visible { outline: 2px solid #8626e8; outline-offset: 2px; }
.tree-toggle .directory-chevron { pointer-events: none; }


/* Flat tag catalogue. Existing blog spacing and site typography remain shared. */
.tags-directory .directory-overview { margin-bottom: 10px; }
.catalog-count-note { margin: 0 0 26px; color: #777d89; font-size: 13px; line-height: 1.7; }
.catalog-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.catalog-tag-cloud > li { max-width: 100%; scroll-margin-top: calc(var(--header-band-height) + 24px); }
.catalog-tag {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  min-height: 50px;
  padding: 11px 13px 11px 17px;
  border: 1px solid #e0d9ec;
  border-radius: 4px;
  background: #fff;
  color: #393243;
  font-size: 14px;
  line-height: 1.5;
}
.catalog-tag-name { overflow-wrap: anywhere; }
.catalog-tag-count {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: none;
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 7px;
  background: #f0e9fc;
  color: #7020cf;
  font-family: inherit; font-size: 11px; line-height: 22px; font-weight: 500;
}
.catalog-tag-cloud > li:target .catalog-tag { border-color: #a979ed; box-shadow: 0 0 0 3px #8626e813; }
@media (max-width:600px) {
  .catalog-count-note { font-size: 12px; margin-bottom: 21px; }
  .catalog-tag-cloud { gap: 9px; }
  .catalog-tag { min-height: 46px; padding: 9px 10px 9px 13px; gap: 11px; font-size: 13px; border-radius: 4px; }
  .catalog-tag-count { min-width: 27px; padding: 1px 6px; font-size: 10px; }
}

/* The entire tag pill, including its count and padding, is a link. */
.catalog-tag { cursor: pointer; text-decoration: none; }
.catalog-tag:hover .catalog-tag-name { text-decoration: underline; text-underline-offset: 3px; }
.catalog-tag:focus-visible { outline: 2px solid #8626e8; outline-offset: 3px; }

/* Categories share the approved tag pills; only catalogue grouping is added. */
.catalog-categories {
  display: grid;
  gap: 30px;
}
.catalog-category {
  min-width: 0;
  scroll-margin-top: calc(var(--header-band-height) + 24px);
}
.catalog-category + .catalog-category {
  padding-top: 28px;
  border-top: 1px solid #e5dfee;
}
.catalog-category-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 13px;
  margin-bottom: 18px;
}
.catalog-category-heading h2 {
  margin: 0;
  color: #191c26;
  font-size: 23px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -.45px;
}
.catalog-category-count {
  flex: none;
  padding: 3px 9px;
  border-radius: 7px;
  background: #f0e9fc;
  color: #7020cf;
  font-size: 11px;
  line-height: 20px;
}
@media (max-width:600px) {
  .catalog-categories { gap: 25px; }
  .catalog-category + .catalog-category { padding-top: 23px; }
  .catalog-category-heading { margin-bottom: 15px; gap: 8px 10px; }
  .catalog-category-heading h2 { font-size: 19px; letter-spacing: -.3px; }
  .catalog-category-count { padding: 2px 7px; font-size: 10px; }
}

/* Category headings open an article selection; per-category totals come from the CMS. */
.catalog-category-heading h2 a {
  color: inherit;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: color .18s ease;
}
.catalog-category-heading h2 a:hover,
.catalog-category-heading h2 a:focus-visible {
  color: #7020cf;
  text-decoration-line: underline;
}
.catalog-category-heading h2 a:focus-visible {
  outline: 2px solid #8626e8;
  outline-offset: 5px;
  border-radius: 3px;
}
.catalog-category-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.catalog-category-tag-count {
  padding: 2px 8px;
  border: 1px solid #d4dce5;
  border-radius: 7px;
  background: #e9eef3;
  color: #627083;
  font-size: 11px;
  line-height: 20px;
}
@media (max-width:600px) {
  .catalog-category-tag-count { padding: 1px 6px; font-size: 10px; }
}
@media (prefers-reduced-motion:reduce) {
  .catalog-category-heading h2 a { transition: none; }
}

/* WBStat palette and thin display type, with the reference structure unchanged. */
.directory-content { padding-top: 6px; }
.directory-content [hidden] { display: none !important; }
.directory-overview p { margin: 0; }
.directory-overview strong { font-weight: 500; }
.tree-root { border-color: #e9e5ed; }
.tree-root-title { font-weight: 400; color: #27212f; }
.tree-node-label { color: #56505d; font-weight: 300; }
.tree-node--branch > .tree-node-label { color: #302637; font-weight: 500; }
.tree-root-marker { border-radius: 50%; background: linear-gradient(120deg,#cb00cb,#7922ee 70%,#393cf2); box-shadow: none; }
.directory-index a { color: #51435e; font-weight: 300; }
.directory-index a:hover { border-color: #9e6bc6; color: #7020cf; }
.tree-root-count,.catalog-tag-count,.catalog-category-count { color: #7020cf; background: #f2eafa; font-family: inherit; font-weight: 400; }
.catalog-category-heading h2 { font-size: 23px; font-weight: 400; letter-spacing: -.6px; }
.catalog-category-tag-count { background: #f0f1f4; border-color: #e0e1e5; color: #66606f; border-radius: 4px; font-weight: 300; }
.catalog-tag { font-weight: 300; color: #39323f; border-color: #e0dce5; }
.catalog-tag:hover { border-color: #b190ca; background: #fff; }
.catalog-category-count { border-radius: 4px; font-weight: 300; }
.tree-map .tree-root:target { border-color: #c9a9df; }
.tree-root,.catalog-category,.catalog-tag-cloud > li { scroll-margin-top: calc(var(--wbp-header-bottom,120px) + 25px); }
@media(max-width:600px) {
 .directory-index { gap: 7px; margin-bottom: 23px; }
 .directory-index a { padding: 9px 11px; font-size: 11px; }
 .tree-root > summary { padding: 21px 17px; grid-template-columns: 9px minmax(0,1fr) 32px; gap: 10px; }
 .tree-root-marker { width: 8px; height: 8px; }
 .tree-root-title { font-size: 18px; letter-spacing: -.3px; }
 .tree-root-count { min-width: 26px; padding: 2px 6px; font-size: 10px; }
 .tree-root > .tree-children { margin: 0 17px 24px 22px; }
 .tree-children { padding-left: 16px; }
 .tree-node::before { left: -16px; width: 10px; }
 .tree-node-label { font-size: 13px; }
 .tree-node--branch > .tree-node-label { font-size: 14px; }
 .catalog-category-heading h2 { font-size: 20px; }
}
@media(prefers-reduced-motion:reduce) { .directory-index a { transition: none; } }

.tree-toggle { border: 0; font: inherit; }

/* Final contrast pass; original category/tree structure stays intact. */
.wbp-main-column .directory-overview p{color:#403747}
.wbp-main-column .tree-node-label{color:#302737;font-weight:400}
.wbp-main-column .tree-node--branch>.tree-node-label{color:#211829;font-weight:500}
.wbp-main-column .tree-root-title,.wbp-main-column .catalog-category-heading h2{color:#201727;font-weight:500}
.wbp-main-column .directory-index a{color:#362341;font-weight:400;border-color:#ceb9e5;background:#fff}
.wbp-main-column .catalog-tag{color:#292031;font-weight:400;border-color:#c8b5df;background:#fff;box-shadow:0 2px 5px #4c1f7806}
.wbp-main-column .catalog-tag:hover{color:#572091;border-color:#8d48ca;background:#f5edff}
.wbp-main-column :is(.catalog-tag-count,.catalog-category-count,.tree-root-count){background:#7926ce;color:#fff;font-weight:500}
.wbp-main-column .catalog-category-tag-count{color:#473251;background:#f0e6fa;border-color:#d6c1ea;font-weight:400}
