/* ============================================================
   EDWARDS KITCHEN & BATH — Base Stylesheet
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  /* No padding reset here — padding:0 on * fights padding-top/bottom on .section.
     Padding is zeroed per-element as needed (ul, p, h1-h6, etc.) below. */
}

/* Zero margins and padding on common elements that browser-default them */
h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure, figcaption, blockquote, dl, dd {
  padding: 0;
}

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-20);
  hanging-punctuation: first last;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition), color var(--transition);
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role="list"], ol[role="list"] {
  list-style: none;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  text-wrap: balance;
  line-height: 1.1;
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

::selection {
  background: rgba(99, 11, 17, 0.18);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Utility Classes ---- */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-16));
}

.container--narrow {
  max-width: var(--content-default);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-16));
}

.container--xwide {
  max-width: var(--content-xwide);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-12));
}

/* Section vertical rhythm */
.section {
  /* Use padding-top/bottom (not padding-block) to override the * { padding:0 } reset */
  padding-top: clamp(4rem, 9vw, 8rem);
  padding-bottom: clamp(4rem, 9vw, 8rem);
}

.section--sm {
  padding-top: clamp(2.5rem, 5vw, 5rem);
  padding-bottom: clamp(2.5rem, 5vw, 5rem);
}

/* Eyebrow label */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-tan);
  text-align: inherit;
}

/* Trade hero only — scoped tightly, does not affect other hero eyebrows */
.trade-hero-content .trade-hero-eyebrow { text-align: center; }
.trade-hero-content h1,
.trade-hero-content h2 { text-align: center; }

/* Dark section override */
.section--dark {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-text);
}

.section--dark .eyebrow {
  color: var(--color-accent-tan);
}

/* Divider line */
.divider {
  width: var(--space-12);
  height: 1px;
  background: var(--color-accent-tan);
  margin-block: var(--space-4);
}

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75em 1.75em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid transparent;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--color-brand);
  color: #fff;
  border-color: var(--color-brand);
}

.btn--primary:hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
  box-shadow: 0 4px 20px rgba(99, 11, 17, 0.30);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn--ghost:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface-offset);
}

.btn--ghost-light {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.72);
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.btn--ghost-light:hover {
  background: rgba(255,255,255,0.18);
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
}

.btn--ghost-brand {
  background: transparent;
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.btn--ghost-brand:hover {
  background: var(--color-brand);
  color: #fff;
}

.btn--lg {
  padding: 0.9em 2.25em;
  font-size: var(--text-base);
}

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-stagger.visible > * { opacity:1; transform:none; }
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 55ms; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 110ms; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 165ms; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 220ms; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 275ms; }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 330ms; }
.reveal-stagger.visible > *:nth-child(8) { transition-delay: 385ms; }
.reveal-stagger.visible > *:nth-child(9) { transition-delay: 440ms; }
.reveal-stagger.visible > *:nth-child(10) { transition-delay: 495ms; }
.reveal-stagger.visible > *:nth-child(n+11) { transition-delay: 550ms; }

/* ---- Reveal failsafe ----
   If JS never fires (blocked iframe, error), force content visible after 2s.
   This CSS-only keyframe runs unconditionally and overrides the initial opacity:0.
   The JS adds .visible which also makes content visible — both paths work. */
@keyframes reveal-fallback {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: none; }
}
.reveal {
  animation: reveal-fallback 0.6s cubic-bezier(0.16,1,0.3,1) 2s both;
}
.reveal-stagger > * {
  animation: reveal-fallback 0.5s cubic-bezier(0.16,1,0.3,1) 2.1s both;
}
/* When JS does run and adds .visible, cancel the animation and snap to final state */
.reveal.visible,
.reveal-stagger.visible > * {
  animation: none;
}
