/* Convert & Count HTML Sitemap Styles */
.sitemap-container {
  padding-bottom: 80px;
}
.sitemap-hero {
  text-align: center;
  padding: 48px 0 32px;
  max-width: 860px;
  margin-inline: auto;
}
.sitemap-hero h1 {
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.15;
}
.sitemap-hero .lead {
  font-size: 17px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 24px;
}

/* Quick Statistics Grid */
.sitemap-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 0 auto 36px;
  max-width: 1040px;
}
.sitemap-stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(23, 40, 65, 0.03);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.sitemap-stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}
.sitemap-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.sitemap-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Interactive Controls: Search & Jump Bar */
.sitemap-controls {
  position: sticky;
  top: 12px;
  z-index: 50;
  background: rgba(250, 251, 248, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  margin-bottom: 36px;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.sitemap-search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}
.sitemap-search-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(49, 92, 232, 0.18);
}
.sitemap-search-wrap svg {
  color: var(--muted);
  width: 20px;
  height: 20px;
  flex: none;
}
.sitemap-search-input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.sitemap-search-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}
.sitemap-search-count {
  font-size: 12px;
  font-weight: 650;
  color: var(--blue);
  background: var(--pale-blue);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.sitemap-clear-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
  display: none;
}
.sitemap-clear-btn:hover {
  color: var(--ink);
}

/* Category Quick Jump Pills */
.sitemap-jump-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.sitemap-jump-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
  padding-right: 4px;
}
.sitemap-jump-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
  flex: none;
}
.sitemap-jump-pill:hover {
  background: var(--pale-blue);
  border-color: var(--blue);
  color: var(--blue);
  text-decoration: none;
}

/* Category Sections */
.sitemap-section {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(23, 40, 65, 0.02);
  transition: border-color 0.15s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.sitemap-section:target {
  border-color: var(--blue);
  scroll-margin-top: 160px;
}
.sitemap-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.sitemap-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sitemap-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--pale-blue);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.sitemap-section h2 {
  font-size: 22px;
  font-weight: 750;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.025em;
}
.sitemap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pale-blue);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sitemap-hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--blue);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.sitemap-hub-link:hover {
  background: var(--pale-blue);
  border-color: var(--blue);
  text-decoration: none;
  transform: translateX(2px);
}

/* Links Grid */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.sitemap-item {
  margin: 0;
}
.sitemap-link {
  display: block;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.15s ease;
  height: 100%;
}
.sitemap-link:hover {
  background: var(--white);
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}
.sitemap-link-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.sitemap-link-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  transition: color 0.15s ease;
}
.sitemap-link:hover .sitemap-link-title {
  color: var(--blue);
}
.sitemap-link-arrow {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex: none;
  transition: transform 0.15s ease, color 0.15s ease;
}
.sitemap-link:hover .sitemap-link-arrow {
  color: var(--blue);
  transform: translateX(2px);
}
.sitemap-link-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sitemap-link-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.sitemap-link-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--muted);
  background: var(--pale-blue);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Empty search state */
.sitemap-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 16px;
  margin: 20px 0;
}
.sitemap-empty h3 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}
.sitemap-empty p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .sitemap-stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .sitemap-section {
    padding: 22px 20px;
  }
  .sitemap-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .sitemap-hero {
    padding: 36px 0 24px;
  }
  .sitemap-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .sitemap-stat-card:last-child {
    grid-column: 1 / -1;
  }
  .sitemap-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .sitemap-hub-link {
    width: 100%;
    justify-content: center;
  }
  .sitemap-controls {
    padding: 10px;
  }
}

/* --- Dedicated Dark Theme Overrides for Sitemap --- */
[data-theme="dark"] .sitemap-stat-card {
  background: #131f38 !important;
  border-color: #223253 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}
[data-theme="dark"] .sitemap-stat-card:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .sitemap-stat-num {
  color: #60a5fa !important;
}
[data-theme="dark"] .sitemap-stat-label {
  color: #94a3b8 !important;
}
[data-theme="dark"] .sitemap-controls {
  background: rgba(19, 31, 56, 0.95) !important;
  border-color: #223253 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .sitemap-search-wrap {
  background: #0b1329 !important;
  border-color: #26385d !important;
}
[data-theme="dark"] .sitemap-search-wrap:focus-within {
  border-color: #4f7df9 !important;
  box-shadow: 0 0 0 3px rgba(79, 125, 249, 0.25) !important;
}
[data-theme="dark"] .sitemap-search-input {
  color: #f1f5f9 !important;
}
[data-theme="dark"] .sitemap-search-input::placeholder {
  color: #64748b !important;
}
[data-theme="dark"] .sitemap-search-count {
  background: rgba(79, 125, 249, 0.2) !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .sitemap-jump-label {
  color: #94a3b8 !important;
}
[data-theme="dark"] .sitemap-jump-pill {
  background: #172545 !important;
  border-color: #273b64 !important;
  color: #cbd5e1 !important;
}
[data-theme="dark"] .sitemap-jump-pill:hover {
  background: #1e335f !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .sitemap-section {
  background: #131f38 !important;
  border-color: #223253 !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35) !important;
}
[data-theme="dark"] .sitemap-section-head {
  border-bottom-color: #1e2e4f !important;
}
[data-theme="dark"] .sitemap-section-icon {
  background: #1a2a4c !important;
  color: #60a5fa !important;
}
[data-theme="dark"] .sitemap-section h2 {
  color: #f1f5f9 !important;
}
[data-theme="dark"] .sitemap-badge {
  background: #1a2a4c !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .sitemap-hub-link {
  background: #0b1329 !important;
  border-color: #223253 !important;
  color: #60a5fa !important;
}
[data-theme="dark"] .sitemap-hub-link:hover {
  background: #1a2a4c !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .sitemap-link {
  background: #0b1329 !important;
  border-color: #1e2e4f !important;
}
[data-theme="dark"] .sitemap-link:hover {
  background: #162444 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}
[data-theme="dark"] .sitemap-link-title {
  color: #f1f5f9 !important;
}
[data-theme="dark"] .sitemap-link:hover .sitemap-link-title {
  color: #60a5fa !important;
}
[data-theme="dark"] .sitemap-link-desc {
  color: #94a3b8 !important;
}
[data-theme="dark"] .sitemap-link-arrow {
  color: #64748b !important;
}
[data-theme="dark"] .sitemap-link-path {
  background: #16264c !important;
  color: #93c5fd !important;
}
[data-theme="dark"] .sitemap-empty {
  background: #131f38 !important;
  border-color: #223253 !important;
}
[data-theme="dark"] .sitemap-empty h3 {
  color: #f1f5f9 !important;
}
