.hero {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-white) 100%);
  padding-block: var(--space-16) var(--space-12);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  align-items: center;
  gap: var(--space-10);
}

.hero__content h1 {
  margin-bottom: var(--space-4);
}

.hero__subheading {
  font-size: var(--fs-md);
  max-width: 46ch;
  margin-bottom: var(--space-6);
}

.hero__search {
  display: flex;
  gap: var(--space-2);
  max-width: 560px;
  margin-bottom: var(--space-4);
}

.hero__search .search-field {
  flex: 1;
}

.hero__trending {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
}

.hero__trending-label {
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
  margin-right: var(--space-1);
}

.hero__trending a {
  color: var(--color-secondary);
  background: rgba(25, 118, 210, 0.08);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-weight: var(--fw-medium);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.hero__trending a:hover {
  background: rgba(25, 118, 210, 0.16);
}

.hero__trending-more { color: var(--color-text-muted) !important; background: none !important; }

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.hero__visual img,
.hero__visual svg {
  width: 100%;
  max-width: 520px;
}

@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  /* The real fix for the mobile overflow: grid items default to
     min-width: auto, which for a replaced element (the hero image)
     locks in its intrinsic 640px width as a floor, preventing the
     image from actually shrinking to fit a narrow viewport even
     though its own CSS says width:100%. Confirmed via a real browser
     measurement: .hero__visual was rendering 415px wide inside a
     375px viewport before this fix — a genuine 40px overflow, not
     a cosmetic issue. */
  .hero__content,
  .hero__visual {
    min-width: 0;
  }

  .hero__subheading { margin-inline: auto; }
  .hero__search { margin-inline: auto; }
  .hero__trending { justify-content: center; }
  .hero__visual { order: -1; margin-bottom: var(--space-6); }
}

@media (max-width: 480px) {
  .hero__search { flex-direction: column; }
}

/* ---- Dark hero variant (new wireframe) ---- */
.hero--dark {
  background: linear-gradient(135deg, var(--color-hero-dark-1) 0%, var(--color-hero-dark-2) 100%);
  padding-block: var(--space-20) var(--space-16);
}

.hero--dark h1 {
  color: var(--color-white);
  max-width: 20ch;
}

.hero--dark .hero__subheading {
  color: rgba(255, 255, 255, 0.75);
}

.hero--dark .hero__search .search-field--hero input {
  border: none;
}

.hero--dark .hero__trending-label {
  color: rgba(255, 255, 255, 0.9);
}

.hero--dark .hero__trending a {
  color: rgba(255, 255, 255, 0.65);
}

.hero--dark .hero__trending a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-white);
}

.hero--dark .hero__visual img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

@media (max-width: 1024px) {
  .hero--dark { padding-block: var(--space-12) var(--space-10); }
}

/* ---- Heading highlight (two-tone hero heading, matching wireframe) ---- */
.hero__heading-highlight { color: var(--color-secondary); }

/* ---- Hero search field: proper size + icon + filter button (the
   old rules for this only existed under the removed dark variant,
   so this was silently falling back to plain default form-field
   sizing — too small/plain next to the wireframe's prominent bar). ---- */
.search-field--hero {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  flex: 1;
}
.search-field--hero .search-field__icon {
  position: static;
  padding-left: var(--space-3);
  display: flex;
  align-items: center;
}
.search-field--hero input {
  border: none !important;
  padding: var(--space-3) var(--space-2) !important;
  font-size: var(--fs-md) !important;
}
.search-field--hero input:focus { outline: none; }
.search-field__filter {
  background: none;
  border: none;
  border-left: 1px solid var(--color-border-soft);
  padding: 0 var(--space-3);
  color: var(--color-text-muted);
  cursor: pointer;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.search-field__filter:hover { color: var(--color-secondary); }

/* ---- Heading size: bigger and allowed to wrap across 3 lines,
   matching the wireframe's proportions more closely. ---- */
.hero__content h1 {
  font-size: var(--fs-5xl, 3.75rem);
  line-height: 1.1;
  max-width: 480px;
}
