/*
Theme Name: RNK Electric v2
Theme URI: https://rnkelectric.com
Author: Marano Marketing
Author URI: https://maranomarketing.com
Description: RNK Electric — ACF-powered editable theme. Licensed electrical contractors serving Montgomery, Bucks, and Delaware Counties, PA.
Version: 2.0
License: Private
Text Domain: rnk-electric
*/

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #5B7A9D;
  --blue-dark:   #344F6B;
  --blue-mid:    #4A6A8A;
  --blue-light:  #7A96B2;
  --blue-pale:   #EAF0F6;
  --yellow:      #FFD000;
  --white:       #FFFFFF;
  --off-white:   #F6F8FA;
  --light-gray:  #EAEEF2;
  --text:        #1C2B3A;
  --text-muted:  #4A6070;
  --border:      rgba(91,122,157,0.15);
  --nav-h:       88px;
  --radius:      6px;
  --radius-lg:   12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito Sans', sans-serif !important;
  background: var(--white);
  color: var(--text);
  font-size: 19px !important;
  font-weight: 400;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { font-size: 19px !important; line-height: 1.8; }
h1 { font-size: clamp(36px, 5vw, 64px) !important; font-weight: 800 !important; line-height: 1.1 !important; }
h2 { font-size: clamp(28px, 4vw, 48px) !important; font-weight: 800 !important; line-height: 1.15 !important; }
h3 { font-size: clamp(18px, 2.5vw, 24px) !important; font-weight: 800 !important; }
h4 { font-size: 17px !important; font-weight: 700 !important; }

/* ── NAV ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 56px;
  background: var(--blue-dark);
  border-bottom: 3px solid var(--yellow);
  transition: box-shadow 0.3s;
}
.nav.scrolled { box-shadow: 0 4px 32px rgba(0,0,0,0.3); }
.nav-logo img { height: 56px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a { font-size: 17px !important; font-weight: 700; letter-spacing: 0.03em; color: rgba(255,255,255,0.75); transition: color 0.2s; text-transform: uppercase; }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-cta { padding: 13px 28px !important; background: var(--yellow) !important; color: var(--blue-dark) !important; border-radius: var(--radius) !important; font-size: 15px !important; font-weight: 800 !important; text-transform: uppercase !important; transition: background 0.2s !important; }
.nav-cta:hover { background: #ffe033 !important; color: var(--blue-dark) !important; }

/* Hamburger */
.nav-hamburger { display: none; flex-direction: column; gap: 6px; cursor: pointer; background: none; border: none; padding: 4px; }
.nav-hamburger span { display: block; width: 28px; height: 2px; background: rgba(255,255,255,0.8); border-radius: 2px; transition: all 0.3s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile drawer */
.nav-drawer {
  display: none; position: fixed;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--blue-dark);
  border-bottom: 3px solid var(--yellow);
  z-index: 499; padding: 24px;
  flex-direction: column; gap: 4px;
}
.nav-drawer.open { display: flex; }
.nav-drawer a { font-size: 17px !important; font-weight: 700; color: rgba(255,255,255,0.8); padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.08); text-transform: uppercase; letter-spacing: 0.03em; }
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer a:hover { color: var(--yellow); }
.nav-drawer .drawer-cta { margin-top: 12px; background: var(--yellow); color: var(--blue-dark) !important; text-align: center; border-radius: var(--radius); padding: 16px !important; font-weight: 800 !important; border-bottom: none !important; }

/* ── TICKER ── */
.ticker-wrap {
  width: 100%;
  background: var(--blue-mid);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  padding: 14px 0;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 0;
  animation: ticker-scroll 30s linear infinite;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0 48px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.ticker-item svg { width: 18px; height: 18px; stroke: var(--yellow); fill: none; flex-shrink: 0; }
.ticker-item span { font-size: 16px !important; font-weight: 700; color: rgba(255,255,255,0.85); }

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 15px 34px; border-radius: var(--radius); font-family: 'Nunito Sans', sans-serif; font-size: 15px !important; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; cursor: pointer; border: none; transition: all 0.2s; text-decoration: none; }
.btn-yellow { background: var(--yellow); color: var(--blue-dark); }
.btn-yellow:hover { background: #ffe033; transform: translateY(-1px); }
.btn-blue { background: var(--blue-dark); color: #fff; }
.btn-blue:hover { background: var(--blue-mid); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid rgba(255,255,255,0.35); color: #fff; }
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-outline-dark { background: transparent; border: 2px solid var(--border); color: var(--text); }
.btn-outline-dark:hover { border-color: var(--blue); color: var(--blue-dark); }

/* ── SECTION SHARED ── */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px !important; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); margin-bottom: 12px; }
.eyebrow::before { content: ''; display: block; width: 20px; height: 2px; background: var(--yellow); flex-shrink: 0; border-radius: 2px; }
.eyebrow.light { color: rgba(255,255,255,0.6); }
.eyebrow.light::before { background: var(--yellow); }

.section-heading { font-size: clamp(30px, 4vw, 50px) !important; font-weight: 800 !important; line-height: 1.12 !important; color: var(--text); }
.section-heading.light { color: #fff; }
.section-heading em { font-style: normal; color: var(--blue); }
.section-heading.light em { color: var(--yellow); }
.section-sub { font-size: 19px !important; font-weight: 300; color: var(--text-muted); line-height: 1.8; margin-top: 16px; }
.section-sub.light { color: rgba(255,255,255,0.65); }

/* ── PAGE HERO ── */
.page-hero { padding-top: var(--nav-h); background: var(--blue-dark); padding-bottom: 72px; padding-left: 56px; padding-right: 56px; position: relative; }
.page-hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 4px; background: var(--yellow); }
.page-hero-inner { padding-top: 64px; max-width: 720px; }
.page-hero-breadcrumb { font-size: 14px !important; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); margin-bottom: 20px; }
.page-hero-breadcrumb a { color: var(--yellow); }
.page-hero-breadcrumb span { color: rgba(255,255,255,0.2); margin: 0 8px; }

/* ── FOOTER ── */
.footer { background: var(--blue-dark); padding: 80px 56px 40px; border-top: 4px solid var(--yellow); }
.footer-top { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 56px; padding-bottom: 56px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 32px; }
.footer-brand img { height: 52px; width: auto; margin-bottom: 18px; }
.footer-brand p { font-size: 16px !important; font-weight: 300; color: rgba(255,255,255,0.5); line-height: 1.75; max-width: 260px; margin-bottom: 24px; }
.footer-contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.footer-contact-item svg { width: 16px; height: 16px; stroke: var(--yellow); fill: none; flex-shrink: 0; }
.footer-contact-item a, .footer-contact-item span { font-size: 16px !important; font-weight: 400; color: rgba(255,255,255,0.65); transition: color 0.2s; }
.footer-contact-item a:hover { color: #fff; }
.footer-col h4 { font-size: 13px !important; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--yellow); margin-bottom: 20px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col ul a { font-size: 16px !important; font-weight: 400; color: rgba(255,255,255,0.6); transition: color 0.2s; }
.footer-col ul a:hover { color: #fff; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: 14px !important; font-weight: 400; color: rgba(255,255,255,0.3); }
.footer-bottom a { color: rgba(255,255,255,0.4); transition: color 0.2s; }
.footer-bottom a:hover { color: var(--yellow); }
.footer-social { display: flex; gap: 12px; margin-top: 20px; }
.footer-social a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: all 0.2s; }
.footer-social a:hover { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.06); }
.footer-social svg { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; fill: rgba(255,255,255,0.6); flex-shrink: 0; }

/* ── ANIMATIONS ── */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.6s ease forwards; }
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.25s; opacity: 0; }
.delay-3 { animation-delay: 0.4s; opacity: 0; }
.delay-4 { animation-delay: 0.55s; opacity: 0; }

/* ── CARD GRID ── */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; border-top: 3px solid var(--blue-pale); transition: border-top-color 0.2s, box-shadow 0.2s; }
.card:hover { border-top-color: var(--blue); box-shadow: 0 4px 24px rgba(91,122,157,0.12); }
.card h3 { font-size: 21px !important; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.card p { font-size: 17px !important; font-weight: 300; color: var(--text-muted); line-height: 1.75; }

/* ── STATS BAR ── */
.stats-bar { background: var(--blue-mid); display: flex; align-items: stretch; width: 100%; border-bottom: 1px solid rgba(255,255,255,0.08); }
.stat-item { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 32px 0; flex: 1; border-right: 1px solid rgba(255,255,255,0.1); }
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 52px !important; font-weight: 800; color: var(--yellow); line-height: 1; }
.stat-label { font-size: 15px !important; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: rgba(255,255,255,0.65); line-height: 1.4; }

/* ── MOBILE ── */
@media (max-width: 960px) {
  :root { --nav-h: 72px; }
  .nav { padding: 0 20px; }
  .nav-links-wrap { display: none; }
  .nav-hamburger { display: flex; }
  .footer { padding: 56px 24px 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 36px; }
  .page-hero { padding-left: 24px; padding-right: 24px; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .stats-bar { flex-wrap: wrap; }
  .stat-item { flex: 0 0 50%; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 24px 16px; }
  body { font-size: 17px !important; }
  p { font-size: 17px !important; }
}
@media (max-width: 600px) {
  .footer-top { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-item { flex: 0 0 100%; }
  h1 { font-size: clamp(30px, 8vw, 44px) !important; }
  h2 { font-size: clamp(24px, 6vw, 36px) !important; }
  .page-hero-inner { padding-top: 40px; }
  .nav-logo img { height: 44px; }
}

/* ── GLOBAL SVG SAFETY ── */
svg { max-width: 100%; flex-shrink: 0; }
.ticker-item svg { width: 18px !important; height: 18px !important; max-width: 18px !important; }
.footer-social svg { width: 18px !important; height: 18px !important; max-width: 18px !important; }
.footer-social a { overflow: hidden; }

/* ══════════════════════════════════════
   CRITICAL LAYOUT — cannot be inline
   ══════════════════════════════════════ */

/* HERO */
.hero-section {
  padding-top: var(--nav-h);
  background: var(--blue-dark);
  position: relative;
  overflow: hidden;
  min-height: 90vh;
  display: flex;
  align-items: center;
}
.hero-slides-wrap {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  opacity: 0;
  transition: opacity 1.5s ease;
}
.hero-slide.active { opacity: 0.22; }
.hero-yellow-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: var(--yellow);
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 80px 56px;
  width: 100%;
  max-width: 820px;
  margin-left: 8%;
}
.hero-headline { color: #fff !important; }
.hero-sub { color: rgba(255,255,255,0.75) !important; font-size: 19px !important; line-height: 1.8 !important; margin-top: 16px !important; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }
.hero-phone-wrap { display: flex; align-items: center; gap: 16px; margin-top: 48px; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.12); }
.hero-phone-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-phone-icon svg { width: 20px; height: 20px; stroke: var(--yellow); fill: none; }
.hero-phone-label { font-size: 12px !important; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.4); display: block; margin-bottom: 4px; }
.hero-phone-num { font-size: 26px !important; font-weight: 800; color: #fff; display: block; }
.hero-phone-num:hover { color: var(--yellow); }

/* STATS BAR */
.stats-bar { background: var(--blue-mid) !important; display: flex !important; align-items: stretch !important; width: 100% !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; }
.stat-item { display: flex !important; align-items: center !important; justify-content: center !important; gap: 16px !important; padding: 32px 0 !important; flex: 1 !important; border-right: 1px solid rgba(255,255,255,0.1) !important; }
.stat-item:last-child { border-right: none !important; }
.stat-num { font-size: 52px !important; font-weight: 800 !important; color: var(--yellow) !important; line-height: 1 !important; }
.stat-label { font-size: 15px !important; font-weight: 700 !important; letter-spacing: 0.05em !important; text-transform: uppercase !important; color: rgba(255,255,255,0.65) !important; line-height: 1.4 !important; }

/* TICKER */
.ticker-wrap { width: 100% !important; background: var(--blue-mid) !important; overflow: hidden !important; padding: 14px 0 !important; border-bottom: 1px solid rgba(255,255,255,0.08) !important; }
.ticker-track { display: flex !important; align-items: center !important; animation: ticker-scroll 30s linear infinite !important; width: max-content !important; }
.ticker-track:hover { animation-play-state: paused !important; }
.ticker-item { display: flex !important; align-items: center !important; gap: 10px !important; padding: 0 48px !important; white-space: nowrap !important; border-right: 1px solid rgba(255,255,255,0.12) !important; }
.ticker-item svg { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; stroke: var(--yellow) !important; fill: none !important; flex-shrink: 0 !important; }
.ticker-item span { font-size: 16px !important; font-weight: 700 !important; color: rgba(255,255,255,0.85) !important; white-space: nowrap !important; }

/* CARD GRID */
.card-grid { display: grid !important; grid-template-columns: repeat(3,1fr) !important; gap: 24px !important; }
.card { background: #fff !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg) !important; padding: 36px 32px !important; border-top: 3px solid var(--blue-pale) !important; transition: border-top-color 0.2s, box-shadow 0.2s !important; display: block !important; }
.card:hover { border-top-color: var(--blue) !important; box-shadow: 0 4px 24px rgba(91,122,157,0.12) !important; }
.card h3 { font-size: 21px !important; font-weight: 800 !important; color: var(--text) !important; margin-bottom: 12px !important; }
.card p { font-size: 17px !important; font-weight: 300 !important; color: var(--text-muted) !important; line-height: 1.75 !important; }

/* PAGE SECTIONS */
.section-white { background: #fff !important; padding: 96px 56px !important; }
.section-gray { background: var(--off-white) !important; padding: 96px 56px !important; }
.section-dark { background: var(--blue-dark) !important; padding: 80px 56px !important; border-top: 4px solid var(--yellow) !important; }
.section-center { text-align: center !important; }
.section-flex-end { display: flex !important; align-items: flex-end !important; justify-content: space-between !important; margin-bottom: 56px !important; gap: 32px !important; flex-wrap: wrap !important; }

/* FOOTER SOCIAL */
.footer-social svg { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; }
.footer-social a { width: 40px !important; height: 40px !important; overflow: hidden !important; }

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero-content { padding: 60px 24px; margin-left: 0; max-width: 100%; }
  .card-grid { grid-template-columns: 1fr 1fr !important; }
  .section-white, .section-gray, .section-dark { padding: 60px 24px !important; }
  .hero-section { min-height: 70vh; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr !important; }
  .stat-item { flex: 0 0 100% !important; border-right: none !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important; }
  .hero-section { min-height: 60vh; }
}

/* HOMEPAGE SPECIFIC */
.card-link { display:inline-block; margin-top:18px; font-size:13px !important; font-weight:700; letter-spacing:0.06em; text-transform:uppercase; color:var(--blue-dark); border-bottom:2px solid var(--yellow); padding-bottom:2px; }

.home-gallery { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.home-gallery-tall { overflow:hidden; border-radius:var(--radius-lg); }
.home-gallery-tall img { width:100%; height:100%; object-fit:cover; display:block; min-height:500px; }
.home-gallery-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.home-gallery-img { overflow:hidden; border-radius:var(--radius-lg); }
.home-gallery-img img { width:100%; height:240px; object-fit:cover; display:block; transition:transform 0.4s; }
.home-gallery-img:hover img { transform:scale(1.04); }

.review-card { border-top-color:var(--yellow) !important; }
.review-stars { display:flex; gap:4px; margin-bottom:16px; }
.review-text { font-style:italic !important; margin-bottom:20px !important; }
.review-name { font-size:16px !important; font-weight:700; color:var(--text); }
.review-loc { font-size:14px !important; color:var(--text-muted); margin-top:3px; }

.about-strip { display:grid !important; grid-template-columns:1fr 1fr !important; gap:64px !important; align-items:center !important; }
.about-strip-left {}
.about-strip-text { font-size:19px !important; font-weight:300; color:rgba(255,255,255,0.65); line-height:1.8; margin-top:20px; }
.about-strip-stats { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.about-stat-box { background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.1); border-radius:var(--radius-lg); padding:28px 24px; }
.about-stat-num { font-size:40px !important; font-weight:800; color:var(--yellow); line-height:1; }
.about-stat-label { font-size:13px !important; font-weight:700; color:rgba(255,255,255,0.55); margin-top:8px; text-transform:uppercase; letter-spacing:0.06em; }

.cta-buttons { display:flex; gap:14px; justify-content:center; flex-wrap:wrap; margin-top:40px; }

/* Update hero slideshow JS target */
.hero-slide { position:absolute !important; inset:0 !important; background-size:cover !important; background-position:center !important; background-repeat:no-repeat !important; opacity:0 !important; transition:opacity 1.5s ease !important; }
.hero-slide.active { opacity:0.22 !important; }

@media(max-width:960px) {
  .about-strip { grid-template-columns:1fr !important; }
  .home-gallery { grid-template-columns:1fr !important; }
  .home-gallery-tall img { min-height:280px; }
}

/* ══════════════════════════════════
   NUCLEAR SVG PREVENTION
   This has caused the black blob issue
   repeatedly — this rule is the final fix.
   ══════════════════════════════════ */
svg {
  max-width: 100% !important;
  height: auto !important;
  flex-shrink: 0 !important;
}
/* Specific small icon contexts */
.hero-phone-icon svg,
.footer-contact-item svg,
.ticker-item svg,
.footer-social svg,
.accordion-icon svg,
.trust-item svg,
.svc-photo-break svg,
.detail-item svg,
.pledge-icon svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
}
.footer-social svg { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; }
.ticker-item svg { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; }
/* Prevent any SVG from being a block-level blob */
svg:not([width]):not([height]) { width: 24px !important; height: 24px !important; }
