/* cl-home.css: the home (templates/home.html) and the Line pages (templates/line.html). The hero is PowerStop's, its
   photo, the H1 and the finder card under it (the card's box is the site's, partials/finder.html, cl-site.css
   .cl-finder); under it on the home the Which line table, or with a vehicle the Lines that fit it as tiles, and the
   links row. Every rule sits in @layer site (cl-site.css: the layer order), on cl-site.css's --site-* tokens; square
   boxes, full-contrast text (the tiles' intent grey by Greg's call). */
@layer base, kit, site;

@layer site {

/* the hero: the photo, the H1, the finder card under it */
.cl-home__hero { min-height: 700px; padding: 48px 144px 40px; background: var(--site-dark) center / cover no-repeat; }
.cl-home__hero-h { max-width: 1296px; font: 700 93px/74.4px var(--site-font-heading); letter-spacing: -1.5px; text-transform: uppercase; color: var(--site-dark-fg); }
.cl-home__finder { margin-top: 24px; }

/* with a vehicle picked the home's hero is the H1 over the finder's vehicle row, so its Lines start in the first screen */
.cl-home__hero.cl-home__hero--picked { min-height: 0; padding-top: 72px; padding-bottom: 72px; }
.cl-home__hero--picked .cl-home__hero-h { font-size: 56px; line-height: 48px; }
.cl-home__hero--picked .cl-finder__title { display: none; }

/* a Line's page: who it is for under the H1, and with a vehicle the Line has no part for, a white box saying so */
.cl-home__hero--line .cl-home__hero-h { font-size: 72px; line-height: 64px; }
.cl-home__about { max-width: 640px; margin-top: 20px; font: 400 21px/1.35 var(--site-font-body); color: var(--site-dark-fg); }
.cl-home__miss { max-width: 640px; margin-top: 24px; padding: 12px 16px; background: var(--site-bg); font: 400 18px/1.3 var(--site-font-body); color: var(--site-fg); }
.cl-home__miss a { color: var(--site-fg); text-decoration: underline; }
.cl-home__miss a:hover { color: var(--site-accent); }

/* the sections under the hero: a heading and its rule, then the table or the tiles */
.cl-home__wrap { max-width: var(--site-max); margin: 0 auto; padding: 32px 15px 96px; }
.cl-home__h2 { font: 700 28px/1.05 var(--site-font-heading); letter-spacing: 0.5px; text-transform: uppercase; color: var(--site-fg); }
.cl-home__head { display: flex; align-items: baseline; gap: 16px; margin-top: 48px; padding-bottom: 8px; border-bottom: 2px solid var(--site-fg); }
.cl-home__head + * { margin-top: 16px; }
.cl-home__which { padding-top: 0; padding-bottom: 56px; }
.cl-home__hero--picked + .cl-home__which > .cl-home__head:first-child { margin-top: 24px; }
.cl-home__clear { display: inline-flex; align-items: center; min-height: 40px; margin-top: 12px; font: 700 16px/1 var(--site-font-body); color: var(--site-fg); text-decoration: underline; }
.cl-home__none { margin-top: 24px; padding: 12px 16px; background: var(--site-band); font: 400 18px/1.3 var(--site-font-body); color: var(--site-fg); }
.cl-home__none a { color: var(--site-fg); text-decoration: underline; }

/* the Which line table: a Line a row, its name and its vehicle count the links */
.cl-home__table { width: 100%; border-collapse: collapse; font: 400 17px/1.3 var(--site-font-body); }
.cl-home__table th, .cl-home__table td { padding: 10px 12px; border-bottom: 1px solid var(--site-rule); text-align: left; vertical-align: top; }
.cl-home__table th { font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.cl-home__table th a { color: var(--site-fg); }
.cl-home__table-n { text-align: right; white-space: nowrap; font-weight: 700; }
.cl-home__table-n a { color: var(--site-fg); text-decoration: underline; }
.cl-home__table th a:hover, .cl-home__table-n a:hover { color: var(--site-accent); }
.cl-home__head + .cl-home__table { margin-top: 8px; }

/* the Lines for the picked vehicle: a tile a Line, the picture over its name, who it is for and the sides it comes for */
.cl-home__lines { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; list-style: none; padding: 0; }
.cl-home__line { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--site-rule); background: var(--site-bg); color: var(--site-fg); text-decoration: none; }
.cl-home__line:hover, .cl-home__line:focus-visible { border-color: var(--site-fg); box-shadow: 0 0 0 1px var(--site-fg); }
.cl-home__line-pic { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--site-photo); }
.cl-home__line-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cl-home__line-name { padding: 12px 14px 0; font: 700 22px/1.1 var(--site-font-heading); letter-spacing: 0.3px; text-transform: uppercase; }
.cl-home__line:hover .cl-home__line-name { color: var(--site-accent); }
/* the intent in grey (Greg), 60% of the ink as the product page's soft text */
.cl-home__line-who { padding: 6px 14px 0; font: 400 17px/1.3 var(--site-font-body); color: color-mix(in srgb, var(--site-fg) 60%, transparent); }
.cl-home__line-has { margin-top: auto; padding: 10px 14px 14px; font: 700 15px/1.3 var(--site-font-body); }
.cl-home__line-name:last-child { padding-bottom: 14px; }

/* the links row */
.cl-home__links { padding-top: 0; padding-bottom: 56px; }
/* Brakes by make: the /brakes hub's tiles (cl-pages.css) for the popular makes */
.cl-home__makes { padding-top: 0; padding-bottom: 56px; }
.cl-home__makes .cl-home__head { margin-top: 0; }
.cl-home__makes .cl-brakes__more { margin-top: 12px; }
/* the 16 in even rows: 8 a row on a wide screen, 4 from a tablet, the hub's 2 on a phone */
@media (min-width: 761px) { .cl-home__makes .cl-brakes__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .cl-home__makes .cl-brakes__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.cl-home__links-row { display: flex; flex-wrap: wrap; gap: 8px 24px; padding-top: 16px; border-top: 2px solid var(--site-rule); }
.cl-home__links-row a { display: inline-flex; align-items: center; min-height: 40px; color: var(--site-fg); font: 700 17px/1.2 var(--site-font-body); text-transform: uppercase; }
.cl-home__links-row a:hover { color: var(--site-accent); }

/* the home drawn in place (fm-site.js wireInPlace): the region dims while its answer is out, after a beat so a fast
   answer shows no flicker; only the opacity changes, never a height, so nothing under the pointer moves */
main[data-fm-inplace] { transition: opacity 0.12s ease; }
main[data-fm-inplace][aria-busy="true"] { opacity: 0.55; transition-delay: 0.12s; }
@media (prefers-reduced-motion: reduce) { main[data-fm-inplace] { transition: none; } }

@media (max-width: 1100px) {
  .cl-home__lines { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 979.98px) {
  .cl-home__hero { min-height: 0; padding: 25px 16px 40px; background-position: 70% center; }
  .cl-home__hero-h, .cl-home__hero--line .cl-home__hero-h { font-size: 44px; line-height: 35.2px; }
}

/* a phone: the H1 a little bigger and every other text a step smaller, so the first screen holds the H1 and the
   finder; inputs and selects stay 16px, a link 40px tall, nothing under 13px */
@media (max-width: 600px) {
  .cl-home__hero-h, .cl-home__hero--line .cl-home__hero-h { font-size: 50px; line-height: 42px; }
  .cl-home__hero.cl-home__hero--picked { padding-top: 36px; padding-bottom: 36px; }
  .cl-home__hero--picked .cl-home__hero-h { font-size: 36px; line-height: 34px; }
  .cl-home__about { margin-top: 14px; font-size: 17px; }
  .cl-home__miss { font-size: 15px; }
  .cl-home__miss a, .cl-home__none a { padding: 11px 0; }
  .cl-home__h2 { font-size: 22px; }
  .cl-home__head { flex-wrap: wrap; gap: 4px 12px; margin-top: 36px; }
  .cl-home__clear { font-size: 15px; }
  .cl-home__none { font-size: 15px; }
  .cl-home__table { font-size: 14px; }
  .cl-home__table th, .cl-home__table td { padding: 8px 6px; }
  .cl-home__table th { white-space: normal; }
  .cl-home__table tr { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--site-rule); }
  .cl-home__table th, .cl-home__table td { border-bottom: 0; }
  .cl-home__table td:not(.cl-home__table-n) { grid-column: 1 / -1; grid-row: 2; padding-top: 0; }
  .cl-home__table-n a { display: inline-flex; align-items: center; min-height: 40px; margin-top: -10px; }
  .cl-home__table th a { display: inline-flex; align-items: center; min-height: 40px; min-width: 40px; margin-top: -10px; }
  .cl-home__lines { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cl-home__line-name { padding: 10px 10px 0; font-size: 18px; }
  .cl-home__line-who { padding: 4px 10px 0; font-size: 15px; }
  .cl-home__line-has { padding: 8px 10px 10px; font-size: 13px; }
  .cl-home__links, .cl-home__which, .cl-home__makes { padding-left: 16px; padding-right: 16px; }
  .cl-home__links-row a { font-size: 15px; }
}

}
