/*
Theme Name: Era Electrical
Theme URI: https://example.com/era-electrical
Author: Era Electrical
Description: A clean WordPress theme template for electrical contractors, Level 2 ASP, switchboard upgrades and meter upgrades.
Version: 1.1
License: GPLv2 or later
Text Domain: era-electrical
*/

:root {
  --era-green: #20c55a;
  --era-dark: #050505;
  --era-charcoal: #111111;
  --era-light: #f4f4f4;
  --era-text: #161616;
  --era-muted: #666666;
  --era-white: #ffffff;
  --era-accent: #20c55a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--era-text);
  background: var(--era-white);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { width: min(1160px, calc(100% - 32px)); margin: 0 auto; }
.site-header { background: var(--era-dark); color: var(--era-white); position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 18px rgba(0,0,0,.18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0; }
.logo { font-size: 24px; font-weight: 800; letter-spacing: .4px; }
.logo span { color: var(--era-green); }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; }
.nav a { opacity: .9; }
.nav a:hover { color: var(--era-accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 13px 22px; font-weight: 700; border: 0; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--era-green); color: white; box-shadow: 0 10px 24px rgba(32,197,90,.28); }
.btn-secondary { background: var(--era-accent); color: var(--era-dark); }
.btn-outline { border: 1px solid rgba(255,255,255,.35); color: white; }
.hero { background: radial-gradient(circle at 20% 0%, rgba(32,197,90,.32), transparent 28%), linear-gradient(135deg, #050505 0%, #111111 100%); color: white; padding: 88px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 44px; align-items: center; }
.eyebrow { color: var(--era-accent); font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; font-size: 13px; margin-bottom: 12px; }
h1 { font-size: clamp(38px, 6vw, 68px); line-height: .98; margin: 0 0 20px; letter-spacing: -2px; }
.hero p { font-size: 19px; color: #e7e7e7; margin: 0 0 28px; max-width: 680px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-card { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 28px; padding: 28px; backdrop-filter: blur(10px); }
.hero-card h3 { margin-top: 0; font-size: 22px; }
.check-list { padding: 0; margin: 0; list-style: none; }
.check-list li { margin: 12px 0; padding-left: 30px; position: relative; }
.check-list li:before { content: "✓"; position: absolute; left: 0; color: var(--era-accent); font-weight: 900; }
.section { padding: 72px 0; }
.section.alt { background: var(--era-light); }
.section-title { max-width: 740px; margin-bottom: 34px; }
.section-title h2 { font-size: clamp(30px, 4vw, 46px); margin: 0 0 12px; letter-spacing: -1px; color: var(--era-dark); }
.section-title p { color: var(--era-muted); margin: 0; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { background: white; border: 1px solid #dedede; border-radius: 22px; padding: 26px; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.card .icon { width: 48px; height: 48px; border-radius: 14px; background: rgba(32,197,90,.12); display:flex; align-items:center; justify-content:center; font-size: 24px; margin-bottom: 14px; }
.card h3 { margin: 0 0 10px; font-size: 22px; color: var(--era-dark); }
.card p { margin: 0 0 18px; color: var(--era-muted); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.feature-box { background: var(--era-dark); color: white; padding: 36px; border-radius: 28px; }
.feature-box h2 { margin-top: 0; font-size: 38px; line-height: 1.05; }
.feature-box p { color: #e7e7e7; }
.panel { background: white; border: 1px solid #dedede; border-radius: 28px; padding: 34px; }
.panel h3 { margin-top: 0; }
.service-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0; list-style: none; }
.service-list li { background: var(--era-light); border-radius: 14px; padding: 13px 14px; font-weight: 700; }
.cta { background: linear-gradient(135deg, var(--era-green), #0c8f3c); color: white; border-radius: 32px; padding: 46px; display: flex; justify-content: space-between; gap: 24px; align-items: center; }
.cta h2 { margin: 0 0 8px; font-size: 36px; line-height: 1.05; }
.cta p { margin: 0; color: #f2fff6; }
.contact-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 28px; }
.contact-card { background: var(--era-dark); color: white; border-radius: 28px; padding: 32px; }
.contact-card p { color: #e7e7e7; }
.form { background: white; border: 1px solid #dedede; border-radius: 28px; padding: 28px; }
.form label { display: block; font-weight: 700; margin: 12px 0 6px; }
.form input, .form textarea, .form select { width: 100%; border: 1px solid #cfcfcf; border-radius: 12px; padding: 13px; font: inherit; }
.form textarea { min-height: 130px; }
.site-footer { background: var(--era-dark); color: white; padding: 34px 0; }
.footer-inner { display:flex; justify-content:space-between; gap:20px; flex-wrap:wrap; color:#d7d7d7; }
.page-hero { background: var(--era-dark); color: white; padding: 72px 0; }
.page-hero h1 { font-size: clamp(36px, 5vw, 58px); }
.content { max-width: 860px; }
@media (max-width: 860px) {
  .nav { display:none; }
  .hero-grid, .split, .contact-wrap { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .service-list { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; }
}
/* -------------------------------------------------
   PAGE LAYOUT — REMOVE GAP BELOW HEADER
-------------------------------------------------- */

html,
body {
	margin: 0;
	padding: 0;
}

.site-header,
header.site-header {
	margin-bottom: 0 !important;
}

.site-content,
.content-area,
.site-main,
main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* Remove spacing from the page.php wrapper */
body.page .section.page-content,
body.page main > .section,
body.page .site-main > .section {
	margin-top: 0 !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Remove spacing before the first Gutenberg block */
body.page .entry-content {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.page .entry-content > :first-child,
body.page .wp-block-post-content > :first-child,
body.page .page-content > :first-child {
	margin-top: 0 !important;
}

/* Allow full-width Gutenberg sections to meet the header */
body.page .entry-content > .alignfull,
body.page .wp-block-post-content > .alignfull,
body.page .page-content > .alignfull {
	margin-top: 0;
}

/* Remove paragraph or block margins accidentally created above content */
body.page .entry-content::before,
body.page .page-content::before {
	display: none;
	content: none;
}

/* ===== ERA ELECTRICAL MOBILE FIX ===== */

@media screen and (max-width: 900px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
    }

    .site-header {
        width: 100%;
        max-width: 100%;
    }

    .header-inner {
        width: 100%;
        max-width: 100%;
        padding: 14px 0;
        gap: 12px;
        justify-content: space-between;
    }

    /* Hide desktop navigation on phones */
    .site-header .nav {
        display: none !important;
    }

    /* Hide desktop Call Now button */
    .site-header .btn-secondary {
        display: none !important;
    }

    .logo img {
        width: 52px;
        height: auto;
    }

    main,
    .site-main,
    .entry-content,
    .wp-block-post-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .alignfull {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .wp-block-columns {
        width: 100%;
        max-width: 100%;
    }

    .wp-block-column {
        min-width: 0;
    }

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

/* ===== ERA MOBILE HEADER CLEANUP ===== */

@media screen and (max-width: 900px) {

    /* Hide desktop navigation */
    .site-header .nav,
    .site-header nav {
        display: none !important;
    }

    /* Keep header compact */
    .site-header {
        min-height: 72px;
    }

    .header-inner {
        min-height: 72px;
        padding: 10px 0;
    }

    .logo img {
        width: 52px;
        height: auto;
    }

    /* Hide WordPress admin toolbar on mobile while logged in */
    #wpadminbar {
        display: none !important;
    }

    html {
        margin-top: 0 !important;
    }

    body.admin-bar {
        margin-top: 0 !important;
    }
}

/* =====================================================
   ERA ELECTRICAL – FINAL MOBILE HEADER FIX
   ===================================================== */

/* Desktop defaults */
.era-menu-toggle,
.era-mobile-menu {
    display: none;
}


/* MOBILE */
@media screen and (max-width: 900px) {

    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    body {
        position: relative;
    }

    /* Header */
    .site-header {
        width: 100% !important;
        max-width: 100% !important;
        position: relative;
        z-index: 9999;
    }

    .site-header .container,
    .header-inner {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .header-inner {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 20px !important;
        min-height: 76px;
        position: relative;
    }


    /* ERA logo */
    .site-header .logo {
        display: flex !important;
        flex-shrink: 0;
        position: relative;
        z-index: 2;
    }


    /* Completely hide desktop navigation */
    #eraDesktopNav,
    .site-header .nav,
    .site-header nav.nav {
        display: none !important;
        visibility: hidden !important;
    }


    /* Completely hide desktop Call Now button */
    .era-desktop-call,
    .site-header .btn-secondary {
        display: none !important;
        visibility: hidden !important;
    }


    /* Hamburger button */
    .era-menu-toggle {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;

        width: 48px;
        height: 48px;
        margin-left: auto;

        border: 1px solid rgba(255,255,255,.18);
        border-radius: 12px;
        background: #151a17;

        padding: 11px;
        cursor: pointer;

        position: relative;
        z-index: 10001;
    }

    .era-menu-toggle span {
        display: block;
        width: 24px;
        height: 3px;
        border-radius: 99px;
        background: #ffffff;
        transition: transform .25s ease,
                    opacity .25s ease;
    }


    /* Mobile dropdown menu */
    .era-mobile-menu {
        display: none !important;

        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;

        width: 100% !important;
        max-width: 100% !important;

        margin: 0 !important;
        padding: 18px 20px 24px !important;

        background: #0b100d !important;

        border-top: 1px solid rgba(107,203,68,.3);
        box-shadow: 0 18px 35px rgba(0,0,0,.35);

        box-sizing: border-box !important;
        z-index: 10000;
    }


    /* Show menu only after hamburger is pressed */
    body.era-menu-open .era-mobile-menu {
        display: flex !important;
        flex-direction: column;
        gap: 0;
    }


    /* Mobile menu links */
    .era-mobile-menu a {
        display: block !important;

        width: 100% !important;

        padding: 14px 6px;

        color: #ffffff !important;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.3;

        text-decoration: none !important;

        border-bottom: 1px solid rgba(255,255,255,.08);
    }

    .era-mobile-menu a:hover {
        color: #6bcb44 !important;
    }


    /* Mobile Call Now */
    .era-mobile-menu .era-mobile-call {
        width: 100% !important;

        margin-top: 16px;
        padding: 15px 20px;

        border: none;
        border-radius: 999px;

        background: #6bcb44 !important;
        color: #071008 !important;

        text-align: center;
        font-weight: 800;
    }


    /* Animate hamburger into X */
    body.era-menu-open .era-menu-toggle span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    body.era-menu-open .era-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.era-menu-open .era-menu-toggle span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }


    /* Prevent Gutenberg/page content creating horizontal scroll */
    main,
    article,
    .entry-content,
    .wp-block-post-content,
    .wp-site-blocks,
    .alignfull {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}