/* ==========================================================================
   ABCELECTRIC - home page
   Page-specific layout only: the hero card, the intro statement, the callback
   panel and small glue around shared components. Everything else comes from
   app.css.
   ========================================================================== */

/* 1. Hero ----------------------------------------------------------------- */
/* The template's construction on the shared .banner shell (navy frame +
   rounded card): card -> photo layer -> gradient overlay -> content.
   Below 992px the photo covers the whole card under a dark, almost uniform
   overlay. From 992px the 1100px source is not stretched across the card: it
   is anchored to the right at (or under) its native size, its left edge
   dissolves into the card and the template's left-to-right gradient runs over
   everything, so it reads as one full-card background. */
.home-hero__card {
  --hero-rgb: 15 34 73;   /* --navy-800: the card colour and its overlay */
  --hero-inset: 20px;
  position: relative;
  isolation: isolate;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  padding-block: 0;
  background: var(--navy-800);
}

/* Photo layer. On phones the card is far taller than the photo's proportions:
   the picture is drawn a little larger than the card and anchored to the top,
   which keeps the helmet and the face in the visible slice. The layer stops
   one pixel short of the card's bottom edge, where the overlay is solid, so
   the lettering on the uniform cannot shine through along a fractional edge. */
.home-hero__media {
  position: absolute;
  inset: 0 0 1px;
  z-index: -2;
  overflow: hidden;
}
.home-hero__media img {
  width: 100%;
  height: 115%;
  object-fit: cover;
  object-position: 60% 0;
}

/* Overlay layer. Phones: dark and nearly uniform (the photo is bright and the
   text runs over all of it), lighter towards the right where the electrician
   stands, solid behind the eyebrow and behind the stats. */
.home-hero__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to bottom, rgb(var(--hero-rgb) / .88) 0, rgb(var(--hero-rgb) / .8) 84px, rgb(var(--hero-rgb) / 0) 170px),
    linear-gradient(to top, rgb(var(--hero-rgb) / 1) 0, rgb(var(--hero-rgb) / .95) 32%, rgb(var(--hero-rgb) / 0) 56%),
    linear-gradient(to right, rgb(var(--hero-rgb) / .92) 0, rgb(var(--hero-rgb) / .86) 45%, rgb(var(--hero-rgb) / .62) 100%);
}

/* Content layer. Left-aligned text needs air inside the rounded card on narrow
   screens, but lines up with the page container (and the logo) once the card
   is wider. */
.home-hero__card > .container {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding-block: 56px 44px;
  padding-inline: max(var(--gutter), calc(var(--hero-inset) - max(0px, (100% - var(--container)) / 2)));
}
.home-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
/* Keeps the eyebrow on one line on 360-400px phones. */
@media (max-width: 399px) {
  .home-hero__content > .eyebrow {
    font-size: .9375rem;
    letter-spacing: .05em;
  }
}
.home-hero__title {
  margin: 0;
  color: #ffffff;
}
.home-hero__lead {
  max-width: 580px;
  margin: var(--space-4) 0 0;
  color: rgb(255 255 255 / .92);
}
.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

/* Phone link next to the CTA: outlined disc + two-line label. */
.home-hero__phone {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  color: #ffffff;
  text-decoration: none;
}
.home-hero__phone-icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgb(255 255 255 / .4);
  border-radius: 50%;
  color: var(--accent);
  transition: background-color .3s, border-color .3s, color .3s;
}
.home-hero__phone:hover .home-hero__phone-icon,
.home-hero__phone:focus-visible .home-hero__phone-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--navy-950);
}
.home-hero__phone-label {
  display: block;
  color: rgb(255 255 255 / .8);
  font-size: .875rem;
  line-height: 1.3;
}
.home-hero__phone-number {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  transition: color .3s;
}
.home-hero__phone:hover .home-hero__phone-number,
.home-hero__phone:focus-visible .home-hero__phone-number {
  color: var(--accent);
}

/* Trust stats close the card: three equal columns on phones, a divided row
   from 480px. The grid lets the long label wrap instead of pushing the third
   stat to a new row. */
.home-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 12px;
  width: 100%;
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid rgb(255 255 255 / .22);
}
.home-hero__stats .stat + .stat {
  padding-left: 0;
  border-left: 0;
}
.home-hero__stats .stat__value {
  color: var(--accent);
}
.home-hero__stats .stat__label {
  margin-top: 6px;
  color: rgb(255 255 255 / .82);
  font-size: .8125rem;
}

@media (min-width: 480px) {
  .home-hero__card {
    --hero-inset: 30px;
  }
  .home-hero__card > .container {
    padding-block: 60px 48px;
  }
  .home-hero__media img {
    object-position: 82% 40%;
  }
  .home-hero__stats {
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 0;
    width: auto;
  }
  .home-hero__stats .stat + .stat {
    margin-left: 26px;
    padding-left: 26px;
    border-left: 1px solid rgb(255 255 255 / .22);
  }
  .home-hero__stats .stat__label {
    font-size: .9375rem;
  }
}

/* Tablet: the card is close to the photo's own proportions, so nearly all of
   it shows. The text column keeps to the left; the overlay opens up towards
   the electrician on the right. */
@media (min-width: 768px) {
  .home-hero__card {
    --hero-inset: 40px;
    min-height: 640px;
  }
  .home-hero__media {
    inset: 0;
  }
  .home-hero__media img {
    height: 100%;
    object-position: 100% 50%;
  }
  .home-hero__card::before {
    background:
      linear-gradient(to top, rgb(var(--hero-rgb) / .6) 0, rgb(var(--hero-rgb) / 0) 28%),
      linear-gradient(to right, rgb(var(--hero-rgb) / .95) 0, rgb(var(--hero-rgb) / .92) 48%, rgb(var(--hero-rgb) / .6) 78%, rgb(var(--hero-rgb) / .35) 100%);
  }
  .home-hero__card > .container {
    padding-block: 70px 56px;
  }
  .home-hero__content {
    max-width: 72%;
  }
  .home-hero__actions {
    margin-top: var(--space-6);
  }
}
/* Tablet portrait: the stats row is tightened so it ends before the lettering
   on the uniform. */
@media (min-width: 768px) and (max-width: 991px) {
  .home-hero__stats .stat + .stat {
    margin-left: 14px;
    padding-left: 14px;
  }
}

/* Desktop: photo anchored right. The box takes its width from the card's
   height (it always shows ~89% of the photo's height: helmet at the top, the
   lettering on the uniform at the bottom) and never exceeds the 1100px file. */
@media (min-width: 992px) {
  .home-hero__card {
    --hero-inset: 50px;
    min-height: clamp(640px, 47vw, 860px);
  }
  .home-hero__media {
    inset: 0 0 0 auto;
    width: auto;
    max-width: min(78%, 1100px);
    aspect-ratio: 1100 / 890;
    -webkit-mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) 26%, #000 52%);
    mask-image: linear-gradient(to right, transparent 0, rgb(0 0 0 / .5) 26%, #000 52%);
  }
  .home-hero__media img {
    object-position: 100% 60%;
  }
  /* The template's gradient: solid on the text side, ~55% mid-card, ~10% at
     the right edge. */
  .home-hero__card::before {
    background: linear-gradient(to right, rgb(var(--hero-rgb) / 1) 0, rgb(var(--hero-rgb) / .92) 30%, rgb(var(--hero-rgb) / .55) 58%, rgb(var(--hero-rgb) / .1) 90%);
  }
  .home-hero__card > .container {
    padding-block: 70px 60px;
  }
  .home-hero__content {
    max-width: 57%;
  }
  .home-hero__stats .stat + .stat {
    margin-left: var(--space-5);
    padding-left: var(--space-5);
  }
  .home-hero__stats .stat__label {
    font-size: 1rem;
  }
}

@media (min-width: 1280px) {
  .home-hero__card > .container {
    padding-block: 80px 70px;
  }
  .home-hero__content {
    max-width: 54%;
  }
  .home-hero__actions {
    column-gap: var(--space-5);
  }
}

/* 2. Intro statement ------------------------------------------------------ */
/* One large centred sentence and a button, at the template's measures. */
.home-intro__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 700px;
  margin-inline: auto;
  text-align: center;
}
.home-intro__action {
  margin-top: var(--space-6);
}
/* On phones the sentence runs past the six lines browsers balance: at least
   keep a single word from being left alone on the last line. */
@media (max-width: 767px) {
  .home-intro .statement {
    text-wrap: pretty;
  }
}
@media (min-width: 992px) {
  .home-intro__inner {
    max-width: 760px;
  }
}
@media (min-width: 1280px) {
  .home-intro__inner {
    max-width: 840px;
  }
}

/* 3. Callback panel ------------------------------------------------------- */
/* Rounded photo panel in the navy frame; the band below (solutions) is navy
   too, so the frame simply continues into it. */
.home-callback {
  /* One pixel tucked under the next band: no seam between the two navy
     backgrounds at fractional zoom levels. */
  margin-bottom: -1px;
  padding: var(--gutter) var(--gutter) 1px;
  background: var(--navy-900);
}
.home-callback__panel {
  position: relative;
  isolation: isolate;
  padding: var(--space-7) 5px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--navy-800);
}
.home-callback__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.home-callback__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-callback__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(204deg, rgb(var(--navy-rgb) / .62), rgb(var(--navy-rgb) / .95));
}
.home-callback__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}
.home-callback__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-5);
  border-radius: 50%;
  background: var(--accent);
  color: var(--navy-950);
}
.home-callback__title {
  margin: 0;
}
.home-callback__text {
  max-width: 560px;
  margin: var(--space-4) 0 0;
  color: rgb(255 255 255 / .9);
}
.home-callback__form {
  margin-top: var(--space-5);
}
.home-callback__note {
  max-width: 480px;
  margin: var(--space-4) 0 0;
  color: var(--c-muted);
  font-size: .875rem;
  line-height: 1.5;
  text-wrap: balance;
}
.home-callback__direct {
  margin: var(--space-4) 0 0;
  color: #ffffff;
  line-height: 1.4;
}
.home-callback__direct a {
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  transition: color .3s;
}
.home-callback__direct a:hover {
  color: #ffffff;
}
@media (min-width: 768px) {
  .home-callback__panel {
    padding: var(--space-8) var(--space-4);
  }
}
@media (min-width: 1280px) {
  .home-callback__panel {
    padding-block: var(--space-9);
  }
}

/* 4. About block ---------------------------------------------------------- */
/* Landscape source in a narrow shaped crop: keep the electrician in frame. */
.home-about__photo-a {
  object-position: 80% 50%;
}
.home-about__text .lead {
  margin-bottom: 0;
}
/* The four "why us" points: bold claim, one supporting line each. */
.home-about__points {
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
}
.home-about__points > li {
  display: flex;
  flex-direction: column;
  color: var(--c-text);
}
.home-about__points strong {
  color: var(--c-heading);
  font-size: var(--fs-lead);
  line-height: 1.35;
}
.home-about__action {
  margin-top: var(--space-6);
}

/* 5. Projects and blog teasers -------------------------------------------- */
.home-projects__more {
  display: flex;
  justify-content: center;
  margin-top: var(--block-gap);
}
@media (min-width: 768px) {
  .home-blog__more {
    padding-bottom: 12px;
    text-align: right;
  }
}
