/* ============================================================
   SWITCH SMART ELECTRICAL CONTRACTORS
   main.css — Base styles, layout, typography, components
   ============================================================ */

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

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

:root {
  --red:        #c41230;
  --red-dark:   #a00e26;
  --black:      #1a1a1a;
  --dark:       #2b2b2b;
  --mid:        #555555;
  --light:      #888888;
  --border:     #dddddd;
  --bg:         #f5f5f5;
  --white:      #ffffff;

  --font:       'Open Sans', sans-serif;
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

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

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

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s var(--ease-out);
}

.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-top {
  display: flex;
  align-items: stretch;
  height: 70px;
  padding: 0 30px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 40px;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.nav-logo:hover { opacity: 0.85; }

.nav-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.nav-logo-text .brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
}
.nav-logo-text .tagline {
  font-size: 10px;
  color: var(--light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Main nav links */
.nav-main {
  display: flex;
  align-items: stretch;
  flex: 1;
}

.nav-main > li {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-main > li > a {
  display: flex;
  align-items: center;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dark);
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
  cursor: pointer;
}

.nav-main > li > a:hover,
.nav-main > li.active > a {
  color: var(--red);
  border-bottom-color: var(--red);
}

/* Dropdown */
.dropdown {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.22s var(--ease-out),
              transform 0.22s var(--ease-out);
}

.nav-main > li:hover > .dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown li a {
  display: block;
  padding: 11px 20px;
  font-size: 12px;
  color: var(--dark);
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.dropdown li:last-child a { border-bottom: none; }
.dropdown li a:hover {
  background: #f8f8f8;
  color: var(--red);
  padding-left: 26px;
}

/* Right side */
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}

.nav-phone {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  transition: color 0.2s;
}
.nav-phone:hover { color: var(--red); }

.nav-contact-btn {
  background: var(--red);
  color: var(--white);
  padding: 10px 22px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s, transform 0.15s;
}
.nav-contact-btn:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  margin-top: 70px;
  position: relative;
  width: 100%;
  height: 560px;
  overflow: hidden;
  background: #1a1a1a;
}

.hero-photo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.45) 100%),
    linear-gradient(160deg, #0d1a0d 0%, #1a2a1a 25%, #1a1a2a 55%, #1a1a1a 100%);
}

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 80px 80px;
}

.hero-red-bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--red);
}

.hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0 40px 60px;
  max-width: 760px;
}

.hero-headline {
  font-size: 52px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.hero-sub {
  font-size: 16px;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  max-width: 540px;
  margin-bottom: 28px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: gap 0.3s var(--ease-out);
}
.hero-cta:hover { gap: 20px; }

.hero-cta-arrow {
  width: 30px;
  height: 1px;
  background: var(--red);
  position: relative;
  transition: width 0.3s var(--ease-out);
  flex-shrink: 0;
}
.hero-cta-arrow::after {
  content: '';
  position: absolute;
  right: 0; top: -4px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 7px solid var(--red);
}
.hero-cta:hover .hero-cta-arrow { width: 44px; }

/* ============================================================
   THREE PANELS
   ============================================================ */

.three-panels {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.3fr;
  border-top: 4px solid var(--red);
}

.panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: background 0.25s;
  cursor: pointer;
}
.panel:last-child { border-right: none; }
.panel:hover { background: #fafafa; }

.panel-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.panel-img-placeholder svg {
  transition: transform 0.5s var(--ease-out), opacity 0.3s;
}
.panel:hover .panel-img-placeholder svg {
  transform: scale(1.08);
  opacity: 0.25;
}

/* Red solid panel (middle) */
.panel-red {
  background: var(--red);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px 32px;
  transition: background 0.25s;
}
.panel:hover .panel-red { background: var(--red-dark); }

.panel-body {
  padding: 28px 32px 36px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--light);
  margin-bottom: 10px;
}
.panel-eyebrow.light { color: rgba(255,255,255,0.6); }

.panel-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--black);
  margin-bottom: 12px;
  transition: color 0.2s;
}
.panel-title.light { color: var(--white); font-size: 28px; }
.panel:hover .panel-title { color: var(--red); }
.panel:hover .panel-title.light { color: var(--white); }

.panel-desc {
  font-size: 13px;
  line-height: 1.75;
  color: var(--mid);
  flex: 1;
}
.panel-desc.light { color: rgba(255,255,255,0.75); }

.panel-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  border-bottom: 1px solid var(--red);
  padding-bottom: 2px;
  transition: color 0.2s, padding-left 0.2s;
}
.panel-link:hover { padding-left: 4px; }
.panel-link.light {
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

/* ============================================================
   SERVICES SECTION
   ============================================================ */

.services-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.services-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
}

.services-left {
  padding: 70px 40px;
  border-right: 1px solid var(--border);
}

.services-left .section-title { margin-bottom: 20px; }

.services-left p {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.75;
  margin-bottom: 28px;
}

.view-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red);
  transition: gap 0.25s var(--ease-out);
}
.view-link:hover { gap: 14px; }

.services-grid {
  padding: 70px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.service-item {
  padding: 28px 24px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, transform 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.service-item::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--red);
  transition: width 0.35s var(--ease-out);
}
.service-item:hover::before { width: 100%; }
.service-item:hover { background: var(--white); }

.service-item:nth-child(3n) { border-right: none; }
.service-item:nth-child(n+4) { border-bottom: none; }

.service-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  opacity: 0.6;
}

.service-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
  transition: color 0.2s;
}
.service-item:hover .service-name { color: var(--red); }

.service-desc {
  font-size: 12px;
  color: var(--mid);
  line-height: 1.7;
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */

.projects-section { background: var(--white); }

.section-wrap { padding: 70px 40px; }

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 8px;
  line-height: 1.2;
}

.section-intro {
  font-size: 14px;
  color: var(--mid);
  max-width: 640px;
  line-height: 1.75;
  margin-bottom: 36px;
}

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 28px;
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: gap 0.25s var(--ease-out);
}
.view-all-link:hover { gap: 14px; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.project-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #1a1a1a;
  display: block;
}

.project-thumb-bg {
  position: absolute;
  inset: 0;
  transition: transform 0.6s var(--ease-out);
}
.project-thumb:hover .project-thumb-bg { transform: scale(1.07); }

.pt-bg-1 { background: linear-gradient(135deg, #1a1f18 0%, #2e3828 100%); }
.pt-bg-2 { background: linear-gradient(135deg, #18191f 0%, #252632 100%); }
.pt-bg-3 { background: linear-gradient(135deg, #1a1010 0%, #2e1e1e 100%); }
.pt-bg-4 { background: linear-gradient(135deg, #101a10 0%, #1e2e1e 100%); }

.project-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 55%);
  transition: opacity 0.3s;
}
.project-thumb:hover .project-thumb-overlay { opacity: 0.9; }

.project-thumb-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px;
  transform: translateY(4px);
  transition: transform 0.3s var(--ease-out);
}
.project-thumb:hover .project-thumb-info { transform: translateY(0); }

.project-thumb-sector {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 4px;
}

.project-thumb-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
}

/* Red border bottom on hover */
.project-thumb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--red);
  transition: width 0.4s var(--ease-out);
}
.project-thumb:hover::after { width: 100%; }

/* ============================================================
   ABOUT BANNER
   ============================================================ */

.about-banner {
  background: var(--dark);
  padding: 80px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-banner-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 20px;
}

.about-banner-body {
  font-size: 14px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.85;
  margin-bottom: 28px;
}

.about-banner-link {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--red);
  padding: 14px 32px;
  transition: background 0.2s, transform 0.15s;
}
.about-banner-link:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.about-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.pillar {
  border-left: 3px solid var(--red);
  padding-left: 18px;
  transition: border-color 0.2s;
}
.pillar:hover { border-color: #ff4466; }

.pillar-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 6px;
}

.pillar-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
}

/* ============================================================
   NEWS SECTION
   ============================================================ */

.news-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.news-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
}

.news-left {
  padding: 70px 40px;
  border-right: 1px solid var(--border);
}

.news-left .section-title { margin-bottom: 20px; }

.news-list { border-top: 1px solid var(--border); }

.news-item {
  display: flex;
  gap: 24px;
  padding: 22px 40px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
  position: relative;
}
.news-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--red);
  transition: width 0.3s var(--ease-out);
}
.news-item:hover::before { width: 3px; }
.news-item:hover { background: #eeeeee; }

.news-date {
  font-size: 12px;
  color: var(--light);
  flex-shrink: 0;
  min-width: 100px;
  padding-top: 2px;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--black);
  transition: color 0.2s;
}
.news-item:hover .news-title { color: var(--red); }
.news-title::after { content: ' »'; color: var(--red); }

/* ============================================================
   FOOTER
   ============================================================ */

footer {
  background: var(--dark);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  border-top: 4px solid var(--red);
}

.footer-top {
  display: grid;
  grid-template-columns: 260px 1fr 1fr 1fr 1fr;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  padding: 48px 36px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.footer-logo img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.footer-logo-text .brand {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
}
.footer-logo-text .sub {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer-address {
  font-size: 12px;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.4);
}
.footer-address a {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
}
.footer-address a:hover { color: var(--white); }

.footer-col {
  padding: 48px 28px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-col:last-child { border-right: none; }

.footer-col-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-col ul li { margin-bottom: 8px; }

.footer-col ul a {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s, padding-left 0.2s;
  display: inline-block;
}
.footer-col ul a:hover {
  color: var(--white);
  padding-left: 4px;
}

.footer-social {
  display: flex;
  gap: 20px;
  padding: 20px 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.social-link {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.2s;
}
.social-link:hover { color: var(--white); }

.footer-bottom {
  padding: 20px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
}
.footer-bottom-links a {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  transition: color 0.2s;
}
.footer-bottom-links a:hover { color: rgba(255, 255, 255, 0.6); }
