/*
 * Ajay Estate Responsive Fix
 * Brand palette: warm white, beige and brown. Loaded after theme styles.
 */

:root {
  --aerf-white: #fffdf9;
  --aerf-beige: #f2e8da;
  --aerf-beige-soft: #fffdf8;
  --aerf-beige-deep: #e1cfb8;
  --aerf-brown: #5c4033;
  --aerf-brown-soft: #4a3429;
  --aerf-gold: #866047;
  --aerf-line: #d2bfa6;
  --aerf-shadow: 0 14px 38px rgba(92, 64, 51, 0.12);
  --aerf-safe-gutter: clamp(16px, 4vw, 64px);
}

html {
  max-width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.ajay-estate-responsive-enabled {
  max-width: 100%;
  overflow-x: clip;
}

body.ajay-estate-responsive-enabled *,
body.ajay-estate-responsive-enabled *::before,
body.ajay-estate-responsive-enabled *::after {
  box-sizing: border-box;
}

body.ajay-estate-responsive-enabled img,
body.ajay-estate-responsive-enabled video,
body.ajay-estate-responsive-enabled iframe,
body.ajay-estate-responsive-enabled svg {
  max-width: 100%;
}

body.ajay-estate-responsive-enabled img,
body.ajay-estate-responsive-enabled video {
  height: auto;
}

body.ajay-estate-responsive-enabled .container,
body.ajay-estate-responsive-enabled .elementor-container,
body.ajay-estate-responsive-enabled .e-con-inner {
  width: min(100%, 1440px);
  max-width: 100%;
}

body.ajay-estate-responsive-enabled input,
body.ajay-estate-responsive-enabled select,
body.ajay-estate-responsive-enabled textarea,
body.ajay-estate-responsive-enabled button,
body.ajay-estate-responsive-enabled .elementor-button {
  max-width: 100%;
  font: inherit;
}

body.ajay-estate-responsive-enabled button,
body.ajay-estate-responsive-enabled [role="button"],
body.ajay-estate-responsive-enabled .button,
body.ajay-estate-responsive-enabled .elementor-button,
body.ajay-estate-responsive-enabled .project-actions a,
body.ajay-estate-responsive-enabled .project-actions button {
  touch-action: manipulation;
}

/* Replace the black Residential / Commercial strip shown in the screenshot. */
body.ajay-estate-responsive-enabled .project-navigation {
  background: var(--aerf-beige) !important;
  border-block: 1px solid var(--aerf-line) !important;
  color: var(--aerf-brown) !important;
}

body.ajay-estate-responsive-enabled .project-navigation-inner {
  background: transparent !important;
}

body.ajay-estate-responsive-enabled .project-navigation a {
  background: var(--aerf-white) !important;
  border-color: var(--aerf-line) !important;
  color: var(--aerf-brown) !important;
  text-decoration: none !important;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease,
    box-shadow 180ms ease !important;
}

body.ajay-estate-responsive-enabled .project-navigation a:hover,
body.ajay-estate-responsive-enabled .project-navigation a:focus-visible {
  background: var(--aerf-beige-soft) !important;
  color: var(--aerf-brown) !important;
  box-shadow: inset 0 -3px 0 var(--aerf-gold);
  outline: 2px solid transparent;
}

body.ajay-estate-responsive-enabled .project-navigation small,
body.ajay-estate-responsive-enabled .project-navigation .arrow {
  color: var(--aerf-gold) !important;
}

body.ajay-estate-responsive-enabled .project-navigation strong {
  color: var(--aerf-brown) !important;
}

/* Replace the black social rail and keep it clear of page controls. */
body.ajay-estate-responsive-enabled .ae-social-dock {
  background: var(--aerf-white) !important;
  border: 1px solid var(--aerf-line) !important;
  box-shadow: var(--aerf-shadow) !important;
  color: var(--aerf-brown) !important;
}

body.ajay-estate-responsive-enabled .ae-social-dock-title,
body.ajay-estate-responsive-enabled .ae-social-link {
  background: var(--aerf-white) !important;
  border-color: var(--aerf-line) !important;
  color: var(--aerf-brown) !important;
}

body.ajay-estate-responsive-enabled .ae-social-link:hover,
body.ajay-estate-responsive-enabled .ae-social-link:focus-visible {
  background: var(--aerf-beige) !important;
  color: var(--aerf-brown) !important;
  outline-color: var(--aerf-gold) !important;
}

/* Smooth, native scrolling areas. */
body.ajay-estate-responsive-enabled .projects-grid,
body.ajay-estate-responsive-enabled .project-category-menu,
body.ajay-estate-responsive-enabled .project-navigation {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--aerf-gold) var(--aerf-beige);
}

body.ajay-estate-responsive-enabled .projects-grid {
  touch-action: pan-x pan-y !important;
  cursor: grab;
}

body.ajay-estate-responsive-enabled .projects-grid:active {
  cursor: grabbing;
}

body.ajay-estate-responsive-enabled .carousel-button,
body.ajay-estate-responsive-enabled [data-carousel-prev],
body.ajay-estate-responsive-enabled [data-carousel-next] {
  position: relative;
  z-index: 20;
  pointer-events: auto !important;
  touch-action: manipulation;
}

body.ajay-estate-responsive-enabled .project-actions {
  position: relative;
  z-index: 20;
}

body.ajay-estate-responsive-enabled .project-actions a,
body.ajay-estate-responsive-enabled .project-actions button {
  position: relative;
  z-index: 21;
  pointer-events: auto !important;
  min-height: 44px;
}

body.ajay-estate-responsive-enabled [id] {
  scroll-margin-top: 96px;
}

/*
 * Light hero treatment. The complete image stays visible instead of being
 * enlarged and cropped by object-fit: cover.
 */
body.ajay-estate-responsive-enabled .hero,
body.ajay-estate-responsive-enabled .blog-hero,
body.ajay-estate-responsive-enabled .home-hero,
body.ajay-estate-responsive-enabled .hero-section,
body.ajay-estate-responsive-enabled .contact-page {
  background-color: var(--aerf-beige) !important;
  color: var(--aerf-brown) !important;
}

body.ajay-estate-responsive-enabled .hero-background,
body.ajay-estate-responsive-enabled .hero-slide {
  background: var(--aerf-beige) !important;
}

body.ajay-estate-responsive-enabled .hero-background img,
body.ajay-estate-responsive-enabled .hero-slide img,
body.ajay-estate-responsive-enabled .home-hero img,
body.ajay-estate-responsive-enabled .hero-section img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: var(--aerf-beige) !important;
  filter: saturate(0.94) contrast(1.02) brightness(1.02) !important;
}

body.ajay-estate-responsive-enabled .hero-shade {
  background:
    linear-gradient(
      90deg,
      rgba(255, 253, 249, 0.94) 0%,
      rgba(243, 234, 220, 0.72) 42%,
      rgba(243, 234, 220, 0.18) 76%,
      rgba(243, 234, 220, 0.06) 100%
    ),
    linear-gradient(
      0deg,
      rgba(243, 234, 220, 0.72) 0%,
      rgba(243, 234, 220, 0) 48%
    ) !important;
}

body.ajay-estate-responsive-enabled .hero h1,
body.ajay-estate-responsive-enabled .blog-hero h1,
body.ajay-estate-responsive-enabled .home-hero h1,
body.ajay-estate-responsive-enabled .hero-section h1,
body.ajay-estate-responsive-enabled .contact-page h1 {
  color: var(--aerf-brown) !important;
  text-shadow: none !important;
}

body.ajay-estate-responsive-enabled .hero h1 em,
body.ajay-estate-responsive-enabled .blog-hero h1 em,
body.ajay-estate-responsive-enabled .home-hero h1 em,
body.ajay-estate-responsive-enabled .hero-section h1 em,
body.ajay-estate-responsive-enabled .contact-page h1 em,
body.ajay-estate-responsive-enabled .hero .eyebrow,
body.ajay-estate-responsive-enabled .blog-hero .eyebrow,
body.ajay-estate-responsive-enabled .contact-page .eyebrow {
  color: var(--aerf-gold) !important;
}

body.ajay-estate-responsive-enabled .hero-description p,
body.ajay-estate-responsive-enabled .hero-intro,
body.ajay-estate-responsive-enabled .hero-intro p,
body.ajay-estate-responsive-enabled .contact-page .intro,
body.ajay-estate-responsive-enabled .hero-bottom {
  color: var(--aerf-brown-soft) !important;
}

body.ajay-estate-responsive-enabled .hero::before,
body.ajay-estate-responsive-enabled .blog-hero::after {
  color: rgba(93, 64, 51, 0.055) !important;
}

body.ajay-estate-responsive-enabled .hero-carousel-controls {
  background: rgba(255, 253, 249, 0.92) !important;
  border-color: var(--aerf-line) !important;
  box-shadow: 0 10px 30px rgba(93, 64, 51, 0.12) !important;
}

body.ajay-estate-responsive-enabled .hero-carousel-button {
  color: var(--aerf-brown) !important;
}

body.ajay-estate-responsive-enabled .hero-carousel-button:hover,
body.ajay-estate-responsive-enabled .hero-carousel-button:focus-visible {
  color: var(--aerf-brown) !important;
  background: var(--aerf-beige-deep) !important;
}

body.ajay-estate-responsive-enabled .hero-carousel-dot {
  background: rgba(93, 64, 51, 0.28) !important;
}

body.ajay-estate-responsive-enabled .hero-carousel-dot.is-active {
  background: var(--aerf-gold) !important;
}

/* Refined split hero for the Ajay Estate home/projects page. */
@media (min-width: 768px) {
  body.ajay-estate-responsive-enabled .hero:has(.hero-background) {
    min-height: clamp(680px, 84svh, 860px) !important;
    align-items: center !important;
    padding: 130px 0 78px !important;
    background: var(--aerf-beige) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-background {
    inset: 68px 0 0 48% !important;
    width: 52% !important;
    height: auto !important;
    border-left: 1px solid var(--aerf-line);
    background: var(--aerf-white) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-background img {
    padding: clamp(12px, 1.5vw, 24px);
    background: var(--aerf-white) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-shade {
    background: linear-gradient(
      90deg,
      var(--aerf-beige) 0%,
      var(--aerf-beige) 43%,
      rgba(242, 232, 218, 0.82) 49%,
      rgba(242, 232, 218, 0.08) 66%,
      transparent 100%
    ) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(290px, 0.48fr) !important;
    gap: clamp(38px, 7vw, 110px) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) h1 {
    max-width: 760px !important;
    font-size: clamp(60px, 7.1vw, 112px) !important;
    line-height: 0.86 !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-description {
    padding: clamp(20px, 2.2vw, 30px) !important;
    border: 1px solid rgba(210, 191, 166, 0.88);
    border-radius: 2px;
    background: rgba(255, 253, 249, 0.92);
    box-shadow: 0 18px 55px rgba(92, 64, 51, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-description p {
    margin: 0 !important;
    color: var(--aerf-brown-soft) !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-carousel-controls {
    right: clamp(22px, 3vw, 58px) !important;
    bottom: 30px !important;
  }
}

/* Compact desktop header. Mobile sizing is intentionally left touch-friendly. */
@media (min-width: 951px) {
  body.ajay-estate-responsive-enabled .header-inner {
    min-height: 68px !important;
    gap: clamp(16px, 1.8vw, 28px) !important;
  }

  body.ajay-estate-responsive-enabled .header .logo {
    width: 142px !important;
    max-width: 142px !important;
  }

  body.ajay-estate-responsive-enabled .header .logo img {
    width: auto !important;
    max-width: 142px !important;
    height: 44px !important;
    max-height: 44px !important;
    object-fit: contain !important;
  }

  body.ajay-estate-responsive-enabled .header .navigation,
  body.ajay-estate-responsive-enabled .header .site-navigation {
    gap: clamp(14px, 1.7vw, 28px) !important;
  }

  body.ajay-estate-responsive-enabled .header .navigation a,
  body.ajay-estate-responsive-enabled .header .site-navigation a {
    padding-block: 8px !important;
    font-size: 8.5px !important;
  }

  body.ajay-estate-responsive-enabled .header-call {
    min-height: 40px !important;
    gap: 12px !important;
    padding: 10px 14px !important;
  }

  body.ajay-estate-responsive-enabled .elementor-location-header .elementor-widget-theme-site-logo img,
  body.ajay-estate-responsive-enabled .elementor-location-header .custom-logo,
  body.ajay-estate-responsive-enabled header.site-header .custom-logo {
    width: auto !important;
    max-width: 150px !important;
    max-height: 46px !important;
    object-fit: contain !important;
  }

  body.ajay-estate-responsive-enabled .elementor-location-header .elementor-nav-menu--main .elementor-item {
    min-height: 0 !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }
}

@media (max-width: 1024px) {
  body.ajay-estate-responsive-enabled .container,
  body.ajay-estate-responsive-enabled .elementor-container,
  body.ajay-estate-responsive-enabled .e-con-inner {
    padding-inline: var(--aerf-safe-gutter);
  }

  body.ajay-estate-responsive-enabled .project-card,
  body.ajay-estate-responsive-enabled .project-item,
  body.ajay-estate-responsive-enabled .listing-card {
    min-width: 0;
  }

  body.ajay-estate-responsive-enabled table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 767px) {
  html {
    scroll-padding-top: 76px;
  }

  body.ajay-estate-responsive-enabled {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  body.ajay-estate-responsive-enabled h1 {
    font-size: clamp(2rem, 10vw, 3.35rem);
    line-height: 1.06;
    overflow-wrap: anywhere;
  }

  body.ajay-estate-responsive-enabled h2 {
    font-size: clamp(1.65rem, 8vw, 2.6rem);
    line-height: 1.12;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) {
    min-height: auto !important;
    padding-top: clamp(430px, 132vw, 570px) !important;
    padding-bottom: 72px !important;
  }

  body.ajay-estate-responsive-enabled .hero-background {
    right: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: clamp(410px, 122vw, 540px) !important;
    bottom: auto !important;
    background: var(--aerf-white) !important;
  }

  body.ajay-estate-responsive-enabled .hero-background img,
  body.ajay-estate-responsive-enabled .hero-slide img,
  body.ajay-estate-responsive-enabled .home-hero img,
  body.ajay-estate-responsive-enabled .hero-section img {
    object-fit: contain !important;
    object-position: center top !important;
  }

  body.ajay-estate-responsive-enabled .hero-shade {
    background:
      linear-gradient(
        180deg,
        rgba(243, 234, 220, 0.05) 0%,
        rgba(243, 234, 220, 0.18) 42%,
        rgba(243, 234, 220, 0.96) 68%,
        var(--aerf-beige) 100%
      ) !important;
  }

  body.ajay-estate-responsive-enabled .hero-content {
    padding-inline: 18px !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) h1 {
    margin-top: 18px !important;
    font-size: clamp(46px, 14vw, 68px) !important;
    line-height: 0.9 !important;
  }

  body.ajay-estate-responsive-enabled .hero:has(.hero-background) .hero-description {
    padding: 18px !important;
    border: 1px solid var(--aerf-line);
    background: rgba(255, 253, 249, 0.9);
  }

  body.ajay-estate-responsive-enabled .hero-carousel-controls {
    right: 16px !important;
    bottom: auto !important;
    top: 360px !important;
  }

  body.ajay-estate-responsive-enabled .blog-hero,
  body.ajay-estate-responsive-enabled .home-hero,
  body.ajay-estate-responsive-enabled .hero-section {
    background-color: var(--aerf-beige) !important;
  }

  /* Phone view: swipe between Residential and Commercial naturally. */
  body.ajay-estate-responsive-enabled .project-navigation {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    touch-action: pan-x !important;
    padding: 12px 0 14px;
  }

  body.ajay-estate-responsive-enabled .project-navigation-inner {
    display: flex !important;
    gap: 12px;
    width: max-content !important;
    max-width: none !important;
    padding-inline: 16px !important;
  }

  body.ajay-estate-responsive-enabled .project-navigation a,
  body.ajay-estate-responsive-enabled .project-navigation a:first-child,
  body.ajay-estate-responsive-enabled .project-navigation a:last-child {
    flex: 0 0 min(82vw, 340px);
    min-height: 108px !important;
    padding: 20px !important;
    border: 1px solid var(--aerf-line) !important;
    border-radius: 14px;
    scroll-snap-align: center;
    box-shadow: 0 8px 24px rgba(93, 64, 51, 0.08);
  }

  body.ajay-estate-responsive-enabled .project-navigation strong {
    font-size: clamp(1.55rem, 7vw, 2.15rem) !important;
    line-height: 1.08;
  }

  body.ajay-estate-responsive-enabled .project-category-menu {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    touch-action: pan-x !important;
    padding: 4px 16px 12px !important;
  }

  body.ajay-estate-responsive-enabled .project-category-menu[hidden] {
    display: none !important;
  }

  body.ajay-estate-responsive-enabled .project-category-menu button,
  body.ajay-estate-responsive-enabled .project-category-menu a {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  body.ajay-estate-responsive-enabled .projects-grid {
    display: grid !important;
    grid-auto-flow: column !important;
    grid-template-columns: none !important;
    grid-auto-columns: min(86vw, 360px) !important;
    gap: 14px !important;
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    padding: 6px 16px 20px !important;
  }

  body.ajay-estate-responsive-enabled .projects-grid > * {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    scroll-snap-align: center !important;
    scroll-snap-stop: normal;
  }

  body.ajay-estate-responsive-enabled .project-actions,
  body.ajay-estate-responsive-enabled .modal-project-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100%;
  }

  body.ajay-estate-responsive-enabled .project-actions a,
  body.ajay-estate-responsive-enabled .project-actions button,
  body.ajay-estate-responsive-enabled .modal-project-actions a,
  body.ajay-estate-responsive-enabled .modal-project-actions button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    min-width: 0;
    min-height: 46px;
    padding: 11px 10px !important;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  body.ajay-estate-responsive-enabled .carousel-button,
  body.ajay-estate-responsive-enabled [data-carousel-prev],
  body.ajay-estate-responsive-enabled [data-carousel-next] {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }

  /* The side rail blocks phone taps; the existing phone action bar remains. */
  body.ajay-estate-responsive-enabled .ae-social-dock {
    display: none !important;
  }

  body.ajay-estate-responsive-enabled .floating-actions {
    left: 10px !important;
    right: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    border-radius: 14px !important;
    overflow: hidden;
  }

  body.ajay-estate-responsive-enabled .form-modal-content,
  body.ajay-estate-responsive-enabled .ae-lead-dialog,
  body.ajay-estate-responsive-enabled [role="dialog"] {
    width: calc(100vw - 24px) !important;
    max-width: 560px !important;
    max-height: calc(100dvh - 24px) !important;
    overflow-y: auto !important;
    margin: 12px auto !important;
  }
}

@media (max-width: 390px) {
  body.ajay-estate-responsive-enabled .projects-grid {
    grid-auto-columns: calc(100vw - 36px) !important;
    padding-inline: 12px !important;
  }

  body.ajay-estate-responsive-enabled .project-actions,
  body.ajay-estate-responsive-enabled .modal-project-actions {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body.ajay-estate-responsive-enabled .projects-grid,
  body.ajay-estate-responsive-enabled .project-category-menu,
  body.ajay-estate-responsive-enabled .project-navigation {
    scroll-behavior: auto !important;
  }

  body.ajay-estate-responsive-enabled *,
  body.ajay-estate-responsive-enabled *::before,
  body.ajay-estate-responsive-enabled *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
