/* ============================================================
   home.css — Homepage-specific styles (UX v1.1)
   Extends style.css. Uses TSC Brand System v1.1 tokens.
   ============================================================ */

/* ---------- 1. Hero: two-column split layout ---------- */
.hero--split {
  padding-block: 5rem 5.5rem;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__copy {
  max-width: 560px;
}

.hero__copy h1 {
  margin-bottom: 1.25rem;
}

.hero__copy .hero-sub {
  margin-bottom: 2rem;
}

/* Hero CTA button group */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

/* Outline button variant (BEM modifier) */
.btn--outline {
  background: transparent;
  color: var(--tsc-primary);
  border: 2px solid var(--tsc-primary);
  box-shadow: none;
}
.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--tsc-primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

/* Larger CTA button on hero */
.btn--lg {
  font-size: 1rem;
  padding: 0.8rem 1.8rem;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

/* ---------- 2. Trust strip ---------- */
.trust-strip {
  background: var(--tsc-primary-soft);
  border-bottom: 1px solid var(--tsc-primary-border);
  padding-block: 0.75rem;
}

.trust-strip__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--tsc-primary-soft);
  border: 1px solid var(--tsc-primary-border);
  color: var(--tsc-primary);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.trust-badge svg {
  flex-shrink: 0;
}

/* ---------- 3. Hero visual: stacked mini-cards ---------- */
.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-card-stack {
  position: relative;
  width: 280px;
  height: 220px;
}

.hc {
  position: absolute;
  background: var(--tsc-bg);
  border: 1px solid var(--tsc-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  width: 240px;
}

.hc__icon {
  flex-shrink: 0;
  color: var(--tsc-primary);
}

.hc__label {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--tsc-text);
  flex: 1;
}

.hc__score {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--tsc-primary);
  white-space: nowrap;
}

.hc--1 { top: 0;    left: 20px; z-index: 3; }
.hc--2 { top: 72px; left: 0;    z-index: 2; opacity: 0.92; }
.hc--3 { top: 144px;left: 20px; z-index: 1; opacity: 0.82; }

/* ---------- 4. Category cards — fully clickable ---------- */
.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--tsc-bg);
  border: 1px solid var(--tsc-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--tsc-transition),
              transform var(--tsc-transition),
              border-color var(--tsc-transition);
}

.cat-card:hover,
.cat-card:focus-visible {
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.13);
  transform: translateY(-3px);
  border-color: var(--tsc-primary);
  text-decoration: none;
  color: inherit;
}

.cat-card:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.cat-card__icon {
  margin-bottom: 0.75rem;
  color: var(--tsc-primary);
}

.cat-card__icon svg {
  display: block;
}

.cat-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tsc-text);
  margin-bottom: 0.5rem;
}

.cat-card__desc {
  font-size: 0.9375rem;
  color: var(--tsc-muted);
  flex: 1;
  margin-bottom: 1rem;
  max-width: none;
}

.cat-card__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tsc-primary);
}

.cat-card:hover .cat-card__cta {
  text-decoration: underline;
}

/* ---------- 5. Review list — coloured category tags ---------- */
.tag--automation {
  background: #eff6ff;
  border-color: var(--tsc-primary-border);
  color: var(--tsc-primary);
}

.tag--seo {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.tag--hosting {
  background: #fdf4ff;
  border-color: #e9d5ff;
  color: #7e22ce;
}

.review-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

/* ---------- 6. Comparison table — card wrapper + scroll hint ---------- */
.table-card {
  background: var(--tsc-bg);
  border: 1px solid var(--tsc-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.table-card .table-wrap {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  /* scroll hint: right-edge gradient on mobile */
  position: relative;
}

.table-card .table-note {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--tsc-border);
  background: var(--tsc-surface);
  margin-bottom: 0;
  font-size: 0.85rem;
  color: var(--tsc-muted);
}

/* Striped rows */
tbody tr:nth-child(even) td {
  background: var(--tsc-surface);
}

/* Recommended row */
tr.row-recommended td {
  background: #f0f7ff;
}
tr.row-recommended:hover td {
  background: var(--tsc-primary-soft);
}

/* ---------- 7. Comparison table rows — hover tint ---------- */
.table-card tbody tr {
  transition: background var(--tsc-transition);
  cursor: default;
}

.table-card tbody tr:hover td {
  background: var(--tsc-primary-soft);
}

/* ---------- 8. Prose "Learn more" link ---------- */
.prose-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tsc-primary);
  text-decoration: none;
  transition: color var(--tsc-transition);
}
.prose-link:hover {
  text-decoration: underline;
  color: var(--tsc-primary-dark);
}

/* ---------- 9. Footer affiliate disclosure ---------- */
.footer-disclosure {
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--tsc-muted);
  max-width: 38ch;
}

/* ---------- 10. Typography refinements ---------- */
body {
  font-size: var(--tsc-body-size);
  line-height: var(--tsc-body-leading);
}

.section-intro {
  font-size: 1.0625rem;
}

/* ---------- 11. Mobile responsiveness ---------- */

/* Tablet: 2-col hero, 2-col cards */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero__copy {
    max-width: 100%;
  }

  .hero__visual {
    justify-content: flex-start;
  }

  .card-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: single column everything */
@media (max-width: 600px) {
  .hero--split {
    padding-block: 3rem 3.5rem;
  }

  .hero-card-stack {
    width: 100%;
    max-width: 300px;
  }

  .card-grid--3 {
    grid-template-columns: 1fr;
  }

  /* Disable hover lift on touch */
  @media (hover: none) {
    .cat-card:hover {
      transform: none;
      box-shadow: none;
      border-color: var(--tsc-border);
    }
    .btn:hover {
      transform: none;
      box-shadow: none;
    }
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .footer-legal {
    text-align: left;
  }

  /* Table horizontal scroll on mobile */
  .table-card {
    overflow: visible;
  }

  .table-card .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Gradient scroll hint on right edge */
    background-image: linear-gradient(to right, transparent 85%, rgba(37,99,235,0.06) 100%);
    background-attachment: local;
  }

  /* Nav toggle */
  .nav-toggle {
    display: block;
  }

  .primary-nav {
    display: none;
    width: 100%;
    order: 3;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    flex-direction: column;
    gap: 0;
    padding-block: var(--space-xs);
  }

  .primary-nav ul li a {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--tsc-border);
  }

  .header-inner {
    flex-wrap: wrap;
  }
}

/* Disable hover effects on touch devices globally */
@media (hover: none) {
  .cat-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--tsc-border);
  }
  .btn:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
  }
}

/* ---------- 12. AOE / semantic helpers ---------- */
.section > .container > h2,
.section > .container > .container-prose > h2 {
  scroll-margin-top: 5rem;
}
