/* ============================================================
   morgan-home — components.css (shared component norms, PAGE-SCAFFOLD)
   Sections may USE these classes and add scoped overrides in css/sections/<slug>.css;
   they never edit this file.
   ============================================================ */

/* Icons can never balloon to the broken-image 300x150 default */
.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

/* Buttons — brief-page §4.3/§4.4: radius 0, 1px #FFF stroke, padding --btn-py / --btn-px,
   text --text-body (Inter 400, lh 1.5). The Figma stroke is OUTSIDE (frame 48 = 24 line + 2x12
   padding), so it is drawn with an outer box-shadow, NOT border: the box stays the Figma frame
   size (e.g. 108x48) and the visible ring sits 1px outside it, exactly as drawn. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: var(--btn-py) var(--btn-px);
  border: 0;
  box-shadow: 0 0 0 var(--border-width) var(--color-outline);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--lh-body);
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn--primary {
  background: var(--color-btn-primary-bg);
  color: var(--color-btn-primary-text);
  box-shadow: 0 0 0 var(--border-width) var(--color-btn-primary-bg);
}
.btn--outline {
  background: transparent;
  color: var(--color-text);
}
@media (hover: hover) {
  .btn--primary:hover { background: transparent; color: var(--color-text); }
  .btn--outline:hover { background: var(--color-btn-primary-bg); color: var(--color-btn-primary-text); }
}

/* ---- Reveal on scroll (Shopify Dawn "Reveal sections on scroll", user request 2026-10-09) ----
   Elements carry [data-animate] (+ optional --animation-order for a stagger). Hidden only when JS
   runs (html.js, set in <head> before first paint) and until js/main.js marks them .is-visible.
   The slide-in plays only while .is-revealing is set (added together with .is-visible by the
   IntersectionObserver, removed on animationend) — so tooling that forces .is-visible measures the
   final layout at once, and no transform is left behind on the element. */
@keyframes reveal-slide-in {
  from { opacity: 0.01; transform: translateY(2rem); }
  to   { opacity: 1;    transform: none; }
}
html.js [data-animate]:not(.is-visible) {
  opacity: 0.01;
  transform: translateY(2rem);
}
[data-animate].is-revealing {
  animation: reveal-slide-in 0.6s cubic-bezier(0, 0, 0.3, 1) both;
  animation-delay: calc(var(--animation-order, 0) * 75ms);
}
@media (prefers-reduced-motion: reduce) {
  html.js [data-animate]:not(.is-visible) { opacity: 1; transform: none; }
  [data-animate].is-revealing { animation: none; }
}
