/* Home hero, tablet and desktop: photo stage, popular chips that never hide, a compact bear.
   Loaded after the older home stylesheets; :not(#kmc-a) lifts rules over their selectors.
   The phone hero is untouched (its photo collage is hidden there). */

/* ---------- photo stage ---------------------------------------------------------- */
@media (min-width: 768px) {
  body.page-home .home-hero-slider.is-stage:not(#kmc-a) { position: relative; isolation: isolate; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-viewport:not(#kmc-a) {
    overflow: visible;
    padding: 0;
    margin: 0;
    border-radius: 0;
    outline: none;
    touch-action: pan-y;
    user-select: none;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-viewport:focus-visible:not(#kmc-a) { box-shadow: 0 0 0 3px rgba(19, 111, 56, .35); border-radius: 30px; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-track:not(#kmc-a) {
    display: grid;
    transform: none !important;
    transition: none !important;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slide:not(#kmc-a) {
    grid-area: 1 / 1;
    min-width: 0;
    padding: 4px 6px 8px;
    visibility: hidden;
    pointer-events: none;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active:not(#kmc-a) { visibility: visible; pointer-events: auto; z-index: 2; }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-leaving:not(#kmc-a) { visibility: visible; z-index: 1; animation: km-stage-leave .55s cubic-bezier(.4, 0, .2, 1) both; }

  /* each photo of the incoming slide opens from a rounded window, one after another */
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-card:not(#kmc-a) {
    animation: km-stage-reveal .9s cubic-bezier(.22, 1, .36, 1) both;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-side-top:not(#kmc-a) { animation-delay: .12s; }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-side-bottom:not(#kmc-a) { animation-delay: .24s; }
  body.page-home .home-hero-slider.is-stage[data-dir="back"] .home-hero-slide.is-active .home-hero-photo-card:not(#kmc-a) { animation-name: km-stage-reveal-back; }
  /* and the camera settles slowly while the slide is on */
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-card img:not(#kmc-a) {
    animation: km-stage-settle calc(var(--stage-ms, 6500ms) + 900ms) cubic-bezier(.2, .6, .3, 1) both;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-side-top img:not(#kmc-a) { animation-delay: .12s; }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-active .home-hero-photo-side-bottom img:not(#kmc-a) { animation-delay: .24s; }
  body.page-home .home-hero-slider.is-stage.is-paused .home-hero-slide.is-active .home-hero-photo-card img:not(#kmc-a) { animation-play-state: paused; }

  /* dots: a glass pill over the photos; the active one fills like a timeline */
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dots:not(#kmc-a) {
    position: absolute;
    left: calc((100% - 12px) * 1.25 / 2.25 / 2 + 6px);
    bottom: 22px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 6px 18px -8px rgba(16, 60, 30, .35), inset 0 0 0 1px rgba(255, 255, 255, .7);
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    transform: translateX(-50%);
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot:not(#kmc-a) {
    position: relative;
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    transition: width .45s cubic-bezier(.22, 1, .36, 1);
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot:not(#kmc-a)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(19, 111, 56, .28);
    transform: translate(-50%, -50%);
    transition: width .45s cubic-bezier(.22, 1, .36, 1), background-color .3s ease;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot:hover:not(#kmc-a)::after { background: rgba(19, 111, 56, .5); }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot.is-active:not(#kmc-a) { width: 44px; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot.is-active:not(#kmc-a)::after {
    width: 32px;
    background: rgba(19, 111, 56, .18) linear-gradient(90deg, #1f9d55, #136f38) no-repeat 0 0 / var(--fill, 0%) 100%;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot.is-active.is-running:not(#kmc-a)::after { animation: km-stage-fill var(--stage-ms, 6500ms) linear both; }
  body.page-home .home-hero-slider.is-stage:is(.is-paused, .is-hidden-tab) .home-hero-slider-dot.is-active:not(#kmc-a)::after { animation-play-state: paused; }
  body.page-home .home-hero-slider.is-stage.is-still .home-hero-slider-dot.is-active:not(#kmc-a)::after { animation: none; background-size: 100% 100%; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-dot:focus-visible:not(#kmc-a) { outline: 2px solid #136f38; outline-offset: 1px; }

  /* arrows: glass circles that slide in when the pointer is over the photos */
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:not(#kmc-a) {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    color: #136f38;
    box-shadow: 0 10px 24px -10px rgba(16, 60, 30, .5), inset 0 0 0 1px rgba(255, 255, 255, .8);
    backdrop-filter: blur(10px) saturate(1.3);
    -webkit-backdrop-filter: blur(10px) saturate(1.3);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1), background-color .2s ease, color .2s ease;
  }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow svg { display: block; width: 20px; height: 20px; }
  /* the old site.css chevrons drawn with pseudo-elements: the SVG replaces them */
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:not(#kmc-a)::before,
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:not(#kmc-a)::after { content: none; display: none; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow-prev:not(#kmc-a) { left: 18px; transform: translate(-10px, -50%); }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow-next:not(#kmc-a) { right: 18px; transform: translate(10px, -50%); }
  body.page-home .home-hero-slider.is-stage:is(:hover, :focus-within) .home-hero-slider-arrow:not(#kmc-a) { opacity: 1; transform: translate(0, -50%); }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:hover:not(#kmc-a) { background: #136f38; color: #fff; }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:active:not(#kmc-a) { transform: translate(0, -50%) scale(.92); }
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:focus-visible:not(#kmc-a) { outline: 3px solid rgba(19, 111, 56, .45); outline-offset: 2px; opacity: 1; }
}
/* touch screens have no hover: keep the arrows visible */
@media (min-width: 768px) and (hover: none) {
  body.page-home .home-hero-slider.is-stage .home-hero-slider-arrow:not(#kmc-a) { opacity: 1; transform: translate(0, -50%); }
}

@keyframes km-stage-reveal {
  from { opacity: 0; clip-path: inset(14% 18% 14% 4% round 40px); transform: translateX(18px) scale(.97); }
  to { opacity: 1; clip-path: inset(0 0 0 0 round 0); transform: none; }
}
@keyframes km-stage-reveal-back {
  from { opacity: 0; clip-path: inset(14% 4% 14% 18% round 40px); transform: translateX(-18px) scale(.97); }
  to { opacity: 1; clip-path: inset(0 0 0 0 round 0); transform: none; }
}
@keyframes km-stage-settle { from { transform: scale(1.12); } to { transform: scale(1.02); } }
@keyframes km-stage-leave { from { opacity: 1; } to { opacity: 0; transform: scale(.985); filter: blur(3px); } }
@keyframes km-stage-fill { from { --fill: 0%; background-size: 0% 100%; } to { --fill: 100%; background-size: 100% 100%; } }

/* ---------- stats under the photos: tighter, no hairline ------------------------- */
@media (min-width: 961px) {
  /* bigger photos: the right column matches the left one instead of leaving a hole */
  body.page-home .home-hero-grid .home-hero-slider.is-stage .home-hero-slide-grid:not(#kmc-a) { grid-template-rows: repeat(2, clamp(150px, 14.6vw, 222px)); gap: 12px; }
  body.page-home .home-hero-visual .home-hero-stats:not(#kmc-a) { margin-top: 10px; padding-top: 0; border-top: 0; }
}

/* ---------- popular chips: wrap instead of scrolling under the photos ------------- */
@media (min-width: 769px) {
  body.page-home .home-hero .home-search-popular-row:not(#kmc-a) { flex-direction: column; align-items: flex-start; gap: 7px; margin-top: 12px; }
  body.page-home .home-hero .home-search-popular-lead:not(#kmc-a) { padding: 0; }
  body.page-home .home-hero .home-search-popular-chips:not(#kmc-a) {
    flex-wrap: wrap;
    overflow: visible;
    row-gap: 7px;
    padding: 2px 0 3px;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- the bear: a compact companion under the search, not a whole block ----- */
@media (min-width: 768px) {
  body.page-home .home-hero .mappy-helper:not(#kmc-a) { margin: 8px 0 0; }
  body.page-home .home-hero .mappy-content:not(#kmc-a) {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    min-height: 0;
  }
  body.page-home .home-hero .mappy-portrait:not(#kmc-a) { height: 132px; margin-top: 0; }
  body.page-home .home-hero .mappy-cloud:not(#kmc-a) { margin-left: -6px; }
  body.page-home .home-hero :is(.mappy-bubble, .mappy-content:hover .mappy-bubble):not(#kmc-a) {
    max-width: 300px;
    min-height: 92px;
    padding: 22px 30px 24px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-home .home-hero-slider.is-stage :is(.home-hero-slide, .home-hero-photo-card, .home-hero-photo-card img):not(#kmc-a) { animation: none !important; }
  body.page-home .home-hero-slider.is-stage .home-hero-slide.is-leaving:not(#kmc-a) { visibility: hidden; }
}

/* ---------- search on narrow desktops: the field gets its own line -------------- */
@media (min-width: 961px) and (max-width: 1199px) {
  body.page-home .home-hero-search-area .home-search-primary-row:not(#kmc-a) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  body.page-home .home-hero-search-area .home-search-primary-row > .home-search-input-wrap:not(#kmc-a) { grid-column: 1 / -1; }
  body.page-home .home-hero-search-area .home-search-primary-row > :is(button, a):not(#kmc-a) { width: 100%; justify-content: center; }
}
