/* ============================================
   EAGLE CHIMNEY & FIREPLACE - PREMIUM CSS
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-dark: #001f3f;
  --primary-light: #003d6b;
  --accent-red: #c41e3a;
  --gold: #b8860b;
  --text-dark: #2c2c2c;
  --text-light: #666666;
  --bg-light: #f8f8f8;
  --border: #ddd;
  --border-color: #ddd;
  --white: #ffffff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.15);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  color: var(--primary-dark);
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  color: var(--primary-dark);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
  line-height: 1.7;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-red);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 200px;
}

.logo img {
  max-height: 50px;
  width: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  align-items: center;
  flex: 1;
}

.nav-links a {
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-red);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.cta-button {
  background: var(--accent-red);
  color: var(--white);
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.3s, transform 0.3s;
}

.cta-button:hover {
  background: #a01830;
  transform: translateY(-2px);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  max-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  overflow: hidden;
}

.hero video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 31, 63, 0.65) 0%, rgba(196, 30, 58, 0.5) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 700px;
  padding: 3rem;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.btn-primary {
  background: var(--accent-red);
  color: var(--white);
}

.btn-primary:hover {
  background: #a01830;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--white);
  color: var(--primary-dark);
  border: 2px solid var(--white);
}

.btn-secondary:hover {
  background: transparent;
  color: var(--white);
}

.btn-phone {
  background: var(--gold);
  color: var(--primary-dark);
  font-weight: 700;
}

.btn-phone:hover {
  background: #9a7109;
  color: var(--white);
}

/* ============================================
   SECTIONS & CONTAINERS
   ============================================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 5rem 0;
}

section.bg-light {
  background: var(--bg-light);
}

section.bg-dark {
  background: var(--primary-dark);
  color: var(--white);
}

section.bg-dark h2,
section.bg-dark h3,
section.bg-dark h4 {
  color: var(--white);
}

section.bg-dark p {
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   SERVICE CARDS & GRIDS
   ============================================ */

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.service-card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  background: var(--bg-light);
}

.service-card-content {
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.service-card h3 {
  margin-bottom: 0.75rem;
}

.service-card p {
  flex: 1;
  margin-bottom: 1.5rem;
}

.service-link {
  color: var(--accent-red);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.service-link:hover {
  color: var(--primary-dark);
}

/* ============================================
   FEATURE SECTION
   ============================================ */

.feature-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  margin: 3rem 0;
}

.feature-section img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.feature-content h2 {
  margin-bottom: 1.5rem;
}

/* ============================================
   FORMS
   ============================================ */

form {
  display: grid;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  padding: 0.875rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

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

/* ============================================
   FOOTER
   ============================================ */

footer {
  background: var(--primary-dark);
  color: var(--white);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h4 {
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section li {
  margin-bottom: 0.75rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.3s;
}

.footer-section a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

/* ============================================
   BREADCRUMB
   ============================================ */

.breadcrumb {
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.breadcrumb a {
  margin: 0 0.25rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
  text-align: center;
}

.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    max-height: 400px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-ctas {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .feature-section {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  section {
    padding: 3rem 0;
  }

  .hero-content {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .logo {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .hero-ctas {
    gap: 1rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* ============================================
   STATES & MESSAGES
   ============================================ */

.success-message {
  background: #4caf50;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.error-message {
  background: #f44336;
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================
   IMAGE CARD SYSTEM (v2) — Services, Locations, Blog
   ============================================ */

/* Card grids */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Universal image card */
.img-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.img-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.img-card__imgwrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-light);
}
.img-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.img-card:hover .img-card__img { transform: scale(1.06); }
.img-card__body {
  padding: 1.4rem 1.5rem 1.6rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.img-card__body h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  color: var(--primary-dark);
}
.img-card__body p {
  margin: 0 0 1.1rem;
  color: var(--text-light);
  font-size: 0.97rem;
  line-height: 1.55;
  flex: 1;
}
.img-card__link {
  color: var(--accent-red);
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}
.img-card:hover .img-card__link { color: var(--primary-dark); }
/* Make whole card clickable via stretched link */
.img-card--clickable { position: relative; }
.img-card--clickable .img-card__link.stretched::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Location card badge */
.img-card__badge {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(0,31,63,0.88);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
}

/* Page hero image band */
.page-hero-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}
@media (max-width: 768px) { .page-hero-img { height: 220px; } }

/* Featured image (blog article) */
.article-featured {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-md);
}

/* In-content supporting image */
.content-img {
  width: 100%;
  border-radius: 10px;
  display: block;
  margin: 2rem 0;
  box-shadow: var(--shadow);
  object-fit: cover;
}

/* Technician / team section */
.team-section { background: var(--bg-light); }
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}
.team-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.team-feature {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-top: 2rem;
}
.team-feature img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
@media (max-width: 768px) {
  .team-feature { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* Section heading helper */
.section-eyebrow {
  color: var(--accent-red);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Responsive card grids */
@media (max-width: 1024px) {
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .card-grid, .card-grid.cols-3, .card-grid.cols-4 {
    grid-template-columns: 1fr;
    gap: 1.3rem;
  }
}

/* Logo sizing in sticky header */
.logo img { max-height: 48px; width: auto; display: block; }
@media (max-width: 768px) { .logo img { max-height: 40px; } }

/* ============================================
   MOBILE OVERFLOW FIXES (v3)
   ============================================ */

/* Global safety net against horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
*, *::before, *::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }

/* Collapse ALL inline multi-column content grids on mobile.
   Pages use inline styles like "grid-template-columns: 2fr 1fr" or
   "1fr 1fr" which do not respond to media queries on their own. */
@media (max-width: 900px) {
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
}

/* Prevent flex/grid children from forcing overflow */
.card-grid, .team-grid, .team-feature, .service-grid, .footer-grid { min-width: 0; }
.img-card, .img-card__body, .service-card { min-width: 0; }

/* Forms must never exceed their container on mobile */
input, textarea, select, .form-group { max-width: 100%; }
input, textarea, select { width: 100%; }

/* Buttons wrap instead of pushing width */
.btn { max-width: 100%; white-space: normal; word-break: break-word; }

/* The team feature image column shouldn't overflow */
.team-feature img, .team-photo, .page-hero-img, .article-featured, .content-img { max-width: 100%; }

/* Extra guard for very small screens */
@media (max-width: 480px) {
  nav { padding: 0.75rem 1rem; gap: 1rem; }
  .container { padding-left: 1rem; padding-right: 1rem; }
  section { overflow-x: hidden; }
  .btn { font-size: 0.95rem; padding: 0.7rem 1rem; }
}
