/* Shared tactile feedback for every button-like control across Créno Maison. */

/* Standalone documents and authentication screens do not load a site shell.
   Give their primary and secondary controls the same resting depth as the
   public, member and administration interfaces. */
body:not(.site-public):not(.site-private):not(.admin-shell) :is(
  .btn,
  .print-btn,
  .actions button:not(.secondary),
  .actions a:not(.secondary)
) {
  border-radius: 14px;
  box-shadow: 0 4px 0 #056158, 0 9px 18px rgb(18 59 53 / 15%);
  font-weight: 800;
}

body:not(.site-public):not(.site-private):not(.admin-shell) .actions .secondary {
  border-color: rgb(18 59 53 / 20%);
  background: #fffefb;
  box-shadow: 0 3px 0 rgb(18 59 53 / 12%), 0 7px 15px rgb(18 59 53 / 7%);
  color: #123b35;
}

body :is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a[class*="btn"],
  a[class*="cta"],
  .actions a,
  a.interactive-surface,
  [role="button"]
) {
  position: relative;
  transform-origin: center;
  -webkit-tap-highlight-color: rgba(11, 104, 101, .18);
  transition-property: transform, box-shadow, filter, background-color, border-color, color;
  transition-duration: 190ms;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}

/* Main actions get a quick light sweep. It adds energy without delaying the
   click, and pointer-events keeps the decorative layer inert. */
body :is(
  button[type="submit"],
  button[class*="btn"],
  button[class*="cta"],
  a[class*="btn"],
  a[class*="cta"],
  .actions button,
  .actions a
) {
  overflow: hidden;
  isolation: isolate;
}

body :is(
  button[type="submit"],
  button[class*="btn"],
  button[class*="cta"],
  a[class*="btn"],
  a[class*="cta"],
  .actions button,
  .actions a
)::after {
  position: absolute;
  top: -70%;
  bottom: -70%;
  left: -34%;
  width: 22%;
  transform: translateX(-340%) rotate(16deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 34%), transparent);
  content: "";
  pointer-events: none;
  transition: transform 480ms cubic-bezier(.22, 1, .36, 1);
}

/* Text links stay visually quiet at rest, then gain weight on hover, keyboard
   focus and touch. Logos and explicitly marked interactive surfaces keep their
   own presentation. */
body :is(
  a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
) {
  transform-origin: center;
  -webkit-tap-highlight-color: rgba(11, 104, 101, .14);
  text-decoration: none;
  transition-property: transform, opacity, color, font-weight;
  transition-duration: 160ms;
  transition-timing-function: cubic-bezier(.22, 1, .36, 1);
}

body :is(
  a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
):is(:focus-visible, [aria-current="page"]) {
  font-weight: 800;
}

body :is(
  a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
):is(:active, .is-button-pressing) {
  transform: translateY(1px);
  opacity: .72;
  font-weight: 800;
  transition-duration: 80ms;
}

body :is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a[class*="btn"],
  a[class*="cta"],
  .actions a,
  a.interactive-surface,
  [role="button"]
):focus-visible {
  outline: 3px solid var(--cm-brand, #0b6865);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  body :is(
  a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
  ):hover {
    font-weight: 800;
  }

  body :is(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a[class*="btn"],
    a[class*="cta"],
    .actions a,
    a.interactive-surface,
    [role="button"]
  ):not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-3px) scale(1.012);
    filter: saturate(1.06) brightness(1.025);
  }

  body :is(
    button[type="submit"],
    input[type="submit"],
    button[class*="btn"],
    button[class*="cta"],
    a[class*="btn"],
    a[class*="cta"],
    .actions button,
    .actions a,
    a.interactive-surface
  ):not(:disabled):not([aria-disabled="true"]):hover {
    box-shadow: 0 12px 24px rgb(23 49 45 / 18%);
  }

  body :is(
    button[type="submit"],
    button[class*="btn"],
    button[class*="cta"],
    a[class*="btn"],
    a[class*="cta"],
    .actions button,
    .actions a
  ):not(:disabled):not([aria-disabled="true"]):hover::after {
    transform: translateX(760%) rotate(16deg);
  }
}

body :is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a[class*="btn"],
  a[class*="cta"],
  .actions a,
  a.interactive-surface,
  [role="button"]
):not(:disabled):not([aria-disabled="true"]):is(:active, .is-button-pressing) {
  transform: translateY(1px);
  filter: brightness(.97);
  transition-duration: 80ms;
}

body :is(
  button[type="submit"],
  input[type="submit"],
  button[class*="btn"],
  button[class*="cta"],
  a[class*="btn"],
  a[class*="cta"],
  .actions button,
  .actions a,
  a.interactive-surface
):not(:disabled):not([aria-disabled="true"]):is(:active, .is-button-pressing) {
  transform: translateY(2px) scale(.985);
  box-shadow: 0 1px 3px rgb(23 49 45 / 14%);
}

/* Touchscreens have no hover state and Safari can expose :active for only a
   single frame. The companion script keeps this clearer pressed state visible
   for a short, non-blocking beat after the finger is lifted. */
@media (hover: none), (pointer: coarse) {
  body :is(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a[class*="btn"],
    a[class*="cta"],
    .actions a,
    a.interactive-surface,
    [role="button"]
  ):not(:disabled):not([aria-disabled="true"]):is(:active, .is-button-pressing) {
    filter: brightness(.92);
  }

  body :is(
    button[type="submit"],
    input[type="submit"],
    button[class*="btn"],
    button[class*="cta"],
    a[class*="btn"],
    a[class*="cta"],
    .actions button,
    .actions a,
    a.interactive-surface
  ):not(:disabled):not([aria-disabled="true"]):is(:active, .is-button-pressing) {
    transform: translateY(2px) scale(.965);
    box-shadow: inset 0 3px 5px rgb(23 49 45 / 16%), 0 1px 2px rgb(23 49 45 / 10%);
  }
}

@media (hover: hover) and (pointer: fine) {
  body.home-brnds .hero-search button:not(:disabled):not([aria-disabled="true"]):hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 0 var(--hy-green-dark), 0 18px 30px rgb(18 59 53 / 20%);
  }

  body.home-brnds .home-pro-actions .btn-cta-amber:not([aria-disabled="true"]):hover {
    transform: translateY(-3px) rotate(-.5deg);
    box-shadow: 0 8px 0 rgb(5 28 25 / 30%), 0 18px 30px rgb(84 29 19 / 18%);
  }
}

body.home-brnds .hero-search button:not(:disabled):not([aria-disabled="true"]):is(:active, .is-button-pressing),
body.home-brnds .home-pro-actions .btn-cta-amber:not([aria-disabled="true"]):is(:active, .is-button-pressing) {
  transform: translateY(3px) scale(.985);
  box-shadow: 0 2px 0 var(--hy-green-dark), 0 5px 10px rgb(18 59 53 / 14%);
}

body :is(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  a[class*="btn"],
  a[class*="cta"],
  .actions a,
  a.interactive-surface,
  [role="button"]
):is(:disabled, [aria-disabled="true"]) {
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  body :is(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a[class*="btn"],
    a[class*="cta"],
    .actions a,
    a.interactive-surface,
    [role="button"]
  ) {
    transition-duration: .01ms !important;
  }

  body :is(
    button[type="submit"],
    button[class*="btn"],
    button[class*="cta"],
    a[class*="btn"],
    a[class*="cta"],
    .actions button,
    .actions a
  )::after {
    display: none;
  }

  body :is(
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a[class*="btn"],
    a[class*="cta"],
    .actions a,
    a.interactive-surface,
    [role="button"]
  ):is(:hover, :active, .is-button-pressing) {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
  }

  body :is(
    a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
  ) {
    transition-duration: .01ms !important;
  }

  body :is(
    a[href]:not([class*="btn"]):not([class*="cta"]):not(.logo):not(.interactive-surface):not([aria-label])
  ):is(:active, .is-button-pressing) {
    transform: none !important;
  }
}
