/* News hub (Phase 7b; audit and search fixes). The reference's structure (1300px container, a
   4-column grid with 24px gaps, 8px card corners) in TWW's own colours and
   fonts. No divider lines, no cream backgrounds. */
.hub { max-width: 1340px; margin: 0 auto; padding: 8px 20px 80px; }
.hub-hero-intro { padding-bottom: 8px; }

/* Topic chips: one readable colour pair per topic (contrast 4.5:1 or more). */
.hub-chip { display: inline-block; max-width: 100%; padding: 1px 6px; border-radius: 4px; background: #f5f5f3; color: #4f4b43; font-size: .72rem; font-weight: 600; letter-spacing: .04em; line-height: 1.5; text-transform: uppercase; overflow-wrap: anywhere; }
.hub-chip--tariffs { background: #eeedfe; color: #3430d2; }
.hub-chip--free-trade-agreements { background: #e8f3dc; color: #2e5c0a; }
.hub-chip--export-controls { background: #fdecea; color: #8b2020; }
.hub-chip--customs { background: #e3edfb; color: #0d4e8a; }
.hub-chip--trade-outlook { background: #fef3e2; color: #7a4a08; }
.hub-meta { margin: 6px 0 0; color: var(--ink-3); font-size: .8125rem; overflow-wrap: anywhere; }
.hub-meta span + time::before { content: "\00B7"; margin: 0 6px; }

/* Media: fixed ratio boxes; a tile with the News icon when there is no image. */
.hub-media { position: relative; overflow: hidden; border-radius: 8px; aspect-ratio: 1.38 / 1;
  /* The News icon (Lucide bell) shows until the image arrives, and stays if it
     never does: a tile is never blank grey. */
  background: #eeedfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24' fill='none' stroke='%234743f9' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.268 21a2 2 0 0 0 3.464 0'/%3E%3Cpath d='M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326'/%3E%3C/svg%3E") center / 48px no-repeat; }
.hub-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.hub-media__fallback { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--accent); background: var(--accent-soft); }
.hub-media > .hub-chip { position: absolute; top: 12px; left: 12px; background-color: #fff; }
.hub-media > .hub-chip[class*="hub-chip--"] { box-shadow: 0 0 0 1px rgba(0, 0, 0, .04); }

/* Search: its own block, clearly below the section tabs. One large bar with
   the button inside it, one row of topic chips with a Filters panel, then the
   active filters as removable chips. */
.hub-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 36px 0 8px; }
/* White pill, thin hairline. The Search button is inset on the top, right
   and bottom; its radius is the pill radius minus that inset and the border. */
.hub-search__bar {
  --hub-search-inset: 6px;
  --hub-search-radius: 999px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  min-height: 60px;
  margin: 0;
  padding: var(--hub-search-inset);
  padding-inline-start: 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--hub-search-radius);
  background: #fff;
  color: var(--ink-3);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
/* One ring, the same radius as the pill, drawn outside the border so it
   does not cross the button. The input must not draw its own. */
.hub-search__bar:hover { background: #fff; border-color: var(--hairline-strong); }
.hub-search__bar:focus-within,
.hub-search__bar:focus-within:hover {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.hub-search__bar .tww-icon { flex: none; width: 20px; height: 20px; }
.hub-search__bar input {
  flex: 1;
  align-self: stretch;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.2;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
/* Keep the browser clear control (it only shows once there is text) and draw
   it with the same Lucide x already used on the active-filter chips, so it
   lines up with the icon and the text instead of sitting in its own box. */
.hub-search__bar input::-webkit-search-decoration,
.hub-search__bar input::-webkit-search-results-button,
.hub-search__bar input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }
.hub-search__bar input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-inline-start: 8px;
  background: center / 16px 16px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234f4b43' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E");
  cursor: pointer;
}
.hub-search__bar input::placeholder { color: var(--ink-3); opacity: 1; }
.hub-search__go {
  flex: none;
  align-self: stretch;
  box-sizing: border-box;
  height: auto;
  min-height: 0;
  margin: 0;
  padding-block: 0;
  padding-inline: 22px;
  border-radius: calc(var(--hub-search-radius) - var(--hub-search-inset) - 1px);
  white-space: nowrap;
}
.hub-search__go:hover { box-shadow: none; }
.hub-search__go:active { transform: none; }
.hub-search__row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }

/* Topic chips: one row; it scrolls sideways on its own on narrow screens. */
.hub-chiprow { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 520px; min-width: 0; }
.hub-filter { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 93px; background: var(--surface); color: var(--ink-2); font-size: .8125rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hub-filter:hover { background: var(--accent-soft); color: var(--accent-ink); }
.hub-filter.is-current { background: var(--ink); color: #fff; }

/* Filters: a <details> panel (works without JavaScript). */
.hub-more { flex: 0 1 auto; min-width: 0; }
.hub-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--hairline); border-radius: 93px; background: #fff; color: var(--ink); font-size: .8125rem; font-weight: 650; cursor: pointer; list-style: none; }
.hub-more > summary::-webkit-details-marker { display: none; }
.hub-more > summary .tww-icon { width: 16px; height: 16px; }
.hub-more[open] > summary { border-color: var(--ink); }
.hub-more__fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 12px; margin-top: 10px; padding: 16px; border-radius: var(--r-lg); background: var(--surface); }
.hub-more__fields label { display: grid; gap: 4px; min-width: 0; color: var(--ink-3); font-size: .72rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.hub-more__fields select, .hub-more__fields input { min-height: 40px; width: 200px; max-width: 100%; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: .875rem; letter-spacing: 0; text-transform: none; }
.hub-more__fields .button { min-height: 40px; }
@media (min-width: 900px) {
  /* On wide screens the panel opens under the whole row, not squeezed beside the chips. */
  .hub-search__row { position: relative; }
  .hub-more[open] { flex-basis: 100%; order: 2; }
}

/* Active filters: removable chips and Clear all. */
.hub-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.hub-active__chip { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; max-width: 100%; padding: 0 10px 0 12px; border-radius: 93px; background: var(--accent-soft); color: var(--accent-ink); font-size: .8125rem; font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.hub-active__chip:hover { background: #e2e0fd; }
.hub-active__chip .tww-icon { flex: none; width: 14px; height: 14px; }
.hub-active__clear { color: var(--ink-2); font-size: .8125rem; font-weight: 650; }
.hub-results { margin-top: 32px; }
.hub-results__line { margin: 0 0 20px; font-family: var(--font-ui); font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }

/* Section labels. */
.hub-section { margin-top: 64px; }
.hub-label { margin: 0 0 20px; font-family: var(--font-ui); font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hub-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.hub-label-row .hub-label { margin: 0; }
.hub-label-row a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: .8125rem; font-weight: 650; text-decoration: none; }
.hub-label-row a:hover { color: var(--accent-ink); }

/* Top: lead story (text + large image) and a narrow rail of headlines. */
.hub-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 28px; }
.hub-top--solo { grid-template-columns: minmax(0, 1fr); }
.hub-lead__link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: 24px; align-items: start; color: var(--ink); text-decoration: none; }
.hub-lead__title { margin: 12px 0 14px; font-size: clamp(1.7rem, 2.6vw, 2.25rem); font-weight: 450; letter-spacing: -.02em; line-height: 1.12; overflow-wrap: anywhere; hyphens: auto; }
.hub-lead__deck { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.hub-lead__media { aspect-ratio: 1.38 / 1; }
.hub-lead__link:hover .hub-lead__title { color: var(--accent-ink); }
.hub-rail { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); }
.hub-rail .hub-label { margin-bottom: 12px; }

/* Lists of headlines. */
.hub-rows { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.hub-row__link { display: flex; gap: 14px; align-items: flex-start; color: var(--ink); text-decoration: none; }
.hub-row__text { min-width: 0; }
.hub-row__title { margin: 6px 0 0; font-family: var(--font-ui); font-size: 1rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.hub-row__link:hover .hub-row__title { color: var(--accent-ink); }
.hub-row__thumb { flex: none; width: 104px; aspect-ratio: 1.08 / 1; }
.hub-row__thumb .hub-media__fallback .tww-icon { width: 28px; height: 28px; }

/* Cards. */
.hub-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 24px; }
.hub-card { min-width: 0; }
.hub-card__link { display: block; color: var(--ink); text-decoration: none; }
.hub-card__title { margin: 12px 0 0; font-family: var(--font-ui); font-size: 1.0625rem; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.hub-card__deck { margin: 8px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; }
.hub-card__link:hover .hub-card__title { color: var(--accent-ink); }
.hub-card__link:hover img, .hub-lead__link:hover img, .hub-row__link:hover img { transform: scale(1.03); }
.hub-card--big .hub-card__title { font-family: var(--font-display); font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 450; letter-spacing: -.015em; line-height: 1.15; }

/* A large story beside a list; topic sections: big + two + a list. */
.hub-band__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.hub-topic__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.hub-topic__pair { display: grid; gap: 24px; }

.hub-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 36px; color: var(--ink-3); font-size: .875rem; }
.hub-pager a { color: var(--ink); font-weight: 650; }
.hub-empty { margin: 24px 0; padding: 24px; border-radius: var(--r-lg); background: var(--surface); color: var(--ink-2); }

/* Archive link. */
.hub-archive { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; margin-top: 72px; padding: 28px 30px; border-radius: var(--r-xl); background: var(--accent-soft); }
.hub-archive h2 { margin: 0 0 6px; font-size: 1.5rem; }
.hub-archive p { max-width: 62ch; margin: 0; color: var(--ink-2); line-height: 1.55; }
.hub-archive .hub-archive__links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hub-archive__soon { color: var(--ink-2); font-weight: 600; }

/* Visible focus on every link, chip, field and card. The news search input is
   excluded: its ring is the pill's :focus-within rule, so a second outline
   here would draw a box inside the pill around the text and the clear button. */
.hub a:focus-visible, .hub button:focus-visible, .hub select:focus-visible, .hub input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.hub .hub-search__bar input:focus,
.hub .hub-search__bar input:focus-visible { outline: none; border: 0; box-shadow: none; background: transparent; }
/* Keyboard focus sits inside the button, so it cannot meet the pill ring
   or eat the white inset. */
.hub .hub-search__go:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -5px;
  border-radius: calc(var(--hub-search-radius) - var(--hub-search-inset) - 1px);
}
.hub-card__link:focus-visible, .hub-lead__link:focus-visible, .hub-row__link:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

@media (max-width: 1080px) {
  .hub-top { grid-template-columns: minmax(0, 1fr); }
  .hub-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-topic__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .hub-topic__grid > .hub-card--big { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .hub { padding: 4px 16px 60px; }
  .hub-search { margin-top: 24px; }
  .hub-search__bar { min-height: 52px; padding-inline-start: 16px; }
  .hub-search__bar input { font-size: 1rem; }
  .hub-search__go { min-height: 0; padding-inline: 18px; }
  .hub-search__row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .hub-chiprow { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: thin; }
  .hub-more, .hub-more > summary { width: 100%; justify-content: center; }
  .hub-more__fields label { flex: 1 1 140px; }
  .hub-more__fields select, .hub-more__fields input { width: 100%; }
  .hub-more__fields .button { width: 100%; }
  .hub-section { margin-top: 48px; }
  .hub-lead__link { grid-template-columns: minmax(0, 1fr); }
  .hub-lead__media { order: -1; }
  .hub-lead__title { font-size: 1.6rem; }
  .hub-grid4, .hub-band__grid, .hub-topic__grid { grid-template-columns: minmax(0, 1fr); }
  .hub-row__thumb { width: 88px; }
  .hub-archive { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-media img { transition: none; }
  .hub-card__link:hover img, .hub-lead__link:hover img, .hub-row__link:hover img { transform: none; }
}

/* Archive pages (Phase 7c). */
.archive-note { margin: 0 0 28px; color: var(--ink-3); font-size: .875rem; }
.archive-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.archive-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 22px; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); text-decoration: none; }
.archive-list a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.archive-list strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 450; overflow-wrap: anywhere; }
.archive-list span { color: var(--ink-3); font-size: .875rem; white-space: nowrap; }
.archive-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 48px; }
.archive-pager a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 650; text-decoration: none; }
.archive-pager a:hover { color: var(--accent-ink); }
.archive-pager .tww-icon { width: 16px; height: 16px; }
