/* The home page picker (templates/home.html, routes/home.py).

   Built on the Banner look's own tokens (brand.css), so light and dark come
   for free and nothing here names a colour of its own except what sits on the
   blue band, which is blue in both modes. Orange stays rationed: the title's
   mark and keyboard focus, nothing else.

   Four looks share the badge, the search box and the "coming soon" tag; each
   then has its own block below. Phone first where it matters: every link is
   at least 44px tall and nothing scrolls sideways at 320px. */

.hp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp-ico { width: 26px; height: 26px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.hp-arrow { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.hp-badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-dim); color: var(--accent); }
.hp-tag { align-self: flex-start; display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px;
  border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 700;
  white-space: nowrap; }
.hp-all { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700;
  color: var(--accent); text-decoration: none; }
.hp-all:hover { color: var(--accent-hi); }
.page-main a:focus-visible, .hp-band a:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------------------------------------------------------------- search (on the band) */
.hp-search { display: flex; gap: 8px; max-width: 640px; margin: 18px 0 14px; }
.hp-search input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border: 0; border-radius: 12px;
  background: #fff; color: #0e1b2c; font: inherit; font-size: 1rem;      /* 16px: iOS does not zoom */
  box-shadow: 0 10px 24px -16px rgba(0, 20, 60, .8); }
.hp-search input::placeholder { color: #5a6a80; opacity: 1; }
.hp-search select { flex: none; height: 50px; padding: 0 34px 0 14px; border: 0; border-radius: 12px; font: inherit;
  font-size: .95rem; font-weight: 600; color: #14335c; cursor: pointer; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%2314335c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center / 11px; }
.hp-search select:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
:root[data-mode="dark"] .hp-search select { background-color: #0e1727; color: #e8eef8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23e8eef8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.hp-band-search .hp-search select { height: 58px; border-radius: 14px; }
.hp-search button { flex: none; height: 50px; padding: 0 20px; border: 0; border-radius: 12px;
  background: #0b2a55; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.hp-search button:hover { background: #071d3c; }
.hp-search input:focus-visible, .hp-search button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
:root[data-mode="dark"] .hp-search input { background: #0e1727; color: #e8eef8; }
:root[data-mode="dark"] .hp-search input::placeholder { color: #8293ad; }
:root[data-mode="dark"] .hp-search button { background: #0a1220; }
:root[data-mode="dark"] .hp-search button:hover { background: #050a14; }

/* ---------------------------------------------------------------- look: tiles */
.hp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hp-tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-tiles-1 { grid-template-columns: minmax(0, 1fr); }
.hp-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 26px;
  border-radius: var(--radius-lg); background: var(--bg-elev); border: 1px solid var(--border);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: transform .15s ease, border-color .15s ease; }
a.hp-tile:hover { transform: translateY(-2px); border-color: var(--accent-line); }
.hp-tile-top { display: flex; align-items: center; gap: 12px; }
.hp-tile-name { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.hp-stat { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.hp-num { font-size: 2.1rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hp-unit, .hp-from { font-size: .95rem; color: var(--text-2); }
.hp-from b { color: var(--text); font-variant-numeric: tabular-nums; }
.hp-about { max-width: 34ch; font-size: .92rem; line-height: 1.45; color: var(--text-2); }
.hp-go { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: auto;
  padding: 0 18px; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
a.hp-tile:hover .hp-go { background: var(--accent-hi); }
.hp-tile > :not(.hp-art) { position: relative; z-index: 1; }
/* the picture: the right side of the tile, on a wash of the accent */
.hp-tile::after { content: ""; position: absolute; inset: 0 0 0 auto; width: 46%;
  background: linear-gradient(100deg, transparent, var(--accent-dim) 55%); pointer-events: none; }
.hp-art { position: absolute; right: -14px; top: 50%; z-index: 1; width: min(40%, 250px); transform: translateY(-50%);
  fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; transition: transform .25s ease; }
.hp-art-b { opacity: .32; }
a.hp-tile:hover .hp-art { transform: translateY(-50%) scale(1.04) rotate(-2deg); }
.hp-tiles-3 .hp-tile { padding: 22px; }
.hp-tiles-3 .hp-about { display: none; }
.hp-tiles-3 .hp-art { width: 38%; right: -22px; opacity: .8; }
.hp-soon .hp-art { stroke: var(--text-3); opacity: .5; }
.hp-tile.hp-soon::after { display: none; }
/* under the tiles: deals, most listed, how it works */
.hp-sec { margin-top: 44px; }
.hp-sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 4px 20px; }
.hp-sec-head h2 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.hp-sec-head p { margin: 4px 0 0; max-width: 62ch; font-size: .95rem; color: var(--text-2); }
.hp-sec .hp-cards { margin-top: 14px; }
.hp-sec .hp-cards-wide { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.hp-sec .hp-card { background: var(--bg-elev); box-shadow: var(--shadow); padding: 16px; }
.hp-card-per { color: var(--text-3); }
.hp-how-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; margin-top: 14px;
  padding-top: 18px; border-top: 1px solid var(--border); }
.hp-how-grid h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.hp-how-grid p { margin: 5px 0 0; font-size: .92rem; line-height: 1.5; color: var(--text-2); }
.hp-how-grid a { color: var(--accent); font-weight: 700; }
.hp-tile.hp-soon { background: var(--surface); box-shadow: none; border-style: dashed; border-color: var(--border-strong); }
.hp-soon .hp-badge { background: var(--surface-2); color: var(--text-3); }
.hp-soon .hp-tile-name { color: var(--text-2); }
.hp-soon .hp-tag { margin-top: auto; }

/* ---------------------------------------------------------------- look: list */
.hp-list { overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-elev);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.hp-row + .hp-row { border-top: 1px solid var(--border); }
.hp-row-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center;
  gap: 6px 18px; padding: 20px 22px; color: var(--text); text-decoration: none; }
a.hp-row-main:hover { background: var(--hover); }
.hp-row-name { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; }
.hp-row-about { display: block; margin-top: 2px; font-size: .92rem; line-height: 1.45; color: var(--text-2); }
.hp-row-stats { display: flex; align-items: center; gap: 28px; }
.hp-row-stat { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.hp-row-stat b { display: block; font-size: 1.2rem; font-weight: 800; }
.hp-row-stat small { display: block; font-size: .78rem; color: var(--text-3); }
.hp-chev { display: grid; place-items: center; color: var(--text-3); font-size: 1.15rem; }
a.hp-row-main:hover .hp-chev { color: var(--accent); }
.hp-row-soon .hp-badge { background: var(--surface-2); color: var(--text-3); }
.hp-row-soon .hp-row-name { color: var(--text-2); }
.hp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 22px 18px 86px; }
.hp-chips-lbl { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.hp-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .88rem; font-weight: 600; text-decoration: none; }
.hp-chip:hover { background: var(--accent-dim); color: var(--accent); }
.hp-chip-more { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--border); }

/* ---------------------------------------------------------------- look: search first */
:root[data-look="banner"] .hp-band-search { padding-top: 44px; text-align: center; }
:root[data-look="banner"] .hp-band-search .page-lede { margin-inline: auto; }
.hp-band-search .hp-search { max-width: 720px; margin: 24px auto 16px; }
.hp-band-search .hp-search input, .hp-band-search .hp-search button { height: 58px; border-radius: 14px; }
.hp-band-search .hp-search input { padding: 0 20px; font-size: 1.08rem; }
.hp-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 18px; }
.hp-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 18px 0 14px;
  border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .4);
  color: #fff; text-decoration: none; }
.hp-pill b { font-weight: 700; }
.hp-pill span { font-size: .9rem; opacity: .92; font-variant-numeric: tabular-nums; }
a.hp-pill:hover { background: rgba(255, 255, 255, .26); }
.hp-pill-soon { background: transparent; border-style: dashed; }
.hp-most { padding: 24px 26px 18px; border-radius: var(--radius-lg); background: var(--bg-elev);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.hp-most-title { margin: 0 0 16px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.hp-most-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px 40px; }
.hp-most h3 { margin: 0 0 6px; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); }
.hp-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 6.2em; align-items: baseline; gap: 14px;
  min-height: 46px; padding: 11px 0; border-top: 1px solid var(--border); color: var(--text-2);
  font-size: .9rem; text-decoration: none; font-variant-numeric: tabular-nums; }
.hp-line b { color: var(--text); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.hp-line-low { text-align: right; color: var(--text); font-weight: 600; }
.hp-line:hover b { color: var(--accent); }
.hp-most .hp-all { border-top: 1px solid var(--border); width: 100%; }

/* ---------------------------------------------------------------- look: shelves */
.hp-shelves { display: grid; gap: 16px; }
.hp-shelf { padding: 22px; border-radius: var(--radius-lg); background: var(--bg-elev);
  border: 1px solid var(--border); box-shadow: var(--shadow); }
.hp-shelf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.hp-shelf-text { flex: 1 1 150px; min-width: 0; }
.hp-shelf-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.hp-shelf-sum { display: block; margin-top: 2px; font-size: .92rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hp-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.hp-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: .86rem;
  text-decoration: none; font-variant-numeric: tabular-nums; }
.hp-card b { color: var(--text); font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }
.hp-card-low { margin-top: 5px; color: var(--text); font-weight: 700; }
.hp-card:hover { border-color: var(--accent-line); background: var(--hover); }
.hp-card:hover b { color: var(--accent); }
.hp-shelf-soon { background: var(--surface); box-shadow: none; border-style: dashed; border-color: var(--border-strong); }
.hp-shelf-soon .hp-badge { background: var(--surface-2); color: var(--text-3); }
.hp-shelf-soon h2 { color: var(--text-2); }
.hp-shelf-soon .hp-tag { align-self: center; }

/* ---------------------------------------------------------------- the preview switch */
.hp-switch { position: fixed; left: 50%; bottom: 12px; z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; max-width: calc(100vw - 16px); padding: 5px; border-radius: 999px;
  background: #0e1b2c; border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: .84rem; white-space: nowrap;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .65); }
.hp-switch span { padding: 0 8px 0 11px; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; opacity: .72; }
.hp-switch a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px;
  color: #fff; font-weight: 600; text-decoration: none; }
.hp-switch a:hover { background: rgba(255, 255, 255, .14); }
.hp-switch a[aria-current] { background: #fff; color: #0e1b2c; }
:root:has(.hp-switch) .site-foot { padding-bottom: 92px; }

@media (max-width: 860px) {
  .hp-tiles { grid-template-columns: 1fr; gap: 12px; }
  .hp-tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 18px; }
  .hp-tile-top { grid-column: 1 / -1; margin-bottom: 6px; }
  .hp-stat { margin-top: 0; }
  .hp-num { font-size: 1.7rem; }
  .hp-from { grid-column: 1; }
  .hp-go { grid-column: 2; grid-row: 2 / span 2; margin: 0; padding: 0; align-self: center; }
  .hp-go { font-size: 0; min-height: 0; background: none; color: var(--accent); }   /* the arrow alone: the whole tile is the link */
  a.hp-tile:hover .hp-go { background: none; }
  .hp-about, .hp-art, .hp-tile::after { display: none; }
  .hp-go .hp-arrow { font-size: 1.4rem; }
  .hp-soon .hp-from { grid-column: 1 / -1; }
  .hp-soon .hp-tag { margin-top: 6px; }
  .hp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-sec .hp-cards-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hp-sec { margin-top: 34px; }
}
@media (max-width: 640px) {
  .hp-search { margin-top: 14px; }
  .hp-search button { padding: 0 15px; }
  .hp-search { flex-wrap: wrap; }
  .hp-search input { flex: 1 1 100%; }
  .hp-search select, .hp-band-search .hp-search select { flex: 1; min-width: 0; height: 46px; }
  .hp-search:has(select) button, .hp-band-search .hp-search:has(select) button { height: 46px; }
  .hp-row-main { grid-template-columns: auto minmax(0, 1fr) auto; padding: 16px; gap: 10px 14px; }
  .hp-row-stats { grid-column: 2 / -1; grid-row: 2; gap: 22px; }
  .hp-row-stat { min-width: 0; text-align: left; }
  .hp-chev { grid-column: 3; grid-row: 1; }
  .hp-chips { padding: 0 16px 16px; }
  :root[data-look="banner"] .hp-band-search { padding-top: 26px; }
  .hp-band-search .hp-search input, .hp-band-search .hp-search button { height: 52px; }
  .hp-band-search .hp-search input { padding: 0 16px; font-size: 1rem; }
  .hp-pills { gap: 8px; }
  .hp-pill { flex: 1 1 100%; justify-content: flex-start; }
  .hp-pill span { margin-left: auto; }
  .hp-most { padding: 20px 16px 12px; }
  .hp-line { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; }
  .hp-line span:nth-of-type(1) { grid-column: 1; grid-row: 2; }
  .hp-line-low { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .hp-shelf { padding: 16px; }
  .hp-shelf-head .hp-all { flex-basis: 100%; }
  .hp-card { padding: 12px; }
  .hp-sec .hp-card { padding: 13px; }
  .hp-sec .hp-cards-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-how-grid { grid-template-columns: 1fr; }
  .hp-sec-head h2 { font-size: 1.2rem; }
}
@media (max-width: 400px) {
  .hp-switch span { display: none; }
  .hp-switch a { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-tile, .hp-art { transition: none; }
  a.hp-tile:hover .hp-art { transform: translateY(-50%); }
  a.hp-tile:hover { transform: none; }
}
