/**
 * Top Dog Custom Boxes — front (scoped .tdcb-*).
 */

.tdcb *,
.tdcb *::before,
.tdcb *::after {
  box-sizing: border-box;
}

.tdcb {
  --svc-radius: 16px;
  --tdcb-accent: #5b9fd4;
  --tdcb-border: rgba(91, 159, 212, 0.28);
  padding: clamp(48px, 6vw, 80px) clamp(16px, 4vw, 24px);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.tdcb__inner {
  width: 100%;
  max-width: var(--tdcb-inner-max, 1320px);
  margin: 0 auto;
}

.tdcb__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 24px);
  align-items: stretch;
}

@media (max-width: 960px) {
  .tdcb__grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }
}

/* Card */
.tdcb-card {
  --tdcb-accent: #5b9fd4;
  --tdcb-badge-bg: rgba(255, 255, 255, 0.1);
  --tdcb-badge-fg: rgba(255, 255, 255, 0.92);
  --tdcb-title: var(--tdcb-navy, #ffffff);
  --tdcb-sub: var(--tdcb-accent);
  --tdcb-body: var(--tdcb-body-text, #94a3b8);
  --tdcb-cta: var(--tdcb-accent);
  --tdcb-check: var(--tdcb-accent);
  --tdcb-surface: var(--tdcb-card-surface, #1a2438);

  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(380px, 36vw, 430px);
  border-radius: var(--svc-radius);
  background: var(--tdcb-surface);
  border: 1px solid var(--tdcb-border);
  overflow: hidden;
  isolation: isolate;
  transform-origin: center center;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease,
    border-color 0.35s ease;
}

.tdcb-card--green {
  --tdcb-accent: #5b9fd4;
}

.tdcb-card--amber {
  --tdcb-accent: #5b9fd4;
}

.tdcb-card--violet {
  --tdcb-accent: #5b9fd4;
}

.tdcb-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.5s ease,
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.tdcb-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.45s ease;
  background: linear-gradient(
    180deg,
    rgba(15, 26, 46, 0.08) 0%,
    rgba(15, 26, 46, 0.35) 45%,
    rgba(15, 26, 46, 0.82) 100%
  );
  pointer-events: none;
}

.tdcb-card__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-start;
  padding: clamp(26px, 3vw, 34px);
  min-height: 100%;
}

.tdcb-card:hover .tdcb-card__content,
.tdcb-card:focus-within .tdcb-card__content {
  justify-content: flex-end;
}

.tdcb-card__badge {
  align-self: flex-start;
  margin-bottom: 16px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tdcb-badge-fg);
  background: var(--tdcb-badge-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

.tdcb-card__title {
  margin: 0 0 10px;
  font-family: "Bebas Neue", "Barlow Condensed", sans-serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tdcb-title);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.tdcb-card__subtitle {
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tdcb-sub);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.tdcb-card__desc {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--tdcb-body);
  transition: opacity 0.35s ease, color 0.35s ease;
}

.tdcb-card__desc p {
  margin: 0;
}

.tdcb-card__list {
  margin: 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.tdcb-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--tdcb-body);
  transition: opacity 0.35s ease, color 0.35s ease;
}

.tdcb-card__check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: var(--tdcb-check);
  transition: color 0.35s ease;
}

.tdcb-card__cta {
  margin-top: 28px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: var(--tdcb-cta);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: color 0.35s ease, opacity 0.2s ease, transform 0.25s ease;
}

.tdcb-card__cta span {
  transition: transform 0.25s ease;
}

.tdcb-card__cta:hover,
.tdcb-card__cta:focus-visible {
  opacity: 0.9;
}

.tdcb-card__cta:hover span,
.tdcb-card__cta:focus-visible span {
  transform: translateX(3px);
}

.tdcb-card__cta:focus-visible {
  outline: 2px solid var(--tdcb-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Hover / focus — scale, content at bottom */
.tdcb-card:hover,
.tdcb-card:focus-within {
  transform: scale(1.04);
  border-color: rgba(91, 159, 212, 0.45);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(91, 159, 212, 0.15);
  z-index: 3;
  cursor: pointer;
}

.tdcb-card:hover .tdcb-card__image,
.tdcb-card:focus-within .tdcb-card__image {
  opacity: 1;
  transform: scale(1);
}

.tdcb-card:hover .tdcb-card__overlay,
.tdcb-card:focus-within .tdcb-card__overlay {
  opacity: 1;
}

.tdcb-card:hover,
.tdcb-card:focus-within {
  --tdcb-title: #ffffff;
  --tdcb-sub: rgba(255, 255, 255, 0.92);
  --tdcb-body: rgba(255, 255, 255, 0.88);
  --tdcb-cta: #ffffff;
  --tdcb-check: rgba(255, 255, 255, 0.95);
}

.tdcb-card:hover .tdcb-card__badge,
.tdcb-card:focus-within .tdcb-card__badge {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.tdcb-card:hover .tdcb-card__title,
.tdcb-card:focus-within .tdcb-card__title {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 4px 18px rgba(0, 0, 0, 0.35);
}

.tdcb-card:hover .tdcb-card__subtitle,
.tdcb-card:focus-within .tdcb-card__subtitle {
  margin-bottom: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.tdcb-card:hover .tdcb-card__desc,
.tdcb-card:focus-within .tdcb-card__desc,
.tdcb-card:hover .tdcb-card__list,
.tdcb-card:focus-within .tdcb-card__list {
  display: none;
}

.tdcb-card:hover .tdcb-card__cta,
.tdcb-card:focus-within .tdcb-card__cta {
  margin-top: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .tdcb-card,
  .tdcb-card__image,
  .tdcb-card__overlay,
  .tdcb-card__badge,
  .tdcb-card__title,
  .tdcb-card__subtitle,
  .tdcb-card__desc,
  .tdcb-card__list li,
  .tdcb-card__check,
  .tdcb-card__cta,
  .tdcb-card__cta span {
    transition: none;
  }

  .tdcb-card:hover,
  .tdcb-card:focus-within {
    transform: none;
  }
}
