/**
 * Top Dog tabs — matches hero / how-it-works typography & width.
 */

.tdtabs-root {
  --tdtabs-navy: #0f1a2e;
  --tdtabs-accent: #0f1a2e;
  --tdtabs-tab-bar: #e8eaef;
  --tdtabs-tab-inactive: #4a5568;
  --tdtabs-body: #6b7280;
  --tdtabs-badge-bg: #eef1f5;
  --tdtabs-badge-text: #5c6570;
  --tdtabs-max: 1320px;
  width: 100%;
}

.tdtabs-root *,
.tdtabs-root *::before,
.tdtabs-root *::after {
  box-sizing: border-box;
}

.tdtabs {
  padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 24px);
  background: #fff;
}

.tdtabs__inner {
  width: 100%;
  max-width: var(--tdtabs-max);
  margin: 0 auto;
}

/* Pill tab bar — light gray track, left-aligned tabs */
.tdtabs__bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 6px;
  margin: 0 0 clamp(24px, 4vw, 36px);
  border-radius: 999px;
  background: var(--tdtabs-tab-bar);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tdtabs__tab {
  font-family: "DM Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  padding: 12px 22px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--tdtabs-tab-inactive);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
  touch-action: manipulation;
}

.tdtabs__tab:hover {
  color: var(--tdtabs-navy);
}

.tdtabs__tab--active,
.tdtabs__tab[aria-selected="true"] {
  background: var(--tdtabs-navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 26, 46, 0.2);
}

.tdtabs__tab:focus-visible {
  outline: 2px solid var(--tdtabs-accent);
  outline-offset: 2px;
}

.tdtabs__panel {
  display: none;
}

.tdtabs__panel--active {
  display: block;
  animation: tdtabs-fade 0.35s ease;
}

.tdtabs__panel[hidden] {
  display: none !important;
}

@keyframes tdtabs-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tdtabs__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 24px);
  align-items: stretch;
}

.tdtabs__card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  padding: clamp(20px, 3vw, 26px) clamp(18px, 3vw, 24px);
  border: 1px solid rgba(15, 26, 46, 0.08);
  box-shadow: 0 4px 24px rgba(15, 26, 46, 0.06);
  transition: box-shadow 0.25s ease;
}

.tdtabs__card:hover {
  box-shadow: 0 8px 32px rgba(15, 26, 46, 0.1);
}

.tdtabs__card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tdtabs__card-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  font-size: 42px;
  line-height: 1.15;
  color: var(--tdtabs-accent);
  letter-spacing: 0.01em;
}

.tdtabs__badge {
  flex-shrink: 0;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tdtabs-badge-text);
  background: var(--tdtabs-badge-bg);
  padding: 7px 11px;
  border-radius: 999px;
}

.tdtabs__card-body {
  flex: 1 1 auto;
  font-family: "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--tdtabs-body);
  margin: 0;
}

.tdtabs__card-body p {
  margin: 0 0 0.75em;
}

.tdtabs__card-body p:last-child {
  margin-bottom: 0;
}

.tdtabs__card-cta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35em;
  margin-top: auto;
  padding-top: 1rem;
  font-family: "DM Sans", sans-serif;
  font-style: normal;
  font-weight: 600;
  font-size: 14px;
  line-height: 16px;
  color: #004a7c !important;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.tdtabs__card-cta:hover,
.tdtabs__card-cta:focus-visible {
  color: rgb(50, 120, 200);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tdtabs__card-cta:focus-visible {
  outline: 2px solid rgb(74, 144, 217);
  outline-offset: 2px;
}

.tdtabs__card-cta__arrow {
  flex-shrink: 0;
  margin-left: 0.05em;
}

@media (max-width: 900px) {
  .tdtabs__grid {
    grid-template-columns: 1fr;
  }

  .tdtabs__bar {
    width: 100%;
    justify-content: flex-start;
  }

  .tdtabs__tab {
    flex: 1 1 auto;
    min-width: min(100%, 140px);
    text-align: center;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tdtabs__panel--active {
    animation: none;
  }
}
