/* =============================================================================
   Comparison Table
   Upload to: twentytwentythree/blocks/comparison-table/comparison-table.css
   ============================================================================= */

/* ── Design tokens ── */
.cct-block {
  --bg: rgba(247, 245, 241, 1);
  --surface: rgba(255, 255, 255, 1);
  --border: rgba(227, 223, 216, 1);
  --border-soft: rgba(238, 235, 229, 1);
  --ink: rgba(0, 0, 0, 1);
  --ink-2: rgba(88, 83, 76, 1);
  --ink-3: rgba(154, 149, 144, 1);
  --accent: rgba(26, 102, 66, 1);
  --accent-bg: rgba(234, 244, 238, 1);
  --accent-hover: rgba(21, 85, 54, 1);
  --accent-border: rgba(184, 222, 200, 1);
  --link: rgba(41, 118, 235, 1);
  --link-hover: rgba(29, 78, 216, 1);
  --warn: rgba(124, 58, 16, 1);
  --warn-bg: rgba(254, 240, 227, 1);
  --star-color: rgba(245, 158, 11, 1);
  --star-empty: rgba(213, 208, 202, 1);
  --dollar-on: rgba(0, 0, 0, 1);
  --dollar-off: rgba(142, 140, 134, 1);
  --ff-display: "Fraunces", Georgia, serif;
  --ff-body: "DM Sans", system-ui, sans-serif;
  --ease: 160ms ease;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --sh-card: 0 1px 2px rgba(24, 22, 15, 0.05), 0 4px 18px rgba(24, 22, 15, 0.07);
  font-family: var(--ff-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  --grid-columns: 1.5fr 1.45fr 1.05fr 1fr;
  --fs-small: 12px;
}

/* ── Inner wrapper ── */
.cct-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

/* ── Section header ── */
.cct-header {
  margin-bottom: 32px;
}



/* ── Controls ── */
.cct-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cct-meta {
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.cct-meta strong {
  color: var(--ink);
}
.cct-sort-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-small);
  color: var(--ink-2);
}
.cct-sort-btn {
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-family: var(--ff-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--ease);
}
.cct-sort-btn:hover,
.cct-sort-btn.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.cct-sort-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Table chrome ── */
.cct-table {
  border: 2px solid rgba(217, 230, 243, 1);
  overflow: hidden;
}

/* ── Column headers ── */
.cct-thead {
  display: grid;
  grid-template-columns: var(--grid-columns);
  padding: 0 10px;
  background: rgba(244, 248, 251, 1);
  border-bottom: 2px solid rgba(217, 230, 243, 1);
}
.cct-th {
  padding: 5px 0;
  font-size: 14px;
  font-weight: 900;
  color: rgba(0, 0, 0, 1);
}
/* .cct-th:last-child { 
  text-align: right; 
} */

/* ── Row ── */
@keyframes cct-row-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.cct-row {
  display: grid;
  grid-template-columns: var(--grid-columns);
  padding: 0 10px;
  border-bottom: 2px solid rgba(217, 230, 243, 1);
  align-items: center;
}
.cct-row:last-child {
  border-bottom: none;
}

/* Top-ranked row accent */
.cct-row--top {
  background: rgba(255, 255, 255, 1);
  position: relative;
}

.cct-company {
  padding: 20px 0;
}
.cct-company-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Name row: rank number · linked name · claimed badge */
.cct-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cct-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

/* Company name as a blue link — matches mock */
.cct-name-link {
  font-size: 14px;
  font-weight: 600;
  color: rgba(41, 118, 235, 1) !important;
  text-decoration: none;
  line-height: 1.25;
}
.cct-name-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}
.cct-name-link:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Logo — sits below the name row */
.cct-logo {
  display: flex;
  align-items: center;
}
.cct-logo img {
  max-width: 160px;
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.cct-logo--fallback {
  width: 56px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Claimed badge ── */
.cct-claimed {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px 2px 5px;
  background: rgba(238, 247, 255, 1);
  font-size: 10px;
  font-weight: 600;
  color: rgba(41, 118, 235, 1);
  position: relative;
  cursor: pointer;
  white-space: wrap;
  outline: none;
}
.cct-claimed:hover {
  background: rgba(238, 247, 255, 0.1);
}
.cct-claimed:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cct-claimed-tip {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  width: 260px;
  font-size: var(--fs-small);
  font-weight: 400;
  line-height: 1.55;
  padding: 10px 13px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity var(--ease), transform var(--ease);
  z-index: 50;
  background-color: rgb(255, 255, 255);
  border: 1px solid var(--link);
  box-shadow: rgba(100, 102, 106, 0.15) 0px 4px 8px 0px,
    rgba(100, 102, 106, 0.33) 0px 8px 16px 0px;
  color: rgb(0, 0, 0);
}

/* Border layer of arrow */
.cct-claimed-tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 14px;
  border: 6px solid transparent;
  border-bottom-color: var(--link);
}
/* White fill layer — sits 1px lower, covers the border */
.cct-claimed-tip::after {
  content: "";
  position: absolute;
  bottom: calc(100% - 1px);
  left: 15px;
  border: 5px solid transparent;
  border-bottom-color: #fff;
}

.cct-claimed:hover .cct-claimed-tip,
.cct-claimed:focus .cct-claimed-tip {
  opacity: 1;
  transform: translateY(0);
}

/* ── Summary line (market • year • $score) ── */
.cct-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  font-size: var(--fs-small);
  color: var(--ink);
  font-weight: 600;
}
.cct-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cct-summary-item svg {
  color: var(--ink-3);
}
.cct-summary-sep {
  margin: 0 6px;
  color: var(--ink);
  font-size: 10px;
}

/* Dollar score */
.cct-dollars {
  display: inline-flex;
  gap: 1px;
  align-items: center;
}
.cct-dollar {
  font-size: var(--fs-small);
  font-weight: 900;
  line-height: 1;
}
.cct-dollar--on {
  color: var(--dollar-on);
}
.cct-dollar--off {
  color: var(--dollar-off);
  font-weight: 400;
}

/* ── Generic cell ── */
.cct-cell {
  padding: 20px 0;
}
.cct-cell-label {
  display: none;
} /* desktop: hidden, shown on mobile */

/* ── Rating ── */
.cct-rating {
  display: flex;
  gap: 5px;
  align-items: center;
}
.cct-stars-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}
.cct-stars {
  display: flex;
  gap: 2px;
}
.cct-star-svg {
  color: var(--star-color);
}
.cct-star-svg--empty {
  color: var(--star-empty);
}
.cct-rating-score {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
}
.cct-rating-count {
  font-size: 20px;
  color: rgba(102, 102, 102, 1);
}
.cct-rating-none {
  font-size: 16px;
  color: var(--ink-3);
  font-style: italic;
}

/* ── Fee ── */
.cct-fee-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cct-fee-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.cct-fee-value--unverified {
  font-size: 11px;
  font-weight: 500;
  color: var(--warn);
  background: var(--warn-bg);
  padding: 2px 8px;
  border-radius: 20px;
}
.cct-fee-na {
  font-size: var(--fs-small);
  color: var(--ink-3);
  font-style: italic;
}

/* Fee info tooltip trigger */
.cct-info-trigger {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  color: var(--ink-3);
  position: relative;
  cursor: pointer;
}
.cct-info-trigger:focus {
  outline: none;
}
.cct-info-trigger:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 2px;
  outline-offset: 2px;
}
.cct-info-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(3px);
  width: 210px;
  font-size: var(--fs-small);
  line-height: 1.55;
  padding: 10px 13px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 50;
  text-align: left;
  white-space: normal;
  background-color: rgb(255, 255, 255);
  border: 1px solid rgb(177, 179, 181);
  box-shadow: rgba(100, 102, 106, 0.15) 0px 4px 8px 0px,
    rgba(100, 102, 106, 0.33) 0px 8px 16px 0px;
  color: rgb(0, 0, 0);
}

/* Border layer of arrow */
.cct-info-tip::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 47.5%;
  transform: translateX(-47.5%);
  border: 6px solid transparent;
  border-bottom-color: var(--link);
  rotate: 180deg;
}
/* White fill layer — sits 1px lower, covers the border */
.cct-info-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  border: 5px solid transparent;
  border-bottom-color: #fff;
  rotate: 180deg;
}

.cct-info-trigger:hover .cct-info-tip,
.cct-info-trigger[aria-expanded="true"] .cct-info-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── CTA column ── */
.cct-cta {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Primary button — blue matching mock */
.cct-btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: var(--link);
  color: #fff !important;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease), transform var(--ease),
    box-shadow var(--ease);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.cct-btn--primary:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}
.cct-btn--primary:active {
  transform: none;
  box-shadow: none;
}
.cct-btn--primary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

/* Review button — outlined blue */
.cct-btn--review {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  background: var(--surface);
  color: var(--link) !important;
  border: 1px solid var(--link);
  border-radius: var(--r-md);
  font-family: var(--ff-body);
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--ease), transform var(--ease);
  font-size: 14px;
  font-weight: 700;
}
.cct-btn--review:hover {
  background: #eff6ff;
  transform: translateY(-1px);
}
.cct-btn--review:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
}

/* Secondary plain link */
.cct-link--secondary {
  font-size: 14px;
  font-weight: 600;
  color: rgba(102, 102, 102, 1) !important;
  text-decoration: none;
  /* border-bottom: 1px solid transparent; */
  transition: color var(--ease), border-color var(--ease);
  text-align: center;
}
.cct-link--secondary:hover {
  color: var(--ink);
  border-color: var(--ink-3);
  text-decoration: underline;
}
.cct-link--secondary:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 2px;
  outline-offset: 2px;
}




@media (max-width: 880px) {

  .cct-rating-score,
  .cct-rating-count,
  .cct-fee-value {
    font-size:16px;
  }
}

/* ── Mobile ≤ 776px ── */
@media (max-width: 776px) {
  .cct-inner {
    padding: 36px 16px 60px;
  }
  .cct-thead {
    display: none;
  }

  .cct-table {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .cct-claimed-tip::after {
    display: none;
  }
  .cct-row {
    display: flex;
    flex-direction: column;
    padding: 0;
    border-left: 2px solid rgba(217, 230, 243, 1);
    border-right: 2px solid rgba(217, 230, 243, 1);
    border-bottom:2px solid rgba(217, 230, 243, 1);
    overflow: hidden;
    text-align: center;
    padding:15px 0;
  }

   .cct-row:first-child {
    border-top:2px solid rgba(217, 230, 243, 1);
  }

  .cct-row:last-child {
    border-bottom:2px solid rgba(217, 230, 243, 1);
  }


  .cct-company {
    padding: 16px 16px 14px;
    border-bottom: 1px solid var(--border-soft);
  }
  .cct-company-body {
    align-items: center;
  }

  .cct-cell {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-soft);
  }
  .cct-cell:last-child {
    border-bottom: none;
  }

  .cct-cell-label {
    display: block;
    font-size: 14px;
    font-weight: 900;

    color: rgba(0, 0, 0, 1);
    margin-bottom: 5px;
  }

  .cct-cta {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    padding: 13px 16px;
    border-top: 1px solid var(--border-soft);
  }

  .cct-claimed-tip {
    left: auto;
    right: 0;
  }
  .cct-claimed-tip::before {
    left: auto;
    right: 14px;
  }

  .cct-info-tip {
   transform: translateX(-50%) translateY(3px);
   left:-50%;
   transition: unset;
   /* opacity: 1; */
  }

  .cct-info-tip::before {
    display: none;
  }

}



/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .cct-row,
  .cct-btn--primary,
  .cct-btn--review,
  .cct-link--secondary,
  .cct-claimed-tip,
  .cct-info-tip {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Editor preview ── */
.cct-block--preview {
  pointer-events: none;
}
