/* Home page (index.html): hero, category index, configurator band, shops and
   the search results that replace them. Loaded after css/style.css and
   css/parts.css. The bands (.band-*) and .section come from style.css.
   html.is-searching is set by js/index.js (and by a line in index.html for a
   link with ?q=) while the results are showing. */

.page-home main { padding-bottom: 0; }

/* ---------- section rhythm ---------- */
.home .section { padding-block: 72px; }
.home .section-head { align-items: flex-end; margin-bottom: 30px; }
.home .section-head h2, .howto h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
.home .section-head p { margin-top: 8px; max-width: 40em; font-size: 15.5px; color: var(--ink-2); }
.home .section-head p:empty { display: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 64px; align-items: center; padding-block: 48px 56px; }
.hero-text { min-width: 0; padding-top: 12px; }
/* Without a price box (it failed to load) js/index.js adds .hero-solo and the column goes. */
.hero-solo { grid-template-columns: minmax(0, 1fr); }
.hero-solo .hero-example { display: none; }
.hero-solo .hero-text { max-width: 760px; }
.hero h1 { max-width: 11em; font-size: clamp(38px, 5.4vw, 64px); font-weight: 750; line-height: 1; letter-spacing: -.04em; }
.lead { max-width: 34em; margin: 22px 0 30px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

.search.lg .search-field { height: 62px; padding: 0 20px; border-radius: 12px; border-color: var(--line-2); background: var(--surface); box-shadow: 0 2px 0 rgb(15 26 46 / .04); }
.search.lg .search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.try { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: 13.5px; color: var(--ink-3); }
.try-label { margin-right: 4px; }
.try .chip { border-color: var(--line-2); color: var(--ink); }
.try .chip:hover { border-color: var(--accent); color: var(--accent); }

.stats { display: flex; flex-wrap: wrap; gap: 18px 40px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.stats:empty { display: none; }
.stat { display: grid; gap: 4px; }
.stat b { font: 700 30px/1 var(--font-display); letter-spacing: -.02em; }
.stat span { font-size: 13.5px; color: var(--ink-2); }

/* ---------- hero comparison: a real price box with bars drawn from zero ---------- */
.compare {
  display: block; min-width: 0; padding: 26px 26px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
  box-shadow: var(--shadow-md); color: var(--ink); text-decoration: none; transition: border-color .15s;
}
.compare:hover { color: var(--ink); border-color: var(--line-2); }
.compare-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.compare-pic { width: 80px; height: 80px; }
.compare-kicker { font-size: 13px; color: var(--ink-3); }
.compare-name { margin: 4px 0; font: 700 24px/1.1 var(--font-display); letter-spacing: -.02em; overflow-wrap: anywhere; }
.compare-sub { font-size: 13.5px; color: var(--ink-2); }
.compare-best { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 16px; margin: 18px 0 14px; padding: 14px 16px; border-radius: var(--r-l); background: var(--good-soft); }
.compare-label { font-size: 13.5px; font-weight: 600; color: var(--good); }
.compare-best > b { grid-column: 2; grid-row: 1 / span 2; font: 700 34px/1 var(--font-display); letter-spacing: -.02em; color: var(--good); }
.compare-gap { grid-column: 1; font-size: 13px; color: var(--ink-2); }
.compare-gap b { color: var(--ink); font-weight: 650; }

/* style.css resets only <ul> */
.cbars, .howto-slots { margin: 0; padding: 0; list-style: none; }
.cbars { display: grid; }
.cbars li { display: grid; grid-template-columns: 132px minmax(0, 1fr) 80px; align-items: center; gap: 12px; padding: 4px 0; font-size: 13.5px; }
.cb-shop { overflow: hidden; color: var(--ink-2); }
.cb-shop > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-track {
  position: relative; height: 14px;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: var(--tick) 100%;
}
.cb-track i { position: absolute; left: 0; top: 2px; bottom: 2px; border-radius: 0 3px 3px 0; background: var(--ill-mid); }
.cb-price { text-align: right; font-weight: 600; white-space: nowrap; }
.cbars li.best .cb-shop { color: var(--good); font-weight: 650; }
.cbars li.best .cb-track i { background: var(--good); }
.cbars li.best .cb-price { color: var(--good); font-weight: 700; }
.cb-axis { display: grid; grid-template-columns: 132px minmax(0, 1fr) 80px; gap: 12px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.cb-axis-in { position: relative; grid-column: 2; height: 14px; }
.cb-axis-in span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.cb-axis-in span:first-child { transform: none; }
.compare-note { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.compare-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--accent); }
.compare:hover .compare-more { color: var(--accent-2); }

/* ---------- category index: drawings in hairline cells ---------- */
/* Each cell draws its own right and bottom hairline; the grid clips the ones
   on its outer edge, where its own border is. An unfinished last row stays white. */
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.cat-grid > li { display: grid; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.cat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 24px 22px 22px;
  color: var(--ink); text-decoration: none; transition: background-color .15s;
}
a.cat-card:hover { background: var(--tint); color: var(--ink); }
a.cat-card:hover h3 { color: var(--accent); }
/* the grid clips what is outside the cells, so the ring is drawn inside */
a.cat-card:focus-visible { outline-offset: -3px; }
.cat-card.is-empty { color: var(--ink-3); }
.cat-card .art { width: 72px; height: 72px; }
.cat-text { display: grid; gap: 3px; min-width: 0; }
.cat-card h3 { font: 700 19px/1.15 var(--font-display); letter-spacing: -.015em; }
.cat-count { font-size: 13.5px; color: var(--ink-2); }

/* ---------- build your own: the deep band ---------- */
.band-deep .section { padding-block: 80px; }
.howto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px 72px; align-items: center; }
.howto h2 { color: var(--on-deep); }
.howto-text p { max-width: 32em; margin: 12px 0 22px; font-size: 17px; color: var(--band-ink-2); }
.howto-btn { background: var(--surface); border-color: var(--surface); color: var(--deep); }
.howto-btn:hover { background: var(--tint); border-color: var(--tint); color: var(--deep); }
.howto-note { margin-bottom: 10px; font-size: 13.5px; color: var(--band-ink-2); }
.howto-checks { padding: 6px 22px; border: 1px solid var(--band-line); border-radius: 14px; background: rgb(255 255 255 / .06); }
.howto-checks li { display: grid; gap: 3px; padding: 14px 0; border-top: 1px solid var(--band-line); }
.howto-checks li:first-child { border-top: 0; }
.howto-checks b { font-size: 15px; font-weight: 600; color: var(--on-deep); }
.howto-checks span { font-size: 13.5px; color: var(--band-ink-2); }
.howto-limits { margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--band-ink-2); }

/* the eight slots: cells divided by hairlines straight on the band, like the
   category index on white (each cell draws its right and bottom line, the grid
   clips the outer ones). Only the drawing has a light tile behind it. */
.howto-slots { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 16px; border: 1px solid var(--band-line); border-radius: 14px; overflow: hidden; }
.howto-slot { display: grid; justify-items: start; align-content: start; gap: 12px; padding: 18px 14px 16px; box-shadow: 1px 0 0 var(--band-line), 0 1px 0 var(--band-line); }
.howto-slot .thumb { width: 56px; height: 56px; }
.howto-slot > span:last-child { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--on-deep); }

/* ---------- shops ---------- */
.shops { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.shop-tile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 16px 0 18px; border-top: 1px solid var(--line); }
.shop-name { font: 700 18px/1.2 var(--font-display); letter-spacing: -.01em; }
.shop-when { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.shop-when.stale { color: var(--warn); }
.shop-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.shop-when.stale .shop-dot { background: var(--warn); }

/* ---------- search results ---------- */
/* Either the hero and the sections under it, or the results (html.is-searching). */
html:not(.is-searching) .results-intro, html:not(.is-searching) .search-view { display: none; }
.is-searching .hero-intro, .is-searching .try, .is-searching .stats, .is-searching .hero-example, .is-searching .home-sections { display: none; }
.is-searching .hero { grid-template-columns: minmax(0, 1fr); padding-block: 40px 44px; }
.is-searching .hero-text { padding-top: 0; }
.is-searching .search.lg { max-width: 760px; }
.results-intro h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 700; line-height: 1.05; letter-spacing: -.03em; }
.results-count { min-height: 24px; margin: 10px 0 22px; font-size: 16px; color: var(--ink-2); }

.search-view .section { padding-block: 28px 72px; }
.rchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.rchips .chip { height: 34px; }
.chip-n { color: var(--ink-3); font-weight: 500; }
/* on the results the chosen category is ink, not the usual cobalt wash */
.rchips .chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--on-deep); }
.rchips .chip[aria-pressed="true"]:hover { color: var(--on-deep); }
.rchips .chip[aria-pressed="true"] .chip-n { color: var(--band-ink-2); }
.results-note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.search-view .notice.card { max-width: 560px; }
.search-view .notice p { color: var(--ink-2); }
.search-view .notice-error { max-width: none; margin-bottom: 18px; padding: 14px 18px; border-radius: var(--r-m); background: var(--bad-soft); }

/* ---------- the Geekomat ad, under the categories ----------
   Its look is css/promo.css; here only the room under it. Hidden with the
   other sections while search results show. */
.band-promo .wrap { padding-bottom: 72px; }
.band-promo .wrap:empty { display: none; }

/* ---------- breakpoints ---------- */
@media (min-width: 721px) {
  .search.lg .search-field input { font-size: 17px; }
}
@media (min-width: 1021px) {
  /* The price box arrives after the page is shown: its room (about the height of
     a box with a dozen shops) is kept until it is there, so nothing below jumps. */
  .hero-example:empty { min-height: 670px; }
}
@media (max-width: 1100px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 44px; }
  .compare { max-width: 620px; }
  .howto { grid-template-columns: minmax(0, 1fr); }
  .howto-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
  .shops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .home .section { padding-block: 52px; }
  .band-deep .section { padding-block: 56px; }
  .home .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hero { padding-bottom: 52px; }
  .lead { font-size: 16.5px; }
  .stats { gap: 16px 28px; margin-top: 30px; }
  .stat b { font-size: 24px; }
  .compare { padding: 20px 18px 18px; }
  .search-view .section { padding-block: 20px 52px; }
  .band-promo .wrap { padding-bottom: 52px; }
}
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-card { gap: 12px; padding: 18px 16px; }
  .cat-card .art { width: 56px; height: 56px; }
  .cat-card .art svg { width: 56px; height: 56px; }
  .cat-card h3 { font-size: 16.5px; }
  .howto-slot { padding: 14px 10px 12px; }
  .howto-slot > span:last-child { font-size: 12px; }
}
@media (max-width: 520px) {
  .shops { grid-template-columns: minmax(0, 1fr); }
  .compare-top { grid-template-columns: 64px minmax(0, 1fr); gap: 14px; }
  .compare-pic { width: 64px; height: 64px; }
  .compare-name { font-size: 21px; }
  .compare-best > b { font-size: 30px; }
  /* name and price on one line, the bar full width under them */
  .cbars li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "shop price" "track track"; gap: 3px 12px; padding: 6px 0; }
  .cb-track { height: 12px; }
  .cb-shop { grid-area: shop; }
  .cb-price { grid-area: price; }
  .cb-track { grid-area: track; }
  .cb-axis { grid-template-columns: minmax(0, 1fr); }
  .cb-axis-in { grid-column: 1; }
  .cb-axis-in span:last-child { transform: translateX(-100%); }
}
