/*
 * Front page (template/home.php), after the mockup's shop home (iProff mockup, shop-home.module.css and
 * shop-product-card.module.css): picture tiles, light cards with a round action button,
 * blue chips. Loaded on the front page only (home-sections.php).
 */
.home {
  --home-ink: #1d1d1f;
  --home-muted: #5b5b66;
  --home-line: #e5e5ea;
  --home-soft: #f5f5f7;
  --home-blue: #0071e3;
  --home-blue-soft: #f0f7ff;
  font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--home-ink);
}

.home .container {
  display: block;
}

/* Hero: H1 and lead (why-us.php part 'intro') and the category tiles; the header has the search */
.home h1,
.home h2,
.home h3 {
  font-family: inherit;
}

.home-hero {
  padding: 40px 0 0;
}

.home-hero .why-us-intro h1 {
  margin: 0;
  font-size: 40px;
  line-height: 48px;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: #000;
}

.home-hero .why-us-intro p {
  max-width: 620px;
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--home-muted);
}

/* Tiles: equal cards across the row, the picture standing on a soft grey */
.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 32px;
}

.home-tiles a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 18px 12px 16px;
  border-radius: 18px;
  background: var(--home-soft);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--home-ink);
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease;
}

.home-tiles a:hover,
.home-tiles a:focus-visible {
  background: #ececf0;
}

.home-tile-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 84px;
}

.home-tile-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 120px;
  max-height: 84px;
  mix-blend-mode: multiply; /* the white behind the photos melts into the grey */
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.home-tiles a:hover .home-tile-image img,
.home-tiles a:focus-visible .home-tile-image img {
  transform: scale(1.06);
}

/* Why-us strip (why-us.php part 'items'): four short facts in one row between hairlines */
.why-us-strip {
  margin-top: 32px;
  font-family: "Inter", "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.why-us-strip ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e5e5ea;
  border-bottom: 1px solid #e5e5ea;
}

.why-us-strip li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 18px 20px;
  color: #1d1d1f;
}

.why-us-strip li:first-child {
  padding-left: 0;
}

.why-us-strip li + li {
  border-left: 1px solid #e5e5ea;
}

.why-us-strip svg {
  flex: none;
  margin-top: 1px;
}

.why-us-strip span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  color: #5b5b66;
}

.why-us-strip strong {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #1d1d1f;
}

@media (max-width: 991.98px) {
  .why-us-strip ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .why-us-strip li:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .why-us-strip li:nth-child(n+3) {
    border-top: 1px solid #e5e5ea;
  }
}


/* Sections */
.home-section {
  margin-top: 56px;
}

.home-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.home-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--home-ink);
}

.home-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--home-blue);
  text-decoration: none;
  white-space: nowrap;
}

.home-view-all:hover {
  text-decoration: underline;
}

.home-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.home-chips[hidden] {
  display: none;
}

.home-chips::-webkit-scrollbar {
  display: none;
}

.home-chips button {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 7px 16px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 18px;
  color: var(--home-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.home-chips button:hover {
  background: var(--home-soft);
}

.home-chips button[aria-pressed="true"] {
  background: var(--home-blue);
  color: #fff;
}

/* Cards */
.home-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-row > li {
  min-width: 0;
}

.home-row > li[hidden] {
  display: none;
}

.home-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  min-height: 300px;
  padding: 16px 16px 56px;
  border: 1px solid var(--home-line);
  border-radius: 20px;
  background: #fff;
  transition: border-color 250ms ease;
}

.home-card:hover {
  border-color: #c9c9d1;
}

.home-card-simple {
  min-height: 252px;
}

.home-card-badge {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  padding: 3px 8px;
  border-radius: 48px;
  background: #fff4e5;
  color: #934500;
  font-size: 11px;
  font-weight: 500;
  line-height: 15px;
}

.home-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 156px;
  margin-bottom: 12px;
}

.home-card-simple .home-card-image {
  height: 120px;
  margin-bottom: 14px;
}

.home-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 300ms ease;
}

.home-card:hover .home-card-image img {
  transform: scale(1.03);
}

.home-card-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 40px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #18191f;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.home-card-name:hover {
  text-decoration: underline;
}

.home-card-price {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.2px;
  color: #18191f;
  white-space: nowrap;
}

.home-card-simple .home-card-price {
  font-size: 16px;
  line-height: 22px;
}

.home-card-sale s {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: #727281;
}

.home-card-used {
  margin-top: 4px;
  font-size: 13px;
  line-height: 18px;
  color: var(--home-blue);
  text-decoration: none;
}

.home-card-used:hover {
  text-decoration: underline;
}

.home-card-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--home-blue-soft);
  color: var(--home-blue);
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}

.home-card-action:hover,
.home-card-action:focus-visible {
  background: var(--home-blue);
  color: #fff;
}

.home-card-action[disabled] {
  opacity: 0.5;
  cursor: progress;
}

/* "More options" */
.home-directions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-direction {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 144px;
  padding: 20px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--home-soft);
  color: var(--home-ink);
  text-decoration: none;
  transition: background-color 180ms ease;
}

.home-direction:hover {
  background: #ececf0;
}

.home-direction-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.home-direction-title {
  margin-bottom: 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.25px;
}

.home-direction-desc {
  font-size: 13px;
  line-height: 19px;
  color: var(--home-muted);
}

.home-direction-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 18px;
  color: var(--home-blue);
}

.home-direction-used {
  flex: none;
  width: 73px;
  height: auto;
  align-self: flex-end;
  margin: 0 -20px -20px 0;
}

.home-direction-image {
  flex: none;
  width: 80px;
  height: 104px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.home-direction-icon {
  flex: none;
  color: var(--home-ink);
}

/* The store block follows the last section */
.home + .visit-us {
  margin-top: 56px;
}

@media (max-width: 1099.98px) {
  .home-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .home-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-directions {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-direction {
    min-height: 120px;
  }
}

@media (max-width: 767.98px) {
  .home-hero {
    padding-top: 24px;
  }

  .home-hero .why-us-intro h1 {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.5px;
  }

  .home-hero .why-us-intro p {
    font-size: 15px;
    line-height: 22px;
  }

  /* tiles: one row of cards that scrolls sideways, to the screen edge */
  .home-tiles {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 20px -20px 0;
    padding: 0 20px;
  }

  .home-tiles::-webkit-scrollbar {
    display: none;
  }

  .home-tiles a {
    flex: 0 0 108px;
    gap: 8px;
    padding: 12px 8px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 18px;
  }

  .home-tile-image {
    height: 60px;
  }

  .home-tile-image img {
    max-width: 88px;
    max-height: 60px;
  }

  .why-us-strip {
    margin-top: 24px;
  }

  .why-us-strip li {
    padding: 14px 12px 14px 0;
    gap: 10px;
  }

  .why-us-strip li + li {
    padding-left: 12px;
  }

  .why-us-strip li:nth-child(3) {
    padding-left: 0;
  }

  .home-section {
    margin-top: 40px;
  }

  .home-heading h2 {
    font-size: 21px;
    line-height: 28px;
  }

  .home-chips {
    margin: 0 -20px 14px;
    padding: 0 20px;
  }

  .home-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-card {
    min-height: 0;
    padding: 12px 12px 52px;
    border-radius: 16px;
  }

  .home-card-image {
    height: 120px;
  }

  .home-card-simple .home-card-image {
    height: 100px;
  }

  .home-card-name {
    font-size: 13px;
    line-height: 18px;
    min-height: 36px;
  }

  .home-card-price {
    font-size: 16px;
  }

  .home-card-simple .home-card-price {
    font-size: 15px;
  }

  .home + .visit-us {
    margin-top: 40px;
  }
}

@media (max-width: 575.98px) {
  /* the strip: one fact a row, so the short lines don't wrap into narrow columns */
  .why-us-strip ul {
    grid-template-columns: 1fr;
  }

  .why-us-strip li,
  .why-us-strip li + li,
  .why-us-strip li:nth-child(3) {
    padding: 12px 0;
    border-left: 0;
  }

  .why-us-strip li + li {
    border-top: 1px solid #e5e5ea;
  }

  .why-us-strip span {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-tile-image img,
  .home-card-image img,
  .home-chips button,
  .home-card,
  .home-direction {
    transition: none;
  }

  .home-tiles a:hover .home-tile-image img,
  .home-card:hover .home-card-image img {
    transform: none;
  }
}
