/*
 * Palm Harbor Villas desktop presentation fixes.
 *
 * Every layout rule is pinned to the exported WordPress page ID and to a
 * Kadence block UID from palm-pages-before.xml. This keeps the overrides from
 * changing similarly structured blocks elsewhere on the site.
 */

/* In-page CTAs should clear the sticky header and use zero-height aliases. */
.phv-scroll-target,
.phv-contact-anchor {
  scroll-margin-top: clamp(5.5rem, 10vw, 8rem);
}

.phv-contact-anchor {
  position: relative;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Consistent text rhythm and safe edges across every marketing page. */
:root {
  --phv-content-gutter: clamp(1.125rem, 3vw, 2.25rem);
  --phv-copy-gap: clamp(0.9rem, 1.5vw, 1.3rem);
}

body .entry-content :is(.kt-row-column-wrap, .kt-inside-inner-col) {
  box-sizing: border-box;
}

body .entry-content .kt-inside-inner-col > :where(p, ul, ol):not(:last-child) {
  margin-bottom: var(--phv-copy-gap);
}

body .entry-content .kt-inside-inner-col > :where(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
}

body.page-id-516 .kt-adv-heading516_59de6a-bf {
  padding-bottom: clamp(1.25rem, 2.4vw, 1.75rem) !important;
}

/* No image captions are displayed in page galleries or lightboxes. */
body .entry-content figure figcaption,
:is(
    .mfp-title,
    .fancybox__caption,
    .pswp__caption,
    .lg-sub-html,
    .gslide-description,
    .gdesc-inner,
    .gslide-desc,
    .kb-gallery-caption-container
  ) {
  display: none !important;
}

/*
 * About: use Kadence's native vectors for the four compact contact icons.
 * The former 128px raster tiles were being squeezed into a 22px box, which
 * made the glyphs look soft and left a second tile inside the white icon card.
 */
body.page-id-520
  :is(
    .kt-info-box520_34702b-0d,
    .kt-info-box520_355c1b-ce,
    .kt-info-box520_bfeba2-1b,
    .kt-info-box520_452cc1-d5
  )
  .kadence-info-box-icon-inner-container {
  width: 22px;
  height: 22px;
  background: none !important;
}

body.page-id-520
  :is(
    .kt-info-box520_34702b-0d,
    .kt-info-box520_355c1b-ce,
    .kt-info-box520_bfeba2-1b,
    .kt-info-box520_452cc1-d5
  )
  .kadence-info-box-icon-inner-container
  :is(.kadence-dynamic-icon, .kb-svg-icon-wrap, svg) {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1 !important;
  pointer-events: none;
}

/*
 * The four feature cards originally used unrelated car/map/clock/snowflake
 * glyphs. Retain the vetted semantic artwork for those larger 50px icons.
 */
body.page-id-520
  :is(
    .kt-info-box520_fc511a-b3,
    .kt-info-box520_d4814e-57,
    .kt-info-box520_3307d4-b1,
    .kt-info-box520_46eec4-0c
  )
  .kadence-info-box-icon-inner-container {
  width: 50px;
  height: 50px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

body.page-id-520
  :is(
    .kt-info-box520_fc511a-b3,
    .kt-info-box520_d4814e-57,
    .kt-info-box520_3307d4-b1,
    .kt-info-box520_46eec4-0c
  )
  .kadence-info-box-icon-inner-container
  > :is(.kadence-dynamic-icon, .kb-svg-icon-wrap, svg) {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0 !important;
  pointer-events: none;
}

body.page-id-520
  .kt-info-box520_fc511a-b3
  .kadence-info-box-icon-inner-container {
  background-image: url("../icons/single-story.png");
}

body.page-id-520
  .kt-info-box520_d4814e-57
  .kadence-info-box-icon-inner-container {
  background-image: url("../icons/pet-friendly.png");
}

body.page-id-520
  .kt-info-box520_3307d4-b1
  .kadence-info-box-icon-inner-container {
  background-image: url("../icons/service.png");
}

body.page-id-520
  .kt-info-box520_46eec4-0c
  .kadence-info-box-icon-inner-container {
  background-image: url("../icons/nearby.png");
}

/*
 * Keep the promotional banner below every site dialog and lightbox.
 * The banner ships with an inline z-index of 2147483000, so modal layers must
 * intentionally occupy the few browser-safe levels above it.
 */
.bcio-flex-pay-top-banner {
  z-index: 99990 !important;
}

:is(
    .kadence-conversion-wrap:not(.kadence-conversion-banner):not(.kadence-conversion-slide_in),
    .lity,
    .ff_modal_overlay,
    .ff_modal_container,
    .mfp-wrap,
    .fancybox__container,
    .pswp,
    .glightbox-container,
    .kt-modal-overlay,
    .kb-modal-container,
    [role="dialog"][aria-modal="true"]
  ) {
  z-index: 2147483646 !important;
}

.mfp-bg {
  z-index: 2147483645 !important;
}

/* Reviewed sections: replace translucent artwork with calm solid surfaces. */
body.page-id-516
  :is(.kb-row-layout-id516_535370-f4, .kb-row-layout-id516_d6d1dc-6a) {
  background-color: #f7f5ef !important;
  background-image: none !important;
}

body.page-id-516 .kb-row-layout-id516_535370-f4 > .kt-row-layout-overlay,
body.page-id-516 #tour > .kt-row-layout-overlay,
body.page-id-520 .kb-row-layout-id520_25f142-ab > .kt-row-layout-overlay,
body.page-id-522 .kb-row-layout-id522_1737f8-e3 > .kt-row-layout-overlay,
body.page-id-607 .kb-row-layout-id607_958104-66 > .kt-row-layout-overlay {
  display: none !important;
}

body.page-id-516 #tour {
  background-color: #f7f5ef !important;
  background-image: none !important;
}

body.page-id-516 .kadence-column516_6ad4f1-de > .kt-inside-inner-col {
  border-left: 0 !important;
}

body.page-id-520 .kb-row-layout-id520_25f142-ab {
  background-color: #f5f3ec !important;
  background-image: none !important;
}

body.page-id-522
  :is(.kb-row-layout-id522_1737f8-e3, .kb-row-layout-id522_ae47c8-9e) {
  background-color: #f7f5ef !important;
  background-image: none !important;
}

body.page-id-522 .kb-row-layout-id522_1737f8-e3 {
  border-block: 1px solid rgba(150, 121, 69, 0.16);
}

body.page-id-607 .kb-row-layout-id607_958104-66 {
  background-color: #fff !important;
  background-image: none !important;
}

/* Finish the Home photo section with a proper heading and visual container. */
body.page-id-516 .kb-row-layout-id516_928063-3e {
  border-block: 1px solid rgba(150, 121, 69, 0.16);
  background: #f5f1e7 !important;
}

body.page-id-516 .kb-row-layout-id516_928063-3e .kt-inside-inner-col {
  text-align: center;
}

.phv-local-living-intro {
  width: min(46rem, 100%);
  margin: 0.65rem auto 2rem;
}

.phv-local-living-intro h2 {
  margin: 0 0 0.65rem;
  color: var(--global-palette3, #2c2923);
  font-size: clamp(1.75rem, 3vw, 2.6rem);
  line-height: 1.15;
  text-wrap: balance;
}

.phv-local-living-intro p {
  margin: 0;
  color: var(--global-palette5, #5d5a54);
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.7;
  text-wrap: pretty;
}

body.page-id-516
  .kb-gallery-wrap-id-516_bf9420-d8
  :is(.kb-gal-image-radius, img) {
  border-radius: 0.75rem;
}

body.page-id-516 .kb-gallery-wrap-id-516_bf9420-d8 .kb-gal-image-radius {
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(44, 41, 35, 0.15);
}

/* Turn the reviewed three-image Home row into an obvious gallery launcher. */
.phv-gallery-trigger {
  position: relative;
  overflow: hidden;
  border-radius: 0.65rem;
  cursor: zoom-in;
}

.phv-gallery-trigger img {
  transition: transform 220ms ease, filter 220ms ease;
}

.phv-gallery-trigger:hover img {
  transform: scale(1.025);
  filter: saturate(1.04);
}

.phv-gallery-trigger:focus-visible {
  outline: 3px solid var(--global-palette1, #967945);
  outline-offset: 5px;
}

/* Give the FAQ accordion a clear, stable transition between closed and open. */
body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-accordion-inner-wrap {
  display: grid;
  gap: 0.75rem;
}

body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-accordion-pane {
  overflow: hidden;
  border: 1px solid rgba(44, 41, 35, 0.14);
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 5px 18px rgba(44, 41, 35, 0.06);
}

body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-blocks-accordion-header {
  padding: 1rem 1.15rem !important;
  border: 0 !important;
  transition: color 180ms ease, background-color 180ms ease !important;
}

body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-blocks-accordion-header[aria-expanded="true"] {
  background: #fbfaf6 !important;
  color: var(--global-palette1, #967945) !important;
}

body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-accordion-panel {
  overflow: hidden;
  transition: height 260ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity 180ms ease !important;
}

body.page-id-522
  .kb-row-layout-id522_ae47c8-9e
  .kt-accordion-panel-inner {
  padding: 0.25rem 1.15rem 1.15rem !important;
}

/* Runtime-enhanced long copy gets a readable measure without changing copy. */
.phv-readable-copy {
  box-sizing: border-box;
  max-width: 68ch !important;
  margin-right: auto !important;
  margin-left: auto !important;
  line-height: 1.75 !important;
  text-align: left !important;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

/* The footer brand becomes a clear keyboard-accessible home link. */
.phv-footer-logo-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 0.35rem;
}

.phv-footer-logo-link:focus-visible {
  outline: 3px solid var(--global-palette2, #ba9756);
  outline-offset: 5px;
}

/* Shared, iframe-isolated contact form dialog. */
.phv-contact-modal[hidden] {
  display: none !important;
}

.phv-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647 !important;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(0.75rem, 3vw, 2rem);
}

.phv-contact-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 22, 18, 0.72);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.phv-contact-modal__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(48rem, 100%);
  max-height: calc(100vh - clamp(1.5rem, 6vw, 4rem));
  max-height: min(52rem, calc(100dvh - clamp(1.5rem, 6vw, 4rem)));
  overflow: hidden;
  border: 1px solid rgba(150, 121, 69, 0.32);
  border-radius: 1rem;
  background: var(--global-palette9, #fff);
  color: var(--global-palette3, #2c2923);
  box-shadow: 0 24px 80px rgba(20, 18, 14, 0.34);
}

.phv-contact-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(44, 41, 35, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--global-palette3, #2c2923);
  font: inherit;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.phv-contact-modal__close:hover,
.phv-contact-modal__close:focus-visible {
  border-color: var(--global-palette1, #967945);
  background: var(--global-palette1, #967945);
  color: #fff;
}

.phv-contact-modal__close:focus-visible {
  outline: 3px solid rgba(150, 121, 69, 0.35);
  outline-offset: 2px;
}

.phv-contact-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(46rem, calc(100dvh - 2rem));
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
  padding: 4rem clamp(1rem, 3vw, 1.75rem) clamp(1rem, 3vw, 1.75rem);
  overscroll-behavior: contain;
}

.phv-contact-modal__mount {
  width: min(42rem, 100%);
  margin-inline: auto;
}

.phv-contact-modal__mount :is(.fluentform, .ff-el-group, form) {
  box-sizing: border-box;
  max-width: 100%;
}

.phv-modal-open {
  overflow: hidden !important;
}

/* Accessible photo carousel used by the three reviewed Home images. */
.phv-gallery-modal[hidden] {
  display: none !important;
}

.phv-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647 !important;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(0.75rem, 3vw, 2rem);
}

.phv-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 9, 0.9);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.phv-gallery-modal__panel {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
  align-items: center;
  width: min(72rem, 100%);
  max-height: calc(100dvh - 2rem);
  color: #fff;
}

.phv-gallery-modal__figure {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
}

.phv-gallery-modal__image {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 8rem);
  object-fit: contain;
  border-radius: 0.75rem;
  background: #171613;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.phv-gallery-modal__status {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  padding: 0.8rem 0.15rem 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.phv-gallery-modal__close,
.phv-gallery-modal__previous,
.phv-gallery-modal__next {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.phv-gallery-modal__close:hover,
.phv-gallery-modal__close:focus-visible,
.phv-gallery-modal__previous:hover,
.phv-gallery-modal__previous:focus-visible,
.phv-gallery-modal__next:hover,
.phv-gallery-modal__next:focus-visible {
  border-color: var(--global-palette1, #967945);
  background: var(--global-palette1, #967945);
}

.phv-gallery-modal__close:focus-visible,
.phv-gallery-modal__previous:focus-visible,
.phv-gallery-modal__next:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.phv-gallery-modal__close {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 4rem;
}

.phv-gallery-modal__previous {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.phv-gallery-modal__next {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

@media (max-width: 767px) {
  .phv-contact-modal {
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }

  .phv-contact-modal__panel {
    width: 100%;
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    border-radius: 0.75rem;
  }

  .phv-contact-modal__close {
    top: 0.7rem;
    right: 0.7rem;
    width: 2.6rem;
    height: 2.6rem;
  }

  .phv-contact-modal__body {
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    padding: 3.85rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .phv-gallery-modal {
    padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
  }

  .phv-gallery-modal__panel {
    grid-template-columns: 2.85rem minmax(0, 1fr) 2.85rem;
  }

  .phv-gallery-modal__image {
    max-height: calc(100dvh - 7rem);
  }

  .phv-gallery-modal__close {
    top: 0.4rem;
    right: 3.2rem;
  }

  .phv-gallery-modal__status {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(.phv-contact-modal__backdrop, .phv-gallery-modal__backdrop) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .phv-gallery-trigger img,
  body.page-id-522
    .kb-row-layout-id522_ae47c8-9e
    :is(.kt-blocks-accordion-header, .kt-accordion-panel) {
    transition: none !important;
  }
}

@media (min-width: 1025px) {
  /* Home: give the copy beside the leasing form a readable left inset. */
  body.page-id-516 .kadence-column516_6ad4f1-de > .kt-inside-inner-col {
    box-sizing: border-box;
    padding-left: clamp(2rem, 4vw, 4.5rem);
  }

  /* About: the opening-hours card was visually tighter than its siblings. */
  body.page-id-520 .kadence-column520_dab546-31 > .kt-inside-inner-col {
    box-sizing: border-box;
    padding-inline: clamp(1.25rem, 2vw, 2rem);
  }

  /* About: restore internal gutters to the four-column Core Values section. */
  body.page-id-520
    :is(
      .kadence-column520_5e9bc1-d4,
      .kadence-column520_6cc67e-25,
      .kadence-column520_597fe0-2b,
      .kadence-column520_5259da-d1
    )
    > .kt-inside-inner-col {
    box-sizing: border-box;
    padding-inline: clamp(1rem, 1.8vw, 1.75rem);
  }

  /* Amenities: give the three service icons a consistent, breathable tile. */
  body.page-id-523
    :is(
      .kt-info-box523_3a3749-65,
      .kt-info-box523_0efc3f-a9,
      .kt-info-box523_7883f9-0d
    )
    .kt-blocks-info-box-link-wrap {
    align-items: flex-start;
    gap: clamp(0.875rem, 1.5vw, 1.25rem);
  }

  body.page-id-523
    :is(
      .kt-info-box523_3a3749-65,
      .kt-info-box523_0efc3f-a9,
      .kt-info-box523_7883f9-0d
    )
    .kt-blocks-info-box-media {
    box-sizing: border-box;
    flex: 0 0 auto;
    margin: 0 !important;
    padding: 0.875rem !important;
    border-color: transparent !important;
    border-radius: 0.75rem;
  }

  /*
   * Amenities: the final carousel sits beside "Floor Plans and Private
   * Entrances". Normalize its mixed-source images into one intentional frame.
   */
  body.page-id-523 .kadence-column523_e58418-13 {
    min-height: clamp(28rem, 35vw, 38rem);
    overflow: hidden;
    border-radius: 1rem 0 0 1rem;
  }

  body.page-id-523 .kadence-column523_e58418-13 > .kt-inside-inner-col {
    height: 100%;
    min-height: inherit;
  }

  body.page-id-523
    .kadence-column523_e58418-13
    :is(
      .wp-block-kadence-advancedgallery,
      .kb-gallery-ul,
      .kadence-blocks-gallery-item,
      .kt-blocks-carousel,
      .splide,
      .splide__track,
      .splide__list,
      .splide__slide,
      figure
    ) {
    height: 100%;
    min-height: inherit;
  }

  body.page-id-523 .kadence-column523_e58418-13 img {
    display: block;
    width: 100% !important;
    height: clamp(28rem, 35vw, 38rem) !important;
    max-height: 38rem;
    object-fit: cover;
    object-position: center;
  }
}

/* FAQ: keep each decorative icon visually unchanged when a pointer hovers it. */
@media (hover: hover) and (pointer: fine) {
  body.page-id-522
    :is(
      .kt-info-box522_5cc16c-20,
      .kt-info-box522_fb1264-f7,
      .kt-info-box522_33122c-75,
      .kt-info-box522_273579-c6,
      .kt-info-box522_9e48bb-d8,
      .kt-info-box522_4d74e6-61,
      .kt-info-box522_8eb6ac-9b
    )
    :is(
      .kt-blocks-info-box-media,
      .kadence-info-box-icon-container,
      .kadence-info-box-icon-inner-container,
      .kadence-dynamic-icon,
      svg
    ) {
    color: var(--global-palette1, #967945) !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  body.page-id-522
    :is(
      .kt-info-box522_5cc16c-20,
      .kt-info-box522_fb1264-f7,
      .kt-info-box522_33122c-75,
      .kt-info-box522_273579-c6
    ):hover
    .kt-blocks-info-box-media {
    background: var(--global-palette9, #fff) !important;
    border-color: #eee !important;
  }

  body.page-id-522
    :is(
      .kt-info-box522_9e48bb-d8,
      .kt-info-box522_4d74e6-61,
      .kt-info-box522_8eb6ac-9b
    ):hover
    .kt-blocks-info-box-media {
    background: transparent !important;
    border-color: transparent !important;
  }

  /* Amenities: remove the palette/border change from the service-icon row. */
  body.page-id-523
    :is(
      .kt-info-box523_3a3749-65,
      .kt-info-box523_0efc3f-a9,
      .kt-info-box523_7883f9-0d
    )
    :is(
      .kt-blocks-info-box-link-wrap,
      .kt-blocks-info-box-media,
      .kadence-info-box-icon-container,
      .kadence-info-box-icon-inner-container,
      .kadence-dynamic-icon,
      svg
    ) {
    color: var(--global-palette1, #967945) !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }

  body.page-id-523
    :is(
      .kt-info-box523_3a3749-65,
      .kt-info-box523_0efc3f-a9,
      .kt-info-box523_7883f9-0d
    ):hover
    :is(.kt-blocks-info-box-link-wrap, .kt-blocks-info-box-media) {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }
}
