/* Reuse the site's local Manrope/Libre Caslon Display faces; this changes typography. */
#knox-companion,
#knox-companion .ka-form button,
#knox-companion .ka-welcome-voice,
#knox-companion .ka-listen { font-family: KnoxSans, Arial, sans-serif; }
#knox-companion .ka-open strong,
#knox-companion .ka-heading h2,
#knox-companion .ka-welcome p:first-child { font-family: KnoxDisplay, Georgia, serif; }

/* These rules apply only when the homepage renderer supplied real image elements. */
body.home .elementor #services .situation.knox-opt-image-ready::before,
body.home .elementor #questions .questions-grid > .e-con.knox-opt-image-ready::after {
  content: none !important;
  display: none !important;
  background-image: none !important;
}
body.home .elementor #services .knox-service-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.48;
  object-fit: cover;
  flex: 0 0 auto;
  filter: saturate(.88);
  overflow: hidden;
  margin: 0 !important;
  transition: filter 1s ease;
}
body.home .elementor #services .situation:hover .knox-service-image,
body.home .elementor #services .situation:focus-within .knox-service-image { filter: saturate(1.03) brightness(1.045); }
body.home .elementor #questions .knox-questions-image {
  display: block;
  width: 100%;
  max-width: 550px;
  height: auto;
  aspect-ratio: 1.7;
  object-fit: cover;
  object-position: center 52%;
  margin-top: 38px;
  border: 1px solid #c9b994;
  box-shadow: 12px 12px 0 #eae4d6;
  overflow: hidden;
}
body.home .elementor #services .knox-service-image img,
body.home .elementor #questions .knox-questions-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body.home .elementor #services .knox-service-image .elementor-widget-container,
body.home .elementor #questions .knox-questions-image .elementor-widget-container { height: 100%; }
body.home .elementor #questions .knox-questions-image img { object-position: center 52%; }
.elementor .knox-poster-deferred .knox-lazy-video-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.elementor .coast-cinema.knox-poster-deferred .knox-lazy-video-poster { object-position: 65% center; }
.elementor .knox-poster-deferred video { opacity: 0; }
.elementor .knox-poster-deferred.kn-film-playing video,
.elementor .kn-film-playing .knox-poster-deferred video { opacity: 1; }

/* A closed assistant cannot cover an inquiry. Existing open conversations stay usable. */
#knox-companion.knox-inquiry-visible:not(.ka-expanded),
#knox-companion.knox-inquiry-focused:not(.ka-expanded) {
  visibility: hidden !important;
  pointer-events: none !important;
}
.knox-intake-form input,
.knox-intake-form select,
.knox-intake-form textarea,
.knox-intake-form button { scroll-margin-block: 120px; }

/* Darker text keeps the existing palette and improves normal-text contrast. */
body.home .elementor #services .eyebrow,
body.home .elementor #questions .eyebrow { color: #76643f; }
body.home .elementor .hero-footnote { color: #5e6b70; }
body.home .elementor .faq-item .elementor-accordion .elementor-tab-title.elementor-active,
body.home .elementor .faq-item .elementor-accordion .elementor-tab-title.elementor-active a.elementor-accordion-title,
body.home .elementor .faq-item .elementor-accordion .elementor-tab-title:hover a.elementor-accordion-title { color: #80622f !important; }

@media (min-width: 701px) and (max-width: 950px) {
  body.home .elementor #services .knox-service-image { height: 100%; min-height: 285px; aspect-ratio: auto; }
  body.home .elementor #questions .knox-questions-image { max-width: 100%; aspect-ratio: 2.45; }
}
@media (max-width: 700px) {
  body.home .elementor #services .knox-service-image { aspect-ratio: 1.6; }
  body.home .elementor #questions .knox-questions-image { aspect-ratio: 1.75; margin-top: 29px; box-shadow: 7px 7px 0 #eae4d6; }
}
@media (prefers-reduced-motion: reduce) {
  body.home .elementor #services .knox-service-image { transition: none; }
}

/* Verified small-text contrast gaps; dimensions and layout stay unchanged. */
body.home .elementor .process-grid article > .elementor-widget-text-editor:first-child { color: #715f3c; }
body.home .elementor .signature-block > .elementor-widget-text-editor:last-child { color: #606d71; }
#knox-companion .ka-form label[for="ka-question"] { color: #5f7073; }

/* Only the homepage hero uses an eager responsive still behind deferred video. */
body.page-id-675 #hero-film-widget .elementor-wrapper {
  position: relative;
}
body.page-id-675 #hero-film-widget .knox-responsive-hero-poster {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
body.page-id-675 #hero-film-widget .knox-responsive-hero-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 77% center;
}
/* A playing or paused video paints above the still; errors reveal it again. */
body.page-id-675 #hero-film-widget video {
  position: relative;
  opacity: 0;
}
body.page-id-675 #hero-film-widget.kn-film-playing video {
  opacity: 1;
}
@media (max-width: 700px) {
  body.page-id-675 #hero-film-widget .knox-responsive-hero-poster img,
  body.page-id-675 #hero-film-widget video {
    object-position: 76% center;
  }
}

/* Keep the existing ad-privacy control legible over any page image.
   ID specificity restores the consent plugin's paper/ink palette. */
body #knox-ad-preferences {
  color: #183740;
  background: #f8f5ed;
  border-color: #183740;
}
body #knox-ad-preferences:hover,
body #knox-ad-preferences:focus-visible {
  color: #f8f5ed;
  background: #183740;
  border-color: #f8f5ed;
}
body #knox-ad-preferences:focus-visible {
  outline: 2px solid #183740;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #f8f5ed;
}

/* Restore the consent panel controls to its existing paper/ink palette. */
body #knox-ad-consent button {
  color: #f8f5ed;
  background: #183740;
  border-color: #183740;
}
body #knox-ad-consent button[data-knox-ads="deny"] {
  color: #183740;
  background: transparent;
}
body #knox-ad-consent button:hover {
  color: #f8f5ed;
  background: #285462;
  border-color: #183740;
}
body #knox-ad-consent button:focus-visible {
  outline: 2px solid #183740;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #f8f5ed;
}

/* Preserve the full standing cutout and its existing drag/pinch controls. */
@media (max-width: 700px) {
 #knox-companion .ka-avatar { --ka-default-width: 90px; }
 body.admin-bar #knox-companion {
  --ka-panel-height: calc(min(750px, calc(var(--ka-view-height, 100dvh) - var(--ka-gap) - 12px)) - 46px);
 }
}

/* The dialog must receive taps above a wrapped WordPress account menu. */
@media (max-width: 700px) {
 body.admin-bar #knox-companion.ka-expanded { z-index: 100001; }
}
