/* ===== Custom Styles for MAB Roofing & Siding ===== */

/* Base */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #b92547;
  color: #fefdfb;
}

/* Service Label */
.service-label {
  position: relative;
  display: inline-block;
}

.service-label::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 24px;
  height: 2px;
  background: #b92547;
}

/* Navbar */
#navbar {
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
  background: rgba(254, 253, 251, 0.97);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(123, 45, 59, 0.08);
}

/* Hero */
#hero {
  position: relative;
}

/* Service Cards */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #7B2D3B, #b92547);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.service-card:hover::after {
  transform: scaleX(1);
}

/* Gallery */
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(123, 45, 59, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Testimonials */
.testimonial-card {
  position: relative;
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 16px;
  left: 20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  color: rgba(245, 166, 192, 0.2);
  line-height: 1;
}

/* Animations (progressive enhancement — only active with JS and reduced-motion preference) */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .reveal[data-reveal="left"] {
    transform: translateX(-24px);
  }

  .reveal[data-reveal="right"] {
    transform: translateX(24px);
  }

  .reveal.visible {
    opacity: 1;
    transform: none;
  }

  /* Stagger children */
  .stagger-children .reveal[data-reveal] {
    transition-delay: calc(var(--i, 0) * 0.1s);
  }
}

/* Mobile menu animation */
.mobile-link {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

#mobileMenu.open .mobile-link {
  opacity: 1;
  transform: none;
}

/* Hamburger animation */
.menu-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

#menuBtn.active .menu-line:nth-child(2) {
  opacity: 0;
}

#menuBtn.active .menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 1.5rem;
}

/* Smooth image loading */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #b92547;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Form focus states */
input:focus,
select:focus,
textarea:focus {
  background: white;
}

/* Subtle hover lift on cards */
.service-card,
.testimonial-card {
  will-change: transform;
}

/* Print styles */
@media print {
  header,
  #contactForm,
  .gallery-item::after {
    display: none !important;
  }
  body {
    background: white;
    color: black;
  }
  #hero {
    background: #7B2D3B !important;
    min-height: auto;
    padding: 2rem 0;
  }
}
