/* Rack & Save PH — FINAL link legibility correction.
   Normal WORD links in page content: bold red.
   Solid-background buttons: WHITE text on colored backgrounds.
   Outline/transparent buttons retain their distinct original styling.
   Main only: header/nav/footer untouched. */

/* Word-only links: specifically exclude all button-style and photographic links,
   including the SEO project CTA which does not have a 'button' class. */
main a[href]:not(:is(
  .button, .btn, .nav-quote, .phone, .contact-number,
  .megarack-app-photo-tile, .solution-photo, .content-product-card,
  .content-product-image-link,
  .visual-product-link, .product-picture-card, .application-photo-link,
  [data-image-viewer], [style*="background"],
  .gallery a, .ph-business-photo-grid a,
  .seo-ph-next a,
  .product-background-hero a, .corp-hero a, .project-planning a
)) {
  color: #bb1429 !important;
  font-weight: 700 !important;
}

/* CRITICAL: red filled CTA buttons must NEVER inherit the word-link red color.
   This includes both buttons visible in the user's warehouse screenshot.
   White is enforced on normal, visited, hover and keyboard-focus states. */
main a.button:not(.button-outline),
main a.button:not(.button-outline):visited,
main a.button:not(.button-outline):hover,
main a.button:not(.button-outline):focus-visible,
main .seo-ph-context .seo-ph-next a,
main .seo-ph-context .seo-ph-next a:visited,
main .seo-ph-context .seo-ph-next a:hover,
main .seo-ph-context .seo-ph-next a:focus-visible,
main .mega-load-panel a.button:not(.button-outline),
main .mega-load-panel a.button:not(.button-outline):hover {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration: none;
}

/* Keep the original filled red background and its darker hover shade.
   Do not alter outline buttons, which have light/transparent backgrounds. */
main .seo-ph-context .seo-ph-next a {
  background: #bb1429 !important;
}
main .seo-ph-context .seo-ph-next a:hover,
main .seo-ph-context .seo-ph-next a:focus-visible {
  background: #981222 !important;
}

/* Text links on dark photographic hero backgrounds remain white, not red. */
main .product-background-hero a:not(.button),
main .product-background-hero a:not(.button):visited,
main .corp-hero a:not(.button),
main .corp-hero a:not(.button):visited {
  color: #ffffff !important;
}

/* Application cards: the image and the corresponding Explore action link
   to the SAME destination. Card titles/descriptions remain plain text. */
main div.content-product-card { cursor: default; }
main div.content-product-card .product-card-body > strong,
main div.content-product-card .product-card-description {
  color: #142630 !important;
  text-decoration: none !important;
}
main div.content-product-card a.product-card-cta,
main div.content-product-card a.product-card-cta:visited,
main div.content-product-card a.product-card-cta:hover,
main div.content-product-card a.product-card-cta:focus-visible {
  display: inline-block !important;
  align-self: flex-start !important;
  width: auto !important;
  margin-top: auto !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #bb1429 !important;
  -webkit-text-fill-color: #bb1429 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
main .application-directory .content-product-card .product-card-cta::after {
  content: none !important;
}

/* v4: linked images are full-size clickable surfaces without changing the
   established card layout, crop, appearance, or red word-link styling. */
main .content-product-card > a.content-product-image-link,
main .content-product-card > a.content-product-image-link:visited,
main .content-product-card > a.content-product-image-link:hover {
  display: block !important;
  width: 100% !important;
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  line-height: 0 !important;
  background: transparent !important;
  text-decoration: none !important;
  cursor: pointer !important;
}
main .content-product-card > a.content-product-image-link > img {
  display: block !important;
  width: 100% !important;
  height: 220px !important;
  object-fit: cover !important;
  flex: none !important;
  border-radius: 0 !important;
}
main .application-directory .content-product-card > a.content-product-image-link > img {
  height: 200px !important;
}
main .content-product-card > a.content-product-image-link:focus-visible {
  outline: 3px solid #bb1429 !important;
  outline-offset: -3px !important;
}
@media (max-width: 600px) {
  main .content-product-card > a.content-product-image-link > img {
    height: 230px !important;
  }
}
