/* HSWare 4.2 — Software/Blog directory polish loaded after the active template bundle. */

.hsware-software-directory .hsware-directory-hero {
  padding-top: 52px;
  padding-bottom: 42px;
}
.hsware-software-directory .hsware-directory-hero h1 { margin-bottom: 16px; }
.hsware-software-directory .hsware-directory-search { margin-top: 0; }

/* Category hierarchy: every parent is visible; children expand from the arrow. */
.hsware-software-directory .hsware-directory-sidebar {
  display: block;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  padding: 16px;
}
.hsware-software-directory .hsware-directory-sidebar > h2 { margin-bottom: 10px; }
.hsware-category-tree {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  scrollbar-width: thin;
}
.hsware-category-node { min-width: 0; }
.hsware-category-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.hsware-software-directory .hsware-category-filter {
  flex: 1 1 auto;
  min-width: 0;
  margin: 2px 0;
  padding: 8px 8px;
  gap: 8px;
  border-radius: 9px;
  line-height: 1.2;
}
.hsware-category-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hsware-category-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hsware-category-media {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
}
.hsware-category-media-image {
  display: block;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}
.hsware-software-directory .hsware-category-filter b {
  min-width: 24px;
  padding: 2px 5px;
  font-size: 10px;
  flex: 0 0 auto;
}
.hsware-category-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--so-subtle);
  cursor: pointer;
}
.hsware-category-toggle:hover { background: var(--so-bg-subtle); color: var(--so-strongest); }
.hsware-category-toggle span {
  display: block;
  font-size: 17px;
  line-height: 1;
  transition: transform .16s ease;
  transform: rotate(-90deg);
}
.hsware-category-toggle[aria-expanded="true"] span { transform: rotate(0deg); }
.hsware-category-children {
  margin: 1px 0 3px 13px;
  padding-left: 9px;
  border-left: 1px solid var(--so-border);
}
.hsware-category-children[hidden] { display: none !important; }
.hsware-category-node.depth-1 .hsware-category-filter,
.hsware-category-node.depth-2 .hsware-category-filter,
.hsware-category-node.depth-3 .hsware-category-filter { font-size: 12.5px; font-weight: 600; }
.hsware-category-node.depth-1 .hsware-category-media,
.hsware-category-node.depth-2 .hsware-category-media,
.hsware-category-node.depth-3 .hsware-category-media { width: 22px; height: 22px; flex-basis: 22px; }

/* Software result grid. */
.hsware-software-directory .sb-software-grid,
.hsware-software-directory .sb-archive-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 15px !important;
  align-items: stretch;
}

/* Template 1 compact directory card. Homepage cards are intentionally untouched. */
.hsware-software-directory .sb-software-card.hsware-compact-software-card {
  min-height: 0 !important;
  height: 100%;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-card-body { padding: 14px; }
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-card-top {
  min-height: 72px !important;
  margin-bottom: 10px !important;
  padding-right: 78px !important;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-app-icon-wrap {
  width: 72px !important;
  height: 72px !important;
  flex: 0 0 72px !important;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-app-icon,
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-app-icon.has-image img {
  width: 72px !important;
  height: 72px !important;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-version-float {
  top: 0 !important;
  right: 0 !important;
  max-width: 72px !important;
  min-height: 24px !important;
  padding: 5px 7px !important;
  overflow: hidden !important;
  font-size: 9px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card h3 {
  margin-bottom: 7px !important;
  font-size: 15px !important;
  line-height: 1.28 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-card-meta {
  margin-bottom: 0 !important;
  font-size: 10px !important;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-publisher {
  margin-top: 10px;
  padding-top: 9px;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-card-footer {
  padding: 10px 12px;
}
.hsware-software-directory .sb-software-card.hsware-compact-software-card .sb-card-download {
  min-width: 0 !important;
  min-height: 31px !important;
  padding: 7px 10px !important;
}

/* Template 2 compact directory card. */
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card {
  min-height: 0 !important;
  height: 100%;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-main {
  padding: 14px 14px 0;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-media {
  min-height: 62px;
  margin-bottom: 10px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-logo {
  width: 60px;
  height: 60px;
  flex-basis: 60px;
  border-radius: 13px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-version {
  top: 2px;
  right: 0;
  max-width: calc(100% - 70px);
  overflow: hidden;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card h3 {
  margin-bottom: 6px !important;
  font-size: 15px !important;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-meta {
  margin-bottom: 0;
  gap: 6px;
  font-size: 10px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-meta a {
  padding: 3px 7px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-publisher {
  margin-top: 9px;
  padding-top: 9px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-card-footer {
  margin-top: 10px;
  padding: 10px 14px;
}
body.softorbit-template2 .hsware-software-directory .sbt2-software-card.hsware-compact-software-card .sbt2-download {
  min-height: 30px;
  padding: 0 10px;
  font-size: 10px;
}

/* Pagination: paginate_links() returns plain links/spans, never a vertically styled UL. */
.hsware-directory-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}
.hsware-directory-pagination > a.page-numbers,
.hsware-directory-pagination > span.page-numbers {
  display: inline-flex !important;
  width: auto !important;
  min-width: 34px !important;
  height: 34px !important;
  align-items: center;
  justify-content: center;
  padding: 0 9px !important;
  border: 1px solid var(--so-border) !important;
  border-radius: 8px !important;
  background: var(--so-white) !important;
  color: var(--so-medium) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
}
.hsware-directory-pagination > span.page-numbers.current,
.hsware-directory-pagination > a.page-numbers:hover {
  border-color: var(--so-strongest) !important;
  background: var(--so-strongest) !important;
  color: var(--so-white) !important;
}
.hsware-directory-pagination > span.page-numbers.dots {
  min-width: 20px !important;
  padding: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
}

@media (max-width: 1180px) {
  .hsware-software-directory .sb-software-grid,
  .hsware-software-directory .sb-archive-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 980px) {
  .hsware-software-directory .hsware-directory-sidebar {
    position: static;
    max-height: none;
  }
  .hsware-category-tree { max-height: 430px; }
}
@media (max-width: 700px) {
  .hsware-software-directory .sb-software-grid,
  .hsware-software-directory .sb-archive-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 470px) {
  .hsware-software-directory .sb-software-grid,
  .hsware-software-directory .sb-archive-grid { grid-template-columns: 1fr !important; }
  .hsware-directory-pagination > a.page-numbers,
  .hsware-directory-pagination > span.page-numbers { min-width: 32px !important; height: 32px !important; padding: 0 7px !important; }
}
