/*
Theme Name: SolarVolt
Theme URI: https://github.com/JFXRates/solar-wp-themes
Author: JFXRates
Author URI: https://github.com/JFXRates/solar-wp-themes
Description: A bold, credibility-focused WordPress theme for solar energy vendors, with editable brand bar, team, stats and a floating WhatsApp button.
Version: 1.1.0
Text Domain: solarvolt
*/

/* ============================================================
   SOLARVOLT — Main Stylesheet
   Aesthetic: Bold editorial meets industrial precision
   Palette: Deep navy + amber gold + crisp white
   Fonts: Bebas Neue (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --navy:       #0a1628;
  --navy-mid:   #0f2040;
  --navy-light: #1a3056;
  --gold:       #f5a623;
  --gold-dark:  #d4891a;
  --gold-light: #ffc85e;
  --white:      #ffffff;
  --off-white:  #f4f1eb;
  --grey-light: #e8e4dc;
  --grey-mid:   #9ca3af;
  --grey-text:  #4b5563;
  --red:        #e53e3e;

  --font-display: 'Bebas Neue', cursive;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --radius:    4px;
  --radius-lg: 12px;
  --shadow:    0 4px 24px rgba(10,22,40,0.15);
  --shadow-lg: 0 16px 64px rgba(10,22,40,0.25);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--navy);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a  { text-decoration: none; color: inherit; }
ul { list-style: none; }

/*
 * Visually hidden, still announced.
 *
 * 📘 LESSON: an icon-only control (our WhatsApp button) has no visible text,
 * so a screen reader has nothing to announce unless we give it one. This
 * clips the text to a 1px box instead of display:none, which would remove it
 * from the accessibility tree entirely.
 */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── Typography Scale ── */
/* 📘 LESSON: a clamp() floor is a *fixed* size, so on a 320px phone the middle
   term (a vw value) never wins — the floor does, and a 56px h1 in a 240px
   column makes the longest word overflow the page. The fix is to fold a vw term
   into the floor itself, so the whole scale keeps shrinking all the way down.
   Compare `clamp(3.5rem, 8vw, 7rem)` (flat 56px below 700px) with
   `clamp(2rem, 1rem + 7vw, 7rem)` (38px at 320px, 56px at ~570px). */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.05; letter-spacing: 0.02em; }
h1 { font-size: clamp(2rem, 1rem + 7vw, 7rem); }
h2 { font-size: clamp(1.6rem, 0.9rem + 3.5vw, 4rem); }
h3 { font-size: clamp(1.25rem, 0.95rem + 1.5vw, 2.2rem); }
h4 { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.4rem); }
/* These headings are admin-editable now, so one long unbreakable word — a
   product code, a URL, a hyphen-less brand name — is a realistic input rather
   than a theoretical one. break-word keeps it inside the column. */
h1, h2, h3, h4 { overflow-wrap: break-word; }
p  { font-size: 1.05rem; color: var(--grey-text); max-width: 65ch; }

/* ── Utility Classes ── */
.container       { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.section-pad     { padding: 6rem 0; }
.section-pad-sm  { padding: 4rem 0; }
.text-gold       { color: var(--gold); }
.text-white      { color: var(--white); }
.text-navy       { color: var(--navy); }
.bg-navy         { background: var(--navy); }
.bg-off-white    { background: var(--off-white); }
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 0.75rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-transform: uppercase;
}
.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,166,35,0.35);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-dark {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-dark:hover {
  background: var(--navy-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── Navigation ── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.25rem 0;
  transition: var(--transition);
}
.site-header.scrolled {
  background: rgba(10,22,40,0.97);
  backdrop-filter: blur(12px);
  padding: 0.85rem 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.nav-logo-icon {
  width: 38px; height: 38px;
  background: var(--gold);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-icon svg { width: 22px; height: 22px; fill: var(--navy); }
.nav-logo-text {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--white);
  letter-spacing: 0.05em;
}
.nav-logo-text span { color: var(--gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--gold);
  transition: var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--white); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta { margin-left: 1rem; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5rem;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--navy);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6rem 1.5rem 3rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.3s;
}
.mobile-nav.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.mobile-nav ul {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: auto 0;
  padding: 0;
  list-style: none;
  width: 100%;
}
.mobile-nav ul li { width: 100%; text-align: center; }
.mobile-nav a:not(.btn) {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.1;
  color: var(--white);
  letter-spacing: 0.05em;
  padding: 0.6rem 1.25rem;
  transition: var(--transition);
}
.mobile-nav a:not(.btn):hover,
.mobile-nav a:not(.btn).active { color: var(--gold); }
.mobile-nav .btn { margin-top: 1.5rem; font-size: 0.95rem; }

/* ── Hero Section ── */
.hero {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 5rem;
}
/* Diagonal gold accent behind hero */
.hero::before {
  content: '';
  position: absolute;
  top: -20%; right: -10%;
  width: 60%; height: 130%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  clip-path: polygon(20% 0%, 100% 0%, 100% 100%, 0% 100%);
  opacity: 0.08;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: var(--white);
  clip-path: polygon(0 60%, 100% 0%, 100% 100%, 0% 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245,166,35,0.15);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 100px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
  width: fit-content;
}
.hero-badge::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero h1 { color: var(--white); margin-bottom: 1.5rem; }
.hero h1 em { color: var(--gold); font-style: normal; display: block; }
.hero-desc {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  max-width: 48ch;
  margin-bottom: 2.5rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--gold);
  line-height: 1;
}
.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}
.hero-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
}
.hero-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-card {
  position: absolute;
  bottom: -1.5rem;
  left: -1.5rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.hero-card-icon {
  width: 48px; height: 48px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hero-card-icon svg { width: 24px; height: 24px; fill: var(--navy); }
.hero-card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--navy);
  line-height: 1;
}
.hero-card-sub { font-size: 0.8rem; color: var(--grey-mid); margin-top: 0.2rem; }

/* ── Clients / Trust Bar ── */
.trust-bar {
  background: var(--off-white);
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--grey-light);
}
.trust-inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
}
.trust-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--grey-mid);
  font-weight: 500;
  /* Was nowrap. That is fine on a wide screen where the phrase fits on one
     line, but on a 320px phone the phrase is wider than the container and
     simply runs off the edge — the letter-spacing makes it worse, because it
     is added after the final character too. Wrapping is the safe default. */
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* ── Brand bar: viewport ──
 * .trust-logos clips; .trust-logos-track is the row that moves. The track is
 * width:max-content so it never shrinks, which is what gives the animation
 * somewhere to travel.
 */
.trust-logos {
  overflow: hidden;
  min-width: 0;
}
.trust-logos-track {
  display: flex;
  align-items: center;
  /* The loop's -50% only lands exactly if the join between copy one and copy
     two is the same width as every other gap. The clone cancels that join
     gap below — see .is-clone — so the two stay in step automatically. */
  --marquee-gap: 2.75rem;
  gap: var( --marquee-gap );
  width: max-content;
  margin: 0;
  padding: 0;
}
/* Cancel the flex gap that would otherwise sit between copy one's last brand
   and copy two's first, which would put the seam half a gap off from where
   -50% lands and jump once per cycle. */
.trust-logos-track.is-clone {
  margin-left: calc( -1 * var( --marquee-gap ) );
}

/*
 * A brand chip: initials tile + wordmark, or the uploaded logo on its own.
 * The tile is a stand-in for a logo we have no right to ship, so it reads as
 * deliberate rather than as a missing image.
 */
.trust-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  /* Never let a brand be squeezed when the row is tight. */
  flex: 0 0 auto;
  color: var(--grey-text);
  opacity: 0.8;
  transition: var(--transition);
}
.trust-logo:hover { opacity: 1; color: var(--navy); }
.trust-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--grey-light);
  border-radius: 50%;
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--navy);
}
.trust-logo-name {
  font-family: var(--font-display);
  /* Bebas Neue is a condensed all-caps face, so it reads smaller than its
     nominal size. 1.6rem here lands around the visual weight of a 1.2rem
     wordmark in a normal-width face. */
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.trust-logo img {
  height: 2.75rem;
  width: auto;
  max-width: 11rem;
  object-fit: contain;
}

/* ── Brand bar: marquee ──
 *
 * Only applies once main.js has measured the row and added .is-marquee, i.e.
 * only when the brands genuinely overflow their container. A short list stays
 * still, because an animation looping over three logos reads as a glitch and
 * a third of the space is spent on a duplicated copy nobody needed.
 *
 * The row is duplicated in JS to two identical halves, so translating by
 * -50% lands exactly on the start of copy two. That is what makes the loop
 * seamless — no gap, no jump.
 */
@keyframes trust-marquee-scroll {
  from { transform: translate3d( 0, 0, 0 ); }
  to   { transform: translate3d( -50%, 0, 0 ); }
}

.js .trust-bar.is-marquee .trust-logos {
  /* Take whatever the label and the pause button leave, rather than stacking
     them — a full-width row is what gives the loop room to travel. */
  flex: 1 1 100%;
  min-width: 0;
  /* Fade the cut-off edges so brands appear and leave instead of popping. */
  -webkit-mask-image: linear-gradient( to right, transparent 0, #000 8%, #000 92%, transparent 100% );
  mask-image: linear-gradient( to right, transparent 0, #000 8%, #000 92%, transparent 100% );
}
.js .trust-bar.is-marquee .trust-logos-track:not( .is-clone ) {
  animation: trust-marquee-scroll var( --marquee-duration, 42s ) linear infinite;
}

/* Hover and keyboard focus pause the scroll. */
.js .trust-bar.is-marquee .trust-logos:hover .trust-logos-track:not( .is-clone ),
.js .trust-bar.is-marquee .trust-logos:focus-within .trust-logos-track:not( .is-clone ) {
  animation-play-state: paused;
}
/* …and so does the explicit button. */
.js .trust-bar.is-paused .trust-logos-track:not( .is-clone ) {
  animation-play-state: paused;
}

/* Pause / play control. */
.trust-marquee-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--grey-light);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  transition: var(--transition);
}
.trust-marquee-toggle:hover { border-color: var(--navy); }
/* Shown only when JS reveals it, i.e. when there is something to pause. */
.trust-marquee-toggle[hidden] { display: none; }
.trust-marquee-toggle:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
/* Two bars = pause. Triangle = play. Drawn with borders so there is no icon
   font or SVG to ship. */
.trust-marquee-toggle-icon {
  position: relative;
  display: block;
  width: 0.7rem;
  height: 0.8rem;
}
.trust-marquee-toggle-icon::before,
.trust-marquee-toggle-icon::after {
  content: '';
  position: absolute;
  top: 0;
  width: 0.22rem;
  height: 100%;
  background: var(--navy);
  transition: var(--transition);
}
.trust-marquee-toggle-icon::before { left: 0.1rem; }
.trust-marquee-toggle-icon::after  { right: 0.1rem; }
.trust-bar.is-paused .trust-marquee-toggle-icon::before {
  left: 0.1rem;
  width: 0; height: 0;
  background: transparent;
  border-left: 0.55rem solid var(--navy);
  border-top: 0.4rem solid transparent;
  border-bottom: 0.4rem solid transparent;
}
.trust-bar.is-paused .trust-marquee-toggle-icon::after { display: none; }

@media (max-width: 768px) {
  .trust-logo-name { font-size: 1.35rem; }
  .trust-logo-mark { width: 2.4rem; height: 2.4rem; font-size: 0.85rem; }
  .trust-logo img { height: 2.4rem; }
}

/*
 * A visitor who has asked for less motion gets no animation at all. The row
 * becomes a plain scroll container instead, so the brands are still all
 * reachable — with their own scrollbar rather than moving on their own.
 */
@media (prefers-reduced-motion: reduce) {
  .js .trust-bar.is-marquee .trust-logos-track { animation: none; }
  .js .trust-bar.is-marquee .trust-logos {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
    scrollbar-width: thin;
  }
}

/* Printing is the ultimate reduced-motion case, and a row frozen mid-scroll
   would print half a brand. Print one copy, unwrapped. */
@media print {
  .trust-logos { overflow: visible; }
  .trust-logos-track,
  .trust-logos-track.is-clone {
    animation: none;
    width: auto;
    flex-wrap: wrap;
    justify-content: center;
  }
  .trust-logos-track.is-clone { display: none; }
  .trust-marquee-toggle { display: none; }
}

/* ── Services Section ── */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(245,166,35,0.3);
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
  width: 56px; height: 56px;
  background: rgba(245,166,35,0.12);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.25rem;
}
.service-icon svg { width: 28px; height: 28px; fill: var(--gold); }
.service-card h3 { color: var(--navy); margin-bottom: 0.75rem; }
.service-card p { font-size: 0.95rem; }
/* min-width:0 for the same reason as the service detail blocks: a grid track
   must be allowed to shrink below the width of its widest word. */
.service-card { min-width: 0; }
.service-card .learn-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Why Choose Us ── */
.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.why-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
  position: relative;
}
.why-img img { width: 100%; height: 100%; object-fit: cover; }
.why-img-accent {
  position: absolute;
  bottom: 2rem; right: -2rem;
  background: var(--gold);
  color: var(--navy);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.why-img-accent .num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  line-height: 1;
}
.why-img-accent .sub { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.why-list { margin-top: 2rem; }
.why-item {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--grey-light);
}
.why-item:last-child { border-bottom: none; }
.why-item-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
  width: 2.5rem;
}
.why-item h4 { color: var(--navy); margin-bottom: 0.4rem; }
.why-item p { font-size: 0.92rem; }

/* ── Stats Banner ── */
.stats-banner {
  background: var(--navy);
  position: relative;
  overflow: hidden;
}
.stats-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(245,166,35,0.03) 40px,
    rgba(245,166,35,0.03) 41px
  );
}
.stats-grid {
  display: grid;
  /* minmax(0, 1fr), not 1fr. A bare 1fr is minmax(auto, 1fr), and its `auto`
     minimum is the *min-content* width of the cell — so one unbreakable label
     like "SYSTEMS INSTALLED" (uppercase, plus 0.12em of tracking) inflates the
     track and pushes the row wider than the viewport. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.stat-box {
  background: var(--navy);
  padding: 3rem 2rem;
  text-align: center;
  min-width: 0;
}
.stat-box:hover { background: var(--navy-mid); }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4vw, 4rem);
  color: var(--gold);
  line-height: 1;
  display: block;
}
.stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.5rem;
  display: block;
  /* See the stats-grid note above. */
  overflow-wrap: break-word;
}

/* ── Testimonials ── */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.testimonial-card {
  background: var(--off-white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-family: Georgia, serif;
  font-size: 6rem;
  color: var(--gold);
  opacity: 0.2;
  position: absolute;
  top: -0.5rem; left: 1.25rem;
  line-height: 1;
}
.stars { color: var(--gold); font-size: 1rem; margin-bottom: 1rem; letter-spacing: 2px; }
.testimonial-card p { font-size: 0.95rem; font-style: italic; position: relative; }
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--grey-light);
}
.author-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--navy);
  flex-shrink: 0;
}
.author-name { font-weight: 600; font-size: 0.9rem; color: var(--navy); }
.author-role { font-size: 0.8rem; color: var(--grey-mid); }

/* ── CTA Banner ── */
.cta-banner {
  background: var(--gold);
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}
.cta-banner::after {
  content: 'SOLAR';
  position: absolute;
  right: -2rem; bottom: -2rem;
  font-family: var(--font-display);
  font-size: 14rem;
  color: rgba(10,22,40,0.06);
  line-height: 1;
  pointer-events: none;
}
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
}
.cta-inner h2 { color: var(--navy); max-width: 20ch; }
.cta-inner p { color: rgba(10,22,40,0.7); margin-top: 0.75rem; }

/* ── Footer ── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 5rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 4rem;
}
.footer-brand p {
  color: rgba(255,255,255,0.5);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 30ch;
}
.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: var(--transition);
}
.footer-social a:hover { background: var(--gold); color: var(--navy); }
.footer-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--white);
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}
.footer-links li + li { margin-top: 0.75rem; }
.footer-links a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--gold); padding-left: 4px; }
.footer-contact-item {
  display: flex;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
}
.footer-contact-item svg { width: 18px; height: 18px; fill: var(--gold); flex-shrink: 0; margin-top: 2px; }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.3);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ── Page Hero (inner pages) ── */
.page-hero {
  background: var(--navy);
  padding: 10rem 0 6rem;
  position: relative;
  overflow: hidden;
}
.page-hero.has-hero-image {
  background-size: cover;
  background-position: center;
}
.page-hero.has-hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, 0.86);
  clip-path: none;
  opacity: 1;
}
.page-hero.has-hero-image .container { position: relative; z-index: 1; }
.page-hero::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40%; height: 100%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  clip-path: polygon(30% 0%, 100% 0%, 100% 100%, 0% 100%);
  opacity: 0.07;
}
.page-hero h1 { color: var(--white); }
.page-hero .breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.page-hero .breadcrumb a { color: var(--gold); }
.page-hero .breadcrumb span { color: rgba(255,255,255,0.3); }

/* ── About Page ── */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
}
.about-img img { width: 100%; height: 100%; object-fit: cover; }
.values-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.value-card {
  padding: 1.75rem;
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.value-card:hover { border-color: var(--gold); background: rgba(245,166,35,0.03); }
.value-card h4 { color: var(--navy); margin-bottom: 0.5rem; margin-top: 1rem; }
.value-icon { font-size: 2rem; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.team-card { text-align: center; }
.team-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: var(--off-white);
}
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Fallback for a team member with no Featured Image set. */
.team-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.6rem;
  letter-spacing: 0.06em;
}
.team-name { font-weight: 600; color: var(--navy); }
.team-title { font-size: 0.85rem; color: var(--gold); margin-top: 0.25rem; }

/* Optional. An admin can leave a team member's bio field empty; the card then
   ends at the role and does not gain a stray margin. */
.team-bio {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--grey-text);
  margin-top: 0.65rem;
}

/* ── Services Page ── */
/* These lived in a <style> block inside page-services.php. A page-level
   <style> ships *after* the linked stylesheet, so it outranked every rule in
   this file and could not be overridden without adding !important. */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 5rem 0;
  border-bottom: 1px solid var(--grey-light);
}
.service-detail:last-child { border-bottom: none; }
/* Flipping with `direction` reorders the two columns without a second set of
   markup. The children are flipped straight back so the text itself is not
   re-ordered — which would move any punctuation to the wrong end. */
.service-detail.reverse { direction: rtl; }
.service-detail.reverse > * { direction: ltr; }
.service-detail-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.service-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.service-detail-content h3 { color: var(--navy); margin-bottom: 1rem; }
.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--grey-text);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--grey-light);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
/* Without min-width:0 a grid track is sized by its widest unbreakable child —
   a long URL or an unbroken brand name — which pushes the whole row wider than
   the viewport instead of wrapping. */
.service-detail-content { min-width: 0; }
.feature-list, .pricing-features { min-width: 0; }

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3.5rem;
}
.pricing-card {
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  transition: var(--transition);
  position: relative;
}
.pricing-card.featured {
  background: var(--navy);
  border-color: var(--navy);
  transform: scale(1.04);
}
.pricing-card.featured h4,
.pricing-card.featured .price,
.pricing-card.featured li { color: var(--white) !important; }
.pricing-card.featured .price-sub { color: rgba(255,255,255,0.5) !important; }
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: var(--navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 100px;
  white-space: nowrap;
}
.pricing-card h4 { color: var(--navy); margin-bottom: 0.5rem; }
.price { font-family: var(--font-display); font-size: 2.5rem; color: var(--navy); }
.price-sub { font-size: 0.82rem; color: var(--grey-mid); margin-bottom: 1.5rem; }
.pricing-features { text-align: left; margin-bottom: 2rem; }
.pricing-features li {
  font-size: 0.88rem;
  color: var(--grey-text);
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--grey-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pricing-features li::before { content: '✓'; color: var(--gold); font-weight: 700; }

/* ── Gallery Page ── */
.gallery-filter {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--grey-light);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  color: var(--grey-text);
  letter-spacing: 0.05em;
}
.filter-btn.active,
.filter-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
}
.gallery-item.tall { aspect-ratio: 3/4; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,22,40,0.8), transparent);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 1.25rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay-text { color: var(--white); font-size: 0.9rem; font-weight: 500; }

/* ── Contact Page ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 5rem;
  align-items: start;
}
.contact-info-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--grey-light);
}
.contact-info-item:last-child { border-bottom: none; }
.contact-icon {
  width: 52px; height: 52px;
  background: rgba(245,166,35,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-icon svg { width: 24px; height: 24px; fill: var(--gold); }
.contact-info-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--grey-mid); margin-bottom: 0.25rem; }
.contact-info-val { font-weight: 500; color: var(--navy); }

/* ── Form Styles ── */
.contact-form { background: var(--off-white); border-radius: var(--radius-lg); padding: 2.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--grey-light);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,166,35,0.15); }
.form-group textarea { resize: vertical; min-height: 140px; }
.form-success {
  display: none;
  background: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  padding: 1rem;
  border-radius: var(--radius);
  margin-top: 1rem;
  font-size: 0.9rem;
}
.form-success.show { display: block; }

/* ── Map placeholder ── */
.map-wrap {
  width: 100%;
  height: 350px;
  background: var(--off-white);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3rem;
  border: 1px solid var(--grey-light);
  overflow: hidden;
  position: relative;
}
.map-placeholder {
  text-align: center;
  color: var(--grey-mid);
}
.map-placeholder svg { width: 48px; height: 48px; fill: var(--gold); opacity: 0.5; margin-bottom: 1rem; }

/* ── Scroll animation ──
 *
 * 📘 SCOPED TO .js ON PURPOSE.
 * These elements start at opacity:0 and rely on main.js to add .visible.
 * Unscoped, disabling JavaScript (or a failed script request) left every
 * .reveal element invisible forever — whole sections of the site silently
 * gone, not just un-animated. solarvolt_js_detection() puts a "js" class on
 * <html> before first paint, so with no JavaScript these rules never apply
 * and the content is simply shown.
 */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── WhatsApp Floating Button ── */
.wa-float {
  position: fixed;
  /* env() covers the iPhone home indicator; the plain value is the fallback
     for every other browser, which ignores the whole declaration. */
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 56px clears the 44px minimum touch target comfortably. */
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.28);
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.wa-float:hover,
.wa-float:focus-visible {
  background: #1eb855;
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(10, 22, 40, 0.34);
}
/*
 * A visible focus ring. The theme had no :focus-visible rules at all, so
 * keyboard users currently get the UA default only — and on a circle the
 * default outline is easy to lose against the green.
 */
.wa-float:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}
.wa-float-icon { width: 1.85rem; height: 1.85rem; display: block; }

/* Never print a chat button on an invoice. */
@media print {
  .wa-float { display: none !important; }
}

@media (max-width: 768px) {
  .wa-float {
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    width: 3.25rem;
    height: 3.25rem;
  }
  .wa-float-icon { width: 1.7rem; height: 1.7rem; }
}

/* Respect a stated preference for less motion. */
@media (prefers-reduced-motion: reduce) {
  .wa-float,
  .wa-float:hover,
  .wa-float:focus-visible { transition: none; }
  .wa-float:hover,
  .wa-float:focus-visible { transform: none; }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .services-grid  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .testimonials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-grid      { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid      { grid-template-columns: 1fr; }
  .hero-visual    { display: none; }
  .why-grid       { grid-template-columns: 1fr; }
  .gallery-grid   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contact-grid   { grid-template-columns: 1fr; }
  .about-intro    { grid-template-columns: 1fr; }
  /* Below this width a two-column detail block leaves each column too narrow
     for a heading, so it stacks. The reverse order has to be undone too, or
     the image lands above the text it belongs to. */
  .service-detail { grid-template-columns: 1fr; }
  .service-detail.reverse { direction: ltr; }
  .pricing-cards  { grid-template-columns: 1fr; }
  /* The +6% scale-up that makes the middle card "pop" on desktop stops making
     sense once the cards are stacked: it just nudges one card off-centre and
     eats a chunk of the viewport. */
  .pricing-card.featured { transform: none; }
}
@media (max-width: 992px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
}
@media (max-width: 768px) {
  .services-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .testimonials-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .why-img-accent { right: 1rem; }
}

/* Small phones (iPhone SE and narrower, plus a 360px Android).
   Everything above is tuned for 768px and up, where a 2rem gutter is only a
   small slice of the screen. At 320px the same 2rem eats 20% of the width
   before any content is placed, which is what tips the two-column grids and
   the stats cells over the edge. */
@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }

  /* 3rem top/bottom and 2rem left/right on a ~130px column leaves ~66px for
     the label. Trim the padding and the two-column grid fits. */
  .stat-box { padding: 1.75rem 0.75rem; }
  .stat-num { font-size: clamp(2rem, 9vw, 2.5rem); }
  .stat-label { font-size: 0.7rem; letter-spacing: 0.08em; }

  /* 0.15em of tracking across a full phrase is several characters of width
     that the phone cannot spare. */
  .trust-label { letter-spacing: 0.1em; }
  .label { letter-spacing: 0.14em; }

  /* Tracked-out uppercase buttons ("LEARN MORE →") are the other reliable
     overflow: the tracking is added after the last glyph, so the text is
     always ~1em wider than it measures. */
  .btn, .learn-more, .filter-btn { letter-spacing: 0.05em; }
  .filter-btn { padding: 0.5rem 0.9rem; }

  .service-detail { padding: 3rem 0; gap: 2rem; }
  .pricing-card { padding: 2rem 1.5rem; }
  .value-card { padding: 1.5rem; }
  .brand-bar-track { gap: 1rem; }
}
