/* ============================================================
   Carson Range Electric — Shared Stylesheet
   ============================================================ */

/* Google Fonts are loaded via <link> in each HTML file */

/* -------------------------------------------------------
   CSS Variables
------------------------------------------------------- */
:root {
  --color-primary: hsl(45, 100%, 51%);        /* amber/safety yellow */
  --color-primary-hover: hsl(45, 100%, 45%);
  --color-primary-fg: hsl(222, 47%, 11%);      /* dark navy text on yellow */
  --color-secondary: hsl(222, 47%, 11%);       /* dark navy */
  --color-secondary-fg: #ffffff;
  --color-destructive: hsl(0, 84%, 60%);
  --color-destructive-fg: #ffffff;
  --color-bg: #ffffff;
  --color-fg: hsl(222, 47%, 11%);

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --green-50: #f0fdf4;
  --green-200: #bbf7d0;
  --green-700: #15803d;
  --green-800: #166534;

  --red-50: #fef2f2;
  --red-200: #fecaca;
  --red-900: #7f1d1d;

  --yellow-300: #fde047;
  --yellow-400: #facc15;

  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  --radius: 0.25rem;
  --container-max: 1280px;
  --nav-height: 5rem; /* 80px */
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-fg);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; background: none; }

/* -------------------------------------------------------
   Layout Utilities
------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .container { padding-left: 1.5rem; padding-right: 1.5rem; }
}

main { flex: 1; }

/* -------------------------------------------------------
   Header & Navigation
------------------------------------------------------- */
.site-header {
  background: var(--color-secondary);
  color: var(--color-secondary-fg);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  background: var(--color-primary);
  color: var(--color-primary-fg);
  padding: 6px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.logo:hover .logo-icon { background: var(--yellow-400); }

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Desktop nav */
.desktop-nav {
  display: none;
  align-items: center;
  gap: 2rem;
  font-weight: 500;
}

@media (min-width: 1024px) {
  .desktop-nav { display: flex; }
}

.desktop-nav a {
  color: #fff;
  text-decoration: none;
  transition: color 0.15s;
  padding: 2rem 0;
  display: inline-flex;
  align-items: center;
}

.desktop-nav a:hover { color: var(--color-primary); }

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  padding: 2rem 0;
  transition: color 0.15s;
  white-space: nowrap;
}

.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn { color: var(--color-primary); }

.nav-dropdown-btn svg { transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-btn svg { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 0.375rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  overflow: hidden;
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--color-fg);
  font-size: 0.95rem;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.dropdown-menu a:hover {
  background: var(--slate-50);
  color: var(--color-primary-fg);
}

/* Desktop CTA button */
.header-cta {
  display: none;
}

@media (min-width: 1024px) {
  .header-cta { display: flex; }
}

/* Hamburger button */
.hamburger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding: 0.5rem;
  transition: color 0.15s;
}

.hamburger-btn:hover { color: var(--color-primary); }

@media (min-width: 1024px) {
  .hamburger-btn { display: none; }
}

/* Mobile menu */
.mobile-menu {
  display: none;
  background: var(--color-secondary);
  border-top: 1px solid var(--slate-800);
}

.mobile-menu.open { display: block; }

.mobile-menu-inner {
  padding: 1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-label {
  color: var(--slate-400);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.mobile-menu a {
  color: var(--color-secondary-fg);
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  display: block;
  transition: color 0.15s;
}

.mobile-menu a:hover { color: var(--color-primary); }

.mobile-menu-divider {
  border-top: 1px solid var(--slate-800);
  padding-top: 1rem;
}

.mobile-cta { padding-top: 0.5rem; padding-bottom: 0.25rem; }

/* -------------------------------------------------------
   Buttons
------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s, transform 0.1s;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}
.btn-primary:hover { background: var(--yellow-400); }

.btn-white {
  background: #fff;
  color: var(--color-secondary);
}
.btn-white:hover { background: var(--slate-100); }

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); }

.btn-sm  { height: 2.5rem;  padding: 0 1.25rem; font-size: 0.875rem; }
.btn-md  { height: 2.75rem; padding: 0 1.5rem;  font-size: 1rem; }
.btn-lg  { height: 3.5rem;  padding: 0 2rem;    font-size: 1.125rem; }
.btn-xl  { height: 4rem;    padding: 0 2rem;    font-size: 1.25rem; }
.btn-full { width: 100%; }

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */
.site-footer {
  background: var(--slate-900);
  color: var(--slate-300);
  padding: 4rem 0 0;
  border-top: 6px solid var(--color-primary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
}

.footer-brand .logo-icon {
  background: var(--color-primary);
  color: var(--color-primary-fg);
}

.footer-brand .logo-text { color: #fff; }

.footer-logo { margin-bottom: 1.5rem; }

.footer-contact { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-contact a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s;
}

.footer-phone {
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-phone:hover { color: var(--color-primary); }

.footer-email { color: var(--slate-300); }
.footer-email:hover { color: #fff; }

.footer-col h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 1.25rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-col a {
  color: var(--slate-300);
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }
}

.footer-disclaimer {
  color: var(--slate-500);
  font-size: 0.875rem;
  max-width: 48rem;
  line-height: 1.6;
}

.footer-copy {
  color: var(--slate-500);
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

/* -------------------------------------------------------
   Page Header Sections
------------------------------------------------------- */

/* Light header (most pages) */
.page-header {
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .page-header { padding: 4rem 0; }
}

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.15;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .page-header h1 { font-size: 3rem; }
}

.page-header p {
  font-size: 1.15rem;
  color: var(--slate-600);
  max-width: 48rem;
}

/* Dark header (contact, emergency) */
.page-header-dark {
  background: var(--color-secondary);
  color: #fff;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .page-header-dark { padding: 4rem 0; }
}

.page-header-dark h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .page-header-dark h1 { font-size: 3rem; }
}

.page-header-dark p {
  font-size: 1.15rem;
  color: var(--slate-300);
  max-width: 48rem;
}

/* Red header (emergency) */
.page-header-red {
  background: var(--color-destructive);
  color: #fff;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .page-header-red { padding: 4rem 0; }
}

.page-header-red h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .page-header-red h1 { font-size: 3rem; }
}

.page-header-red p {
  font-size: 1.15rem;
  color: hsl(0, 84%, 90%);
  max-width: 40rem;
  margin-bottom: 2rem;
}

/* -------------------------------------------------------
   Hero Section (homepage)
------------------------------------------------------- */
.hero {
  background: var(--color-secondary);
  color: #fff;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .hero { padding: 6rem 0; }
}

.hero-badge {
  display: inline-block;
  background: var(--color-primary);
  color: var(--color-primary-fg);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero h1 { font-size: 3.5rem; }
}
@media (min-width: 1024px) {
  .hero h1 { font-size: 4rem; }
}

.hero p {
  font-size: 1.2rem;
  color: var(--slate-300);
  margin-bottom: 2rem;
  max-width: 40rem;
  line-height: 1.7;
}

@media (min-width: 768px) {
  .hero p { font-size: 1.4rem; }
}

.hero-btns {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 36rem;
}

@media (min-width: 480px) {
  .hero-btns { flex-direction: row; flex-wrap: wrap; }
}

/* -------------------------------------------------------
   Content Section (two-column layout)
------------------------------------------------------- */
.content-section {
  padding: 4rem 0;
  background: #fff;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .content-grid { grid-template-columns: 2fr 1fr; gap: 5rem; }
}

/* Wide sidebar variant (home page) */
.content-grid-home {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .content-grid-home { grid-template-columns: 7fr 5fr; gap: 5rem; }
}

/* Contact page */
.content-grid-contact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .content-grid-contact { grid-template-columns: 7fr 5fr; gap: 5rem; }
}

/* -------------------------------------------------------
   Prose / Body Copy
------------------------------------------------------- */
.prose {
  color: var(--color-fg);
}

.prose p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  color: var(--slate-700);
}

.prose h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-secondary);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.prose h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose a {
  color: var(--color-secondary);
  font-weight: 700;
  text-decoration: none;
}

.prose a:hover { text-decoration: underline; }

.prose .cta-line {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-secondary);
  margin-top: 2rem;
}

.prose .alert-box {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  color: var(--red-900);
  padding: 1rem 1.25rem;
  border-radius: 0.375rem;
  font-weight: 700;
  margin: 1.5rem 0;
  line-height: 1.6;
}

/* -------------------------------------------------------
   Sidebar Form Box
------------------------------------------------------- */
.sidebar-form-box {
  background: var(--slate-50);
  border-top: 6px solid var(--color-primary);
  border-radius: 0 0 0.375rem 0.375rem;
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

.sidebar-form-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-secondary);
  margin-bottom: 0.4rem;
}

.sidebar-form-box p {
  font-size: 0.95rem;
  color: var(--slate-600);
  margin-bottom: 1.25rem;
}

/* Emergency sidebar (dark) */
.sidebar-dark-box {
  background: var(--color-secondary);
  color: #fff;
  padding: 2rem;
  border-radius: 0.375rem;
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}

.sidebar-dark-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.sidebar-dark-box p {
  color: var(--slate-300);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

/* -------------------------------------------------------
   Contact Form
------------------------------------------------------- */
.contact-form {
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 0.375rem;
  padding: 1.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.form-field { display: flex; flex-direction: column; gap: 0.35rem; }

.form-field label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--slate-700);
}

.form-field input,
.form-field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-fg);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 0 0.75rem;
  height: 3rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px hsla(45, 100%, 51%, 0.15);
}

.form-field textarea {
  height: auto;
  min-height: 7.5rem;
  padding: 0.75rem;
  resize: vertical;
}

.form-full { margin-bottom: 2rem; }

.form-submit-btn {
  width: 100%;
  height: 3.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--color-secondary);
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font-body);
}

.form-submit-btn:hover { background: hsl(222, 47%, 18%); }

.form-success {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  border-radius: 0.375rem;
  padding: 2rem;
  text-align: center;
}

.form-success h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-800);
  margin-bottom: 0.5rem;
}

.form-success p {
  color: var(--green-700);
  font-size: 1rem;
}

/* -------------------------------------------------------
   Homepage Sidebar (emergency box)
------------------------------------------------------- */
.emergency-box {
  background: var(--color-secondary);
  color: #fff;
  padding: 1.5rem;
  border-radius: 0.375rem;
  margin-top: 1.5rem;
}

.emergency-box h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.emergency-box p {
  color: var(--slate-300);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* -------------------------------------------------------
   About Page Boxes
------------------------------------------------------- */
.about-boxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

@media (min-width: 640px) {
  .about-boxes { grid-template-columns: 1fr 1fr; }
}

.about-box {
  background: var(--slate-50);
  border-left: 4px solid var(--color-primary);
  padding: 1.5rem;
  border-radius: 0 0.25rem 0.25rem 0;
}

.about-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-secondary);
  margin-bottom: 0.75rem;
}

.about-box ul { display: flex; flex-direction: column; gap: 0.5rem; }

.about-box a {
  color: var(--slate-700);
  transition: color 0.15s;
}
.about-box a:hover { color: var(--color-primary); }

.about-box .muted { color: var(--slate-500); }

/* -------------------------------------------------------
   Contact Page
------------------------------------------------------- */
.contact-call-box {
  background: var(--color-secondary);
  color: #fff;
  padding: 2rem;
  border-radius: 0.375rem;
}

.contact-call-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.contact-call-box p {
  color: var(--slate-300);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.contact-info-box {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  padding: 2rem;
  border-radius: 0.375rem;
}

.contact-info-box h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-secondary);
  margin-bottom: 1rem;
}

.contact-info-box p {
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: 1.7;
}

.contact-info-box ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-info-box li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--slate-600);
  font-size: 0.95rem;
}

.check-icon {
  color: var(--color-primary);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.contact-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* -------------------------------------------------------
   Utility
------------------------------------------------------- */
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.text-primary { color: var(--color-primary); }
.text-white { color: #fff; }
.font-bold { font-weight: 700; }
