/* ==========================================================================
   NY PLUMBING — HOMECREST, BROOKLYN
   Core Stylesheet & Technical SEO Design System
   ========================================================================== */

:root {
  --color-primary: #0b192c;       /* Deep navy / midnight blue */
  --color-primary-dark: #050d18;  /* Deepest navy */
  --color-primary-light: #162a45; /* Rich slate navy */
  --color-secondary: #334155;     /* Slate body text */
  --color-muted: #64748b;         /* Muted technical gray */
  --color-accent: #ea580c;        /* High-contrast heating ember accent */
  --color-accent-hover: #c2410c;  /* Deep flame hover */
  --color-accent-active: #9a3412;
  --color-bg-main: #ffffff;       /* Pure white */
  --color-bg-subtle: #f8fafc;     /* Clean ice-slate 50 */
  --color-bg-card: #ffffff;
  --color-border: #e2e8f0;        /* Subtle slate border */
  --color-border-dark: #cbd5e1;
  --color-emergency-bg: #fef2f2;  /* Alert / gas safety banner */
  --color-emergency-border: #fca5a5;
  --color-emergency-text: #991b1b;
  --color-urgent-bg: #fffbeb;     /* Amber advisory */
  --color-urgent-border: #fcd34d;
  --color-urgent-text: #92400e;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --container-max: 1200px;
  --container-content: 860px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px 0 rgba(11, 25, 44, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(11, 25, 44, 0.08), 0 2px 4px -2px rgba(11, 25, 44, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(11, 25, 44, 0.08), 0 4px 6px -4px rgba(11, 25, 44, 0.04);
  --transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-secondary);
  background-color: var(--color-bg-main);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: 72px; /* Reserved space for mobile sticky call bar */
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  top: -999px;
  left: 20px;
  background: var(--color-primary);
  color: #ffffff;
  padding: 12px 20px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--radius-sm);
  outline: 3px solid var(--color-accent);
}

.skip-link:focus {
  top: 20px;
}

/* Focus styles for keyboard accessibility */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  h1 {
    font-size: 2.85rem;
  }
}

h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.35rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1.25rem;
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

strong {
  color: var(--color-primary);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

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

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Emergency Safety Bar */
.emergency-bar {
  background-color: var(--color-emergency-bg);
  border-bottom: 1px solid var(--color-emergency-border);
  color: var(--color-emergency-text);
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  font-weight: 500;
}

.emergency-bar strong {
  color: var(--color-emergency-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Header & Site Navigation */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-logo {
  display: flex;
  flex-direction: column;
}

.logo-link {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
  text-decoration: none;
  letter-spacing: -0.03em;
  display: inline-block;
}

.logo-location {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation List */
.main-nav {
  display: none;
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
    align-items: center;
  }
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
  align-items: center;
}

.nav-list a,
.dropdown-trigger {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color var(--transition);
}

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

/* Services Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 260px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  z-index: 1010;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.is-open .dropdown-menu {
  display: block;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-secondary);
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
  background-color: var(--color-bg-subtle);
  color: var(--color-accent);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition), transform var(--transition);
  font-family: inherit;
}

.btn-phone {
  background-color: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

.btn-phone:hover {
  background-color: var(--color-accent-hover);
  color: #ffffff;
}

.btn-phone-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1.1rem;
}

.header-cta {
  display: none;
}

@media (min-width: 640px) {
  .header-cta {
    display: inline-flex;
  }
}

/* Mobile Toggle */
.menu-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

@media (min-width: 992px) {
  .menu-toggle {
    display: none;
  }
}

/* Mobile Navigation Drawer */
@media (max-width: 991px) {
  .main-nav.is-active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 2px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
  }

  .main-nav.is-active .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .main-nav.is-active .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 1rem;
    width: 100%;
    display: none;
  }

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

/* Breadcrumbs */
.breadcrumb-nav {
  background-color: var(--color-bg-subtle);
  border-bottom: 1px solid var(--color-border);
  padding: 0.65rem 0;
  font-size: 0.85rem;
}

.breadcrumb-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.breadcrumb-item a {
  color: var(--color-muted);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--color-border-dark);
}

.breadcrumb-item[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(180deg, #ffffff 0%, var(--color-bg-subtle) 100%);
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 860px) {
  .hero-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.hero-content {
  max-width: 680px;
}

.hero-eyebrow {
  color: var(--color-accent);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.hero-title {
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.hero-lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-secondary);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  object-fit: cover;
  display: block;
}

.hero-no-media {
  text-align: center;
  padding: 3.5rem 0;
}

.hero-no-media .hero-content {
  margin: 0 auto;
}

.hero-no-media .hero-actions {
  justify-content: center;
}

/* Main Content & Service Page Styles */
.service-section {
  padding: 3rem 0;
}

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

.lead-paragraph {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--color-primary);
  margin-bottom: 1.5rem;
}

/* Service Process & Cards */
.process-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.process-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.process-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-dark);
}

.process-card h3 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.process-card p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: var(--color-secondary);
}

/* Service Highlight Box */
.service-highlight-box {
  background-color: var(--color-bg-subtle);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.5rem;
  margin: 2rem 0;
}

.service-highlight-box h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.service-highlight-box p:last-child {
  margin-bottom: 0;
}

/* Related Services Cards */
.related-services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

@media (min-width: 640px) {
  .related-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .related-services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.service-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.service-card h3 {
  margin-top: 0;
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.service-card p {
  font-size: 0.92rem;
  color: var(--color-secondary);
  flex-grow: 1;
  margin-bottom: 1rem;
}

.service-card a {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-accent);
  text-decoration: none;
}

.service-card a:hover {
  text-decoration: underline;
}

/* FAQ Accordion */
.faq-accordion {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}

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

.faq-question:hover {
  background-color: var(--color-bg-subtle);
}

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

.faq-question[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--color-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-answer.is-open {
  display: block;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* CTA Banner */
.cta-banner {
  background: var(--color-primary);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 3.5rem 0;
  box-shadow: var(--shadow-lg);
}

.cta-banner h2 {
  color: #ffffff;
  border-bottom: none;
  margin-top: 0;
  font-size: 2rem;
}

.cta-banner p {
  color: #cbd5e1;
  max-width: 640px;
  margin: 0 auto 1.75rem auto;
  font-size: 1.1rem;
}

/* Site Footer */
.site-footer {
  background-color: var(--color-primary);
  color: #cbd5e1;
  padding: 3.5rem 0 2rem 0;
  margin-top: auto;
  border-top: 3px solid var(--color-accent);
}

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

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.footer-col h4 {
  color: #ffffff;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col p {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.85rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition);
}

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

.footer-phone-cta {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
  text-decoration: none;
}

.footer-phone-cta:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(226, 232, 240, 0.15);
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  color: #94a3b8;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    text-align: left;
  }
}

.footer-bottom a {
  color: #94a3b8;
}

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

/* Sticky Mobile Call Bar */
.sticky-call-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-primary);
  border-top: 2px solid var(--color-accent);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.15);
}

@media (min-width: 900px) {
  .sticky-call-bar {
    display: none;
  }
}

.sticky-call-text {
  display: flex;
  flex-direction: column;
}

.sticky-call-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.sticky-call-number {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.sticky-call-btn {
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sticky-call-btn:hover {
  background-color: var(--color-accent-hover);
  color: #ffffff;
}

/* Utility Helpers */
.text-accent {
  color: var(--color-accent);
}

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