/* Project styles layered on top of Bootstrap 5.
   Keep this thin - prefer Bootstrap utilities and components over new CSS, so
   the remaining legacy pages can be converted by reaching for the same classes. */

:root {
  --qp-brand: #0d5aa7;

  /* Barlow is self-hosted in css/fonts.css. Setting Bootstrap's own custom
     property applies it everywhere at once, rather than repeating font-family
     on individual rules the way the legacy stylesheet did. */
  --bs-body-font-family: 'Barlow', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bootstrap's default secondary text is 4.45:1 on --bs-tertiary-bg, just
     under WCAG AA. Darkened so nav, footer, .text-secondary and .link-secondary
     all pass. The -rgb pair matters: .text-secondary and .link-secondary resolve
     through rgba(var(--bs-...-rgb), opacity), so setting only the plain colour
     property leaves them unchanged. */
  --bs-secondary-color: #5c636a;
  --bs-secondary-color-rgb: 92, 99, 106;
  --bs-secondary-rgb: 92, 99, 106;
}

/* Condensed is the display face: headings and the large numeric readouts. */
h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: var(--qp-heading-font);
  letter-spacing: .02em;
}

.navbar-brand {
  letter-spacing: -0.01em;
}

/* The selector's result panel is preformatted text from the hydraulics code. */
#out {
  font-size: .85rem;
  line-height: 1.5;
  max-height: 32rem;
  overflow-y: auto;
}

/* Tables emitted into the alternative-pumps box by selector.js are raw HTML,
   so they need the Bootstrap look applying from here. */
#altPumpsBox table {
  width: 100%;
  margin-bottom: 0;
  font-size: .875rem;
}

#altPumpsBox th,
#altPumpsBox td {
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--bs-border-color);
  text-align: left;
}

#altPumpsBox th {
  font-weight: 600;
  color: var(--bs-secondary-color);
}

/* ---- Header: logo row, then the department bar ---------------------------
   Its own blue: --qp-brand is redefined as a light cyan on the selector page,
   which fails contrast here, and the header must look the same everywhere. */
:root { --qp-header-blue: #0d5aa7; }

/* The site's look as variables (stage 5, themes, 4 Dec 2026). Each default
   is exactly the value the rules used to write out, so with no theme chosen
   nothing changes; app/theme.py writes a <style> over these when a theme or
   our own colours are published. Contrast is checked there, before saving. */
:root {
  --qp-brand-dark: #0a4886;        /* hover on brand, the banner's gradient end */
  --qp-brand-tint: #e8f0f9;        /* a pale wash of the brand */
  --qp-brand-line: #a9c3e3;        /* a border in the brand, on hover */
  --qp-brand-shadow: rgba(13, 90, 167, .12);
  --qp-on-brand: #e3edf8;          /* softer words on the brand */
  --qp-on-brand-2: #dbe7f5;
  --qp-cta-tint: #eef4fb;          /* the light call to action */
  --qp-cta-line: #cfe0f3;
  --qp-link-light: #0a58ca;        /* links on the light grey background */
  --qp-panel: #f4f6f8;             /* the grey panel under a tile's or card's words */
  --qp-light-bg: #f5f7fa;          /* a block's light grey background */
  --qp-heading-font: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --qp-radius-lg: .75rem;          /* tiles, cards, calls to action */
  --qp-radius-md: .5rem;           /* pictures, menus, the banner's box */
}

/* The header stays to hand while the page scrolls, kept slim. On a computer
   it sticks with a negative top the height of the logo row, so the logo row
   scrolls away and the navigation bar is what stays pinned. On a phone the
   whole header sticks, and slides away while scrolling down (base.html). */
.qp-header {
  position: sticky;
  top: calc(-1 * var(--qp-brandrow-h, 0px));
  z-index: 1030;
}

@media (max-width: 767.98px) {
  .qp-header {
    top: 0;
    transition: transform .2s ease;
  }
  .qp-header.qp-header-away { transform: translateY(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .qp-header { transition: none; }
}

/* Anchor jumps land below the sticky header, not under it. */
html { scroll-padding-top: calc(var(--qp-header-h, 0px) + .75rem); }

.qp-brandrow {
  padding: .6rem 0;
  background: #fff;
  border-bottom: 1px solid var(--bs-border-color);
}

/* Logo left, search in the middle, contact links right. On a phone the
   search drops to its own full-width line below the logo. */
.qp-brandrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
}

.qp-brandrow-links {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  order: 2;
}

.qp-topsearch {
  flex: 1 1 22rem;
  max-width: 36rem;
  margin: 0 auto;
  order: 1;
}

.qp-topsearch-go {
  font-weight: 600;
  color: #fff;
  background: var(--qp-header-blue);
  border-color: var(--qp-header-blue);
}

.qp-topsearch-go:hover,
.qp-topsearch-go:focus-visible {
  color: #fff;
  background: var(--qp-brand-dark);
  border-color: var(--qp-brand-dark);
}

@media (max-width: 767.98px) {
  .qp-brandrow { padding: .45rem 0; }
  .qp-topsearch { flex-basis: 100%; max-width: none; order: 3; }
  .qp-brand { font-size: 1.35rem; }
  .qp-brand img { height: 28px; width: auto; }
}

.qp-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--qp-heading-font);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--bs-emphasis-color);
  text-decoration: none;
}

.qp-brandrow-link {
  font-size: .875rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.qp-brandrow-link:hover { color: var(--qp-header-blue); }

/* The departments. Positioned, so a department's panel can span the page
   beneath it; the row itself scrolls sideways on a phone rather than hiding
   behind a toggler. */
.qp-depts {
  position: relative;
  z-index: 1020;
  background: #eef1f4;
  border-bottom: 1px solid var(--bs-border-color);
}

.qp-depts-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qp-depts-row {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

/* The search box, docked on the left of the bar while scrolled. */
.qp-depts-search { flex: 0 1 18rem; }
.qp-depts-search .qp-topsearch { max-width: none; margin: 0; }
.qp-depts-search .form-control,
.qp-depts-search .btn { padding-top: .3rem; padding-bottom: .3rem; }

/* Centred - with auto margins rather than justify-content, so that when a
   phone is too narrow for the bar it scrolls from the first item instead of
   cutting it off on the left. */
.qp-depts-row > :first-child { margin-left: auto; }
.qp-depts-row > :last-child { margin-right: auto; }

.qp-dept {
  position: relative;
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .85rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
  text-decoration: none;
  white-space: nowrap;
}

/* A department with a panel is a plain wrapper, so the panel positions
   against the whole bar and spans the page. */
.qp-depts-row > .qp-mega { position: static; display: flex; }

/* The thin dividers between departments, as in a shop's department bar -
   drawn on the link itself, which is positioned, whichever wrapper it is in. */
.qp-depts-row > * + .qp-dept::before,
.qp-depts-row > * + .qp-mega > .qp-dept::before {
  content: "";
  position: absolute;
  left: 0;
  top: 30%;
  bottom: 30%;
  border-left: 1px solid #b9c1c9;
}

.qp-dept.active::before,
.qp-mega.open > .qp-dept::before { display: none; }

.qp-dept:hover { color: var(--qp-header-blue); }

/* Manufacturers and Pumps: the name is a link to the page, the arrow beside
   it opens the panel. The two read as one item - same colours, no gap. */
.qp-mega > .qp-dept { padding-right: .3rem; }
.qp-dept-caret {
  /* Positioned so its visually hidden label stays inside the scrolling row:
     against the whole bar it stuck out past a phone's edge (16 Nov 2026). */
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 1.1rem 0 .3rem;
  border: 0;
  background: transparent;
  color: var(--bs-emphasis-color);
  font-size: 1.1rem;
}
.qp-dept-caret::after { margin-left: 0; }
/* Keyboard focus: a white ring inside the blue, not the browser's dark box
   round the outside. */
.qp-dept:focus-visible,
.qp-dept-caret:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -5px;
  box-shadow: none;
}
.qp-dept:not(.active):focus-visible,
.qp-mega:not(.open) > .qp-dept-caret:not(.active):focus-visible { outline-color: var(--qp-header-blue); }
.qp-dept-caret:hover { color: var(--qp-header-blue); }

/* A fixed blue rather than --qp-brand: the selector's stylesheet redefines
   that as a light cyan, which fails contrast behind white text, and the
   header should look the same on every page. */
.qp-dept.active,
.qp-dept-caret.active,
.qp-mega.open > .qp-dept,
.qp-mega.open > .qp-dept-caret,
.qp-dept.active:hover,
.qp-dept-caret.active:hover {
  color: #fff;
  background: var(--qp-header-blue);
}

/* ---- The Pumps panel -----------------------------------------------------
   Heading, "Shop all pumps", then the categories as thumbnail tiles. Opens
   full width under the department bar; on the home page it is the page. */
.qp-mega-menu {
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  margin-top: 0;
  padding: 1.25rem 0 1.5rem;
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: 0 12px 24px rgba(29, 35, 40, .12);
}

.qp-mega-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .75rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--qp-header-blue);
}

.qp-mega-title {
  font-family: var(--qp-heading-font);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--qp-header-blue);
}

.qp-mega-all { font-weight: 600; }

.qp-mega-title { text-decoration: none; }
.qp-mega-title:hover { text-decoration: underline; }

/* Submersible / Surface over each run of tiles in the Pumps panel. */
.qp-mega-group {
  margin: 0 0 .5rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bs-secondary-color);
}
.qp-mega-grid + .qp-mega-group { margin-top: 1.25rem; }

.qp-mega-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: .75rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.qp-mega-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .35rem;
  color: var(--bs-body-color);
  text-decoration: none;
  border-radius: var(--qp-radius-md);
}

.qp-mega-item:hover,
.qp-mega-item:focus-visible { background: var(--qp-brand-tint); color: var(--bs-body-color); }

.qp-mega-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.qp-mega-item:hover .qp-mega-thumb { border-color: var(--qp-header-blue); }

.qp-mega-thumb img {
  max-width: 56px;
  max-height: 56px;
  object-fit: contain;
}

.qp-mega-name {
  display: block;
  font-size: 1.05rem;
  line-height: 1.2;
}

.qp-mega-count {
  display: block;
  font-size: .8125rem;
  color: var(--bs-secondary-color);
}

/* On a phone the tiles become a list. */
@media (max-width: 767.98px) {
  .qp-mega-menu { padding: .75rem 0 1rem; }
  .qp-mega-head { margin-bottom: .75rem; }
  .qp-mega-title { font-size: 1.35rem; }
  .qp-mega-grid { grid-template-columns: 1fr; gap: .25rem; }
  .qp-mega-thumb { flex-basis: 48px; width: 48px; height: 48px; }
  .qp-mega-thumb img { max-width: 42px; max-height: 42px; }
}

/* ---- Home page ------------------------------------------------------------ */
.qp-hero {
  padding: 3.5rem 0 3rem;
  color: #fff;
  text-align: center;
  /* The colour is the gradient's own lighter end: what a browser without
     gradients shows, and what the contrast audit measures white text against. */
  background-color: var(--qp-header-blue);
  background-image: linear-gradient(135deg, var(--qp-header-blue) 0%, var(--qp-brand-dark) 100%);
}

.qp-hero-title {
  margin: 0 0 .75rem;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.05;
  color: #fff;
}

.qp-hero-lead {
  max-width: 44rem;
  margin: 0 auto 1.75rem;
  font-size: 1.15rem;
  color: var(--qp-on-brand);
}

/* The central search box: one field and a button, joined. */
.qp-hero-search {
  display: flex;
  max-width: 44rem;
  margin: 0 auto;
  border-radius: var(--qp-radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.qp-hero-search .form-control {
  border: 0;
  border-radius: var(--qp-radius-md) 0 0 var(--qp-radius-md);
}

.qp-hero-go {
  padding-inline: 1.75rem;
  font-weight: 600;
  color: #fff;
  background: #1d2328;
  border: 0;
  border-radius: 0 var(--qp-radius-md) var(--qp-radius-md) 0;
}

.qp-hero-go:hover,
.qp-hero-go:focus-visible { color: #fff; background: #000; }

.qp-hero-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem 1.75rem;
  margin-top: 1.25rem;
}

.qp-hero-links a { color: #fff; font-weight: 600; }

/* Pumps by type: the categories as large photo tiles. */
.qp-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.qp-type {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--qp-radius-lg);
  transition: border-color .15s, box-shadow .15s;
}

.qp-type:hover,
.qp-type:focus-visible {
  color: inherit;
  border-color: var(--qp-brand-line);
  box-shadow: 0 6px 18px var(--qp-brand-shadow);
}

.qp-type-photo {
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #fff;
}

.qp-type-photo img { max-height: 100%; max-width: 80%; object-fit: contain; }

.qp-type-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .9rem 1rem 1rem;
  background: var(--qp-panel);
  border-top: 1px solid #e9ecef;
}

.qp-type-name {
  font-family: var(--qp-heading-font);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--bs-emphasis-color);
}

.qp-type:hover .qp-type-name { color: var(--qp-header-blue); }

.qp-type-blurb { font-size: .9rem; color: var(--bs-secondary-color); }

.qp-type-count {
  margin-top: auto;
  padding-top: .25rem;
  font-weight: 600;
  color: var(--qp-header-blue);
}

/* ---- Coming-soon pages ---------------------------------------------------- */
.qp-soon { max-width: 40rem; }

/* ---- Manufacturers ---------------------------------------------------------
   Logos are wide, so their frame is too; white, as the logos are on white. */
.qp-maker-logo {
  flex: 0 0 104px;
  width: 104px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .3rem .4rem;
  background: #fff;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}

.qp-mega-item:hover .qp-maker-logo { border-color: var(--qp-header-blue); }
.qp-maker-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.qp-type-logo img { max-width: 75%; max-height: 90px; }

.qp-maker-hero {
  max-height: 72px;
  max-width: 200px;
  object-fit: contain;
}

/* A control panel group the Control Panels menu jumps to clears the sticky
   header (16 Nov 2026). */
.qp-anchor { scroll-margin-top: calc(var(--qp-header-h, 0px) + 1rem); }

/* Footer columns, from the site settings (3 Dec 2026): up to four, side by
   side on a computer, stacked on a phone. */
.qp-footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1.5rem;
}

/* ---- Card and tile looks set in Pages (4 Dec 2026) -----------------------
   Choices from a set list (pages.CARD_FIELDS / TILE_FIELDS): how many across
   on a wide screen, the photograph filling its box, fewer figures, a tile's
   picture beside its words. Colours never change, so contrast holds. */
@media (min-width: 992px) {
  .qp-grid.qp-cols-2, .qp-type-grid.qp-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .qp-grid.qp-cols-3, .qp-type-grid.qp-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .qp-grid.qp-cols-4, .qp-type-grid.qp-cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.qp-photo-fill .qp-card-photo { padding: 0; }
.qp-photo-fill .qp-card-photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.qp-figs.qp-figs-2 { grid-template-columns: repeat(2, 1fr); }
.qp-figs.qp-figs-1 { grid-template-columns: 1fr; }
@media (min-width: 576px) {
  .qp-tiles-beside .qp-type { flex-direction: row; }
  .qp-tiles-beside .qp-type-photo { flex: 0 0 42%; height: 170px; align-self: center; }
  .qp-tiles-beside .qp-type-body { border-top: 0; border-left: 1px solid #e9ecef; justify-content: center; }
}
/* Words over the picture: the picture fills the tile and the words sit on a
   dark band across its foot - dark enough for white text over a white photo. */
.qp-tiles-over .qp-type { position: relative; min-height: 320px; }
.qp-tiles-over .qp-type-photo { position: absolute; inset: 0; height: auto; padding: 1rem 1rem 4.5rem; }
.qp-tiles-over .qp-type-body { position: relative; flex: 0 0 auto; margin-top: auto; border-top: 0;
  background: rgba(8, 20, 36, .85); }
.qp-tiles-over .qp-type-name, .qp-tiles-over .qp-type:hover .qp-type-name { color: #fff; }
.qp-tiles-over .qp-type:hover .qp-type-name { text-decoration: underline; }
.qp-tiles-over .qp-type-blurb { color: #e9ecef; }
.qp-tiles-over .qp-type-count { color: #cfe2ff; }
/* Outline only: no grey panel, no line between picture and words. */
.qp-tiles-outline .qp-type { border: 2px solid #ced4da; }
.qp-tiles-outline:not(.qp-tiles-over) .qp-type-body { background: #fff; border-top: 0; border-left: 0; }
