/* ============================================
   CP Electric - Main Stylesheet
   Brand Colors: #FFFFFF, #333333, #D02128, #000000
   Fonts: Montserrat (Headings), Open Sans (Body)
   ============================================ */

/* === CSS Custom Properties === */
:root {
  --color-white: #FFFFFF;
  --color-charcoal: #333333;
  --color-red: #D02128;
  --color-black: #000000;
  --color-dark-overlay: rgba(0, 0, 0, 0.7);
  --color-light-gray: #f5f5f5;
  --color-mid-gray: #666666;
  
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease-out;
  --transition-slow: 0.3s ease;
  
  --max-width: 1200px;
  --header-height: 70px;
}

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

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

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  color: var(--color-charcoal);
  background-color: var(--color-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* === Utility Classes === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Header / Navigation === */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-black);
  height: var(--header-height);
  transition: background-color var(--transition-normal);
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
}

.header__logo img {
  height: 45px;
  width: auto;
}

.header__logo-compact {
  display: none;
}

/* Desktop Navigation */
.nav {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  gap: 30px;
}

.nav__link {
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  padding: 5px 0;
}

/* Micro-interaction: Navigation underline animation expanding from center */
.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-red);
  transition: width var(--transition-fast), left var(--transition-fast);
}

.nav__link:hover::after,
.nav__link:focus::after,
.nav__link--active::after {
  width: 100%;
  left: 0;
}

.nav__link:focus {
  outline: 2px solid var(--color-red);
  outline-offset: 4px;
}

/* Mobile Navigation Toggle */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
}

.nav__toggle-bar {
  width: 25px;
  height: 3px;
  background-color: var(--color-white);
  transition: transform var(--transition-slow), opacity var(--transition-slow);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* === Primary CTA Button === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
  transition: all var(--transition-normal);
}

.btn--primary {
  background-color: var(--color-red);
  color: var(--color-white);
  /* Micro-interaction: Subtle glow effect on hover */
  box-shadow: 0 2px 10px rgba(208, 33, 40, 0);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: #b81c22;
  transform: scale(1.02);
  box-shadow: 0 4px 20px rgba(208, 33, 40, 0.4);
}

.btn--primary:focus {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn--secondary:hover,
.btn--secondary:focus {
  background-color: var(--color-white);
  color: var(--color-charcoal);
}

.btn--dark {
  background-color: var(--color-charcoal);
  color: var(--color-white);
}

.btn--dark:hover,
.btn--dark:focus {
  background-color: var(--color-black);
}

/* === Hero Section === */
.hero {
  position: relative;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-black);
  overflow: hidden;
}

.hero__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/images/assets_images_hero-cityscape.webp');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Parallax effect */
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.75));
}

.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 60px 20px;
}

.hero__title {
  color: var(--color-white);
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero__subtitle {
  color: var(--color-white);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 35px;
  opacity: 0.95;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero__cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
}

.hero__trust {
  color: var(--color-white);
  font-size: 1.125rem;
  font-weight: 600;
}

.hero__trust a {
  color: var(--color-red);
  transition: color var(--transition-fast);
}

.hero__trust a:hover {
  color: #ff4a4a;
}

/* === Section Base Styles === */
.section {
  padding: 80px 0;
}

.section--dark {
  background-color: var(--color-charcoal);
  color: var(--color-white);
  /* Subtle texture pattern for dark sections */
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23444444' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.section--black {
  background-color: var(--color-black);
  color: var(--color-white);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23222222' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.section--light {
  background-color: var(--color-light-gray);
}

.section__header {
  text-align: center;
  margin-bottom: 50px;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 15px;
}

.section__subtitle {
  font-size: 1.0625rem;
  color: var(--color-mid-gray);
  max-width: 600px;
  margin: 0 auto;
}

.section--dark .section__subtitle,
.section--black .section__subtitle {
  color: rgba(255,255,255,0.8);
}

/* === Services Section === */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.service-card {
  background-color: var(--color-white);
  padding: 40px 30px;
  border-radius: 5px;
  text-align: center;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

/* Micro-interaction: Card lift on hover */
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-card__icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-card__icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.service-card__title {
  font-size: 1.25rem;
  margin-bottom: 15px;
  color: var(--color-charcoal);
}

.service-card__description {
  color: var(--color-mid-gray);
  margin-bottom: 20px;
  font-size: 0.9375rem;
}

.service-card__link {
  color: var(--color-red);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap var(--transition-fast);
}

.service-card__link:hover {
  gap: 10px;
}

.service-card__link::after {
  content: '\2192';
}

/* === About Section === */
.about__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about__text h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 25px;
}

.about__text p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.about__highlight {
  background-color: var(--color-red);
  color: var(--color-white);
  padding: 20px 25px;
  border-radius: 3px;
  font-weight: 600;
  margin-top: 25px;
}

.about__image {
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.about__image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* === Process Section === */
.process__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.process-step {
  text-align: center;
  padding: 30px 20px;
  position: relative;
}

.process-step__number {
  width: 50px;
  height: 50px;
  background-color: var(--color-red);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto 20px;
}

.process-step__icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Micro-interaction: Icon animation on scroll */
.process-step__icon.animate {
  opacity: 1;
  transform: translateY(0);
}

.process-step__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.process-step__title {
  font-size: 1.125rem;
  margin-bottom: 10px;
}

.process-step__description {
  font-size: 0.9375rem;
  opacity: 0.9;
}

/* Connector line between steps */
.process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 55px;
  right: -15px;
  width: 30px;
  height: 2px;
  background-color: rgba(255,255,255,0.3);
}

/* === Testimonials Section === */
.testimonials__slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  overflow: hidden;
}

.testimonials__track {
  display: flex;
  transition: transform 0.5s ease;
}

.testimonial {
  min-width: 100%;
  padding: 40px;
  text-align: center;
}

.testimonial__quote {
  font-size: 1.25rem;
  font-style: italic;
  line-height: 1.8;
  margin-bottom: 25px;
  position: relative;
}

.testimonial__quote::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--color-red);
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.3;
  font-family: Georgia, serif;
}

.testimonial__author {
  font-weight: 600;
  color: var(--color-red);
}

.testimonials__nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.testimonials__nav-btn {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-white);
  border-radius: 50%;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.testimonials__nav-btn:hover,
.testimonials__nav-btn:focus {
  background-color: var(--color-white);
  color: var(--color-charcoal);
}

.testimonials__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.testimonials__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.3);
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.testimonials__dot--active {
  background-color: var(--color-red);
}

/* === Blog Preview Section === */
.blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.blog-card {
  background-color: var(--color-white);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

/* Micro-interaction: Blog card lift on hover */
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.blog-card__image {
  height: 200px;
  overflow: hidden;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.blog-card:hover .blog-card__image img {
  transform: scale(1.05);
}

.blog-card__content {
  padding: 25px;
}

.blog-card__title {
  font-size: 1.125rem;
  margin-bottom: 10px;
  color: var(--color-charcoal);
}

.blog-card__excerpt {
  color: var(--color-mid-gray);
  font-size: 0.9375rem;
  margin-bottom: 15px;
}

.blog-card__link {
  color: var(--color-red);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap var(--transition-fast);
}

.blog-card__link:hover {
  gap: 10px;
}

.blog-card__link::after {
  content: '\2192';
}

/* === Contact Form === */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 50px;
}

.contact__info h3 {
  font-size: 1.5rem;
  margin-bottom: 25px;
}

.contact__detail {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.contact__icon {
  width: 40px;
  height: 40px;
  background-color: var(--color-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  flex-shrink: 0;
}

.contact__detail-text {
  line-height: 1.6;
}

.contact__detail-text strong {
  display: block;
  margin-bottom: 3px;
}

.contact__form {
  background-color: var(--color-white);
  padding: 40px;
  border-radius: 5px;
  box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

.form__group {
  margin-bottom: 20px;
}

.form__label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
}

.form__input,
.form__textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* Micro-interaction: Input field focus glow */
.form__input:focus,
.form__textarea:focus {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 3px rgba(208, 33, 40, 0.15);
}

.form__textarea {
  min-height: 150px;
  resize: vertical;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* === Footer === */
.footer {
  background-color: var(--color-black);
  color: var(--color-white);
  padding: 60px 0 30px;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23222222' fill-opacity='0.2'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer__logo img {
  height: 40px;
  margin-bottom: 20px;
}

.footer__description {
  opacity: 0.8;
  font-size: 0.9375rem;
  line-height: 1.7;
}

.footer__title {
  font-size: 1rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer__links li {
  margin-bottom: 12px;
}

.footer__links a {
  opacity: 0.8;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.footer__links a:hover {
  opacity: 1;
  color: var(--color-red);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
  opacity: 0.8;
}

.footer__contact-item svg {
  flex-shrink: 0;
  margin-top: 3px;
}

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.7;
}

/* === Page Header (for inner pages) === */
.page-header {
  background-color: var(--color-charcoal);
  padding: 80px 0 60px;
  text-align: center;
}

.page-header__title {
  color: var(--color-white);
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 10px;
}

.page-header__breadcrumb {
  color: rgba(255,255,255,0.7);
}

.page-header__breadcrumb a {
  color: var(--color-red);
  transition: color var(--transition-fast);
}

.page-header__breadcrumb a:hover {
  color: #ff4a4a;
}

/* === Responsive Styles === */
@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .process__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .process-step:nth-child(2)::after {
    display: none;
  }
  
  .contact__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }
  
  /* Mobile Navigation */
  .nav__toggle {
    display: flex;
  }
  
  .nav__list {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: var(--color-black);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 40px;
    gap: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all var(--transition-slow);
  }
  
  .nav__list.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .nav__item {
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  
  .nav__link {
    display: block;
    padding: 20px;
    font-size: 1rem;
  }
  
  .header__logo img {
    height: 38px;
  }
  
  .header__logo-full {
    display: none;
  }
  
  .header__logo-compact {
    display: block;
  }
  
  /* Hero adjustments */
  .hero {
    min-height: 70vh;
  }
  
  .hero__background {
    background-attachment: scroll; /* Disable parallax on mobile for performance */
  }
  
  /* Section adjustments */
  .section {
    padding: 60px 0;
  }
  
  .about__content {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .about__image {
    order: -1;
  }
  
  .process__grid {
    grid-template-columns: 1fr;
  }
  
  .process-step::after {
    display: none !important;
  }
  
  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer__contact-item {
    justify-content: center;
  }
  
  .form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero__content {
    padding: 40px 15px;
  }
  
  .hero__cta-group {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .services__grid {
    grid-template-columns: 1fr;
  }
  
  .blog__grid {
    grid-template-columns: 1fr;
  }
  
  .contact__form {
    padding: 25px;
  }
}
