﻿/* =============================================================================
   COMPONENTS - pieces used on several pages
     1. Text styles (titles, paragraphs)
     2. Section backgrounds (photos / videos behind a section)
     3. Buttons and links with arrows
   Sizes are in cqw (% of the page width) - see the top of base.css.
   ============================================================================= */


/* ---------- 1. Text styles ------------------------------------------------- */

/* big title at the top of a page */
.title-xl {
  font-family: var(--font-heading);
  font-size: 5.226cqw;
  line-height: 1.1;
  text-transform: uppercase;
}

/* section title */
.title-lg {
  font-family: var(--font-heading);
  font-size: 3.484cqw;
  line-height: 1.2;
  text-transform: capitalize;
}

/* smaller title (e.g. "The Challenge") */
.title-md {
  font-family: var(--font-heading);
  font-size: 2.091cqw;
  line-height: 1.3;
  text-transform: capitalize;
}

/* card title (e.g. "CRANES & RIGGING") */
.title-sm {
  font-family: var(--font-heading);
  font-size: 1.742cqw;
  line-height: 1.3;
  text-transform: uppercase;
}

/* normal paragraph text */
.text {
  font-size: 1.112cqw;
  line-height: 1.6;
}

.text-yellow { color: var(--yellow); }
.text-white  { color: var(--white); }
.text-grey   { color: var(--grey); }
.text-center { text-align: center; }

@media (max-width: 1000px) {
  .title-xl { font-size: 5.312cqw; }
  .title-lg { font-size: 3.32cqw; }
  .title-md { font-size: 2.656cqw; }
  .title-sm { font-size: 2.131cqw; }
  .text     { font-size: 1.864cqw; }
}

@media (max-width: 750px) {
  .title-xl { font-size: 8.588cqw; }
  .title-lg { font-size: 6.71cqw; }
  .title-md { font-size: 4.831cqw; }
  .title-sm { font-size: 5.339cqw; }
  .text     { font-size: 3.737cqw; }
}


/* ---------- 2. Section backgrounds -------------------------------------------

   <section class="has-background">
     <div class="background">                     colour behind the photo (black)
       <img src="..." alt="" style="opacity: 0.1">  the photo, faded into the colour
     </div>
     ...content...
   </section>

   Add "background--fixed" to make the photo stay still while the page scrolls
   over it (the photo then needs a wrapper: <div class="background__holder">).   */

.has-background {
  position: relative;
  isolation: isolate;               /* keeps the background behind this section only */
}

.background {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: clip;
  background-color: var(--black);
}

.background img,
.background video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* "stays still while you scroll": the holder reaches one screen above and below
   the section, and the photo sticks to the top of the window inside it */
.background--fixed .background__holder {
  height: calc(100% + 200lvh);
  margin-top: -100lvh;
}
.background--fixed img {
  position: sticky;
  top: 0;
  height: max(100lvh, calc(100% - 200lvh));   /* at least one screen tall */
}


.card-link.card-link--yellow { color: var(--yellow); }


/* Small black square with an arrow, linking to the next page
   (top right of the Cranes, Logistics and Transportation pages).
   Turns white on hover. */
.next-page-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 57px;
  height: 57px;
  border: 0.8px solid var(--black);
  border-radius: 3px;
  background-color: var(--black);
  color: var(--white);
}
.next-page-button::after {
  content: "";
  width: 18px;
  height: 18px;
  background-color: currentColor;
  -webkit-mask: url("/images/icons/chevron.svg") center / contain no-repeat;
          mask: url("/images/icons/chevron.svg") center / contain no-repeat;
}
.next-page-button:hover {
  border: 1px solid var(--black);
  background-color: var(--white);
  color: var(--black);
}


/* ---------- Page hero (top of most pages) ------------------------------------
   Photo background with a dark shade on the left, a small yellow title,
   a big title and a short paragraph. The height and spacing of each page's
   hero are set in that page's CSS file.                                       */
.page-hero {
  position: relative;
  isolation: isolate;
  color: var(--white);
}
.page-hero .background img { object-fit: cover; }

.page-hero__shade {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, #000 18.42%, rgba(243, 248, 240, 0) 100%);
  box-shadow: 0 0.078cqw 0.3125cqw rgba(0, 0, 0, 0.6);
}

.page-hero__eyebrow {
  font-family: var(--font-heading);
  font-size: 1.738cqw;
  line-height: 1.4;
  color: var(--yellow);
}

.page-hero__title {
  margin-top: 0.84cqw;
  font-family: var(--font-heading);
  line-height: 1.1;
  text-transform: uppercase;
}

.page-hero__text {
  margin-top: 0.79cqw;
  font-size: 1.112cqw;
  line-height: normal;
  color: var(--light-grey);
}

@media (max-width: 1000px) {
  .page-hero__eyebrow { font-size: 1.859cqw; }
  .page-hero__title { margin-top: 0.9cqw; }
  .page-hero__text { font-size: 1.859cqw; }
}
@media (max-width: 750px) {
  .page-hero__eyebrow { font-size: 3.47cqw; }
  .page-hero__title { margin-top: 0.8cqw; }
  .page-hero__text { margin-top: 0.8cqw; font-size: 3.47cqw; }
}

/* ---------- List with yellow arrows ------------------------------------------
   <ul class="arrow-list"><li>Certified Crane Operator</li> ...</ul>          */
.arrow-list {
  list-style: none;
  font-size: 1.112cqw;
  line-height: normal;
}
.arrow-list li {
  position: relative;
  padding-left: 2.78cqw;
}
.arrow-list li + li { margin-top: 2.05cqw; }
.arrow-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.1cqw;
  width: 1.63cqw;
  height: 1.63cqw;
  background: url("/images/icons/yellow-arrow.avif") center / cover no-repeat;
}
@media (max-width: 1000px) {
  .arrow-list { font-size: 1.726cqw; }
  .arrow-list li { padding-left: 2.82cqw; }
  .arrow-list li + li { margin-top: 1.69cqw; }
  .arrow-list li::before { top: 0.12cqw; width: 1.58cqw; height: 1.58cqw; }
}
@media (max-width: 750px) {
  .arrow-list { font-size: 3.47cqw; }
  .arrow-list li { padding-left: 6.67cqw; }
  .arrow-list li + li { margin-top: 4.27cqw; }
  .arrow-list li::before { top: -0.27cqw; width: 4cqw; height: 4cqw; }
}


/* ---------- Closing section: big title + two buttons (bottom of most pages) --- */
.closing {
  text-align: center;
}
.closing__buttons {
  display: flex;
  justify-content: center;
}
@media (max-width: 750px) {
  .closing__buttons { flex-direction: column; align-items: center; }
}


/* thin yellow band under some heroes */
.yellow-strip {
  height: 3.2cqw;
  background-color: var(--yellow);
}


/* ---------- 3. Buttons ------------------------------------------------------

   <a class="button" href="/contact/">GET A QUOTE</a>
       yellow button with an arrow; turns black with yellow text on hover

   Extra classes:
     button--outlined      thin black border
     button--white         white with a thin black border
     button--thin-arrow    a longer, thinner arrow
     button--hover-border  a thin white border appears on hover
     button--small         rounded corners, round arrow, text left / arrow right
                           (turns white on hover) - the footer's "Careers"
     button--black         black button with white text, no arrow

   Each button's size (width, height, text size) is set in the page's CSS file. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.697cqw;
  padding: 0 1.045cqw;
  border: 0 solid var(--yellow);
  background-color: var(--yellow);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.115cqw;
  line-height: normal;
  color: var(--black);
  white-space: nowrap;
  cursor: pointer;
}

/* the arrow is drawn from an icon file and takes the text colour */
.button::after {
  content: "";
  flex-shrink: 0;
  width: 1.42cqw;
  height: 1.42cqw;
  background-color: currentColor;
  -webkit-mask: url("/images/icons/arrow.svg") center / contain no-repeat;
          mask: url("/images/icons/arrow.svg") center / contain no-repeat;
}

.button:hover {
  background-color: var(--black);
  color: var(--yellow);
}

.button--outlined { border: 0.8px solid var(--black); }

/* white button with a thin black border */
.button--white {
  border: 0.8px solid var(--black);
  background-color: var(--white);
}

/* see-through with a thin white border and white text (on dark backgrounds) */
.button--ghost {
  border: 0.8px solid var(--white);
  background-color: transparent;
  color: var(--white);
}

/* see-through with a black border (on light backgrounds) */
.button--outline-black {
  border: 0.8px solid var(--black);
  background-color: transparent;
}

/* turns yellow (instead of black) on hover */
.button.button--hover-yellow:hover { background-color: var(--yellow); color: var(--black); }

/* thicker border (2.4px) */
.button--thick-border { border-width: 2.4px; border-style: solid; }
.button--white.button--thick-border { border-color: var(--black); }

/* longer, thinner arrow */
.button--thin-arrow { gap: 1.045cqw; }
.button--thin-arrow::after {
  width: 1.73cqw;
  height: 1.73cqw;
  -webkit-mask-image: url("/images/icons/arrow-thin.svg");
          mask-image: url("/images/icons/arrow-thin.svg");
}

.button--hover-border:hover {
  border: max(0.5px, 0.07cqw) solid var(--white);
}

.button--small {
  justify-content: space-between;
  gap: 15px;
  padding: 0 15px;
  border-radius: 5px;
}
.button--small::after {
  width: 1.31cqw;
  height: 1.31cqw;
  -webkit-mask-image: url("/images/icons/arrow-circle.svg");
          mask-image: url("/images/icons/arrow-circle.svg");
}
.button--small:hover {
  background-color: var(--white);
  color: var(--black);
}

.button--black {
  background-color: var(--black);
  color: var(--white);
}
.button--black::after { display: none; }
.button--black:hover { background-color: var(--black); color: var(--white); }


/* "Text link": white text with a thin underline and an arrow at the far right
   (e.g. "SCHEDULE A LUNCH AND LEARN"). Turns yellow on hover. */
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.045cqw;
  padding: 0.139cqw;
  border-bottom: max(0.5px, 0.07cqw) solid var(--white);
  font-size: 1.115cqw;
  line-height: normal;
  color: var(--white);
  white-space: nowrap;
}
.text-link::after {
  content: "";
  flex-shrink: 0;
  width: 1.73cqw;
  height: 1.73cqw;
  background-color: currentColor;
  -webkit-mask: url("/images/icons/arrow-thin.svg") center / contain no-repeat;
          mask: url("/images/icons/arrow-thin.svg") center / contain no-repeat;
}
.text-link:hover {
  color: var(--yellow);
  border-bottom-color: var(--yellow);
}


/* "Card link": bold text with a round arrow at the far right, no background
   (e.g. "View Services" on the home page cards). */
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.045cqw;
  padding-right: 1.045cqw;
  font-weight: 700;
  font-size: 1.115cqw;
  line-height: normal;
  color: var(--black);
  white-space: nowrap;
}
.card-link:hover { font-weight: 400; }   /* the text turns regular when the mouse is over it */
.card-link::after {
  content: "";
  flex-shrink: 0;
  width: 1.73cqw;
  height: 1.73cqw;
  background-color: currentColor;
  -webkit-mask: url("/images/icons/arrow-circle.svg") center / contain no-repeat;
          mask: url("/images/icons/arrow-circle.svg") center / contain no-repeat;
}
