:root {
  --color-grey-min: rgb(244, 244, 246);
  --color-grey-light: rgb(226, 226, 229);
  --color-grey-mid: rgb(153, 153, 160);
  --color-grey-dark: rgb(102, 102, 107);
  --color-grey-darker: rgb(40, 40, 44);
  --color-green: #00893b;
  --padding-default: 1.5rem;
  --padding-default-neg: calc(-1 * var(--padding-default));
  --column-right-width: 37%;
  --column-gap: var(--padding-default);
  --line-width: 2px;
  --line-color: var(--color-green);
}
@media all and (min-width: 48rem), print {
  :root {
    --padding-default: 2.25rem;
  }
}
@media all and (min-width: 72rem), print {
  :root {
    --width-column-right: 30%;
  }
}
@media all and (min-width: 80rem), print {
  :root {
    --padding-default: 3rem;
  }
}


/* Layout. */
* {
  box-sizing: border-box;
}
html {
  height: 100%;
  min-height: 100%;
  /* Prevent text resizing on orientation change. Requires full viewport meta tag. */
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
body {
  max-width: 80em;
  margin: 0 auto;
  height: 100%;
  font-family: Arial, sans-serif;
  font-size: 100%;
}
body * {
  max-height: 999999px;  /* Prevent Android font scaling */
}
@media all and (min-width: 120rem) {
  body {
    font-size: 112.5%;
  }
}
main {
  padding: 0 var(--padding-default);
}

/* Page backgrounds. */
html {
  background-color: var(--color-grey-dark);
}
body {
  background-color: var(--color-grey-darker);
}
header,
main {
  background-color: white;
}

/* Header & footer. */
header > .logo {
  display: block;
  width: 100%;
  padding: 2rem var(--padding-default);
}
.menu {
  background-color: var(--color-green);
}
.menu > * {
  display: block;
  padding: 1.2em var(--padding-default) 1.1em;
  border-top: 1px solid rgba(255, 255, 255, 0.8);
  font-weight: bold;
  text-decoration: none;
  color: white;
}
@media (hover: hover) {
  .menu > a[href]:hover {
    text-decoration: underline;
  }
}
.menu > a:first-child {
  border-top: none;
}
.menu > .legal {
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top: none;
  background-color: var(--color-grey-darker);
  font-weight: normal;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.5);
}
@media all and (min-width: 36rem), print {
  header > .logo {
    width: 33rem;
  }
  .menu > a {
    display: inline-block;
    border-top: none;
    margin: 0;
    padding-right: 0;
  }
  .menu > a:nth-child(n+2) {
    padding-left: 0;
  }
  .menu > a:nth-child(n+2)::before {
    content: '|';
    position: relative;
    top: -0.07rem;
    padding: 0 1.5rem;
  }
}

/* General text. */
h1, h2 {
  text-transform: uppercase;
  text-wrap: balance;
}
h1 {
  margin: 0 var(--padding-default-neg);
  padding:  clamp(1.5rem, 6.5vw, 6rem) var(--padding-default);
  background: white url('../images/grate-drops-blue.jpg') no-repeat center center;
  background-size: cover;
  font-size: 1rem;
  color: #afafca;
  text-shadow: black 0 0 0.6rem;
  letter-spacing: 0.16em;
  line-height: 1.4;
}
h2 {
  font-size: 1.13rem;
  margin: 2.5rem 0 0.5em 0;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
p, ul {
  line-height: 1.33;
}
ul {
  padding-left: 1.25em;
}
li {
  margin: 0.33em 0;
}

/* Images. */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Email/phone obfuscation. */
a[data-dest] > span {
  unicode-bidi: bidi-override;
  direction: rtl;
}

/* Mobile-only page-top image. */
img.mobile {
  max-width: clamp(11rem, 50vw, 18rem);
  margin: 1rem auto -1.5rem;
}
@media all and (min-width: 48rem), print {
  img.mobile {
    display: none;
  }
}

/* OVERVIEW SECTION. */
#overview {
  padding: 0 0 2.5rem 0;
}
#overview h2 {
  color: var(--color-green);
}

/* Column layout. */
#overview .container {
  margin-top: 2.5rem;
}
@media all and (min-width: 48rem), print {
  #overview .container {
    margin-top: 2rem;
  }
  #overview .description {
    display: flex;
  }
  #overview .description > div {
    padding-top: 0.7rem;
    padding-bottom: 1rem;
  }
  #overview .text {
    flex: 0 0 calc(100% - var(--column-right-width));
    padding-right: var(--column-gap);
    border-right: var(--line-width) solid var(--line-color);
  }
  #overview .resources {
    flex: 0 0 var(--column-right-width);
    padding-left: var(--column-gap);
  }
  #overview .products {
    width: 100%;
    border-top: var(--line-width) solid var(--line-color);
    padding: 0.7rem var(--column-gap) 0.7rem 0;
  }
}
@media all and (min-width: 60rem), print {
  #overview .container {
    display: flex;
    flex-direction: row-reverse;
  }
  #overview .description {
    display: block;
    flex: 0 0 var(--column-right-width);
  }
  #overview .text {
    padding-left: var(--column-gap);
    border-right: none;
  }
  #overview .products {
    border-top: none;
    border-right: var(--line-width) solid var(--line-color);
  }
}

/* Text. */
#overview .text > h2 {
  margin-top: 0;
  position: absolute;
  top: 999px;
  left:999px;
  height: 0;
}
#overview .text > p {
  max-width: 65ch;
}
@media all and (min-width: 48rem), print {
  #overview .text > h2 {
    position: static;
    height: auto;
  }
}

/* Resources. */
#overview .resources a {
  display: block;
  margin: 0 var(--padding-default-neg);
  padding: 0.7em var(--padding-default);
  border-bottom: var(--line-width) solid var(--line-color);
  background: transparent no-repeat var(--padding-default) 0.63em;
  background-size: 16px;
  font-weight: bold;
  text-decoration: none;
  text-indent: 1.5rem;
  text-wrap: balance;
  line-height: 1.25;
  color: black;
}
#overview .resources a[href$=\.pdf] {
  background-image: url(../images/icon-pdf-16x16.png);
}
#overview .resources a[href*=youtube\.com] {
  background-image: url(../images/icon-youtube-square.svg);
}
@media (hover: hover) {
  #overview .resources a:hover {
    text-decoration: underline;
  }
}
#overview .resources a:first-of-type {
  border-top: 2px solid var(--color-grey-mid);
}
@media all and (min-width: 48rem), print {
  #overview .resources > h2 {
    margin-top: 0;
  }
  #overview .resources a:nth-child(n) {
    margin: 0;
    padding: 0.4em 0 0.4em 1.5rem;
    border-top: none;
    border-bottom: none;
    background-position: 0 0.4em;
    text-indent: 0;
  }
}

/* Products. */
#overview .products {
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--column-gap);
  row-gap: 1.5rem;
  justify-content: center;
  padding-bottom: var(--padding-default);
}
#overview .products h2 {
  flex: 0 0 100%;
  margin-bottom: 0;
}
#overview .product {
  width: 75%;
}
#overview .product img {
  display: block;
  position: relative;
  z-index: 1;
  max-width: 100%;
  margin: 0 auto;
  transform-origin: center;
}
#overview .product img[style*=scale] {
  transform: scale(var(--scale, 100%));
}
#overview .caption {
  position: relative;
  display: block;
  margin: 0.5rem auto 0;
  padding: 0.7rem 0.5rem 0.6rem;
  font-size: 0.83rem;
  font-weight: bold;
  color: var(--color-grey-dark);
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
  letter-spacing: 0.03em;
  line-height: 1.4;
}
#overview .click-drain {
  order: 1000;
}
#overview .click-drain .caption {
  --connect-offset: 0rem;
  --connect-height: 10rem;
  border: var(--line-width) solid var(--line-color);
  border-radius: 0.3rem;
}
#overview .click-drain .caption::before {
  content: '';
  display: block;
  position: absolute;
  bottom: calc(-1 * (var(--connect-height) + var(--connect-offset)));
  left: 50%;
  transform: translate(-50%);
  height: var(--connect-height);
  border-left: var(--line-width) solid var(--line-color);
}
@media all and (min-width: 22rem), print {
  #overview .products {
    row-gap: 3rem;
  }
  #overview .product {
    flex: 0 1 calc(50% - 0.5 * var(--column-gap));
  }
}
@media all and (min-width: 33rem), print {
  #overview .product {
    flex-basis: calc(33% - 0.67* var(--column-gap));
  }
  #overview .click-drain {
    order: unset;
  }
}
@media all and (min-width: 60rem), print {
  #overview .products {
    margin-bottom: var(--padding-default);
    padding-bottom: 0;
  }
  #overview .products h2 {
    margin: 0;
  }
}

/* CLICK DRAIN SECTION. */

#click-drain {
  padding-bottom: 0;
}

/* Video. */
#click-drain .video {
  position: relative;
  z-index: 1;
  margin: 0 var(--padding-default-neg);
  background-color: white;
  border-top: 1rem solid var(--color-green);
}
#click-drain .video iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  margin: 0 auto;
  border: none;
}

/* Column container. */
#click-drain .container {
  padding-top: 0.5rem;
  padding-bottom: 2rem;
}
@media all and (min-width: 48rem), print {
  #click-drain .container {
    display: flex;
    gap: var(--column-gap);
    flex-direction: row-reverse;
    padding-top: 2rem;
    padding-bottom: 3rem;
  }
}

/* Description. */
#click-drain .description {
  display: flex;
  flex-direction: column;
}
#click-drain .description > h2 {
  margin-top: 2rem;
}
#click-drain .description > h2 > img {
  margin-left: -0.3em;
  margin-bottom: 1rem;
}
@media all and (min-width: 48rem), print {
  #click-drain .description {
    flex: 0 0 var(--column-right-width);
  }
  #click-drain .description > h2 {
    margin-top: 1.2rem;
  }
}
@media all and (min-width: 60rem), print {
  #click-drain .description > h2 {
    margin-top: 3rem;
  }
}
@media all and (min-width: 72rem), print {
  #click-drain .description > h2 {
    margin-top: 4rem;
  }
}

/* Logos. */
#click-drain .logos {
  margin-bottom: var(--padding-default);
}
#click-drain .logos > img {
  --size: 3.6rem;
  --gap: 0.6rem;
  display: inline-block;
  max-width: var(--size);
  max-height: var(--size);
  object-fit: contain;
}
#click-drain .logos > img:nth-child(n+2) {
  margin-left: var(--gap);
}
@media all and (min-width: 30rem), print {
  #click-drain .logos > img {
    --size: 5rem;
    --gap: 1.5rem;
  }
}
@media all and (min-width: 48rem), print {
  #click-drain .logos {
    margin-top: auto;
    margin-bottom: 0;
  }
  #click-drain .logos > img {
    --size: 3.3rem;
    --gap: 0.5rem;
  }
}
@media all and (min-width: 60rem), print {
  #click-drain .logos > img {
    --size: 4rem;
    --gap: 1rem;
  }
}
@media all and (min-width: 72rem), print {
  #click-drain .logos > img {
    --size: 4rem;
    --gap: 1.5rem;
  }
}

/* Diagrams. */
#click-drain .diagrams > [src*=size] {
  margin: 1rem auto;
}
#click-drain .diagrams > [src*=grate] {
  width: 85%;
  margin: 0 auto;
  position: relative;
  left: 2rem;
}
@media all and (min-width: 54rem), print {
  #click-drain .diagrams > [src*=size] {
    width: 90%;
  }
  #click-drain .diagrams > [src*=grate] {
    width: 77%;
  }
}

/* Banner images progressive reveal. */
#click-drain .banner {
  display: flex;
  margin: 0 var(--padding-default-neg);
}

#click-drain .banner > img {
  display: none;
  min-width: 10rem;
}
#click-drain .banner > :nth-child(-n+2) {
  display: block;
}
@media all and (min-width: 33rem), print {
  #click-drain .banner > :nth-child(-n+3) {
    display: block;
  }
}
@media all and (min-width: 48rem), print {
  #click-drain .banner > :nth-child(-n+4) {
    display: block;
  }
}
@media all and (min-width: 60rem), print {
  #click-drain .banner > :nth-child(-n+5) {
    display: block;
  }
}
@media all and (min-width: 72rem), print {
  #click-drain .banner > :nth-child(n) {
    display: block;
  }
}

/* PRINT OVERRIDES. */

@media print {
  :root {
    --padding-default: 20pt;
    --line-width: 1pt;
  }
  body, h1 {
    font-size: 10pt;
  }
  h1, .menu, .resources a, #click-drain {
    -webkit-print-color-adjust: exact;
  }
  h1 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  h2 {
    font-size: 12pt;
  }
  #overview .caption {
    font-size: 7pt;
  }
  #click-drain {
    position: relative;
    z-index: 1;
    background-color: white;
  }
  #click-drain .video iframe {
    display: none;
  }
  #click-drain .video::before {
    content: attr(data-print);
    display: block;
    margin: 1rem 0;
    font-weight: bold;
  }
  #click-drain .logos > img {
    --size: 3rem;
    --gap: 10pt;
  }
}
