/*
 * Comparison pages and Compare hub (KWEB-96).
 * Enqueued only on single `comparison` posts and the compare.php page template (koongo_scripts()).
 */

/* Long H1 in the page title band (same approach as the About page in style.css) */
.koongo-comparison-hero-title .page-title-heading {
  word-break: normal;
}

@media (max-width: 991px) {
  .koongo-comparison-hero-title .page-title-heading {
    padding-right: 30%;
  }
}

@media (max-width: 767px) {
  .koongo-comparison-hero-title .page-title-heading {
    padding-right: 0;
  }
}

/* Hero */
.koongo-cmp-lead {
  font-size: 1.0625rem;
}

.koongo-cmp-jump {
  margin-top: .25rem;
  font-weight: 600;
}

/* Sections */
.koongo-cmp-section h2.block-title {
  overflow-wrap: break-word;
}

.koongo-cmp-text > :last-child,
.koongo-cmp-card .card-text > :last-child,
.koongo-cmp-checklist > :last-child,
.koongo-cmp-related > :last-child {
  margin-bottom: 0;
}

.koongo-cmp-card .card-title {
  margin-bottom: .75rem;
}

.koongo-cmp-card ul,
.koongo-cmp-checklist ul,
.koongo-cmp-related ul {
  padding-left: 1.25rem;
}

/* .badge.koongo-cmp-badge beats the theme's .badge:not(.badge-light) { color: #fff } */
.badge.koongo-cmp-badge {
  margin-left: .375rem;
  padding: .25em .5em;
  border: 1px solid #f66800;
  border-radius: .25rem;
  color: #f66800;
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
}

.koongo-cmp-checklist {
  padding: 1.25rem 1.5rem;
  border-left: 3px solid #f66800;
  background: #fff;
}

.bg-secondary .koongo-cmp-checklist {
  background: #fff;
}

.koongo-cmp-text-link {
  font-weight: 600;
}

/* Step flow (e.g. Store or ERP > Integration > Marketplace) */
.koongo-flow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1.5rem;
  padding: 0;
  counter-reset: none;
}

.koongo-flow-step {
  position: relative;
  margin: .375rem 1.75rem .375rem 0;
  padding: .625rem 1rem;
  border: 1px solid #e7e7e7;
  border-radius: .25rem;
  background: #fff;
  font-weight: 600;
}

.koongo-flow-step::after {
  content: "\2192";
  position: absolute;
  top: 50%;
  right: -1.375rem;
  transform: translateY(-50%);
  color: #f66800;
}

.koongo-flow-step:last-child {
  margin-right: 0;
}

.koongo-flow-step:last-child::after {
  content: none;
}

@media (max-width: 767.98px) {
  .koongo-flow {
    flex-direction: column;
  }

  .koongo-flow-step {
    margin: 0 0 1.75rem;
    text-align: center;
  }

  .koongo-flow-step::after {
    content: "\2193";
    top: auto;
    right: auto;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Comparison and pricing tables */
.koongo-comparison-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e7e7e7;
  background: #fff;
}

.koongo-comparison-table-scroll:focus {
  outline: 2px solid #f66800;
  outline-offset: 2px;
}

.koongo-comparison-table {
  width: 100%;
  min-width: 640px;
  margin-bottom: 0;
  background: #fff;
}

.koongo-comparison-table th,
.koongo-comparison-table td {
  padding: .875rem 1rem;
  vertical-align: top;
  font-size: .9375rem;
  line-height: 1.5;
}

.koongo-comparison-table thead th {
  border-bottom: 2px solid #f66800;
  background: #fff;
  font-weight: 700;
}

.koongo-comparison-table th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 9.5rem;
  background: #f9f9f9;
  font-weight: 600;
}

.koongo-comparison-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.koongo-comparison-table td {
  min-width: 13rem;
}

/* Pricing */
.koongo-pricing-checked {
  margin-top: .75rem;
  color: #8c8c8c;
  font-size: .875rem;
}

.koongo-pricing-highlight {
  padding: 1rem 1.5rem;
  border: 1px dashed #f66800;
  border-radius: .25rem;
  background: #fff;
}

.koongo-pricing-highlight > :last-child {
  margin-bottom: 0;
}

/* Source markers in the text: pills without brackets (design "Sources Section Redesign", variant C) */
.koongo-ref {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: #fff0e5;
  color: #c45200;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: 2px;
  text-decoration: none;
  transition: background .15s;
}

.koongo-ref:hover,
.koongo-ref:focus {
  background: #ffd9bd;
  color: #c45200;
  text-decoration: none;
}

/* Collapsible Sources block */
.koongo-sources-wrap {
  max-width: 960px;
  margin: 0 auto;
}

.koongo-sources {
  overflow: hidden;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  background: #fff;
  color: #343b43;
}

.koongo-sources-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
}

.koongo-sources-summary::-webkit-details-marker {
  display: none;
}

.koongo-sources-summary:hover {
  background: #fafafa;
}

.koongo-sources-summary:focus-visible {
  outline: 2px solid #f66800;
  outline-offset: -2px;
}

.koongo-sources-title {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #343b43;
}

.koongo-sources-title::after {
  content: none;
}

.koongo-sources-count {
  padding: 3px 10px;
  border-radius: 999px;
  background: #c45200;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.koongo-sources-meta {
  flex: 1;
  min-width: 0;
  color: #5f666d;
  font-size: 13px;
}

.koongo-sources-toggle {
  color: #c45200;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.koongo-sources-toggle-show,
.koongo-sources[open] .koongo-sources-toggle-hide {
  display: inline;
}

.koongo-sources-toggle-hide,
.koongo-sources[open] .koongo-sources-toggle-show {
  display: none;
}

.koongo-sources-chevron {
  flex: none;
  color: #c45200;
  transition: transform .2s;
}

.koongo-sources[open] .koongo-sources-chevron {
  transform: rotate(180deg);
}

.koongo-sources-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 2px;
  margin: 0;
  padding: 8px 24px 24px;
  border-top: 1px solid #e7e7e7;
  list-style: none;
}

.koongo-sources-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  transition: background .3s, box-shadow .3s;
  scroll-margin-top: 6rem;
}

.koongo-sources-item:target {
  background: #fff0e5;
  box-shadow: inset 0 0 0 1px #f66800;
}

.koongo-sources-n {
  flex: none;
  width: 26px;
  color: #c45200;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.koongo-sources-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.koongo-sources-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  color: #343b43;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}

a.koongo-sources-link:hover,
a.koongo-sources-link:focus {
  color: #c45200;
  text-decoration: underline;
}

.koongo-sources-link svg {
  flex: none;
  color: #c45200;
}

.koongo-sources-domain {
  color: #5f666d;
  font-size: 12px;
}

.koongo-sources-note {
  margin-top: 12px;
  color: #5f666d;
  font-size: 13px;
}

.koongo-sources-note > :last-child {
  margin-bottom: 0;
}

@media (max-width: 767.98px) {
  .koongo-sources-summary {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 16px;
  }

  .koongo-sources-meta {
    flex-basis: 100%;
    order: 5;
  }

  .koongo-sources-toggle {
    margin-left: auto;
  }

  .koongo-sources-list {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 12px 16px;
  }
}

.koongo-cmp-section[id] {
  scroll-margin-top: 5rem;
}

/* Final CTA */
.koongo-cmp-final-links .list-inline-item:not(:last-child) {
  margin-right: 1.5rem;
}

.koongo-cmp-final-links a {
  font-weight: 600;
}

/* Compare hub */
.koongo-hub-cards .koongo-cmp-card,
.koongo-hub-topics .koongo-cmp-card {
  display: flex !important;
  flex-direction: column;
}

.koongo-hub-card-media {
  display: flex;
  align-items: center;
  height: 56px;
  margin-bottom: 1rem;
}

.koongo-hub-card-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 56px;
  object-fit: contain;
}

.koongo-hub-card-action {
  margin-top: auto;
  padding-top: .75rem;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .koongo-comparison-hero-title .page-title-heading {
    font-size: 1.875rem;
  }
}
