/* =========================================================================
   homepage.css
   Homepage hero + the shared visual language for search box, sidebar widgets,
   trending list and the news-card grid reveal. (Widget styles live here since
   they appear across the home and listing pages.)
   ========================================================================= */

/* ---- Hero ---- */
.home__hero { margin-bottom: var(--sp-7); }
.hero-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 900px) {
  .hero-wrap { grid-template-columns: 1.7fr 1fr; }
}

.hero {
  position: relative;
  display: block;
  min-height: 420px;
  border-radius: var(--r-lg);
  overflow: hidden;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(20,17,15,.92) 0%, rgba(20,17,15,.45) 45%, rgba(20,17,15,.05) 100%);
}
.hero__content {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: var(--sp-6);
  color: #fff;
}
.hero__cat {
  display: inline-block; background: var(--signal); color: #fff;
  font-weight: 800; font-size: .8rem; letter-spacing: .04em;
  padding: 4px 12px; border-radius: 2px; margin-bottom: var(--sp-3);
}
.hero__title {
  font-size: clamp(1.8rem, 3.4vw, 3rem); font-weight: 900; color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,.4); max-width: 22ch;
}
.hero__summary { margin-top: var(--sp-3); max-width: 52ch; color: #efe9df; }
.hero__cta {
  display: inline-block; margin-top: var(--sp-4);
  font-weight: 800; color: #fff; border-bottom: 2px solid var(--signal);
  padding-bottom: 2px;
}
.hero:hover .hero__title { transform: translateY(-2px); }
.hero__title { transition: transform .3s ease; }

.hero-side { display: grid; gap: var(--sp-4); align-content: start; }

/* ---- Search box ---- */
.search { display: flex; align-items: stretch; }
.search__input {
  border: 2px solid var(--line-2);
  border-inline-end: none;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 8px 12px;
  font-family: var(--body); font-size: .95rem;
  width: 200px; background: var(--card); color: var(--ink);
  transition: border-color .18s, width .25s;
}
.search__input:focus { outline: none; border-color: var(--signal); width: 230px; }
.search__btn {
  border: 2px solid var(--line-2);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
  background: var(--ink); color: #fff;
  padding: 0 14px; font-size: 1.2rem; line-height: 1;
  transition: background .18s;
}
.search__btn:hover { background: var(--signal); }

/* ---- Sidebar + widgets ---- */
.sidebar { display: grid; gap: var(--sp-5); }
.widget {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.widget__title {
  font-family: var(--body); font-weight: 800; font-size: 1rem;
  letter-spacing: .02em; margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--ink);
}

/* Weather */
.weather__row { display: flex; align-items: center; gap: var(--sp-3); }
.weather__icon { font-size: 2.6rem; line-height: 1; }
.weather__temp { font-family: var(--display); font-weight: 900; font-size: 2rem; }
.weather__info { display: flex; flex-direction: column; }
.weather__desc { color: var(--muted); }
.weather__city {
  display: inline-block; margin-top: var(--sp-3); font-weight: 700;
  color: var(--accent);
}

/* Stocks */
.stocks__list { list-style: none; margin: 0; padding: 0; }
.stocks__row {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: var(--sp-3); align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-variant-numeric: tabular-nums;
}
.stocks__row:last-child { border-bottom: none; }
.stocks__name { font-weight: 700; }
.stocks__price { color: var(--ink-2); }
.stocks__chg { font-weight: 800; font-size: .9rem; }
.stocks__row--up   .stocks__chg { color: #1a8a3c; }
.stocks__row--down .stocks__chg { color: var(--signal); }
.stocks__row--flat .stocks__chg { color: var(--muted); }

/* Trending list */
.trending__list { list-style: none; margin: 0; padding: 0; }
.trending__item { border-bottom: 1px solid var(--line); }
.trending__item:last-child { border-bottom: none; }
.trending__link {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) 0; transition: transform .15s;
}
.trending__link:hover { transform: translateX(-3px); }
.trending__rank {
  font-family: var(--display); font-weight: 900; font-size: 1.4rem;
  color: var(--signal); min-width: 1.4em; line-height: 1;
}
.trending__text { display: flex; flex-direction: column; gap: 2px; }
.trending__title { font-weight: 700; line-height: 1.3; }
.trending__city { font-size: .82rem; color: var(--muted); }
