/* ============================================================
   Page components, hero, service rows, process sequence, stats,
   technology spec tables, forms
   ============================================================ */

/* ---------- Hero: asymmetric, photo-anchored, no text-over-gradient ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: 86vh;
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-7) var(--gutter);
  padding-left: max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter)));
}
@media (max-width: 920px) {
  .hero-copy { padding-left: var(--gutter); padding-top: var(--sp-6); }
}

.hero-copy h1 { font-size: var(--fs-hero); }
.hero-copy .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.hero-media {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: var(--navy);
}
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-media figcaption {
  position: absolute;
  left: var(--sp-2);
  bottom: var(--sp-2);
  background: rgba(10, 30, 56, 0.72);
  color: #fff;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
}

/* A quieter hero variant for interior pages (Commercial, About, etc.) */
.page-hero {
  background: var(--navy);
  color: #fff;
  padding-block: var(--sp-6);
}
.page-hero .section-label { color: var(--sun); }
.page-hero h1 { color: #fff; font-size: var(--fs-h1); }
.page-hero .lede { color: #C9D6E6; max-width: 56ch; margin-top: var(--sp-2); font-size: 1.08rem; }

/* Photo-backed page hero, for interior pages with a strong lead image
   (Residential). Same navy scrim treatment as .compare-item tags, so the
   two photo-overlay patterns on the site stay visually consistent. */
.page-hero-photo {
  position: relative;
  color: #fff;
  padding-block: var(--sp-7);
  overflow: hidden;
  isolation: isolate;
}
.page-hero-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.page-hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, rgba(10,30,56,0.94) 0%, rgba(10,30,56,0.78) 42%, rgba(10,30,56,0.46) 100%);
}
.page-hero-photo .section-label { color: var(--sun); }
.page-hero-photo h1 { color: #fff; font-size: var(--fs-h1); }
.page-hero-photo .lede { color: #C9D6E6; max-width: 52ch; margin-top: var(--sp-2); font-size: 1.08rem; }

/* ---------- Services: numbered full-width rows, not cards ---------- */
.service-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: var(--sp-3);
  padding-block: var(--sp-3);
  border-top: 1px solid var(--line);
}
.service-row:last-child { border-bottom: 1px solid var(--line); }
.service-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold-deep);
  font-weight: 800;
  line-height: 1;
}
.service-body h3 { margin-bottom: 6px; }
.service-body p { color: var(--ink-soft); }
.service-link {
  text-decoration: none;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  align-self: center;
  border-bottom: 1.5px solid var(--gold);
  padding-bottom: 2px;
}
@media (max-width: 680px) {
  .service-row { grid-template-columns: 44px 1fr; }
  .service-link { grid-column: 2; margin-top: 4px; }
}

/* ---------- Process: true connected sequence ---------- */
.process-list {
  position: relative;
  display: flex;
  flex-direction: column;
}
.process-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--sp-3);
  padding-bottom: var(--sp-5);
}
.process-item:last-child { padding-bottom: 0; }
.process-dot {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--sun);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  z-index: 1;
}
.process-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 56px;
  bottom: -8px;
  width: 2px;
  background: var(--line);
}
.process-body h3 { margin-bottom: 4px; }
.process-body p { color: var(--ink-soft); }

/* ---------- Why Ekyam: stat + description pairs, asymmetric ---------- */
.stat-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: var(--sp-4);
  padding-block: var(--sp-4);
  border-top: 1px solid var(--line);
}
.stat-row:last-child { border-bottom: 1px solid var(--line); }
.stat-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
}
.stat-desc { color: var(--ink-soft); max-width: 50ch; }

/* ---------- Dark section variant (navy/deep backgrounds) ---------- */
/* Apply `.section-on-dark` to a section wrapping dark background content;
   it recolors headings, labels and muted text without per-instance inline
   styles, so dark sections stay visually consistent across pages. */
.section-on-dark h1,
.section-on-dark h2,
.section-on-dark h3 { color: #fff; }
.section-on-dark .section-label { color: var(--sun); }
.section-on-dark .on-dark-muted,
.section-on-dark .stat-desc,
.section-on-dark .section-head p { color: #C9D6E6; }
.section-on-dark .stat-label { color: #fff; }
.section-on-dark .stat-row { border-color: var(--line-dark); }
@media (max-width: 640px) {
  .stat-row { grid-template-columns: 1fr; gap: var(--sp-1); }
}

/* ---------- Before/After photo pair ---------- */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}
@media (max-width: 680px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-item { position: relative; border-radius: var(--radius-md); overflow: hidden; }
.compare-item img { width: 100%; height: 420px; object-fit: cover; }
.compare-tag {
  position: absolute;
  left: var(--sp-2); top: var(--sp-2);
  font-weight: 600; font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: 999px;
}
.compare-tag.before { background: #fff; color: var(--deep); }
.compare-tag.after { background: var(--gold); color: #fff; }

/* ---------- CTA band: the one deliberate centered break ---------- */
.cta-band {
  background: var(--deep); /* deliberately one shade darker than --navy, so a
    CTA band directly following another dark (--navy) section still reads as
    a distinct block rather than one continuous navy field */
  color: #fff;
  text-align: center;
  padding-block: var(--sp-6);
}
.cta-band h2 { color: #fff; max-width: 32ch; margin-inline: auto; }
.cta-band .cta-row {
  margin-top: var(--sp-3);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---------- Technology / spec table ---------- */
.spec-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed; /* auto layout's column-width algorithm can round a
    fraction of a pixel wider than the container with border-collapse,
    tipping a narrow viewport into a 1px horizontal scrollbar; fixed layout
    keeps the table strictly within its container's width */
  border-collapse: collapse;
  font-size: 0.95rem;
}
.spec-table caption { text-align: left; font-weight: 600; color: var(--navy); margin-bottom: var(--sp-1); }
.spec-table th, .spec-table td {
  text-align: left;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  vertical-align: top;
}
.spec-table thead th {
  border-top: none;
  border-bottom: 2px solid var(--navy);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.spec-table tbody tr:hover { background: rgba(201, 138, 31, 0.06); }

.tech-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-3);
  align-items: stretch; /* equal-height cards in a row, regardless of copy length */
}

.brand-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--navy);
  background: var(--paper-raised);
}

.callout {
  border-left: 3px solid var(--gold);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(201, 138, 31, 0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout p { color: var(--ink); }

/* ---------- Contact form (the one element allowed a shadow) ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: var(--sp-6);
  align-items: start;
}
@media (max-width: 880px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-info { display: flex; flex-direction: column; gap: var(--sp-3); }
.contact-method {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}
.contact-method svg { width: 22px; height: 22px; color: var(--gold-deep); margin-top: 3px; flex-shrink: 0; }
.contact-method a { color: var(--navy); text-decoration: none; font-weight: 600; }
.contact-method a:hover { text-decoration: underline; }

.contact-form {
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 0.98rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}
.form-note { font-size: 0.82rem; color: var(--ink-soft); }
.form-status { font-size: 0.92rem; font-weight: 600; min-height: 1.2em; }
.form-status[data-state="success"] { color: #1F8A54; }
.form-status[data-state="error"] { color: #B3261E; }

/* ---------- Branch locations (contact page): two cards side by side,
   each with its own map embed ---------- */
.branch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 780px) {
  .branch-grid { grid-template-columns: 1fr; }
}
.branch-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
}
.map-embed {
  position: relative;
  width: 100%;
  padding-top: 65%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- FAQ (native disclosure, no JS needed) ---------- */
.faq-item {
  border-top: 1px solid var(--line);
}
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  padding-block: var(--sp-2);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-2);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s var(--ease);
}
.faq-item[open] summary .faq-icon { transform: rotate(45deg); }
.faq-item p { padding-bottom: var(--sp-2); color: var(--ink-soft); }

/* ---------- Badges (registrations strip) ---------- */
.badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-block: var(--sp-2);
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--navy);
}
.badge-item svg { width: 22px; height: 22px; color: #1F8A54; flex-shrink: 0; }

/* ---------- Welcome popup (homepage only, shown once per visitor) ---------- */
.welcome-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.welcome-popup.is-open { display: flex; }
.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 30, 56, 0.6);
}
.popup-panel {
  position: relative;
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  padding: var(--sp-4);
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.popup-panel h2 { font-size: 1.4rem; padding-right: var(--sp-4); }
.popup-panel .site-visit-form {
  margin-top: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.popup-close {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  background: none;
  border: none;
  padding: 6px;
  color: var(--ink-soft);
  border-radius: 50%;
  line-height: 0;
}
.popup-close:hover { background: var(--paper); color: var(--navy); }
.popup-divider {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.popup-divider::before,
.popup-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.popup-direct-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
@media (prefers-reduced-motion: no-preference) {
  .popup-panel { animation: popup-rise 0.25s var(--ease); }
}
@keyframes popup-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
