/* Decorative page banners; all original content remains in the flow. */
.page-head--visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #f1f5f7;
}

.page-head--visual .page-head-photo {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 auto;
  display: block;
  width: 66%;
  height: 100%;
  pointer-events: none;
  /* Feather the photo's own edge as well as the tint above it. */
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 16%) 5%, rgb(0 0 0 / 50%) 10%, rgb(0 0 0 / 84%) 15%, #000 20%);
  mask-image: linear-gradient(90deg, transparent 0%, rgb(0 0 0 / 16%) 5%, rgb(0 0 0 / 50%) 10%, rgb(0 0 0 / 84%) 15%, #000 20%);
}

.page-head--visual .page-head-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 50%;
}

.page-head--visual::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  /* Eased, broad transition: avoid a narrow band from opaque to clear. */
  background: linear-gradient(
    90deg,
    #f1f5f7 0%,
    #f1f5f7 35%,
    rgb(241 245 247 / 99%) 40%,
    rgb(241 245 247 / 96.2%) 45%,
    rgb(241 245 247 / 91.7%) 50%,
    rgb(241 245 247 / 85.7%) 55%,
    rgb(241 245 247 / 78.7%) 60%,
    rgb(241 245 247 / 71%) 65%,
    rgb(241 245 247 / 63%) 70%,
    rgb(241 245 247 / 55.3%) 75%,
    rgb(241 245 247 / 48.3%) 80%,
    rgb(241 245 247 / 42.2%) 85%,
    rgb(241 245 247 / 37.8%) 90%,
    rgb(241 245 247 / 35%) 95%,
    rgb(241 245 247 / 34%) 100%
  );
  pointer-events: none;
}

.page-head--visual > .wrap {
  position: relative;
  z-index: 1;
}

.page-head--visual h1 {
  max-width: min(68%, 810px);
  color: #142b40;
  text-wrap: balance;
}

.page-head--visual > .wrap > p {
  max-width: min(58%, 650px);
  color: #2d465a;
}

.page-head--visual .breadcrumbs { color: #4f697c; }
.page-head--visual .eyebrow { color: #8a562f; }
.page-head--visual .rental-help { max-width: 60%; color: #2d465a; }
.page-head--owners .page-head-photo { width: 52%; }
.page-head--services-handshake .page-head-photo img { object-position: 65% 20%; }
.page-head--rental-family .page-head-photo img { object-position: 65% 15%; }
.page-head--owner-conversation .page-head-photo img { object-position: 65% 50%; }
.page-head--home-care .page-head-photo img { object-position: 65% 15%; }
.page-head--neighbor-conversation .page-head-photo img { object-position: 65% 50%; }
.page-head--city .page-head-photo img { object-position: center 50%; }

/* Identify real local scenery and keep the license credit easy to find. */
.city-photo-caption { background: #fff; border-bottom: 1px solid #e2e8ec; }
.city-photo-caption .wrap { display: flex; justify-content: flex-end; align-items: baseline; gap: 16px; padding-block: 10px; font-size: .72rem; line-height: 1.5; color: #5c7181; }
.city-photo-caption a { white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }

/* Detail pages reach the useful content sooner while keeping a generous title. */
.page-head--detail { padding: 44px 0; }
.page-head--detail .breadcrumbs { margin-bottom: 16px; }
.page-head--detail .eyebrow { margin-bottom: 14px; }
.page-head--detail h1 { margin-bottom: 18px; }

/* Keep the image visible at intermediate widths without crowding the title. */
@media (min-width: 761px) and (max-width: 1100px) {
  .page-head--visual h1 { max-width: 73%; }
  .page-head--visual > .wrap > p { max-width: 65%; }
  .page-head--visual .rental-help { max-width: 65%; }
}

/* A compact, clear photograph follows the heading on phones. Keeping text on
   its own surface avoids washing out the image or compromising readability. */
@media (max-width: 760px) {
  .city-photo-caption .wrap { justify-content: space-between; gap: 12px; }
  .page-head--visual {
    display: flex;
    flex-direction: column;
    padding: 30px 0 24px;
  }
  .page-head--visual .page-head-photo {
    position: relative;
    inset: auto;
    z-index: auto;
    order: 2;
    width: calc(100% - 40px);
    height: clamp(170px, 37vw, 240px);
    margin: 24px auto 0;
    flex: none;
    overflow: hidden;
    border-radius: 8px;
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .page-head--visual .page-head-photo img { object-position: center 50%; }
  .page-head--services-handshake .page-head-photo img,
  .page-head--rental-family .page-head-photo img,
  .page-head--home-care .page-head-photo img { object-position: center 20%; }
  .page-head--visual::after { display: none; }
  .page-head--visual h1,
  .page-head--visual > .wrap > p,
  .page-head--visual .rental-help {
    max-width: 100%;
  }
  .page-head--visual h1 { text-wrap: initial; }
  .page-head--detail { padding: 28px 0 24px; }
  .page-head--detail .page-head-photo { height: clamp(160px, 33vw, 220px); }
  .page-head--detail .breadcrumbs { margin-bottom: 14px; }
  .page-head--detail .eyebrow { margin-bottom: 12px; }
  .page-head--detail h1 { margin-bottom: 16px; }
}

/* Fit long service names on the narrowest phones without splitting words. */
@media (max-width: 360px) {
  .page-head--detail h1 { font-size: 2.4rem; }
}

@media print {
  .page-head--visual .page-head-photo,
  .page-head--visual::after { display: none; }
  .page-head--visual h1,
  .page-head--visual > .wrap > p,
  .page-head--visual .rental-help { max-width: 100%; }
}
