/* ============================================
   Mountain Home Emergency Roof Tarping — Main Stylesheet
   Mobile-First Responsive Design
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --primary: #1A3A5C;
  --accent: #8B8B7A;
  --accent-hover: #6E6E5F;
  --bg: #F4F5F0;
  --body-text: #1A1A1A;
  --white: #FFFFFF;
  --light-gray: #E8E8E8;
  --medium-gray: #999999;
  --dark-overlay: rgba(26, 58, 92, 0.85);
  --shadow: 0 2px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.15);
  --radius: 6px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
  --max-width: 1200px;
  --header-height: 80px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--body-text);
  background-color: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

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

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: 2rem; margin-bottom: 1rem; }
h2 { font-size: 1.65rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.65rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1rem;
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background-color: var(--white);
}

.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.text-white { color: var(--white); }

.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

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

.btn-accent:hover {
  background-color: var(--accent-hover);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.btn-outline:hover {
  background-color: var(--white);
  color: var(--primary);
}

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

.btn-primary:hover {
  background-color: #122a42;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--accent);
}

.section-header p {
  color: var(--medium-gray);
  max-width: 650px;
  margin: 1rem auto 0;
  font-size: 1.05rem;
}

/* --- Top Bar (Emergency Banner) --- */
.top-bar {
  background-color: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.top-bar a {
  color: var(--white);
  text-decoration: underline;
  font-weight: 700;
}

.top-bar a:hover {
  color: var(--light-gray);
}

/* --- Header / Navigation --- */
.site-header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

.main-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background-color: var(--white);
  box-shadow: var(--shadow-lg);
  padding: 5rem 2rem 2rem;
  transition: right var(--transition);
  z-index: 999;
  overflow-y: auto;
}

.main-nav.open {
  right: 0;
}

.main-nav ul {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.main-nav li {
  border-bottom: 1px solid var(--light-gray);
}

.main-nav a {
  display: block;
  padding: 1rem 0;
  color: var(--primary);
  font-weight: 600;
  font-size: 1.05rem;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
}

.nav-cta {
  margin-top: 1.5rem;
}

.nav-cta .btn {
  display: block;
  text-align: center;
}

.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.nav-overlay.active {
  display: block;
}

.header-phone {
  display: none;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 500px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--dark-overlay);
}

.hero-content {
  position: relative;
  z-index: 1;
  color: var(--white);
  padding: 3rem 0;
}

.hero-content h1 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-content p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  max-width: 600px;
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- Page Hero (Interior Pages) --- */
.page-hero {
  background-color: var(--primary);
  padding: 3rem 0;
  text-align: center;
}

.page-hero h1 {
  color: var(--white);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.05rem;
}

.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.breadcrumb a {
  color: rgba(255,255,255,0.7);
}

.breadcrumb a:hover {
  color: var(--white);
}

.breadcrumb span {
  color: rgba(255,255,255,0.5);
}

.breadcrumb .current {
  color: var(--white);
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.service-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  text-align: center;
  border-top: 4px solid transparent;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-top-color: var(--accent);
}

.service-card .icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

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

.service-card p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.service-card .card-link {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

.service-card .card-link:hover {
  color: var(--accent);
}

/* --- Trust Badges --- */
.trust-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
}

.trust-badge {
  padding: 1.5rem 1rem;
}

.trust-badge .badge-icon {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.trust-badge h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.trust-badge p {
  font-size: 0.85rem;
  color: #666;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.testimonial-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
}

.testimonial-card .stars {
  color: #F5A623;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.testimonial-card blockquote {
  font-style: italic;
  color: #555;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.testimonial-card .author {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
}

/* --- CTA Banner --- */
.cta-banner {
  background-color: var(--primary);
  color: var(--white);
  padding: 3rem 0;
  text-align: center;
}

.cta-banner h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.cta-banner p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn {
  margin: 0 0.5rem;
}

/* --- FAQ Section --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background-color: var(--white);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-question .faq-icon {
  font-size: 1.5rem;
  transition: transform var(--transition);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item.active .faq-question .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-answer-inner {
  padding: 0 1.5rem 1.25rem;
  color: #555;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* --- Service Detail Page --- */
.service-detail {
  padding: 3.5rem 0;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.service-detail-content h2 {
  margin-top: 1.5rem;
}

.service-detail-content ul {
  list-style: none;
  margin: 1rem 0;
}

.service-detail-content ul li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.65rem;
  line-height: 1.6;
}

.service-detail-content ul li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.service-detail-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
}

/* --- About Page --- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  align-items: center;
}

.about-image img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.values-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.value-card {
  background-color: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
}

.value-card h3 {
  margin-bottom: 0.5rem;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.contact-info-item .icon {
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background-color: rgba(26, 58, 92, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-form {
  background-color: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--body-text);
  transition: border-color var(--transition);
  background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1);
}

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

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-top: 2rem;
}

.map-container iframe {
  width: 100%;
  height: 350px;
  border: 0;
}

/* --- Service Area Page --- */
.area-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.area-item {
  background-color: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  transition: all var(--transition);
}

.area-item:hover {
  border-left: 3px solid var(--accent);
  transform: translateX(4px);
}

/* --- Results / Before-After --- */
.results-section img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin: 1rem auto;
}

/* --- Footer --- */
.site-footer {
  background-color: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-col p,
.footer-col a {
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-col a:hover {
  color: var(--white);
}

.footer-col ul li {
  margin-bottom: 0.25rem;
}

.footer-col ul a {
  display: inline-block;
  padding: 0.15rem 0;
}

.footer-logo {
  height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  margin-bottom: 1rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
}

/* --- Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 2rem; }

  .hero-content h1 { font-size: 2.75rem; }
  .page-hero h1 { font-size: 2.5rem; }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .trust-badges {
    grid-template-columns: repeat(4, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .area-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  h1 { font-size: 2.75rem; }

  .hero { min-height: 600px; }
  .hero-content h1 { font-size: 3.25rem; }

  .nav-toggle { display: none; }

  .main-nav {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
  }

  .main-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
  }

  .main-nav li {
    border-bottom: none;
  }

  .main-nav a {
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
  }

  .nav-cta {
    margin-top: 0;
    margin-left: 0.5rem;
  }

  .nav-cta .btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    font-size: 0.9rem;
  }

  .header-phone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
    white-space: nowrap;
  }

  .header-phone:hover {
    color: var(--accent);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
  }

  .area-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Responsive: Large Desktop (1280px+) --- */
@media (min-width: 1280px) {
  .hero-content h1 { font-size: 3.5rem; }
  .container { padding: 0 2rem; }
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Print Styles --- */
@media print {
  .site-header, .top-bar, .site-footer, .cta-banner, .nav-toggle {
    display: none;
  }
  body {
    color: #000;
    background: #fff;
  }
}
