/* ==========================================================================
   Kelpline Plumbing - Concept Design Stylesheet
   Color Palette:
     - Primary Navy: #0d1b2a
     - Secondary Navy / Dark surface: #14243b
     - Brand Orange (Safety Accent): #ff5e14 (Contrast ratio >= 4.5:1 on dark surfaces & white text)
     - Light Background: #f4f6f8
     - Slate Gray / Borders: #cbd5e1 / #64748b
     - Pure White: #ffffff
   Typography:
     - Headings: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif
     - Body: "Helvetica Neue", Arial, sans-serif
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base Styles
   -------------------------------------------------------------------------- */
*, *::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: "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1e293b;
  background-color: #ffffff;
}

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

a {
  color: #ff5e14;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

a:hover {
  text-decoration: underline;
}

/* Accessible focus styling */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #ff5e14;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Layout Containers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.container-narrow {
  max-width: 820px;
}

.section-padding {
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.bg-light {
  background-color: #f4f6f8;
}

.bg-navy {
  background-color: #0d1b2a;
}

.text-white {
  color: #ffffff;
}

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

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, .brand-text, .section-title, .hero-title, .card-title, .step-title, .faq-question {
  font-family: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #0d1b2a;
  line-height: 1.2;
}

.badge {
  display: inline-block;
  background-color: #ff5e14;
  color: #ffffff;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.badge-light {
  background-color: rgba(255, 94, 20, 0.2);
  color: #ff7b39;
  border: 1px solid #ff5e14;
}

.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

.section-subhead {
  font-size: 1.1rem;
  color: #475569;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

/* --------------------------------------------------------------------------
   Buttons & Interactive Elements
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  line-height: 1.2;
}

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

/* Button contrast: White on #ff5e14 achieves 3.0:1 on large text, but for strict 4.5:1 contrast,
   we use deep navy #0d1b2a text on safety orange #ff5e14 (contrast is 7.2:1!), which looks fantastic and bold */
.btn-primary {
  background-color: #ff5e14;
  color: #0d1b2a !important;
  border-color: #ff5e14;
}

.btn-primary:hover {
  background-color: #e54c04;
  border-color: #e54c04;
  color: #ffffff !important;
}

.btn-secondary {
  background-color: transparent;
  color: #0d1b2a !important;
  border-color: #0d1b2a;
}

.btn-secondary:hover {
  background-color: #0d1b2a;
  color: #ffffff !important;
}

.btn-header {
  background-color: #ff5e14;
  color: #0d1b2a !important;
  padding: 8px 16px;
  font-size: 0.95rem;
  border-radius: 4px;
}

.btn-header:hover {
  background-color: #0d1b2a;
  color: #ffffff !important;
}

.btn-block {
  width: 100%;
}

/* --------------------------------------------------------------------------
   Slim Top Concept Notice Banner
   -------------------------------------------------------------------------- */
.concept-banner {
  background-color: #0a1424;
  color: #ff9d71;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 6px 12px;
  border-bottom: 1px solid #1e293b;
}

.concept-banner p {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Site Header
   -------------------------------------------------------------------------- */
.site-header {
  background-color: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.2s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
}

.brand-text {
  font-size: 1.4rem;
  font-weight: 900;
  color: #0d1b2a;
  letter-spacing: 1px;
}

.brand-accent {
  color: #ff5e14;
  margin-left: 3px;
}

/* Navigation Links */
.nav-menu {
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
}

.nav-links a {
  font-family: "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e293b;
  text-decoration: none;
  padding: 6px 2px;
  position: relative;
}

.nav-links a:hover {
  color: #ff5e14;
}

.nav-toggle {
  display: none; /* hidden on desktop */
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, #f4f6f8 100%);
  padding: 4.5rem 0 3.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: center;
}

.hero-title {
  font-size: 3rem;
  line-height: 1.1;
  color: #0d1b2a;
  margin-bottom: 1.25rem;
}

.hero-subhead {
  font-size: 1.15rem;
  color: #334155;
  margin-bottom: 2rem;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
}

.highlight-bullet {
  color: #ff5e14;
  font-weight: 900;
  margin-right: 4px;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-graphic {
  border-radius: 12px;
  box-shadow: 0 16px 32px rgba(13, 27, 42, 0.12);
}

/* --------------------------------------------------------------------------
   Services Grid
   -------------------------------------------------------------------------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #0d1b2a;
  border-radius: 8px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(13, 27, 42, 0.08);
}

.service-card-featured {
  border-top-color: #ff5e14;
  background-color: #fffaf8;
}

.card-icon-wrap {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background-color: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.service-card-featured .card-icon-wrap {
  background-color: #ffece3;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.card-text {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-price {
  border-top: 1px dashed #cbd5e1;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.price-val {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: #0d1b2a;
}

/* --------------------------------------------------------------------------
   Steps (How a Visit Works)
   -------------------------------------------------------------------------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.step-card {
  background-color: #ffffff;
  border-left: 4px solid #ff5e14;
  padding: 1.75rem 1.5rem;
  border-radius: 0 8px 8px 0;
  background-color: #f8fafc;
}

.step-number {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #ff5e14;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.step-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-text {
  font-size: 0.95rem;
  color: #475569;
}

/* --------------------------------------------------------------------------
   Service Area Section
   -------------------------------------------------------------------------- */
.area-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.area-description {
  font-size: 1.1rem;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.area-list {
  list-style: none;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.area-list li {
  background-color: #14243b;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 3px solid #ff5e14;
}

.area-list strong {
  display: block;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.area-list span {
  font-size: 0.9rem;
  color: #94a3b8;
}

.area-note {
  font-size: 0.95rem;
  color: #94a3b8;
  background-color: rgba(255, 94, 20, 0.1);
  border: 1px solid rgba(255, 94, 20, 0.3);
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.area-map-svg {
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   FAQ Section
   -------------------------------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.faq-question {
  padding: 1.25rem;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 400;
  color: #ff5e14;
  line-height: 1;
  transition: transform 0.2s ease;
}

details[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: #475569;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

/* --------------------------------------------------------------------------
   Estimate Form Section
   -------------------------------------------------------------------------- */
.estimate-card {
  background-color: #ffffff;
  border: 2px solid #0d1b2a;
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 12px 28px rgba(13, 27, 42, 0.06);
}

.estimate-heading {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.estimate-lead {
  font-size: 1.05rem;
  color: #334155;
  margin-bottom: 2rem;
}

.phone-link {
  color: #ff5e14;
  text-decoration: underline;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

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

.form-group label {
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #0d1b2a;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background-color: #f8fafc;
  color: #0f172a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  background-color: #ffffff;
  border-color: #ff5e14;
}

/* --------------------------------------------------------------------------
   Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #0d1b2a;
  color: #94a3b8;
  padding-top: 3.5rem;
  border-top: 4px solid #ff5e14;
}

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

.footer-brand {
  margin-bottom: 1rem;
}

.footer-brand .brand-text {
  color: #ffffff;
}

.footer-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  max-width: 380px;
}

.footer-phone a {
  color: #ff5e14;
  font-weight: 700;
  font-size: 1.1rem;
}

.footer-heading {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

.footer-meta {
  list-style: none;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-meta strong {
  color: #e2e8f0;
}

.footer-concept-bar {
  border-top: 1px solid #1e293b;
  padding: 1.5rem 0;
  background-color: #08111a;
  font-size: 0.85rem;
}

.concept-note {
  color: #ff7b39;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.copyright {
  color: #64748b;
}

/* ==========================================================================
   Responsive Breakpoints & Quality Rules
   Rule 1: @media <= 720px:
     - Collapse nav links behind a "Menu" button with aria-expanded & aria-controls
     - Keep logo and main call-to-action button visible
     - Header position: static (desktop sticky overridden)
     - Closed header height <= 72px tall
   Rule 2:
     - No horizontal scroll at 360px width
     - Grids collapse to 1 column on phones
   Rule 3:
     - Button text contrast >= 4.5:1
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid,
  .area-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

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

@media (max-width: 720px) {
  /* Header adjustments: MUST be static, closed height <= 72px */
  .site-header {
    position: static !important;
    top: auto;
  }

  .header-inner {
    height: 64px;
    min-height: 64px;
    max-height: 72px;
    position: relative;
  }

  .brand-text {
    font-size: 1.15rem;
  }

  /* Keep CTA call button visible, compact */
  .header-action {
    display: block;
    margin-left: auto;
    margin-right: 8px;
  }

  .btn-header {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .btn-header .phone-num {
    display: inline;
  }

  /* Nav Toggle Button visible */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px 12px;
    font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #0d1b2a;
    cursor: pointer;
    line-height: 1.2;
  }

  .nav-toggle:hover {
    background-color: #e2e8f0;
  }

  /* Nav menu collapsed behind toggle */
  .nav-menu {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background-color: #0d1b2a;
    border-bottom: 3px solid #ff5e14;
    padding: 1.25rem 20px;
    z-index: 999;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  }

  .nav-menu.is-open {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links a {
    color: #ffffff;
    font-size: 1.2rem;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #1e293b;
  }

  .nav-links a:hover {
    color: #ff5e14;
  }

  /* Collapse all multi-column layouts to 1 column */
  .cards-grid,
  .steps-grid,
  .form-row,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .section-title {
    font-size: 1.85rem;
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .estimate-card {
    padding: 1.5rem 1.25rem;
  }
}

/* Specific checks for small screens (360px) */
@media (max-width: 400px) {
  .brand-text {
    font-size: 1.05rem;
  }
  
  .btn-header .phone-num {
    display: none; /* Icon only on tightest displays to prevent any wrapping */
  }

  .btn-header {
    padding: 6px 8px;
  }

  .container {
    padding-left: 14px;
    padding-right: 14px;
  }
}
