/* =========================================================
   NTX Home Services — homepage (index.html)
   Loads after css/global.css.
   1. Hero extras   2. The NTX Promise   3. What We Offer
   4. Your Neighbors Trust Us   5. Service Area   6. Tablets and phones
   ========================================================= */

/* ---------- 1. Hero extras ---------- */

/* Service shortcuts in the lower-right corner of the hero */
.hero__index {
  align-self: end;
  min-width: 14rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}
.hero__index li { border-bottom: 1px solid rgba(255, 255, 255, 0.24); }
.hero__index a {
  display: block;
  padding: 0.85rem 0.25rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
  transition: padding 0.35s var(--ease);
}
.hero__index a:hover { padding-left: 0.85rem; }

/* Scrolling list of services along the bottom of the hero */
.ribbon {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding-block: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

.ribbon__track { display: flex; width: max-content; }

.ribbon__list {
  display: flex;
  flex: none;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ribbon__list li {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.25rem);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
}
.ribbon__list li::after {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  margin-inline: clamp(1.25rem, 2.5vw, 2.25rem);
  background: var(--gradient-orange);
  transform: rotate(45deg);
}

@keyframes marquee { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: no-preference) {
  .ribbon__track.is-ready { animation: marquee 95s linear infinite; }
  .ribbon:hover .ribbon__track { animation-play-state: paused; }
}

/* Without motion the list wraps instead of scrolling. */
@media (prefers-reduced-motion: reduce) {
  .ribbon { -webkit-mask-image: none; mask-image: none; }
  .ribbon__track { width: auto; }
  .ribbon__list { flex-wrap: wrap; justify-content: center; row-gap: 0.4rem; padding-inline: var(--gutter); }
}

/* ---------- 2–5. Sections ---------- */

/* The NTX Promise — white section with dark text */
.promise {
  background: #fff;
  color: var(--color-text-dark);
  padding-bottom: var(--section-space);
}

.promise__banner { background: #fff; }
.promise__banner img { object-position: 38% 30%; }

.promise .lead { color: #4a525b; }
.promise__intro { margin-top: 1.25rem; }

/* Desktop: the photo keeps its full shape and the heading starts just below the
   tablet in the technician's hand (about 76% of the way down the photo). */
@media (min-width: 60.01rem) {
  .promise__banner {
    display: block;
    min-height: calc(100vw * 1083 / 2560);
  }
  .promise__banner .banner__media,
  .promise__banner .banner__scrim {
    bottom: auto;
    height: auto;
    aspect-ratio: 2560 / 1083;
  }
  .promise__banner .banner__scrim {
    background:
      linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, 0.9) 12%, rgba(255, 255, 255, 0) 34%),
      linear-gradient(270deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.7) 24%, rgba(255, 255, 255, 0) 44%);
  }
  .promise__banner .banner__content { padding-top: 33%; } /* % of the photo's width */
}

.promise-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.promise-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.25rem 1.75rem 2.5rem;
  background: linear-gradient(180deg, #ffffff 0%, #f5f6f7 100%);
  border: 1px solid rgba(16, 19, 23, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px -28px rgba(16, 19, 23, 0.35);
}

.promise-card .icon { width: 3.5rem; height: 3.5rem; }

.promise-card__title {
  margin-top: 1.5rem;
  font-size: 1.375rem;
}

.promise-card__text {
  margin-top: 0.75rem;
  max-width: 21rem;
  color: #4a525b;
  font-size: 0.975rem;
}

/* What We Offer */
.offer {
  background: var(--color-bg-alt);
  padding-block: var(--section-space);
}

.offer__header { max-width: 46rem; }
.offer__header .section-subtitle { margin-top: 1.5rem; }
.offer__text { margin-top: 0.75rem; }

/* Alternating rows: text on one side, photo on the other. */
.service-rows {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  padding: 0;
  list-style: none;
}

.service-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 2rem clamp(2.5rem, 6vw, 5rem);
  padding-block: clamp(2.5rem, 5vw, 4rem);
}
.service-row + .service-row { border-top: 1px solid var(--color-border); }
.service-row:last-child { padding-bottom: 0; }
.service-row:nth-child(even) .service-row__media { order: -1; }

.service-row__tag {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  background: rgba(74, 193, 235, 0.12);
  color: var(--blue-start);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.service-row__title {
  margin-top: 1rem;
  font-size: clamp(1.875rem, 1.5rem + 1.4vw, 2.75rem);
}

.service-row__text {
  margin-top: 1rem;
  max-width: 32rem;
  color: var(--color-text-muted);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
}

.service-row__btn { margin-top: 1.75rem; }
.service-row__btn span { display: inline-block; transition: transform 0.25s var(--ease); }
.service-row__btn:hover span { transform: translateX(4px); }

/* The photo keeps the Version 1 card hover: lift, shadow and a slow zoom. */
.service-row__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.service-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.service-row__media:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.service-row__media:hover img { transform: scale(1.04); }

/* Hovering the button previews the photo too. Kept separate so older browsers skip only this. */
.service-row:has(.service-row__btn:hover) .service-row__media {
  border-color: var(--color-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.service-row:has(.service-row__btn:hover) .service-row__media img { transform: scale(1.04); }

/* Your Neighbors Trust Us + Experience the Difference */
/* No padding of its own: the sections above and below already provide the spacing. */
.trust { background: var(--color-bg-alt); }

.trust__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.trust__story {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

.trust__text { margin-top: 1.25rem; max-width: 34rem; }

.trust__photo {
  position: relative;
  flex: 1;
  min-height: 18rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.trust__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 50%;
}

.contact-tile {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 34rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.contact-tile__img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% 30%;
}

/* Soft shade along the bottom keeps the white heading readable over the photo. */
.contact-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(0deg, rgba(10, 12, 14, 0.88) 0%, rgba(10, 12, 14, 0.55) 30%, rgba(10, 12, 14, 0) 55%);
  pointer-events: none;
}

.contact-tile__content .section-title { margin-top: 0; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); }
.contact-tile__content .btn { margin-top: 1.5rem; }

/* Holds the future Google Reviews widget. Hidden until the widget is added. */
.reviews-slot { padding-top: var(--section-space); }

/* Experience the Difference button: keeps its frosted glass color, and rings pulse
   outward on hover like the Solutions for the Unexpected button on the repairs page. */
.btn--ripple { position: relative; }
.btn--ripple::before,
.btn--ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7);
  opacity: 0;
  pointer-events: none;
}
.btn--ripple:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: no-preference) {
  .btn--ripple:hover::before { animation: btn-ripple 1.4s var(--ease) infinite; }
  .btn--ripple:hover::after { animation: btn-ripple 1.4s var(--ease) 0.7s infinite; }
}

/* Service Area */
.area {
  background: var(--color-bg-alt);
  padding-block: var(--section-space);
}

.area__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  grid-template-areas:
    'intro map'
    'cities map'
    'actions actions';
  gap: 2.5rem 4rem;
  align-items: start;
}

.area__intro { grid-area: intro; }
.area__cities { grid-area: cities; }
.area__map { grid-area: map; align-self: center; }
.area__actions { grid-area: actions; }

/* Columns fill top to bottom, so the alphabet reads down each column. */
.city-list {
  columns: 2;
  column-gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.city-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border);
  font-weight: var(--weight-label);
  break-inside: avoid;
}

.city-list li::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gradient-orange);
}

.area__note {
  margin-top: 1.5rem;
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text);
}

/* Map image. Replace the <img> inside .map-frame with a Google Maps embed later. */
.map-frame {
  position: relative;
  aspect-ratio: 1315 / 807; /* matches the map image so its credit line is never cropped */
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.map-frame img,
.map-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  height: 100%;
  min-height: 5rem;
  padding: 1.1rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.action-card .icon { width: 2.25rem; height: 2.25rem; }

.action-card__arrow {
  margin-left: auto;
  color: var(--color-text-muted);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.action-card:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  transform: translateY(-2px);
}
.action-card:hover .action-card__arrow { color: #fff; transform: translateX(4px); }

/* Section layouts for tablet and mobile */
@media (max-width: 60rem) {
  .promise-grid { grid-template-columns: repeat(2, 1fr); }

  .service-row { grid-template-columns: 1fr; }
  .service-row .service-row__media { order: -1; }

  .trust__grid { grid-template-columns: 1fr; }
  .trust__photo { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .contact-tile { min-height: 32rem; }

  .area__layout {
    grid-template-columns: 1fr;
    grid-template-areas: 'intro' 'map' 'cities' 'actions';
  }
  .city-list { columns: 3; }
  .action-grid { grid-template-columns: 1fr; }
}

/* ---------- 6. Tablets and phones ---------- */

@media (max-width: 60rem) {
  .promise__banner .banner__scrim {
    background: linear-gradient(0deg, #fff 0%, rgba(255, 255, 255, 0) 35%);
    aspect-ratio: var(--media-ratio);
    bottom: auto;
  }
  .hero__index { display: none; }
  .ribbon { margin-top: 3rem; }
}

@media (max-width: 47.99rem) {
  .promise__banner img { object-position: 42% 30%; }

  .promise-grid { grid-template-columns: 1fr; }
  .promise-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.25rem;
    align-items: start;
    text-align: left;
    padding: 1.5rem;
  }
  .promise-card .icon { grid-row: span 2; width: 2.75rem; height: 2.75rem; }
  .promise-card__title { margin-top: 0; font-size: 1.2rem; }
  .promise-card__text { margin-top: 0.4rem; }

  .contact-tile { min-height: 28rem; }
  .contact-tile__img { object-position: 66% 30%; }

  .city-list { columns: 2; }
}
