/* ============================================================
   Granite Electric and Repair Services — Main Stylesheet
   Palette: white + blue | Accents: red + black
   Dark/Light mode via CSS custom properties + data-theme
   Wire-branding: TTHN-inspired section dividers & card accents
   ============================================================ */

/* --- CSS Custom Properties (Light mode default) --- */
:root {
    --color-white: #ffffff;
    --color-blue-900: #0a1f3d;
    --color-blue-800: #0f2b52;
    --color-blue-700: #143d73;
    --color-blue-600: #1a4f94;
    --color-blue-500: #2563b5;
    --color-blue-400: #3b82d0;
    --color-blue-100: #dbeafe;
    --color-blue-50:  #eff6ff;
    --color-red-600:  #dc2626;
    --color-red-500:  #e53935;
    --color-red-100:  #ffe0e0;
    --color-black:    #111111;
    --color-gray-900: #1a1a1a;
    --color-gray-700: #333333;
    --color-gray-600: #555555;
    --color-gray-500: #777777;
    --color-gray-300: #cccccc;
    --color-gray-200: #e0e0e0;
    --color-gray-100: #f0f0f0;
    --color-gray-50:  #f8f8f8;

    --bg-body: var(--color-white);
    --bg-section: var(--color-gray-50);
    --bg-header: var(--color-blue-900);
    --bg-hero: var(--color-blue-800);
    --bg-card: var(--color-white);
    --bg-footer: var(--color-blue-900);
    --bg-form: var(--color-white);
    --bg-toggle: var(--color-gray-200);
    --bg-input: var(--color-white);

    --text-body: var(--color-gray-700);
    --text-heading: var(--color-blue-900);
    --text-light: var(--color-white);
    --text-muted: var(--color-gray-500);
    --text-input: var(--color-gray-700);

    --border-color: var(--color-gray-300);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-form: 0 4px 20px rgba(0,0,0,0.10);

    --padding-section: 60px;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
    --bg-body: #121212;
    --bg-section: #1a1a1a;
    --bg-header: #0a0a1a;
    --bg-hero: #0d1b2a;
    --bg-card: #1e1e1e;
    --bg-footer: #0a0a1a;
    --bg-form: #1e1e1e;
    --bg-toggle: #333333;
    --bg-input: #2a2a2a;

    --text-body: #dddddd;
    --text-heading: #eeeeee;
    --text-light: #ffffff;
    --text-muted: #999999;
    --text-input: #dddddd;

    --border-color: #444444;
    --shadow-card: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-form: 0 4px 20px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-body);
    transition: background-color 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: var(--color-blue-600);
}
a:hover { text-decoration: underline; }

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-description {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

h2 {
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 10px;
    text-align: center;
}

/* --- Buttons --- */
.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    text-align: center;
    transition: background-color 0.25s, color 0.25s, transform 0.2s, box-shadow 0.25s;
}
.button:hover { transform: translateY(-2px); text-decoration: none; }

.primary-btn {
    background-color: var(--color-blue-600);
    color: var(--color-white);
    border-color: var(--color-blue-600);
}
.primary-btn:hover {
    background-color: var(--color-blue-500);
    box-shadow: 0 4px 12px rgba(37, 99, 181, 0.35);
}

.secondary-btn {
    background-color: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}
.secondary-btn:hover {
    background-color: var(--color-white);
    color: var(--color-blue-800);
}

.large-btn {
    padding: 16px 34px;
    font-size: 1.05rem;
}

/* --- Themed Button Variants --- */
[data-theme="dark"] .secondary-btn {
    border-color: var(--color-gray-300);
    color: var(--color-gray-100);
}
[data-theme="dark"] .secondary-btn:hover {
    background-color: var(--color-gray-100);
    color: var(--color-blue-900);
}

/* ============================================================
   TTHN WIRE-BRANDING SYSTEM
   ============================================================ */

/* --- Wire Dividers (full-width section separators) --- */
.wire-divider {
    position: relative;
    height: 8px;
    width: 100%;
    overflow: hidden;
}
.wire-divider .wire-tip {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(90deg, transparent, #b87333 50%, #d4a373);
    border-radius: 0 2px 2px 0;
}

/* 14 gauge — white jacket */
.wire-14 {
    background: repeating-linear-gradient(
        90deg,
        #e0e0e0 0px, #f5f5f5 4px, #e0e0e0 8px
    );
}

/* 12 gauge — black jacket */
.wire-12 {
    background: repeating-linear-gradient(
        90deg,
        #333 0px, #444 4px, #333 8px
    );
}

/* 10 gauge — red jacket */
.wire-10 {
    background: repeating-linear-gradient(
        90deg,
        #b91c1c 0px, #dc2626 4px, #b91c1c 8px
    );
}

[data-theme="dark"] .wire-14 {
    background: repeating-linear-gradient(
        90deg,
        #888 0px, #aaa 4px, #888 8px
    );
}

/* --- Wire Card Accents (left border) --- */
.wire-accent-14 {
    border-left: 5px solid #cccccc;
    position: relative;
}
.wire-accent-14::after {
    content: '';
    position: absolute;
    left: -1px;
    bottom: 0;
    width: 7px;
    height: 12px;
    background: linear-gradient(180deg, #b87333, #d4a373);
    border-radius: 0 2px 2px 0;
}

.wire-accent-12 {
    border-left: 5px solid #333333;
    position: relative;
}
.wire-accent-12::after {
    content: '';
    position: absolute;
    left: -1px;
    bottom: 0;
    width: 7px;
    height: 12px;
    background: linear-gradient(180deg, #b87333, #d4a373);
    border-radius: 0 2px 2px 0;
}

.wire-accent-10 {
    border-left: 5px solid #dc2626;
    position: relative;
}
.wire-accent-10::after {
    content: '';
    position: absolute;
    left: -1px;
    bottom: 0;
    width: 7px;
    height: 12px;
    background: linear-gradient(180deg, #b87333, #d4a373);
    border-radius: 0 2px 2px 0;
}

/* ============================================================
   1. HEADER
   ============================================================ */
.header {
    background-color: var(--bg-header);
    color: var(--color-white);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Logo link (yellow bulb) */
.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s, filter 0.3s;
}
.logo-link:hover, .logo-link:focus {
    transform: scale(1.08) translateY(-2px);
    filter: brightness(1.2);
    outline: none;
}
.logo-link:focus-visible {
    outline: 2px solid var(--color-blue-400);
    outline-offset: 4px;
    border-radius: 4px;
}
.logo-bulb {
    height: 44px;
    width: auto;
    display: block;
}

/* Text logo */
.logo { display: flex; align-items: center; }
.logo-text-link {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    color: var(--color-white);
}
.logo-text-link:hover { text-decoration: none; }
.logo-line1 {
    font-size: 1.5rem;
    font-weight: 700;
}
.logo-line2 {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.85;
}

/* Navigation */
.header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}
.header nav a {
    color: var(--color-white);
    font-weight: 600;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}
.header nav a:hover {
    color: var(--color-blue-400);
    border-bottom-color: var(--color-blue-400);
    text-decoration: none;
}

.header nav a.active {
    color: var(--color-blue-400);
    border-bottom-color: var(--color-blue-400);
}

/* Header actions area */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Phone CTA in header */
.phone-cta {
    padding: 8px 18px;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* --- Theme Toggle --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--color-gray-300);
    background: var(--bg-toggle);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 0.3s, border-color 0.3s, transform 0.2s;
    color: var(--color-gray-700);
    flex-shrink: 0;
}
.theme-toggle:hover { transform: scale(1.1); }

.theme-toggle .theme-icon-dark { display: none; }

[data-theme="dark"] .theme-toggle .theme-icon-light { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-dark { display: inline; }

.theme-toggle:focus-visible {
    outline: 2px solid var(--color-blue-400);
    outline-offset: 3px;
}

/* ============================================================
   2. HERO SECTION
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--bg-hero) 0%, #0d1b2a 100%);
    color: var(--color-white);
    text-align: center;
    padding: 80px 0;
    min-height: 420px;
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.business-name {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 0;
    line-height: 1.1;
}

.page-title {
    max-width: 950px;
    margin-right: auto;
    margin-left: auto;
    font-size: 3rem;
}

.hero-sub {
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--color-blue-400);
    margin-bottom: 15px;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 10px;
    color: var(--color-gray-100);
    line-height: 1.5;
}

.eyebrow {
    color: var(--color-blue-400);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.hero-credentials {
    font-size: 1rem;
    color: var(--color-blue-400);
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Red bulb in hero CTA */
.cta-service { display: inline-flex; align-items: center; gap: 10px; }
.cta-bulb {
    height: 26px; width: auto;
    display: inline-block;
    transition: transform 0.3s, filter 0.3s;
}
.cta-service:hover .cta-bulb,
.cta-service:focus .cta-bulb {
    transform: scale(1.15);
    filter: brightness(1.3) drop-shadow(0 0 6px rgba(220, 38, 38, 0.6));
}

/* ============================================================
   3. TRUST/EXPERIENCE STRIP
   ============================================================ */
.trust-strip {
    background-color: var(--bg-section);
    padding: 20px 0;
    display: flex;
    justify-content: space-around;
    text-align: center;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}
.trust-item {
    flex: 1;
    min-width: 130px;
    padding: 8px 5px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-heading);
}

/* ============================================================
   4. SERVICES SECTION
   ============================================================ */
.services {
    padding: var(--padding-section) 0;
    background-color: var(--bg-body);
    transition: background-color 0.3s;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.service-card {
    background-color: var(--bg-card);
    padding: 24px;
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 3px solid var(--color-blue-600);
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.service-card h3 {
    color: var(--text-heading);
    margin-bottom: 10px;
    font-size: 1.25rem;
}
.service-card p {
    color: var(--text-body);
    font-size: 0.95rem;
}

.service-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.service-card-link:hover,
.service-card-link:focus {
    text-decoration: none;
}

.service-note {
    max-width: 850px;
    margin: 30px auto 0;
    color: var(--text-body);
    font-size: 1.05rem;
    text-align: center;
}

.cta-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.plan-grid,
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.plan-card,
.why-item {
    background-color: var(--bg-card);
    border-top: 3px solid var(--color-blue-600);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    padding: 24px;
}

.plan-card h3 {
    color: var(--text-heading);
    font-size: 1.35rem;
    margin-bottom: 10px;
}

.plan-card p,
.why-item {
    color: var(--text-body);
}

.why-item {
    font-weight: 700;
}

.motto-block {
    max-width: 760px;
    margin: 40px auto 0;
    padding: 28px;
    text-align: center;
    background: linear-gradient(135deg, var(--color-blue-900), var(--color-blue-700));
    border-radius: 8px;
    box-shadow: var(--shadow-card);
}

.motto {
    color: var(--color-white);
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
}

.about-hero .hero-content {
    max-width: 920px;
}

.about-page-section .about-content p {
    margin-bottom: 18px;
}

.about-wide {
    max-width: 920px;
}

.motto-section {
    background-color: var(--bg-body);
}

.about-motto-block p {
    color: var(--color-gray-100);
    font-size: 1.08rem;
    margin-top: 14px;
}

.about-card-grid,
.credential-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.credential-card {
    background-color: var(--bg-card);
    border-top: 3px solid var(--color-blue-600);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    color: var(--text-heading);
    font-weight: 800;
    padding: 24px;
    text-align: center;
}

.final-cta {
    text-align: center;
}

.final-motto {
    color: var(--text-heading);
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 30px;
}

.text-left {
    text-align: left;
}

.request-followup-ctas {
    margin-top: 40px;
}

.service-area-btn {
    border-color: var(--color-blue-600);
    color: var(--color-blue-600);
}

.service-area-btn:hover {
    background-color: var(--color-blue-600);
    color: var(--color-white);
}

/* Emergency card special style */
.emergency-card {
    border-top-color: var(--color-red-500);
    background-color: var(--color-red-100);
}
[data-theme="dark"] .emergency-card {
    background-color: #2a1010;
    border-top-color: var(--color-red-500);
}

/* ============================================================
   5. ABOUT SECTION
   ============================================================ */
.about {
    padding: var(--padding-section) 0;
    background-color: var(--bg-section);
    transition: background-color 0.3s;
}
.about-content { max-width: 800px; margin: 0 auto; }
.about-content p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-body);
}

/* ============================================================
   6. REQUEST SERVICE / CHECK YOUR AREA (combined form)
   ============================================================ */
.request-area {
    padding: var(--padding-section) 0;
    background-color: var(--bg-body);
    transition: background-color 0.3s;
}

.section-heading-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    text-align: center;
}

.heading-icon-wrap {
    display: inline-flex;
    align-items: center;
}
.heading-bulb {
    height: 32px;
    width: auto;
    display: block;
}

/* Form */
.contact-form {
    max-width: 720px;
    margin: 0 auto;
    padding: 30px;
    background-color: var(--bg-form);
    border-radius: 8px;
    box-shadow: var(--shadow-form);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    background-color: var(--bg-input);
    color: var(--text-input);
    transition: border-color 0.2s, background-color 0.3s, color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-blue-500);
    box-shadow: 0 0 0 3px rgba(37, 99, 181, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-submit {
    width: 100%;
    margin-top: 10px;
    justify-content: center;
}

/* ============================================================
   6b. SERVICE AREA SECTION
   ============================================================ */
.service-area {
    padding: var(--padding-section) 0;
    background-color: var(--bg-section);
    transition: background-color 0.3s;
}

.area-layout {
    display: grid;
    grid-template-columns: minmax(320px, 560px) minmax(280px, 1fr);
    gap: 40px;
    align-items: start;
    margin-top: 30px;
}

.area-map {
    width: 100%;
    max-width: 560px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    background-color: var(--bg-card);
    overflow: hidden;
}

.area-map svg,
.service-map-image {
    width: 100%;
    height: auto;
}

.service-map-image {
    display: block;
}

.area-map figcaption {
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
    text-align: center;
}

.area-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0;
}

.area-region {
    background-color: var(--bg-card);
    border-left: 5px solid var(--color-blue-600);
    border-radius: 6px;
    box-shadow: var(--shadow-card);
    margin-bottom: 0;
    padding: 22px;
}

.area-region h3 {
    color: var(--text-heading);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.area-region p {
    color: var(--text-body);
    font-size: 1rem;
    line-height: 1.6;
}

/* ============================================================
   7. FOOTER
   ============================================================ */
.footer {
    background-color: var(--bg-footer);
    color: var(--color-gray-300);
    padding: 40px 0 20px;
    border-top: 4px solid var(--color-blue-600);
    transition: background-color 0.3s;
}

.footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.footer-info .business-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 8px;
}

.footer-info .phone-number { font-size: 1.1rem; }
.footer-info .phone-number a { color: var(--color-blue-400); }
.footer-info .phone-number a:hover { color: var(--color-blue-300); }

.footer-credentials,
.footer-hours,
.footer-area {
    color: var(--color-gray-400);
    font-size: 0.95rem;
}

.facebook-link {
    align-items: center;
    color: var(--color-blue-400);
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 700;
    gap: 8px;
    margin-top: 4px;
}

.facebook-link:hover {
    color: var(--color-white);
}

.facebook-link:focus-visible {
    outline: 2px solid var(--color-blue-400);
    outline-offset: 4px;
}

.facebook-link img {
    width: 24px;
    height: 24px;
    background-color: var(--color-blue-400);
    border-radius: 50%;
    padding: 4px;
    filter: brightness(0) invert(1);
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.6;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    text-align: center;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

/* Tablet+ */
@media (min-width: 768px) {
    .phone-cta { display: inline-flex; }
    .business-name { font-size: 4.5rem; }
    .page-title { font-size: 3.4rem; }
    .hero-sub { font-size: 1.8rem; }
    .tagline { font-size: 1.3rem; }

    .cta-buttons { flex-wrap: nowrap; gap: 25px; }
    .request-followup-ctas { flex-wrap: wrap; }
    .trust-strip { flex-wrap: nowrap; }

    .footer .container {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .footer-info { text-align: left; max-width: 65%; }
    .copyright { text-align: right; width: auto; padding-top: 0; border-top: none; }
}

/* Mobile */
@media (max-width: 767px) {
    .header .container {
        flex-direction: column;
        padding: 10px 15px;
        gap: 8px;
    }
    .logo-bulb { height: 36px; }
    .logo-line1 { font-size: 1.3rem; }
    .logo-line2 { font-size: 0.75rem; }
    .header nav ul { gap: 15px; flex-wrap: wrap; justify-content: center; }
    .header nav a { font-size: 0.9rem; }
    .header-actions { width: 100%; justify-content: center; }
    .phone-cta { font-size: 0.8rem; padding: 7px 14px; }

    .business-name { font-size: 2.5rem; }
    .page-title { font-size: 2.3rem; }
    .hero-sub { font-size: 1.2rem; }
    .tagline { font-size: 1rem; }
    .hero-credentials { font-size: 0.9rem; }

    .trust-strip { flex-direction: column; gap: 6px; }
    .trust-item { min-width: auto; padding: 6px 0; }

    h2 { font-size: 1.6rem; }

    .form-row { flex-direction: column; gap: 0; }

    .area-layout { grid-template-columns: 1fr; gap: 28px; }
    .area-map { max-width: 560px; margin: 0 auto; }
    .area-list { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

    .footer .container { flex-direction: column; align-items: center; }
    .footer-info { text-align: center; }
}

/* Small mobile */
@media (max-width: 480px) {
    .business-name { font-size: 2rem; }
    .page-title { font-size: 1.8rem; }
    .hero-sub { font-size: 1rem; }
    .large-btn { padding: 14px 20px; font-size: 0.95rem; }
    .cta-bulb { height: 22px; }
    .heading-bulb { height: 26px; }
    .section-heading-flex { font-size: 1.3rem; }
}
