/* Behaviour required after removing the original React runtime. */
#static-mobile-nav {
  display: none;
  position: fixed;
  inset: 4rem 0 auto 0;
  z-index: 49;
  padding: 1.25rem;
  border-bottom: 2px solid hsl(var(--foreground));
  background: hsl(var(--background));
}

#static-mobile-nav.is-open {
  display: grid;
}

#static-mobile-nav a {
  padding: .85rem 0;
  border-bottom: 1px solid hsl(var(--foreground) / .18);
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

#static-mobile-nav a:last-child { border-bottom: 0; }

/* Give every large heading enough space for italic glyphs and highlighted
   words. The original tight line box could clip either edge at some widths. */
main h1,
main section h2 {
  line-height: 1.12;
  overflow: visible;
  padding: .08em .16em .12em;
  margin-inline: -.16em 0;
}

main .marker {
  white-space: nowrap;
  padding-inline: .10em;
  margin-inline: .02em;
  box-shadow: none;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* The supplied baking photo was mirrored; flip it back without altering or
   recompressing the original photograph. */
img[src="assets/baking-together.jpg"] {
  transform: scaleX(-1);
}

/* Use the card as the shadow source so transformed photos cannot reverse or
   hide their black offset backing. This also normalises the alternate frame. */
#photos figure > div {
  background: hsl(var(--card));
  box-shadow: .65rem .65rem 0 hsl(var(--foreground));
}

#photos figure img {
  box-shadow: none;
}

#photos img[src="assets/baking-together.jpg"] {
  transform: translate(-.375rem, .375rem) scaleX(-1);
}

@media (min-width: 768px) {
  #static-mobile-nav { inset-block-start: 5rem; }
}

@media (min-width: 1024px) {
  #static-mobile-nav { display: none !important; }
}


/* Accessibility and content refinements for older readers. */
body {
  font-size: 18px;
}

main p,
main li,
main dd {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.72;
}

main .font-mono,
footer .font-mono {
  font-weight: 700;
}

#top a[href^="tel:"] {
  font-size: 1.15rem;
  font-weight: 900;
  padding: 1.1rem 1.75rem;
}

header nav a > span {
  display: none;
}

.relative.mb-14 > span.text-outline,
.relative.md\\:mb-20 > span.text-outline {
  display: none !important;
}

#services-area-callout {
  position: absolute;
  right: 0;
  top: -2.5rem;
  display: grid;
  max-width: 25rem;
  gap: .45rem;
  border: 2px solid hsl(var(--foreground));
  background: hsl(var(--card));
  padding: 1rem 1.2rem;
  box-shadow: .45rem .45rem 0 hsl(var(--foreground));
  font-family: "Space Mono", ui-monospace, monospace;
  text-align: left;
}

#services-area-callout strong {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .16em;
}

#services-area-callout span {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.5;
}

#top div:has(> svg.animate-spin-slow) > svg:last-child {
  display: none;
}

#top div:has(> svg.animate-spin-slow)::after {
  content: "Mission\A Statement";
  white-space: pre;
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: .08em;
  text-align: center;
  text-transform: uppercase;
}

main .marker {
  padding-inline: .14em;
  margin-inline: .10em;
  box-shadow: none !important;
}

#how-it-works .grid > div > div {
  margin-top: 0 !important;
}

#about .bg-foreground .text-accent {
  display: none;
}

@media (max-width: 900px) {
  #services-area-callout {
    position: static;
    margin: 1.5rem 0 0;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 17px;
  }

  main p,
  main li,
  main dd {
    font-size: 1rem;
  }

  #top a[href^="tel:"] {
    width: 100%;
    justify-content: center;
    font-size: 1.05rem;
  }
}


/* Override the original tiny utility sizes on labels and captions. */
main section .relative.mb-14 > p,
main section .relative.md\\:mb-20 > p {
  font-size: .95rem !important;
  line-height: 1.55;
}

main figcaption,
main .text-\\[11px\\] {
  font-size: .88rem !important;
  font-weight: 700;
  line-height: 1.5;
}

footer .text-\\[11px\\] {
  font-size: .82rem !important;
  line-height: 1.55;
}


/* Present the transparent logo as a floating brand mark, not a photo card. */
#top div:has(> div > img[src="assets/angels-homecare-logo-transparent.png"]) {
  top: -2.75rem;
  bottom: auto;
  left: -3.5rem;
  width: 10rem;
  transform: none;
  z-index: 10;
}

#top div:has(> img[src="assets/angels-homecare-logo-transparent.png"]) {
  border: 0;
  padding: 0;
  background: transparent;
}

#top img[src="assets/angels-homecare-logo-transparent.png"] {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  transform: none;
}

@media (max-width: 639px) {
  #top div:has(> div > img[src="assets/angels-homecare-logo-transparent.png"]) {
    top: -2rem;
    left: -.75rem;
    width: 7.5rem;
  }
}


/* Keep highlights inside their own line box instead of covering nearby text. */
main .marker {
  background-color: transparent !important;
  background-image: linear-gradient(
    to bottom,
    transparent 16%,
    hsl(var(--accent)) 16%,
    hsl(var(--accent)) 88%,
    transparent 88%
  ) !important;
  padding: 0 .08em !important;
  margin: 0 .04em !important;
  box-shadow: none !important;
  line-height: inherit;
}


/* Small transparent logo beside the existing header wordmark. */
.header-logo-link {
  display: flex;
  height: 100%;
  align-items: center;
  gap: .6rem;
  flex: 0 0 auto;
}

.header-logo {
  display: block;
  width: auto;
  height: 2.8rem;
  border: 0;
  object-fit: contain;
}

@media (min-width: 768px) {
  .header-logo {
    height: 3.5rem;
  }
}

@media (max-width: 520px) {
  .header-logo-link {
    gap: .35rem;
  }

  .header-logo {
    height: 2.5rem;
  }

  .header-logo-link > span:nth-of-type(2) {
    display: none;
  }
}


/* Make the header phone action prominent and easy to read. */
header a[href^="tel:"] {
  font-size: 1rem !important;
  font-weight: 900 !important;
  padding: .8rem 1.05rem !important;
  letter-spacing: .08em;
}

@media (min-width: 768px) {
  header a[href^="tel:"] {
    font-size: 1.12rem !important;
    padding: .9rem 1.3rem !important;
  }
}


/* Keep the Stories highlight on a clean, dedicated line. */
#stories h2 .marker {
  display: inline-block;
  white-space: nowrap;
  margin-top: .12em !important;
  line-height: 1.08;
}


/* Match desktop navigation readability to the phone-number action. */
@media (min-width: 1024px) {
  header nav {
    gap: 1.5rem;
  }

  header nav a {
    font-size: 1.12rem !important;
    font-weight: 900 !important;
    letter-spacing: .08em;
  }
}


/* Keep the numbered badges visible with the enlarged header menu. */
header nav a > span {
  display: inline-block !important;
}


/* Increase the header logo enough for its internal wordmark to remain legible. */
.header-logo {
  height: 3.2rem;
}

@media (min-width: 768px) {
  .header-logo {
    height: 4.2rem;
  }
}

@media (max-width: 520px) {
  .header-logo {
    height: 2.8rem;
  }
}
