/* Market Watch — the news-specific pieces on top of market-dashboard.css (the Market
   Index design system). Tokens (--mi-*, --elev, --ease-out, --spring) come from the
   shared sheet, so everything here sits inside .mi and follows its motion opt-in:
   the .mi-reveal rules only hide an element when JS added html.mi-motion. */

/* ── Slim hero banner (about 200px on desktop) ──────────────────────── */
.mi .mw-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 32px; margin-top: 16px; padding: 24px clamp(20px, 3.5vw, 44px); border-radius: 28px; }
.mw-hero-main { min-width: 0; }
.mw-hero .mi-kicker { font-size: 11px; }
.mi .mw-hero h1 { margin: 10px 0 0; font-size: clamp(28px, 3.4vw, 44px); line-height: 1.06; letter-spacing: -.04em; }
[dir=rtl] .mi .mw-hero h1 { letter-spacing: 0; line-height: 1.25; }
.mw-hero-side { display: grid; justify-items: end; gap: 12px; min-width: 0; }
.mw-hero .mi-cta { margin: 0; gap: 10px; }
.mw-hero .mi-btn { min-height: 40px; padding: 0 16px; font-size: 13px; }
.mw-hero .mi-status { padding: 7px 14px; }
@media (max-width: 860px) {
  .mi .mw-hero { grid-template-columns: 1fr; padding: 20px; }
  .mw-hero-side { display: flex; flex-wrap: wrap; align-items: center; justify-items: start; gap: 10px 12px; }
  .mw-hero .mi-btn:not(.primary) { display: none; } /* "Find a property" stays in the About card */
}
@media (max-width: 640px) {
  .mi .mw-hero { padding: 18px; }
  .mw-hero .mi-cta { display: none; } /* the calculator link lives in the About card on phones */
  .mi .mw-hero h1 { margin-top: 8px; font-size: clamp(24px, 7vw, 30px); }
}

/* ── Filters ────────────────────────────────────────────────────────── */
.mw-topic .mi-seg button small { margin-inline-start: 7px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .7; }
/* Placeholders match the real controls' height so building them causes no layout shift. */
#mw-topic-host > .mi-skel, #mw-source-host > .mi-skel { min-height: 0; margin: 0; }
#mw-topic-host > .mi-skel { width: min(100%, 340px); height: 54px; border-radius: 999px; }
#mw-source-host > .mi-skel { height: 52px; border-radius: 16px; }
.mw-f-source { flex: 0 1 280px; }
.mw-f-search { flex: 1 1 260px; }
.mw-search { position: relative; }
.mw-search input { width: 100%; height: 52px; padding-block: 0; padding-inline: 46px 16px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface-inset); color: var(--ink); font: 600 16px/1 var(--font-body); -webkit-appearance: none; appearance: none; transition: border-color .2s, box-shadow .2s, background .2s; }
.mw-search input::placeholder { color: var(--muted); font-weight: 500; opacity: 1; }
.mw-search input:hover { border-color: var(--ink-soft); }
.mw-search input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 26%, transparent); background: var(--paper); }
.mw-search svg { position: absolute; inset-inline-start: 16px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.mw-count { min-height: 22px; margin: 22px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }

/* ── Story cards ────────────────────────────────────────────────────── */
.mw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 20px; margin: 20px 0; }
.mw-skel { min-height: 214px; border-radius: 26px; }
.mw-grid { transition: opacity .2s; }
.mw-grid.mw-loading { opacity: .5; }
.mw-story { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: var(--paper); box-shadow: var(--elev); color: var(--ink); text-decoration: none; transition: transform .5s var(--ease-out), border-color .3s, box-shadow .3s; }
.mw-story:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: var(--elev), 0 18px 40px -22px var(--mi-glow); }
.mw-story:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.mw-story img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; flex: none; }
.mw-story-body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 20px; }
.mw-tag { align-self: flex-start; }
.mw-tag.re { background: var(--brand-soft); color: var(--brand-ink); }
.mw-story h3 { margin: 14px 0 0; font-size: 17px; font-weight: 700; line-height: 1.45; letter-spacing: -.015em; }
.mw-story p { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.mw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; font-size: 12px; color: var(--muted); }
.mw-foot > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.mw-out { display: inline-flex; flex: none; align-items: center; gap: 5px; font-weight: 700; color: var(--ink-soft); transition: color .2s; }
.mw-out svg { width: 15px; height: 15px; transition: transform .35s var(--ease-out); }
[dir=rtl] .mw-out svg { scale: -1 1; }
.mw-story:hover .mw-out { color: var(--brand-ink); }
.mw-story:hover .mw-out svg { transform: translate(2px, -2px); }
[dir=rtl] .mw-story:hover .mw-out svg { transform: translate(-2px, -2px); }
.mw-empty { grid-column: 1 / -1; margin: 6px 0; padding: 28px; border: 1px dashed var(--line-strong); border-radius: 26px; text-align: center; color: var(--muted); font-size: 14px; }
.mw-empty p { margin: 0 0 14px; }

/* ── Pager ──────────────────────────────────────────────────────────── */
.mw-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; margin: 26px 0 8px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.mw-pager .mi-btn { min-height: 48px; }
.mw-pager .mw-prev:hover:not([disabled]) svg { transform: translateX(-3px); }
[dir=rtl] .mw-pager .mw-prev:hover:not([disabled]) svg { transform: translateX(3px); }

/* ── About ──────────────────────────────────────────────────────────── */
#mw-publishers:empty { display: none; }
.mw-links { display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 8px 0 0; }

/* ── Small screens ──────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .mw-topic, .mw-f-source, .mw-f-search { flex: 1 1 100%; }
  .mw-topic .mi-seg { display: flex; width: 100%; }
  .mw-topic .mi-seg button { flex: 1 1 0; min-width: 0; padding: 6px 8px; line-height: 1.25; white-space: normal; }
  .mw-topic .mi-seg button small { display: block; margin: 2px 0 0; }
  .mw-story-body { padding: 20px; }
}
