/* Global overrides for measured defects */

/* Contrast fix */
a.nav-link {
  color: #5c2f0e !important;
}

span.clause-num {
  color: #5c2f0e !important;
}

section.cookie-banner p.cookie-banner-text a {
  color: #5c2f0e !important;
}

/* Stacked header fix at 320/390px */
@media (max-width: 768px) {
  a.masthead-contact-pill,
  .masthead-nameplate a.masthead-contact-pill {
    display: none !important;
  }
  .masthead-nameplate {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .masthead-nameplate .brand {
    max-width: 100% !important;
  }
  .masthead-nameplate .brand img {
    max-width: min(220px, 70vw) !important;
    height: auto !important;
  }
}

/* Wide measure fix */
p {
  max-width: 62ch;
}

/* Cookie banner fix for 768px overlaying content */
@media (min-width: 48rem) and (max-width: 1024px) {
  html body section.cookie-banner.cookie-banner {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 22vh;
    padding: 0.5rem 1rem;
    box-sizing: border-box;
    z-index: 999;
  }
  html body section.cookie-banner .cookie-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
}

/* Word breaks in headings */
h1 {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: manual;
}
@media (max-width: 480px) {
  h1 {
    font-size: clamp(1.2rem, 4.8vw, 1.65rem) !important;
    line-height: 1.15 !important;
  }
}
@media (min-width: 1200px) {
  h1 {
    font-size: clamp(1.8rem, 2.2vw, 2.6rem) !important;
  }
}

/* Rolling surface recommendation headline break */
@media (min-width: 1400px) {
  .compatibility-checker-box h3 {
    font-size: 1.15rem !important;
    word-break: normal;
  }
}
@media (max-width: 480px) {
  .compatibility-checker-box h3 {
    font-size: 1.1rem !important;
  }
}

/* Mobile viewport offscreen text & container width fixes */
@media (max-width: 480px) {
  *, *::before, *::after {
    box-sizing: border-box !important;
  }
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }
  .container,
  .container-reading,
  .container-narrow,
  article.container {
    padding-inline: 0.75rem !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  .item-showcase-layout,
  .counter-desk-layout {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  .item-gallery-column,
  .item-spec-column,
  .item-spec-box,
  .margin-layout,
  .main-column,
  .margin-column,
  .compatibility-checker-box,
  .form-ledger,
  .category-hero-header {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    padding-inline: 0 !important;
  }
  .item-spec-box,
  .compatibility-checker-box,
  .form-ledger {
    padding-inline: 0.75rem !important;
  }
  .spec-key-value-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.25rem !important;
  }
  .spec-key-value-row .spec-label,
  .spec-key-value-row .spec-val {
    max-width: 100% !important;
    word-break: break-word !important;
  }
}

/* Inconsistent controls in materials.html */
.btn,
.masthead-contact-pill {
  min-height: 44px !important;
  height: 44px !important;
  border-radius: var(--radius-subtle) !important;
  box-sizing: border-box !important;
}
