/* design-v2/dashboard_news_first.css: the news-first dashboard (2026-10-12
   spec, sections 4, 5, 6, 8, 9 and 16; layout round 2). Loaded only on the dashboard while
   dashboard_news_first_enabled is on (dashboard_news_first_assets.php).
   Colours, shadows and easing come from tokens.css only. Font sizes are rem
   at the v2 root of 15px (px / 15). */

.v2-nf {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
  margin: 0 0 28px;
}
.v2-nf__col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.v2-nf__block {
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 0;
}
.v2-nf__h { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ink-strong); }
.v2-nf__block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v2-nf__block-head a { font-size: 0.8667rem; font-weight: 600; color: var(--pace-secure); }
.v2-nf__head-links { display: inline-flex; gap: 12px; }
.v2-nf__note { margin: 0; font-size: 0.8667rem; color: var(--ink-muted); }

/* Left: progress (dark) */
.v2-nf__progress { background: var(--navy); border-color: var(--navy-deep); color: var(--paper); }
.v2-nf__progress .v2-nf__h { color: var(--paper); }
.v2-nf__progress .v2-nf__block-head a { color: var(--navy-100); }
.v2-nf-prog__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.v2-nf-prog { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px; border-radius: 10px; color: inherit; text-decoration: none; }
.v2-nf-prog:hover, .v2-nf-prog:focus-visible { background: var(--navy-deep); }
.v2-nf-prog:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.v2-nf-prog__ring { flex: 0 0 40px; width: 40px; height: 40px; }
.v2-nf-ring__track { fill: none; stroke: var(--navy-500); stroke-width: 4; }
.v2-nf-ring__fill { fill: none; stroke-width: 4; stroke-linecap: round; stroke: var(--navy-300); }
.v2-nf-prog--ok .v2-nf-ring__fill { stroke: var(--pace-on-track-light); }
.v2-nf-prog--at .v2-nf-ring__fill { stroke: var(--pace-caution-light); }
.v2-nf-prog--be .v2-nf-ring__fill { stroke: var(--pace-risk-light); }
.v2-nf-prog--ach .v2-nf-ring__fill { stroke: var(--pace-secure-light); }
.v2-nf-prog__text { display: flex; flex-direction: column; min-width: 0; }
.v2-nf-prog__name { font-weight: 600; font-size: 0.9333rem; overflow-wrap: anywhere; }
.v2-nf-prog__line { font-size: 0.8rem; color: var(--navy-100); }
.v2-nf-prog--ok .v2-nf-prog__line { color: var(--pace-on-track-light); }
.v2-nf-prog--at .v2-nf-prog__line { color: var(--pace-caution-light); }
.v2-nf-prog--be .v2-nf-prog__line { color: var(--pace-risk-light); }
.v2-nf-prog--ach .v2-nf-prog__line { color: var(--pace-secure-light); }
.v2-nf-prog__fixes {
  margin-top: 10px; width: 100%; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--navy-300); background: transparent; color: var(--paper);
  font: inherit; font-weight: 600; cursor: pointer;
}
.v2-nf-prog__fixes:hover, .v2-nf-prog__fixes:focus-visible { background: var(--navy-deep); }
.v2-nf-prog__more { margin: 10px 0 0; font-size: 0.8rem; color: var(--navy-100); }
.v2-nf-prog__more a { color: var(--paper); text-decoration: underline; }

/* Deadline rows (inside the Loyalty health card) */
.v2-nf-dl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.v2-nf-dl__row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.v2-nf-dl__tile, .v2-nf-trip__tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; font-size: 0.7333rem; line-height: 1.1; text-transform: uppercase;
}
.v2-nf-dl__tile { background: var(--orange-paper); color: var(--pace-risk); }
.v2-nf-dl__tile b, .v2-nf-trip__tile b { font-size: 1rem; }
.v2-nf-dl__what { display: block; font-size: 0.8667rem; overflow-wrap: anywhere; }
.v2-nf-dl__days { display: block; font-size: 0.8rem; color: var(--ink-muted); }

/* Left: Loyalty health (score, Deadlines, To do). About 280 px wide, so the
   score row and the four component bars are stacked. The tone classes use the
   same thresholds and tokens as the full-width .v2-lhc card. */
.v2-nf__health .v2-nf__block-head { flex-wrap: wrap; row-gap: 2px; }
.v2-nf-health__scope { font-size: 0.8rem; color: var(--ink-faint); }
.v2-nf-health__score { display: flex; flex-direction: column; gap: 10px; }
.v2-nf-health__figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.v2-nf-health__num { font-size: 2.4rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; }
.v2-nf-health__outof { font-size: 0.8rem; color: var(--ink-faint); }
.v2-nf-health__grade {
  margin-left: auto; padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: 0.7667rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.v2-nf-health--secure .v2-nf-health__num { color: var(--pace-secure); }
.v2-nf-health--caution .v2-nf-health__num { color: var(--pace-caution); }
.v2-nf-health--risk .v2-nf-health__num { color: var(--pace-risk); }
.v2-nf-health--secure .v2-nf-health__grade { color: var(--pace-secure); background: var(--pace-secure-paper); border-color: var(--pace-secure-border); }
.v2-nf-health--caution .v2-nf-health__grade { color: var(--pace-caution); background: var(--pace-caution-paper); border-color: var(--pace-caution-border); }
.v2-nf-health--risk .v2-nf-health__grade { color: var(--pace-risk); background: var(--pace-risk-paper); border-color: var(--pace-risk-border); }
.v2-nf-health--secure .v2-nf-health__part-fill { background: var(--pace-secure-light); }
.v2-nf-health--caution .v2-nf-health__part-fill { background: var(--pace-caution-light); }
.v2-nf-health--risk .v2-nf-health__part-fill { background: var(--pace-risk-light); }
.v2-nf-health__verdict { margin: 0; font-size: 0.8667rem; line-height: 1.45; color: var(--ink-strong); overflow-wrap: anywhere; }
.v2-nf-health__parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.v2-nf-health__part { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 3px 8px; }
.v2-nf-health__part-k { font-size: 0.8rem; color: var(--ink-muted); }
.v2-nf-health__part-v { font-size: 0.8rem; color: var(--ink); text-align: right; }
.v2-nf-health__part-w { color: var(--ink-faint); }
.v2-nf-health__part-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--paper-shade); overflow: hidden; }
.v2-nf-health__part-fill { display: block; height: 100%; border-radius: 999px; }
.v2-nf-health__sub { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hairline-soft); }
.v2-nf__block-head + .v2-nf-health__sub { margin-top: 0; padding-top: 0; border-top: 0; }
.v2-nf-health__sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.v2-nf-health__sub-h { margin: 0; font-size: 0.9333rem; font-weight: 700; color: var(--ink-strong); }
.v2-nf-health__sub-head a { font-size: 0.8667rem; font-weight: 600; color: var(--pace-secure); }
.v2-nf-health__link { display: inline-block; margin-top: 14px; font-size: 0.8667rem; font-weight: 600; color: var(--pace-secure); }
.v2-nf-health__link:hover { text-decoration: underline; }
.v2-nf-health__sub-head a:focus-visible, .v2-nf-health__link:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 2px; border-radius: 4px; }
/* Centre: news */
.v2-nf__news { padding: 18px 20px; }
.v2-nf__news-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 10px; }
.v2-nf__news-meta { margin: 0; font-size: 0.8rem; color: var(--ink-muted); }
.v2-nf__tabs { display: flex; gap: 8px; margin: -4px -4px 8px; padding: 4px; scroll-padding: 4px; overflow-x: auto; scrollbar-width: none; }
.v2-nf__tabs::-webkit-scrollbar { display: none; }
.v2-nf__tab {
  position: relative; flex: 0 0 auto; min-height: 36px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--hairline-strong); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 0.8667rem; font-weight: 600; cursor: pointer;
}
.v2-nf__tab::after { content: ""; position: absolute; inset: -4px 0; }
.v2-nf__tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--paper); }
.v2-nf__tab:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.v2-nf__list { display: flex; flex-direction: column; transition: opacity 0.15s var(--ease-quick); }
.v2-nf__list[aria-busy="true"] { opacity: 0.55; }
.v2-nf-item { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--hairline-soft); }
.v2-nf-item:first-child { border-top: 0; padding-top: 4px; }
.v2-nf-item__thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: var(--paper-shade); }
.v2-nf-item__thumb > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.v2-nf-item__logo, .v2-nf-item__mono { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--navy-50); }
.v2-nf-item__logo img { width: auto; height: auto; max-width: 50%; max-height: 50%; object-fit: contain; }
.v2-nf-item__mono { color: var(--navy); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.04em; }
.v2-nf-item__source {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  padding: 2px 7px; border-radius: 6px; background: var(--navy-deep); color: var(--paper);
  font-size: 0.7333rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v2-nf-item__body { min-width: 0; }
.v2-nf-item__title {
  margin: 0 0 4px; font-size: 1.0667rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.v2-nf-item__title a { color: var(--ink-strong); text-decoration: none; }
.v2-nf-item__title a:hover { text-decoration: underline; }
.v2-nf-item__title a:focus-visible { outline: 2px solid var(--orange-deep); outline-offset: -2px; border-radius: 4px; }
.v2-nf-item__summary { margin: 0 0 6px; font-size: 0.8667rem; line-height: 1.45; color: var(--ink-muted); overflow-wrap: anywhere; }
.v2-nf-item__meta { margin: 0; font-size: 0.8rem; color: var(--ink-muted); }
.v2-nf-tag { font-weight: 600; color: var(--info); }
.v2-nf-tag--held { color: var(--orange-deep); }
.v2-nf-item__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 6px 0 0;
  font-size: 0.8667rem; opacity: 0; transition: opacity 0.15s var(--ease-quick);
}
.v2-nf-item:hover .v2-nf-item__actions, .v2-nf-item:focus-within .v2-nf-item__actions { opacity: 1; }
.v2-nf-item__read { font-weight: 600; color: var(--pace-secure); }
.v2-nf-item__atlas { min-height: 32px; padding: 0; border: 0; background: none; color: var(--atlas-deep); font: inherit; font-weight: 600; cursor: pointer; }
.v2-nf__divider {
  margin: 10px 0 2px; padding-top: 10px; border-top: 1px solid var(--hairline-strong);
  font-size: 0.7333rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted);
}
.v2-nf__empty, .v2-nf__degraded { margin: 8px 0; color: var(--ink-muted); }
.v2-nf__news-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 14px; }
.v2-nf__more, .v2-nf__switch {
  min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--hairline-strong);
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
}
.v2-nf__more[hidden] { display: none; }
.v2-nf__whats-new { font-size: 0.8667rem; font-weight: 600; color: var(--pace-secure); }
.v2-nf__email { margin: 0; font-size: 0.8rem; color: var(--ink-muted); }
.v2-nf__email a { color: var(--pace-secure); text-decoration: underline; }

/* Right: trips */
.v2-nf-trips__list { display: flex; flex-direction: column; gap: 10px; }
.v2-nf-trip {
  position: relative; display: block; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--hairline); background: var(--paper);
  transition: box-shadow 0.15s var(--ease-quick), border-color 0.15s var(--ease-quick);
}
.v2-nf-trip:hover, .v2-nf-trip.is-previewing { border-color: var(--navy-300); box-shadow: var(--sh-card-hover); }
.v2-nf-trip:has(.v2-nf-trip__link:focus-visible) { outline: 2px solid var(--orange-deep); outline-offset: 2px; }
.v2-nf-trip__link { color: var(--ink-strong); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.v2-nf-trip__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.v2-nf-trip__link:focus-visible { outline: none; }
.v2-nf-trip__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.v2-nf-trip__chip { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; background: var(--orange-paper); color: var(--pace-risk); font-size: 0.7333rem; font-weight: 700; }
.v2-nf-trip__dates, .v2-nf-trip__line { display: block; font-size: 0.8rem; color: var(--ink-muted); overflow-wrap: anywhere; }
.v2-nf-trip__brief { position: relative; z-index: 1; margin-top: 8px; font-size: 0.8rem; pointer-events: none; }
.v2-nf-trip__brief a, .v2-nf-trip__brief button { pointer-events: auto; }
.v2-nf-trip--row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; }
.v2-nf-trip__tile { background: var(--navy-50); color: var(--navy); }
.v2-nf-trip__text { min-width: 0; }
.v2-nf-trips__more-link { display: none; color: var(--pace-secure); font-size: 0.8667rem; font-weight: 600; }
.v2-nf-trips__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.v2-nf-trips__actions .v2-btn { min-height: 44px; }

/* Hover preview (desktop, fine pointer only) */
.v2-nf-preview {
  position: absolute; z-index: 40; width: 360px; max-width: calc(100vw - 32px);
  padding: 16px 18px; border-radius: 14px; border: 1px solid var(--hairline-strong);
  background: var(--paper); box-shadow: var(--sh-pop);
}
.v2-nf-preview[hidden] { display: none; }
.v2-nf-preview::before {
  content: ""; position: absolute; top: var(--arrow-top, 24px); right: -7px; width: 12px; height: 12px;
  background: var(--paper); border-top: 1px solid var(--hairline-strong); border-right: 1px solid var(--hairline-strong);
  transform: rotate(45deg);
}
.v2-nf-preview.is-below::before { top: -7px; right: auto; left: var(--arrow-left, 24px); transform: rotate(-45deg); }
.v2-nf-preview__name { margin: 0; font-size: 1.0667rem; font-weight: 700; color: var(--ink-strong); overflow-wrap: anywhere; }
.v2-nf-preview__sub { margin: 2px 0 0; font-size: 0.8rem; color: var(--ink-muted); }
.v2-nf-preview__items { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.v2-nf-preview__item { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; font-size: 0.8rem; }
.v2-nf-preview__date { color: var(--ink-muted); }
.v2-nf-preview__bit, .v2-nf-preview__earn { display: block; color: var(--ink-muted); }
.v2-nf-preview__earn { color: var(--pace-secure); }
.v2-nf-preview__lounge { margin: 0 0 12px; font-size: 0.8rem; }
.v2-nf-preview__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.v2-nf-preview__actions .v2-btn { min-height: 40px; }
.v2-nf-preview__skeleton { height: 12px; margin: 10px 0; border-radius: 6px; background: var(--paper-shade); }
.v2-nf-preview__error { margin: 0 0 12px; font-size: 0.8667rem; }

/* To do rows (inside the Loyalty health card) */
.v2-nf-na { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.v2-nf-na a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px;
  padding: 6px 8px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 0.9rem;
}
.v2-nf-na a:hover, .v2-nf-na a:focus-visible { background: var(--paper-shade); }
.v2-nf-na__count { font-weight: 700; color: var(--pace-risk); }
.v2-nf-na a > span:first-child { min-width: 0; overflow-wrap: anywhere; }

/* Right: Before you book (the F1 earn decision card and posting rows keep their own styles; only their outer margins are reset so the column's gap spaces them) */
.v2-nf__byb { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.v2-nf__byb > * { min-width: 0; }
.v2-nf__byb .v2-edc, .v2-nf__byb .v2-pcr { margin: 0; }

/* Tablet, 900 to 1279 px: news on the left, a 320 px side column */
@media (max-width: 1279px) {
  /* Row gap 0 and a top margin on the stacked blocks: the health card and the earn card can be absent, and an empty track must not leave a double gap. */
  .v2-nf { grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: auto auto auto 1fr; row-gap: 0; }
  .v2-nf__col--left, .v2-nf__col--right { display: contents; }
  .v2-nf__col--centre { grid-column: 1; grid-row: 1 / span 4; }
  .v2-nf__progress { grid-column: 2; grid-row: 1; }
  .v2-nf__trips { grid-column: 2; grid-row: 2; margin-top: 22px; }
  .v2-nf__health { grid-column: 2; grid-row: 3; margin-top: 22px; }
  .v2-nf__byb { grid-column: 2; grid-row: 4; align-self: start; margin-top: 22px; }
  .v2-nf-item { grid-template-columns: 168px minmax(0, 1fr); }
}

/* Phone, below 900 px: one column in the spec's order */
@media (max-width: 899px) {
  .v2-nf { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .v2-nf__col { display: contents; }
  .v2-nf__progress { order: 1; }
  .v2-nf__trips { order: 2; }
  .v2-nf__news { order: 3; padding: 16px; }
  .v2-nf__health { order: 4; }
  .v2-nf__byb { order: 5; }
  /* the tablet top margins are for the grid; the phone flex column spaces its blocks with the gap */
  .v2-nf__trips, .v2-nf__health, .v2-nf__byb { margin-top: 0; }
  /* the flex row is the <ul>, so the cards are its <li> children; 4 px of padding keeps the focus ring inside the scrollport */
  .v2-nf-prog__list { flex-direction: row; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 4px; padding: 4px; margin: -4px; }
  .v2-nf-prog__list > li { display: flex; flex: 0 0 152px; scroll-snap-align: start; } /* li is a flex row, so its <a> stretches to the tallest card */
  .v2-nf-prog { width: 100%; flex-direction: column; align-items: flex-start; padding: 12px; background: var(--navy-deep); }
  .v2-nf-item { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
  .v2-nf-item__summary { display: none; }
  .v2-nf-item__title { -webkit-line-clamp: 3; font-size: 0.9667rem; }
  .v2-nf-item__actions { opacity: 1; }
  .v2-nf-item__actions a, .v2-nf-item__atlas { min-height: 44px; display: inline-flex; align-items: center; }
  .v2-nf__block-head { align-items: center; }
  .v2-nf__block-head a, .v2-nf__whats-new, .v2-nf-health__sub-head a, .v2-nf-health__link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .v2-nf__byb .v2-btn { min-height: 44px; }
  .v2-nf-item__source { font-size: 0.6667rem; }
  .v2-nf-trip--row { display: none; }
  .v2-nf-trips__more-link { display: flex; align-items: center; min-height: 44px; font-weight: 600; }
}

@media (pointer: coarse) {
  .v2-nf-preview { display: none !important; }
  .v2-nf-item__actions { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .v2-nf__list, .v2-nf-item__actions, .v2-nf-trip { transition: none; }
}
