/* ==========================================================================
 * JO Home Improvements LLC — Custom Layout, Bilingual Pill & Media Overrides
 * Loaded after css/style.css, css/coloring.css, and css/colors/scheme-01.css
 * ========================================================================== */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

#de-loader {
  display: none !important;
}

/* --------------------------------------------------------------------------
 * Header Brand & Bilingual EN | ES Pill Toggle
 * -------------------------------------------------------------------------- */
header .de-flex {
  align-items: center;
  gap: 16px;
}

#logo img.logo-main,
#logo img.logo-scroll {
  height: 41px;
  width: auto;
  max-width: 195px;
}

#logo img.logo-mobile {
  height: 41px;
  width: auto;
  max-width: 44px;
}

img.logo-footer,
img.w-100:not(.jarallax-img),
img.w-40,
img.w-20 {
  height: auto;
}

.menu_side_area {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.jo-lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  min-height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(46, 71, 61, 0.24);
  background-color: var(--bg-light, #F5F5F0);
  color: var(--bg-dark-1, #2E473D);
  font-family: var(--body-font, "Poppins", sans-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jo-lang-pill:hover {
  border-color: var(--primary-color, #7C815D);
}

.jo-lang-pill:focus-visible {
  outline: 2px solid var(--primary-color, #7C815D);
  outline-offset: 2px;
}

.jo-lang-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background-color: transparent;
  color: var(--bg-dark-1, #2E473D);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

#mainmenu > li.jo-mobile-only-nav {
  display: none;
}

@media only screen and (min-width: 993px) {
  #mainmenu li ul {
    width: 270px;
  }
}

.jo-lang-option.is-active {
  background-color: var(--bg-dark-1, #2E473D);
  color: #ffffff;
}

.jo-lang-divider {
  display: none;
}

/* --------------------------------------------------------------------------
 * Pre-JS Jarallax Image Positioning (Prevents Initial Load CLS)
 * -------------------------------------------------------------------------- */
.jarallax {
  position: relative;
  z-index: 0;
}

.jarallax > .jarallax-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: -1;
}

/* --------------------------------------------------------------------------
 * Hero Readability Scrims, Above-the-Fold Visibility & Breadcrumbs
 * -------------------------------------------------------------------------- */
.jo-hero-section {
  position: relative;
}

.jo-hero-section .swiper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.jo-hero-section .swiper-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
}

.jo-hero-section .swiper-slide {
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: 100%;
}

.jo-hero-section .container,
main > section.jarallax:first-of-type .container {
  visibility: visible;
  opacity: 1;
}

.jo-hero-section p {
  color: #2d312c;
  font-weight: 400;
}

.jo-hero-slide {
  background-size: cover !important;
  background-position: center center !important;
}

.jo-hero-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  pointer-events: none;
}

.jo-hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(245, 245, 240, 0.97) 0%,
    rgba(245, 245, 240, 0.90) 45%,
    rgba(245, 245, 240, 0.40) 74%,
    rgba(245, 245, 240, 0.12) 100%
  );
  pointer-events: none;
}

main > section.jarallax:first-of-type .jo-hero-scrim {
  background: linear-gradient(
    90deg,
    rgba(245, 245, 240, 0.97) 0%,
    rgba(245, 245, 240, 0.93) 58%,
    rgba(245, 245, 240, 0.72) 80%,
    rgba(245, 245, 240, 0.28) 100%
  );
}

.crumb {
  color: #2e473d;
  opacity: 0.92;
  margin-bottom: 0;
  font-weight: 600;
}

.crumb li {
  color: #2e473d;
}

.crumb a {
  color: #242422;
  opacity: 0.85;
}

.crumb a:hover {
  color: #7c815d;
  opacity: 1;
}

.jo-hero-scrim-dark {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(27, 42, 36, 0.90) 0%,
    rgba(27, 42, 36, 0.72) 48%,
    rgba(27, 42, 36, 0.25) 100%
  );
  pointer-events: none;
}

.jo-hero-stats-card {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(46, 71, 61, 0.12);
}

.jo-stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bg-dark-1, #2E473D);
  margin-bottom: 4px;
}

.jo-stat-label {
  font-size: 14px;
  font-weight: 500;
  color: #464844;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
 * Before / After TwentyTwenty 4:5 Framing & Handle Contrast
 * -------------------------------------------------------------------------- */
.jo-ba-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.jo-ba-card .twentytwenty-container {
  aspect-ratio: 4 / 5;
  width: 100%;
  height: auto !important;
  overflow: hidden;
  border-radius: var(--rounded-1, 30px);
  background-color: var(--bg-dark-2, #24372F);
}

.jo-ba-card .twentytwenty-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.twentytwenty-before-label::before,
.twentytwenty-after-label::before {
  background: rgba(27, 42, 36, 0.84) !important;
  color: #ffffff !important;
  border-radius: 999px !important;
  font-weight: 600;
  font-size: 12px !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 16px !important;
}

/* --------------------------------------------------------------------------
 * Project Badges, Service Galleries & Compliance Disclosures
 * -------------------------------------------------------------------------- */
.jo-stage-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(27, 42, 36, 0.88);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.jo-region-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(124, 129, 93, 0.14);
  color: var(--bg-dark-1, #2E473D);
  font-size: 12px;
  font-weight: 600;
}

.jo-gallery-thumb {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  display: block;
}

.jo-service-thumb {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  display: block;
}

.jo-compliance-box {
  background-color: var(--bg-light, #F5F5F0);
  border-left: 4px solid var(--primary-color, #7C815D);
  border-radius: 14px;
  padding: 20px 24px;
}

/* --------------------------------------------------------------------------
 * Lead Forms, Honeypot & XSS-Safe Quote Summary
 * -------------------------------------------------------------------------- */
.jo-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.jo-form-status {
  display: none;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
}

.jo-form-status.is-visible {
  display: block;
}

.jo-form-status.is-sending {
  background: rgba(124, 129, 93, 0.12);
  border: 1px solid rgba(124, 129, 93, 0.35);
  color: var(--bg-dark-1, #2E473D);
}

.jo-form-status.is-success {
  background: #edf5ef;
  border: 1px solid #4d7c5b;
  color: #1f452b;
}

.jo-form-status.is-error {
  background: #fdf0ef;
  border: 1px solid #c24b43;
  color: #7c241e;
}

.jo-quote-summary-card {
  display: none;
  background-color: var(--bg-light, #F5F5F0);
  border: 1px solid rgba(124, 129, 93, 0.32);
  border-radius: 20px;
  padding: 28px;
}

.jo-quote-summary-card.is-visible {
  display: block;
}

.jo-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
  margin: 20px 0 24px;
}

.jo-summary-item {
  border-bottom: 1px solid rgba(46, 71, 61, 0.12);
  padding-bottom: 10px;
}

.jo-summary-item.is-full {
  grid-column: 1 / -1;
}

.jo-summary-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color, #7C815D);
  margin-bottom: 4px;
}

.jo-summary-value {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: #242422;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
 * Responsive Refinements (992px Mobile Header, 991px Tablet & 390px Mobile)
 * -------------------------------------------------------------------------- */
@media only screen and (max-width: 992px) {
  header.header-mobile #mainmenu {
    left: 0;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }

  header.header-mobile #mainmenu > li.jo-mobile-only-nav,
  #mainmenu > li.jo-mobile-only-nav {
    display: block;
  }

  main > section:first-of-type.mt-sm-50 {
    margin-top: 71px;
  }
}

@media only screen and (max-width: 991px) {
  header .de-flex {
    justify-content: space-between;
  }

  .menu_side_area {
    display: inline-flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto !important;
    margin-left: auto !important;
    position: relative;
  }

  .menu_side_area #menu-btn {
    float: none !important;
    margin-left: 2px;
  }

  header.header-mobile.menu-open {
    overflow-y: auto;
  }

  .jo-hero-slide {
    background-position: 68% center !important;
  }

  .jo-hero-slide-img {
    object-position: 68% center;
  }

  .jo-hero-scrim {
    background: linear-gradient(
      180deg,
      rgba(245, 245, 240, 0.95) 0%,
      rgba(245, 245, 240, 0.86) 52%,
      rgba(245, 245, 240, 0.44) 82%,
      rgba(245, 245, 240, 0.22) 100%
    );
  }

  main > section.jarallax:first-of-type .jo-hero-scrim {
    background: linear-gradient(
      180deg,
      rgba(245, 245, 240, 0.96) 0%,
      rgba(245, 245, 240, 0.90) 68%,
      rgba(245, 245, 240, 0.72) 100%
    );
  }

  .jo-hero-scrim-dark {
    background: rgba(27, 42, 36, 0.84);
  }
}

@media only screen and (max-width: 767px) {
  .jo-hero-section .mh-800 {
    min-height: 0;
    padding: 48px 0 56px;
  }

  .jo-hero-section .abs-middle {
    position: relative;
    top: auto;
    transform: none;
  }

  .jo-summary-grid {
    grid-template-columns: 1fr;
  }

  .jo-stat-value {
    font-size: 22px;
  }

  #subheader h1,
  h1.fs-sm-10vw {
    font-size: clamp(30px, 8.2vw, 44px) !important;
    line-height: 1.15 !important;
    word-break: break-word;
  }
}

@media only screen and (max-width: 575px) {
  .menu_side_area .jo-header-cta {
    display: none !important;
  }

  .jo-lang-option {
    padding: 6px 8px;
    font-size: 11.5px;
  }
}
