/* ==========================================================================
   About and Contact pages (task T08). Loaded after style.css by the
   `css: contact.css` front matter of src/about.njk and src/contact.njk.
   Screen sizes as in style.css: phones are the base rules, tablets 768px and up,
   desktop 1025px and up.
   ========================================================================== */

/* ---------- About: "Quality Without Compromise" and "Industry Knowledge…" ---------- */

/* Sits right under "Who We Are" and just above the green band, so it needs
   no space of its own above or below. */
.about-values {
  padding-block: 0;
}

.about-values__grid {
  display: grid;
  gap: 20px 30px;
}

/* One blank line between paragraphs and none after the last, as live. */
.about-values__grid p {
  margin-bottom: 1lh;
}

.about-values__grid p:last-child {
  margin-bottom: 0;
}

/* The green band after it: 40px below the text and a shorter bottom, with
   the FAQ heading further below it, as live (phones, then larger screens). */
.about-values + .cta-band-wrap {
  margin-block: 40px 27px;
}

.about-values + .cta-band-wrap .cta-band--rounded {
  padding-bottom: 9px;
}

@media (min-width: 768px) {
  .about-values + .cta-band-wrap {
    margin-bottom: 72px;
  }

  .about-values + .cta-band-wrap .cta-band--rounded {
    padding-bottom: 32px;
  }
}

@media (min-width: 768px) {
  .about-values__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- About: "Who We Are" text and photo ---------- */

/* Photo cropped from its top left corner, as live. */
.about-intro .split__img {
  object-position: left top;
}

/* Spacing as live. Phones: heading 10px below the hero photo, photo 10px
   below the text, 25px below the photo. Larger screens: photo 50px below the
   hero and 55px above the next headings; the text is centred beside it. */
.hero + .about-intro {
  padding: 10px 0 25px;
}

.about-intro .split__inner {
  row-gap: 10px;
}

.about-intro .split__text > :last-child {
  margin-bottom: 0;
}

/* As live: the photo column is half the content width and the text column
   takes the rest, 30px apart (desktop 570 + 600px; tablet 330 + 360px).
   The photo is 393px tall on desktop and 528px on tablets. */
@media (min-width: 768px) {
  .hero + .about-intro {
    padding-block: 50px 55px;
  }

  .about-intro .split__inner {
    grid-template-columns: 1fr 50%;
    column-gap: 30px;
  }

  .about-intro .split__img {
    height: 528px;
    min-height: 0;
  }
}

@media (min-width: 1025px) {
  .about-intro .split__img {
    height: 393px;
  }
}

/* ---------- About: "Service That Works for Real Projects" band ---------- */

/* Live's spacing: the lead line sits close under the heading and the list
   follows it directly, with a blank line before the last sentence. */
.cta-band .about-service__title {
  margin-bottom: 12px;
}

.cta-band .about-service__lead {
  margin-bottom: 0;
}

.cta-band .about-service__list {
  margin-bottom: 24px;
  padding-left: 1.6em;
}

/* Each item is 1px taller than its text, as live. */
.cta-band .about-service__list li {
  padding-bottom: 1px;
}

@media (min-width: 768px) {
  .cta-band .about-service__title {
    margin-bottom: 4px;
  }

  .cta-band .about-service__list {
    margin-bottom: 27px;
  }
}

/* ---------- Contact: intro and the Phone / Delivery / Pickup columns ---------- */
/* Spacing as live: on phones the h1 starts 66px below the header, 20px
   above the intro text, which ends 52px above the first icon. */
.contact-intro .section__intro {
  max-width: 800px;
  margin-bottom: 52px;
}

.contact-intro .section__intro h1 {
  margin-bottom: 20px;
}

/* Space between the columns and the map: 52px on phones, 116px from tablets up (as live). */
.contact-intro {
  padding-block: 66px 52px;
}

.contact-ways {
  display: grid;
  gap: 55px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
}

/* Each column keeps 16px clear at its sides, as live (text 348px wide on a 412px phone). */
.contact-way {
  padding-inline: 16px;
}

.contact-way p {
  margin-bottom: 0.75em;
}

.contact-way > :last-child {
  margin-bottom: 0;
}

.contact-way__icon {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 18px;
  fill: var(--green);
}

/* Styled like the live page's red <h3>; it is an <h2> so heading levels don't skip. */
.contact-way__title {
  margin-bottom: 0.4em;
  color: var(--red);
  font-size: var(--h3);
}

@media (min-width: 768px) {
  .contact-intro {
    padding-block: var(--section-space) 116px;
  }

  .contact-intro .section__intro {
    margin-bottom: 64px;
  }

  .contact-intro .section__intro h1 {
    margin-bottom: 24px;
  }

  /* Three equal columns across the full 1360px row on desktop (as the quote
     form below), so they line up under the live page's. */
  .contact-intro .container {
    max-width: calc(1360px + 2 * var(--gutter));
  }

  .contact-ways {
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
  }

  .contact-way__icon {
    width: 60px;
    height: 60px;
    margin-bottom: 12px;
  }
}

/* Desktop: the column text is inset 31px more than its heading, as live
   (359px of text in a 421px column), so it wraps on the same words. */
@media (min-width: 1025px) {
  .contact-way p {
    margin-inline: 31px;
  }
}

/* ---------- Contact: Google Map ---------- */

/* Inset 32px from the screen edges on phones, full page width from tablets up. */
.contact-map {
  margin-inline: 32px;
}

.contact-map__frame {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
}

/* The map takes keyboard focus (Firefox also tabs through its own controls),
   so show the usual focus ring around it while anything in it has focus.
   js/contact-form.js adds the class; browsers don't match :focus there. */
.contact-map--focused {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .contact-map {
    margin-inline: 0;
  }

  /* Full width, so draw the ring inside the map's edges. */
  .contact-map--focused {
    outline-offset: -3px;
  }
}

/* ---------- Contact: quote form section ---------- */

/* Photo before the form on every screen size (the split macro only does this
   from tablets up). */
.quote .split__media {
  order: -1;
}

/* Wider than the usual content column, as live: 40px from the screen edges at 1440px. */
.quote .container {
  max-width: calc(1360px + 2 * var(--gutter));
}

/* Space between the map and the photo: 82px on phones, 110px from tablets up (as live). */
.section.quote {
  padding-top: 82px;
}

/* Phones: the photo is a 200px strip, 42px above the heading, and the form
   is inset 16px more than the page edge, as live. */
.quote .split__inner {
  row-gap: 42px;
}

.quote .split__text {
  padding-inline: 16px;
}

/* The truck photo: rounder corners than other photos, cropped from its top left (as live). */
.quote .split__img {
  height: 200px;
  min-height: 0;
  object-position: left top;
  border-radius: 20px;
}

/* Tablets and up: photo on the left at half the row, form on the right.
   Live's form column starts 53px right of the photo on desktop and ends 13px
   short of the row's edge; on tablets the photo is 10px narrower and the form
   starts 43px in (photo 350px, form 304px at 800px wide). */
@media (min-width: 768px) {
  .section.quote {
    padding-top: 110px;
  }

  .quote .split__inner {
    grid-template-columns: 1fr 1fr;
    column-gap: 0;
  }

  .quote .split__media {
    margin-right: 10px;
  }

  /* The top and bottom padding make the photo run a little past the form, as live. */
  .quote .split__text {
    padding: 18px 13px 44px 43px;
  }

  .quote .split__img {
    height: 100%;
  }
}

@media (min-width: 1025px) {
  .quote .split__media {
    margin-right: 0;
  }

  .quote .split__text {
    padding-left: 53px;
  }
}

/* Form spacing as live: labels 3px above their box, 13px between one box and the next label. */
.quote-form {
  display: grid;
  gap: 13px;
}

/* Without this, display: grid above would keep the form showing after it is sent. */
.quote-form[hidden] {
  display: none;
}

.quote-form__note {
  margin: 0;
  font-size: 15px;
}

.quote-form__required {
  color: var(--red);
}

/* align-content: start keeps the drop-down 48px tall when the Pickup or Delivery
   column beside it is taller. */
.quote-form__field {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* Labels: dark grey (rgb 75 76 83, live's colour), 14px on phones and 16px from tablets up. */
.quote-form label,
.quote-form legend {
  padding: 0;
  color: rgb(75 76 83);
  font-size: 14px;
  line-height: 1.5;
}

/* Text boxes and the drop-down. 16px text stops phones zooming in; 48px tall
   boxes are easy to tap. */
.quote-form input:not([type="radio"]),
.quote-form select,
.quote-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--green);
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

/* 80px tall, as live; visitors can drag it taller. */
.quote-form textarea {
  height: 80px;
  min-height: 80px;
  resize: vertical;
}

.quote-form ::placeholder {
  color: var(--muted);
  font-style: italic;
}

/* Product Type and Pickup or Delivery: stacked on phones and tablets, side by side
   on desktop. (Side by side in a tablet's narrow form column, the drop-down was
   too narrow to read "Select a product".) */
.quote-form__row {
  display: grid;
  gap: 13px 34px;
}

/* Pickup / Delivery radio buttons, side by side. Each option is 127px wide
   on phones and 135px from tablets up, so "Delivery" starts where live's does. */
.quote-form__choices {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0;
}

.quote-form__choices legend {
  float: left; /* lets the legend sit in the grid like the other labels */
  width: 100%;
  margin-bottom: 3px;
}

/* "Pickup" and "Delivery": italic, 16px on phones and 18px from tablets up (as live). */
.quote-form .quote-form__choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 127px;
  min-height: 44px;
  font-size: 16px;
  font-style: italic;
  cursor: pointer;
}

.quote-form__choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--green);
}

/* A field the visitor needs to fix: thicker red border and a message under it.
   js/contact-form.js sets aria-invalid and the message text. */
.quote-form [aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: inset 0 0 0 1px var(--red);
}

.quote-form__error {
  margin: 0;
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
}

.quote-form__error::before {
  content: "⚠\00a0" / "";
}

.quote-form__error:empty,
.quote-form__status:empty {
  display: none;
}

.quote-form__status {
  margin: 0;
  font-weight: 600;
}

.quote-form__status--error {
  color: var(--red);
}

.quote-form__noscript {
  font-weight: 600;
}

/* Thank-you message shown in place of the form. */
.quote-success {
  padding: 20px 25px;
  border-left: 5px solid var(--green);
  background: var(--gray-bg);
  font-size: 20px;
}

.quote-success p {
  margin: 0;
}

/* "Send Message": 39px tall, as live; on phones 13px in from each side of the form. */
.quote-form .quote-form__submit {
  justify-self: center;
  width: calc(100% - 26px);
  height: 39px;
  min-height: 0;
  padding-block: 0;
}

@media (min-width: 768px) {
  .quote-form label,
  .quote-form legend {
    font-size: 16px;
  }

  .quote-form .quote-form__choice {
    min-width: 135px;
    font-size: 18px;
  }

  /* 272px wide, 4px in from the left, as live. */
  .quote-form .quote-form__submit {
    justify-self: start;
    width: 272px;
    min-width: 0;
    margin-left: 4px;
  }
}

@media (min-width: 1025px) {
  .quote-form__row {
    grid-template-columns: 1fr 1fr;
  }
}
