/* =============================================================================
   Hollings Plumbing & Gas — Global Styles
   ============================================================================= */

/* ---------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   --------------------------------------------------------------------------- */
:root {
  /* Colours */
  --color-blue:          #1825aa;
  --color-cta-red:       #ff4400;
  /* WCAG-AA accessible orange: white text on #ff4400 is only 3.45:1; this
     darker shade reaches 4.70:1. Used only where white sits on orange. */
  --color-cta-red-accessible: #d63a00;
  --color-cream:         #e8e6e0;
  --color-light-blue:    #dde8ff;
  --color-navy-dark:     #091535;
  --color-body-text:     #393939;
  --color-white:         #ffffff;
  --color-muted:         #A1A1AA;
  /* Muted grey for text ON LIGHT backgrounds only — 4.83:1 on white (AA).
     The base --color-muted must stay lighter because it also sits on the dark
     navy footer, where #A1A1AA is 7:1 but #71717a would fail at 3.7:1. */
  --color-muted-on-light: #71717a;
  --color-neutral-50:    #f8f8fa;
  --color-neutral-100:   #f0f0f5;
  --color-neutral-200:   #e2e2ea;

  /* Typography */
  --font-heading:        'Inter', sans-serif;
  --font-body:           'Inter', sans-serif;
  --font-mono:           'Roboto Mono', monospace;

  --text-hero:           clamp(2.5rem, 5vw, 7.5rem);
  --text-hero-secondary: clamp(2rem, 4vw, 7.5rem);
  --text-h1:             clamp(1.75rem, 3vw, 3.125rem);
  --text-h2:             clamp(1.5rem, 2.5vw, 2rem);
  --text-h3:             clamp(1.25rem, 2vw, 1.5rem);
  --text-body:           1rem;
  --text-body-lg:        1.125rem;
  --text-small:          0.875rem;
  --text-xs:             0.75rem;

  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-black:    900;

  --leading-tight:    1.1;
  --leading-snug:     1.25;
  --leading-normal:   1.5;
  --leading-relaxed:  1.75;

  /* Spacing */
  --space-section:       clamp(4rem, 8vw, 8rem);
  --space-module-inner:  clamp(2rem, 4vw, 4rem);
  --space-content-gap:   1.5rem;
  --space-card-gap:      1.5rem;
  --max-content-width:   1280px;
  --max-text-width:      680px;

  /* Border Radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

  /* Transitions */
  --transition-fast:      150ms ease;
  --transition-base:      250ms ease;
  --transition-smooth:    350ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-entrance:  800ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Scroll Animation */
  --scroll-fade-distance: 32px;
  --scroll-stagger:       130ms;
}

/* ---------------------------------------------------------------------------
   Reset & Base
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-body-text);
  background-color: var(--color-white);
}

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

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

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

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-blue);
}

p + p {
  margin-top: 1em;
}

/* ---------------------------------------------------------------------------
   Layout Utilities
   --------------------------------------------------------------------------- */
.hollings-container {
  width: 100%;
  max-width: var(--max-content-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.hollings-section {
  padding-block: var(--space-section);
}

.hollings-text-constrain {
  max-width: var(--max-text-width);
}

/* ---------------------------------------------------------------------------
   Button Styles
   --------------------------------------------------------------------------- */
.hollings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-body);
  font-weight: var(--font-weight-regular);
  line-height: 1;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
}

.hollings-btn__icon {
  font-size: 1.25em;
  line-height: 1;
  font-weight: 700;
}

.hollings-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.hollings-btn:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* CTA (red) — uses the AA-accessible orange because the label is white */
.hollings-btn--cta {
  background-color: var(--color-cta-red-accessible);
  color: var(--color-white);
}

/* Primary (blue) */
.hollings-btn--primary {
  background-color: var(--color-blue);
  color: var(--color-white);
}

/* Outline */
.hollings-btn--outline {
  background-color: transparent;
  color: var(--color-blue);
  border: 2px solid var(--color-blue);
}

.hollings-btn--outline-white {
  background-color: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.hollings-btn--outline-white:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* Large variant */
.hollings-btn--lg {
  padding: 1rem 2rem;
  font-size: var(--text-body-lg);
}

/* ---------------------------------------------------------------------------
   Badge Styles
   --------------------------------------------------------------------------- */
.hollings-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: fit-content;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
}

.hollings-badge--navy {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.hollings-badge--white {
  background-color: var(--color-white);
  color: var(--color-blue);
}

.hollings-badge--outline {
  background-color: transparent;
  color: var(--color-blue);
  border: 1px solid var(--color-blue);
}

/* ---------------------------------------------------------------------------
   Scroll Animations
   --------------------------------------------------------------------------- */
.scroll-animate {
  opacity: 0;
  transform: translateY(var(--scroll-fade-distance));
  transition:
    opacity var(--transition-entrance),
    transform var(--transition-entrance);
}

.scroll-animate.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
.scroll-animate[data-delay="1"] { transition-delay: calc(var(--scroll-stagger) * 1); }
.scroll-animate[data-delay="2"] { transition-delay: calc(var(--scroll-stagger) * 2); }
.scroll-animate[data-delay="3"] { transition-delay: calc(var(--scroll-stagger) * 3); }
.scroll-animate[data-delay="4"] { transition-delay: calc(var(--scroll-stagger) * 4); }
.scroll-animate[data-delay="5"] { transition-delay: calc(var(--scroll-stagger) * 5); }

/* Slide-from-left */
.scroll-animate--left {
  transform: translateX(-40px);
}
.scroll-animate--left.is-visible {
  transform: translateX(0);
}

/* Slide-from-right */
.scroll-animate--right {
  transform: translateX(40px);
}
.scroll-animate--right.is-visible {
  transform: translateX(0);
}

/* Focus-visible on anchor tags inside scroll-animate — white overlay ring */
.scroll-animate a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------------------------- */
@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;
  }

  .scroll-animate {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------------------------
   Form Styles (shared)
   --------------------------------------------------------------------------- */
.hollings-input,
.hollings-textarea {
  display: block;
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-body);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  color: var(--color-body-text);
  transition: border-color var(--transition-fast);
}

.hollings-input:focus,
.hollings-textarea:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(24, 37, 170, 0.1);
}

.hollings-input::placeholder,
.hollings-textarea::placeholder {
  color: var(--color-muted-on-light);
}

.hollings-textarea {
  min-height: 120px;
  resize: vertical;
}

.hollings-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-blue);
  margin-bottom: 0.375rem;
}

/* ---------------------------------------------------------------------------
   Default WordPress Block Containment
   Constrains core and plugin blocks; ACF section blocks remain full-width.
   --------------------------------------------------------------------------- */

/* Wrapper for the_content() output in page templates */
/* ACF section blocks cancel the wrapper's padding at page boundaries
   so full-width hero/section modules don't get extra vertical space */
.hollings-page-content > [class*="wp-block-acf-"]:first-child {
  margin-block-start: calc(-1 * var(--space-section));
}

.hollings-page-content > [class*="wp-block-acf-"]:last-child {
  margin-block-end: calc(-1 * var(--space-section));
}

/* All default WP core + plugin blocks: constrain to content width */
.hollings-page-content > [class*="wp-block-"]:not([class*="wp-block-acf-"]) {
  max-width: var(--max-content-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
  box-sizing: border-box;
}

/* Full-width alignment — allow blocks to break out of containment */
.hollings-page-content > .alignfull:not([class*="wp-block-acf-"]) {
  max-width: 100%;
  width: 100%;
  padding-inline: 0;
}

/* Wide alignment */
.hollings-page-content > .alignwide:not([class*="wp-block-acf-"]) {
  max-width: 1440px;
}

/* Gravity Forms — gform_wrapper is a direct child (GF doesn't output wp-block-* class) */
.hollings-page-content > .gform_wrapper {
  max-width: var(--max-content-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
  box-sizing: border-box;
}
