/* ABC Home & Commercial Services design system: components
   Only the components the home page uses, with the states they have. */

/* 1. Button: the pill with an arrow disc on the right that fills on hover.
   Use when: the one action of a band (white on red, green on white).
   Not when: a link inside running text; use a plain link. */
.button {
  position: relative;
  z-index: 0;
  display: inline-block;
  padding: 11px 53px 13px 20px;
  color: var(--color-green-dark);
  font-family: var(--font-condensed);
  font-size: var(--size-button-lg);
  font-weight: var(--weight-black);
  line-height: var(--lh-button);
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
  border: 2px solid var(--color-green);
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  transition: color var(--ease);
}
.button::before {
  content: "";
  position: absolute;
  top: 2px; right: 2px; bottom: 2px;
  z-index: -1;
  width: 38px;
  border-radius: var(--radius-pill);
  background: var(--color-green);
  transition: width var(--ease);
}
.button::after {
  content: "";
  position: absolute;
  top: 15px; right: 15px;
  width: 12px; height: 12px;
  background: url("/assets/img/arrow-white.svg") no-repeat 50% / contain;
}
.button:hover, .button:focus-visible { color: var(--color-paper); }
.button:hover::before, .button:focus-visible::before { width: calc(100% - 4px); }
/* On red: white ring, white disc, green arrow. */
.on-red .button { color: var(--color-paper); border-color: var(--color-paper); }
.on-red .button::before { background: var(--color-paper); }
.on-red .button::after { background-image: url("/assets/img/arrow-green.svg"); }
.on-red .button:hover, .on-red .button:focus-visible { color: var(--color-green); }
.on-red .button:focus-visible { outline-color: var(--color-paper); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 30px;
}
.button-row.center { justify-content: center; }

/* 2. Site header: logo left, menu right, white with a soft shadow below.
   On phones the menu folds behind a three-line button.
   Use when: the top of every page. Not when: never twice on a page. */
.site-header {
  position: relative;
  z-index: 4;
  background: var(--color-paper);
  box-shadow: var(--shadow-header);
}
.site-header .row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 60px;
  align-items: center;
  min-height: 100px;
}
.site-header .logo a { display: block; }
.site-header .logo img { width: 156px; max-height: 70px; }
.site-header .menu-toggle { display: none; }
.site-header nav { justify-self: end; }
.site-header .menu {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}
.site-header .menu > li { margin: 0; padding: 0; }
.site-header .menu > li::before { display: none; }
.site-header .menu-link {
  display: block;
  padding: 14px 12px;
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--size-nav);
  font-weight: var(--weight-black);
  line-height: var(--lh-nav);
  text-decoration: none;
  text-transform: uppercase;
  border: 0;
  background: none;
  cursor: pointer;
  transition: color var(--ease);
}
.site-header .menu-link:hover { color: var(--color-red); }
.site-header .has-sub { position: relative; }
/* The small down caret beside a menu item that opens a list. */
.site-header .has-sub > .menu-link::after {
  content: "";
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 8px;
  background: url("/assets/img/caret.svg") no-repeat 50% / contain;
  transition: transform var(--ease);
}
.site-header .has-sub > .menu-link[aria-expanded="true"]::after { transform: rotate(180deg); }
.site-header .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 5;
  min-width: 240px;
  padding: 10px;
  background: var(--color-paper);
  box-shadow: var(--shadow-card);
}
.site-header .sub-menu p {
  margin: 5px 0;
  color: var(--color-ink-soft);
  font-size: var(--size-small);
  font-style: italic;
  line-height: var(--lh-small);
}
.site-header .sub-menu ul { margin: 0; padding: 0; }
.site-header .sub-menu li { margin: 0; padding: 0; }
.site-header .sub-menu li::before { display: none; }
.site-header .sub-menu a {
  display: block;
  padding: 8px 15px 7px;
  color: var(--color-red);
  font-size: var(--size-small);
  line-height: var(--lh-small);
  text-decoration: none;
}
.site-header .sub-menu a:hover, .site-header .sub-menu a:focus-visible {
  color: var(--color-paper);
  background: var(--color-red);
  outline: none;
}

@media (max-width: 750px) {
  .site-header .row {
    min-height: 0;
    margin: 0;
    padding: 10px 15px;
    gap: 0;
  }
  .site-header .logo img { width: 100px; }
  /* Three red lines; they turn into a cross when the menu is open. */
  .site-header .menu-toggle {
    display: block;
    justify-self: end;
    position: relative;
    width: 30px; height: 30px;
    padding: 0;
    color: var(--color-green-dark);
    font-size: 0;
    font-weight: var(--weight-bold);
    line-height: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }
  .site-header .menu-toggle span,
  .site-header .menu-toggle::before,
  .site-header .menu-toggle::after {
    content: "";
    position: absolute;
    left: 1px; right: 1px;
    border: 1.5px solid var(--color-red);
    border-radius: 3px;
    transition: transform var(--ease), opacity var(--ease);
  }
  .site-header .menu-toggle::before { top: 4px; }
  .site-header .menu-toggle span { top: 50%; transform: translateY(-50%); }
  .site-header .menu-toggle::after { bottom: 4px; }
  .site-header .menu-toggle[aria-expanded="true"]::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
  .site-header .menu-toggle[aria-expanded="true"]::after { bottom: auto; top: 50%; transform: translateY(-50%) rotate(-45deg); }
  .site-header .menu-toggle[aria-expanded="true"] span { opacity: 0; }
  .site-header nav {
    grid-column: span 2;
    justify-self: stretch;
    display: none;
  }
  .site-header nav.is-open { display: block; }
  .site-header .menu { display: block; padding: 5px 0; }
  .site-header .menu > li { padding: 3px 0; }
  .site-header .menu > li:not(:last-child) { border-bottom: 2px solid var(--color-mist); }
  .site-header .menu-link { width: 100%; padding: 10px 0; text-align: left; }
  .site-header .has-sub > .menu-link::after { position: absolute; top: 18px; right: 0; }
  .site-header .sub-menu { position: static; padding: 0 0 10px; box-shadow: none; }
  .site-header .sub-menu a { padding: 10px 20px; }
}

/* 3. Home hero: the page title and intro on white at left, a photo cut on
   a diagonal at right, a soft gray wedge in the lower left corner.
   Use when: the top of the home page. Not when: a page without a photo. */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: url("/assets/img/hero-gradient.svg") no-repeat left bottom 40px / 230px;
}
.hero-content {
  position: relative;
  z-index: 2;
  margin-left: var(--gutter);
  padding: 10px 10px 190px 0;
}
.hero-content-inner { max-width: 900px; padding-top: 65px; }
.hero h1 { max-width: 92%; }
.hero .t-intro { margin: 22px 0 0; }
.hero-media {
  position: relative;
  z-index: 1;
  max-height: 638px;
  margin-left: -30%;
  overflow: hidden;
}
/* The white diagonal over the photo's left edge: an ABC signature. */
.hero-media::after {
  content: "";
  position: absolute;
  inset: -1px;
  background: url("/assets/img/hero-overlay.svg") no-repeat 0 0 / 700px 640px;
}
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 750px) {
  .hero {
    grid-template-columns: 1fr;
    background-position: 0 100%;
    background-size: 120px;
  }
  .hero-content-inner { padding-top: 30px; }
  .hero .t-intro { margin-top: 20px; }
  .hero-media { display: none; }
}

/* 4. Red surface: the ABC red with pale red text and white headings.
   Use when: a band or card that must stand out. Not when: two red bands
   touch; keep white between them. */
.on-red {
  position: relative;
  z-index: 1;
  color: var(--color-red-tint);
  background: var(--color-red);
}
.on-red h2, .on-red h4 { color: var(--color-paper); }
.on-red a, .on-red a:hover { color: var(--color-paper); }
.on-red ul li::before { background: var(--color-paper); }
.on-red :focus-visible { outline-color: var(--color-paper); }

/* 5. Service cards: two red cards side by side that overlap the hero, each
   with a line icon, a slab heading, a short line and one action. A small
   notch is cut into their top edge at the center.
   Use when: sending visitors down the two paths (business, home).
   Not when: more than two paths; use a link list. */
.service-cards {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: -100px;
  clip-path: polygon(calc(50% - 15px) 0, 50% 15px, calc(50% + 15px) 0, calc(50% + 15px) -15px, 110% -15px, 110% 110%, -15px 110%, -15px -15px, calc(50% - 15px) -15px);
}
.service-card {
  padding: 32px 62px;
  box-shadow: var(--shadow-card);
}
.service-card .card-icon { width: 70px; height: 70px; margin: 0 auto 10px; }
.service-card .card-text { margin-bottom: 15px; text-align: center; }
.service-card h2 { margin-bottom: 0; }
@media (max-width: 750px) {
  .service-cards { grid-template-columns: 1fr; }
  .service-card { padding: 30px 15px; }
}

/* 6. Pill field: a rounded text field with its round arrow button inside on
   the right; the button widens to show its word on hover.
   Use when: a one-field form (zip code). Not when: a form of several
   fields; give each field its own row and a full button. */
.pill-field { min-width: 270px; max-width: 340px; margin: 0 auto; }
.pill-field label {
  display: block;
  padding-left: 6px;
  font-size: var(--size-nav);
  font-weight: var(--weight-bold);
  line-height: var(--lh-body);
}
.on-red .pill-field label { color: var(--color-paper); }
.pill-field .field-wrap { position: relative; }
.pill-field input {
  width: 100%;
  padding: 7px 18px;
  color: var(--color-ink);
  line-height: 28px;
  border: 2px solid var(--color-line-muted);
  border-radius: var(--radius-pill);
  background: none;
  appearance: none;
  transition: border-color var(--ease);
}
.pill-field input:hover, .pill-field input:focus { border-color: var(--color-green-dark); outline: none; }
.on-red .pill-field input { color: var(--color-paper); border-color: var(--color-red-line); }
.on-red .pill-field input:hover, .on-red .pill-field input:focus { border-color: var(--color-paper); }
.pill-field input[aria-invalid="true"] { border-style: dashed; }
.pill-field .pill-submit {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 0;
  display: flex;
  justify-content: flex-end;
  max-width: 38px;
  overflow: hidden;
  padding: 9px 18px 11px;
  color: var(--color-paper);
  font-family: var(--font-condensed);
  font-size: var(--size-button);
  font-weight: var(--weight-black);
  line-height: var(--lh-button);
  text-transform: uppercase;
  white-space: nowrap;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  transition: max-width var(--ease);
}
.pill-field .pill-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-pill);
  background: var(--color-green);
}
.pill-field .pill-submit::after {
  content: "";
  position: relative;
  top: 3px;
  right: -5px;
  flex: 0 0 12px;
  height: 12px;
  margin-left: 8px;
  background: url("/assets/img/arrow-white.svg") no-repeat 50% / contain;
}
.on-red .pill-field .pill-submit { color: var(--color-green); }
.on-red .pill-field .pill-submit::before { background: var(--color-paper); }
.on-red .pill-field .pill-submit::after { background-image: url("/assets/img/arrow-green.svg"); }
.pill-field .pill-submit:focus-visible { outline: 2px solid var(--color-paper); outline-offset: 2px; }
@media (min-width: 751px) {
  .pill-field .pill-submit:hover, .pill-field .pill-submit:focus-visible { max-width: 100vw; }
}
.pill-field .pill-submit:disabled { cursor: progress; opacity: .7; }

/* 7. Form status: the line that says a message is being sent, was sent or
   was not. Empty until then. Use when: beside every form's button. */
.form-status {
  margin: 8px 0 0;
  padding-left: 6px;
  font-size: var(--size-small);
  font-style: italic;
  line-height: var(--lh-small);
}
.form-status:empty { display: none; }
.on-red .form-status { color: var(--color-paper); }

/* 8. Section header: a centered slab heading with one plain line under it.
   Use when: opening a band. Not when: the band is a reading column; keep
   that heading left-aligned. */
.section-header { margin-bottom: 40px; text-align: center; }
.section-header h2 { margin-bottom: 0; }
@media (max-width: 750px) { .section-header { margin-bottom: 30px; } }

/* 9. Perforated rule: the dashed gray line under each branch and above the
   map, drawn as a repeating tile. Use when: separating items in a list. */
.perforated { background: url("/assets/img/perforation.svg") repeat-x 0 100% / 12px; }

/* 10. Branch name link: slab, ink, with a green underline that turns ink and
   shows a red arrow on hover. Use when: a place or service name that opens
   its page. Not when: links inside running text. */
.action {
  position: relative;
  color: var(--color-ink);
  font-family: var(--font-slab);
  font-size: var(--size-action);
  font-weight: var(--weight-slab);
  line-height: var(--lh-action);
  text-decoration: none;
  border-bottom: 2px solid var(--color-green);
  transition: border-color var(--ease);
}
.action::after {
  content: "";
  position: relative;
  top: 3px;
  right: 0;
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-left: -22px;
  opacity: 0;
  pointer-events: none;
  background: url("/assets/img/arrow-red.svg") no-repeat 50% / contain;
  transition: right var(--ease), opacity var(--ease);
}
.action:hover { color: var(--color-ink); border-bottom-color: var(--color-ink); }
.action:hover::after { right: -30px; opacity: 1; }

/* 11. Star rating: five red stars (whole or half) and the review count in
   small gray italics. Use when: a branch's Google rating. Not when: a
   rating the business has not published. */
.google-rating { text-align: right; }
.rating {
  display: grid;
  grid-auto-flow: column;
  justify-content: end;
  gap: 4px;
  margin-bottom: 5px;
}
.rating svg { display: block; width: 22px; height: 22px; fill: var(--color-red); }
.google-rating p {
  margin: 0;
  color: var(--color-ink-soft);
  font-size: var(--size-small);
  font-style: italic;
  line-height: 26px;
}
@media (max-width: 750px) {
  .google-rating {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    text-align: left;
  }
  .rating { justify-content: start; }
}

/* 12. Branch list: every branch with its name, phone and rating, two
   columns on wide screens and one on phones.
   Use when: listing places the business serves. */
.city-list { display: grid; grid-template-columns: 1fr 1fr; gap: 25px 60px; }
.city-info {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 30px;
  padding: 0 5px 20px;
}
.city-info .city-name { margin-bottom: 5px; }
@media (max-width: 750px) {
  .city-list { grid-template-columns: 1fr; }
  .city-info { grid-template-columns: 1fr; gap: 15px; padding: 0 10px 20px; }
}

/* 13. Service map: the states drawn in gray, the served states in green and
   a white ring on each branch that opens a small card with the branch.
   Use when: showing where the business works, on wide screens. Not when:
   on phones; the branch list carries the same facts there. */
.service-map { position: relative; }
.service-map::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: url("/assets/img/perforation.svg") repeat-x 0 100% / 12px;
}
.service-map > svg { display: block; width: 100%; height: auto; }
.service-map .state-serviced { fill: var(--color-green); }
.service-map .state-blank { fill: var(--color-mist); }
.map-marker-container { position: absolute; }
.map-marker {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.map-marker svg { display: block; width: 20px; height: 20px; fill: var(--color-paper); overflow: visible; }
.map-marker .outer-circle { transform-origin: center; transition: transform var(--ease); }
.map-marker:hover .outer-circle, .map-marker[aria-expanded="true"] .outer-circle { transform: scale(1.15); }
.map-marker:focus-visible { outline: 2px solid var(--color-paper); outline-offset: 2px; }
.map-tooltip {
  position: absolute;
  top: -20px;
  left: 50%;
  z-index: 3;
  width: 275px;
  padding: 16px;
  color: var(--color-ink);
  background: var(--color-paper);
  box-shadow: var(--shadow-card);
  transform: translate(-50%, -100%);
}
.map-tooltip::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  border-top: 12px solid var(--color-paper);
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  transform: translate(-50%, 100%);
}
.map-tooltip .close {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 27px;
  height: 27px;
  padding: 6px;
  border: 0;
  background: none;
  cursor: pointer;
}
.map-tooltip .close svg { display: block; width: 15px; height: 15px; fill: var(--color-green-dark); }
.map-tooltip .close:hover svg { fill: var(--color-ink); }
.map-tooltip .location-info { margin-bottom: 10px; padding: 0 5px 10px; }
.map-tooltip .branch-name { margin-bottom: 5px; }
.map-tooltip .branch-name .action { font-size: 26px; line-height: 28px; }
.map-tooltip .google-rating { margin: 0 5px; text-align: left; }
.map-tooltip .rating { justify-content: start; }
@media (max-width: 750px) { .service-map { display: none; } }

/* 14. Photo band: a full-width red band with a photo that rises out of its
   top edge on the left and the words and one action on the right; a white
   corner is cut from the lower left and a faint light falls from the top right.
   Use when: one strong invitation with a photo (careers). Not when: two
   such bands in a row. */
.photo-band {
  position: relative;
  margin-top: 110px;
}
.photo-band::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: -1px;
  width: 160px;
  height: 160px;
  background: url("/assets/img/corner-cta.svg") no-repeat 50% / contain;
}
.photo-band::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  z-index: -1;
  width: 218px;
  height: 218px;
  background: url("/assets/img/cta-gradient.svg") no-repeat 50% / contain;
}
.photo-band .band-inner {
  position: relative;
  top: -40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  align-items: center;
}
.photo-band .band-media img { width: 100%; box-shadow: var(--shadow-card); }
.photo-band .band-text { position: relative; top: 40px; padding: 60px; }
.photo-band .band-text p { margin-bottom: 25px; }
@media (max-width: 750px) {
  .photo-band { margin-top: 80px; padding: 0 10px; }
  .photo-band::before { width: 30px; height: 30px; }
  .photo-band::after { display: none; }
  .photo-band .band-inner { top: -20px; grid-template-columns: 1fr; }
  .photo-band .band-text { top: 0; padding: 0 0 20px; }
}

/* 15. Badge strip: award and membership logos in a centered row of five,
   two to a row on phones. Use when: awards, memberships, certifications.
   Not when: client logos; those need their own permission. */
.logo-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: -20px 0 0 -20px;
  padding: 0;
}
.logo-grid li { flex: 0 0 20%; margin: 0; padding: 20px 0 0 20px; }
.logo-grid li::before { display: none; }
@media (max-width: 750px) { .logo-grid li { flex-basis: 50%; } }

/* 16. Link columns: short lists of articles under slab headings, two
   columns on wide screens. Use when: pointing to the blog by topic.
   Not when: fewer than two topics. */
.link-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 750px) { .link-columns { grid-template-columns: 1fr; } }

/* 17. Site footer: a red band cut on a diagonal at its right end, with the
   white logo, the footer links and the copyright line.
   Use when: the end of every page. */
.site-footer .footer-main { position: relative; z-index: 1; overflow: hidden; }
.site-footer .footer-main::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0; right: 7%;
  z-index: -1;
  background: var(--color-red);
  transform: skew(45deg);
  transform-origin: bottom center;
}
.site-footer .row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: center;
  padding: 12px 0;
}
.site-footer .logo img { width: 110px; }
.site-footer nav { display: grid; gap: 10px; }
.site-footer .menu {
  display: grid;
  grid-auto-flow: column;
  justify-content: start;
  gap: 40px;
  margin: 0;
  padding: 0;
}
.site-footer .menu li { margin: 0; padding: 0; line-height: 28px; }
.site-footer .menu li::before { display: none; }
.site-footer .menu a {
  position: relative;
  color: var(--color-paper);
  font-size: var(--size-button);
  font-weight: var(--weight-black);
  line-height: 28px;
  text-decoration: none;
}
.site-footer .menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  border-top: 2px solid var(--color-paper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s cubic-bezier(.7, 0, .3, 1);
}
.site-footer .menu a:hover::after, .site-footer .menu a:focus-visible::after { transform: scaleX(1); }
.site-footer p {
  margin: 0;
  color: var(--color-red-tint);
  font-size: var(--size-small);
  font-style: italic;
  line-height: var(--lh-small);
}
.site-footer p a { color: var(--color-red-tint); font-weight: var(--weight-regular); }
.site-footer p a:hover { color: var(--color-paper); }
.site-footer :focus-visible { outline-color: var(--color-paper); }
@media (max-width: 880px) {
  .site-footer .footer-main::before {
    right: 0;
    transform: none;
    background: linear-gradient(-135deg, transparent 30px, var(--color-red) 0);
  }
}
@media (max-width: 750px) {
  .site-footer .row { grid-template-columns: 1fr; padding: 30px 0; }
  .site-footer .logo img { width: 90px; }
  .site-footer nav { gap: 30px; }
  .site-footer .menu { grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 15px; }
}

/* 18. Thank-you note: the plain page a visitor sees after sending a form.
   Use when: the thank-you page only. */
.thanks { padding: 30px 0 40px; }
.thanks .t-intro { margin: 22px 0 30px; }
