/*
Theme Name: EverGrid
Theme URI: https://www.evergridtech.com
Author: EverGrid Technology Inc.
Description: Block theme for the EverGrid Technology website: microinverters, micro hybrid and string hybrid systems, and AIDC & commercial storage. Includes Home, Company, Products and Support page layouts, product datasheets and a built-in contact form.
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
Version: 1.1.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: evergrid
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
:where(h1, h2, h3) { text-wrap: balance; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.wp-element-button:focus-visible { outline: 3px solid #E0604F; outline-offset: 2px; }
.has-white-color :is(h1, h2, h3, h4, h5, h6) { color: inherit; }
.eg-section { padding-top: clamp(56px, 8vw, 104px); padding-bottom: clamp(56px, 8vw, 104px); }
.eg-section-tight { padding-top: clamp(40px, 5vw, 64px); padding-bottom: clamp(40px, 5vw, 64px); }
main.wp-block-group { margin-top: 0; }
/* Full-width sections keep the site side gutter on every screen size. */
.wp-site-blocks .alignfull.has-global-padding { padding-left: var(--wp--style--root--padding-left); padding-right: var(--wp--style--root--padding-right); }
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }

/* ---------- Text helpers ---------- */
.eg-kicker { font-size: 13px !important; letter-spacing: 2.4px; font-weight: 700; text-transform: uppercase; color: var(--wp--preset--color--red); margin: 0; }
.eg-eyebrow { font-size: 13px !important; letter-spacing: 3px; font-weight: 700; text-transform: uppercase; color: #F2B8AE; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.eg-eyebrow .eg-rule { display: inline-block; width: 48px; height: 2px; background: var(--wp--preset--color--red); }
.eg-eyebrow .eg-soft { color: #C9D1DD; }
.eg-lead { font-size: 18px; line-height: 1.6; color: var(--wp--preset--color--gray); max-width: 68ch; }
.has-white-color .eg-lead, .eg-lead-light { color: #C9D1DD; }
.eg-body { font-size: 18px; line-height: 1.7; max-width: 68ch; }
.eg-note { font-size: 13px; color: var(--wp--preset--color--gray); }
.eg-stack > * { margin-block: 0; }
.eg-stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--navy); border: 1.5px solid var(--wp--preset--color--navy); padding: 13.5px 22.5px; }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--wp--preset--color--navy); color: #fff; }
.wp-block-button.is-style-eg-light .wp-block-button__link { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,0.7); padding: 13.5px 22.5px; }
.wp-block-button.is-style-eg-light .wp-block-button__link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.eg-btn-sm .wp-block-button__link { font-size: 14px; padding: 12px 18px; }
.eg-btn-sm .is-style-outline .wp-block-button__link { padding: 10.5px 16.5px; }

/* ---------- Header ---------- */
.eg-header { padding-left: var(--wp--style--root--padding-left); padding-right: var(--wp--style--root--padding-right); position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--wp--preset--color--line); min-height: 80px; gap: 32px; }
body.admin-bar .eg-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .eg-header { top: 46px; } }
.eg-logo { margin: 0; line-height: 1; }
.eg-logo a { text-decoration: none; display: inline-flex; flex-direction: column; gap: 3px; }
.eg-logo .eg-word { display: block; white-space: nowrap; line-height: 1; }
.eg-logo .eg-ever, .eg-logo .eg-grid { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 30px; letter-spacing: 0.5px; }
.eg-logo .eg-ever { color: var(--wp--preset--color--navy); }
.eg-logo .eg-grid { color: var(--wp--preset--color--red); }
.eg-logo .eg-sub { display: block; font-size: 10px; letter-spacing: 3px; font-weight: 700; color: var(--wp--preset--color--gray); }
.eg-nav { flex-grow: 1; justify-content: center; }
.eg-nav .wp-block-navigation-item__content { color: var(--wp--preset--color--ink); font-weight: 500; font-size: 16px; padding: 10px 0; border-bottom: 2px solid transparent; }
.eg-nav .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--red); }
.eg-nav .current-menu-item > .wp-block-navigation-item__content,
.eg-nav .wp-block-navigation-item__content[aria-current="page"] { color: var(--wp--preset--color--navy); font-weight: 700; border-bottom-color: var(--wp--preset--color--red); }
.eg-nav .wp-block-navigation__container { gap: 36px; }
@media (max-width: 900px) { .eg-header .wp-block-buttons.eg-header-cta { display: none; } }
@media (max-width: 600px) { .eg-header { min-height: 68px; } .eg-logo .eg-ever, .eg-logo .eg-grid { font-size: 24px; } }

/* ---------- Hero ---------- */
.eg-hero { padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 96px); }
.eg-hero h1 { color: #fff; margin: 0; }
.eg-hero .wp-block-columns { align-items: center; gap: 48px; margin: 0; }
.eg-collage { position: relative; height: 456px; max-width: 540px; margin-left: auto; }
.eg-collage figure { margin: 0; position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.eg-collage img { width: 80%; height: 80%; object-fit: contain; }
.eg-collage-back { left: 0; top: 0; width: 72%; height: 86%; background: var(--wp--preset--color--navy-2); }
.eg-collage-front { right: 0; bottom: 0; width: 46%; height: 55%; background: #fff; box-shadow: 0 16px 40px rgba(0,0,0,0.3); }
@media (max-width: 1000px) { .eg-collage { display: none; } }
.eg-page-hero { padding-top: clamp(56px, 7vw, 88px); padding-bottom: clamp(56px, 7vw, 88px); }
.eg-page-hero h1 { color: #fff; margin: 0; max-width: 1080px; }
.eg-tabs { margin-top: 12px; }

/* ---------- USA strip ---------- */
.eg-strip { padding-top: 32px; padding-bottom: 32px; }
.eg-strip-item { align-items: flex-start; gap: 16px; }
.eg-strip-item svg { flex-shrink: 0; }
.eg-strip-item p { margin: 0; }
.eg-strip-title { font-weight: 700; font-size: 17px; }
.eg-strip-text { font-size: 15px; color: #C9D1DD; line-height: 1.45; }

/* ---------- Company profile ---------- */
.eg-mission { border-radius: 8px; padding: clamp(28px, 4vw, 44px) !important; }
.eg-mission-text { font-family: var(--wp--preset--font-family--display); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; margin: 0; }
.eg-stats { border-top: 1px solid var(--wp--preset--color--line); border-bottom: 1px solid var(--wp--preset--color--line); gap: 0 !important; margin-top: 16px; }
.eg-stats > .wp-block-column { padding: 28px 24px; border-left: 1px solid var(--wp--preset--color--line); }
.eg-stats > .wp-block-column:first-child { border-left: 0; padding-left: 0; }
.eg-stat-n { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 40px; color: var(--wp--preset--color--navy); line-height: 1; margin: 0 0 6px; }
.eg-stat-l { font-size: 15px; color: var(--wp--preset--color--gray); line-height: 1.45; margin: 0; }
@media (max-width: 781px) { .eg-stats > .wp-block-column { border-left: 0; padding: 20px 0; border-top: 1px solid var(--wp--preset--color--line); } .eg-stats > .wp-block-column:first-child { border-top: 0; } }
.eg-facts { background: var(--wp--preset--color--mist); border-radius: 8px; padding: 36px !important; }
.eg-fact { border-bottom: 1px solid var(--wp--preset--color--line); padding-bottom: 16px; gap: 4px !important; }
.eg-fact:last-child { border-bottom: 0; padding-bottom: 0; }
.eg-fact-k { font-size: 13px; letter-spacing: 1.5px; font-weight: 700; color: var(--wp--preset--color--gray); margin: 0; }
.eg-fact-v { font-size: 19px; font-weight: 600; color: var(--wp--preset--color--navy); line-height: 1.4; margin: 0; }

/* ---------- Cards ---------- */
.eg-card { border: 1px solid var(--wp--preset--color--line); border-radius: 8px; background: #fff; overflow: hidden; }
.eg-card-pad { padding: clamp(24px, 3vw, 40px) !important; }
.eg-founder { gap: 18px !important; }
.eg-founder-head { gap: 20px !important; align-items: center; }
.eg-founder-photo { margin: 0; flex-shrink: 0; }
.eg-founder-photo img { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; object-position: center 30%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--wp--preset--color--line); }
.eg-founder-role { font-size: 14px; letter-spacing: 1.5px; font-weight: 700; color: var(--wp--preset--color--red); margin: 0; }
.eg-founder h3 { margin: 0; font-size: 26px; }
.eg-founder-bio { font-size: 16px; line-height: 1.65; color: var(--wp--preset--color--gray); margin: 0; }

.eg-famcard { gap: 0 !important; }
.eg-famcard-photo { margin: 0; height: 240px; background: var(--wp--preset--color--mist); display: flex; align-items: center; justify-content: center; }
.eg-famcard-photo img { height: 78%; width: auto; max-width: 85%; object-fit: contain; }
.eg-famcard-body { padding: 24px !important; gap: 10px !important; }
.eg-famcard-body > * { margin: 0; }
.eg-famcard h3 { font-size: 24px; margin: 0; }
.eg-famcard h3 a { color: inherit; text-decoration: none; }
.eg-famcard h3 a:hover { color: var(--wp--preset--color--red); }
.eg-famcard .eg-models { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--navy); }
.eg-card-text { font-size: 16px; line-height: 1.55; color: var(--wp--preset--color--gray); }

.eg-cta { border-radius: 8px; padding: clamp(32px, 4vw, 56px) clamp(24px, 4.5vw, 64px) !important; }
.eg-cta h2 { font-size: clamp(26px, 3vw, 34px); margin: 0; }
.eg-cta .wp-block-columns { align-items: center; margin: 0; }
.eg-cta-light { border: 1px solid var(--wp--preset--color--line); }

/* Company page */
.eg-usa-item { border-top: 2px solid var(--wp--preset--color--red); padding-top: 28px; gap: 14px !important; }
.eg-usa-item h3 { color: #fff; margin: 0; }
.eg-usa-item p { margin: 0; font-size: 16px; line-height: 1.65; color: #C9D1DD; }
.eg-eng > * { margin: 0; }
.eg-eng { gap: 10px !important; }
.eg-eng-n { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 36px; color: var(--wp--preset--color--navy); line-height: 1; }
.eg-eng h3 { font-family: var(--wp--preset--font-family--body); font-size: 18px; color: var(--wp--preset--color--ink); }
.eg-eng p:last-child { font-size: 15px; line-height: 1.6; color: var(--wp--preset--color--gray); }
.eg-timeline { border-top: 2px solid var(--wp--preset--color--line); }
.eg-year { padding-top: 24px; gap: 10px !important; }
.eg-year > * { margin: 0; }
.eg-year-n { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 28px; color: var(--wp--preset--color--red); }
.eg-year-t { font-size: 16px; line-height: 1.5; font-weight: 500; }
.eg-loc { border: 1px solid var(--wp--preset--color--line); border-radius: 8px; padding: 32px !important; gap: 8px !important; }
.eg-loc > * { margin: 0; }
.eg-loc-k { font-size: 13px; letter-spacing: 1.5px; font-weight: 700; color: var(--wp--preset--color--red); }
.eg-loc-v { font-size: 22px; font-weight: 700; color: var(--wp--preset--color--navy); }
.eg-loc-d { font-size: 16px; line-height: 1.6; color: var(--wp--preset--color--gray); }
.eg-loc.has-navy-background-color { border-color: var(--wp--preset--color--navy); }
.eg-loc.has-navy-background-color .eg-loc-k { color: #F2B8AE; }
.eg-loc.has-navy-background-color .eg-loc-v { color: #fff; }
.eg-loc.has-navy-background-color .eg-loc-d { color: #C9D1DD; }

/* ---------- Products ---------- */
.eg-family { scroll-margin-top: 100px; }
.eg-family-head { border-bottom: 2px solid var(--wp--preset--color--red); padding-bottom: 20px; margin-bottom: 8px; align-items: flex-end !important; }
.eg-family-head h2 { margin: 0; }
.eg-product { gap: 0 !important; align-items: stretch !important; }
.eg-product-photo { margin: 0; width: 240px; flex-shrink: 0; background: var(--wp--preset--color--mist); display: flex; align-items: center; justify-content: center; }
.eg-product-photo img { width: 80%; max-height: 220px; object-fit: contain; }
.eg-product-wide .eg-product-photo { width: 320px; }
.eg-product-body { padding: 28px !important; gap: 12px !important; flex: 1 1 0; min-width: 0; }
.eg-product-body > * { margin: 0; }
.eg-product-kicker { font-size: 12px; letter-spacing: 2px; font-weight: 700; color: var(--wp--preset--color--red); text-transform: uppercase; }
.eg-product h3 { font-size: 26px; line-height: 1.15; }
.eg-specs { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; }
.eg-spec { background: var(--wp--preset--color--mist); border-radius: 4px; padding: 10px 12px !important; gap: 2px !important; }
.eg-spec > * { margin: 0; }
.eg-spec-v { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 17px; color: var(--wp--preset--color--navy); line-height: 1.25; }
.eg-spec-l { font-size: 12px; color: var(--wp--preset--color--gray); line-height: 1.3; }
.eg-product .wp-block-buttons { margin-top: auto; padding-top: 8px; }
@media (max-width: 640px) {
	.eg-product { flex-direction: column; }
	.eg-product-photo, .eg-product-wide .eg-product-photo { width: auto; height: 220px; }
	.eg-product-body { padding: 20px !important; }
}
.eg-subhead { align-items: center; gap: 16px !important; margin-top: 12px; }
.eg-subhead h3 { margin: 0; font-size: 22px; }
.eg-acc { gap: 0 !important; }
.eg-acc > .eg-acc-photo, .eg-acc > .eg-acc-body { align-self: stretch; width: auto; }
.eg-acc-photo { margin: 0; height: 120px; background: var(--wp--preset--color--mist); display: flex; align-items: center; justify-content: center; }
.eg-acc-photo img { width: auto; height: auto; max-height: 80%; max-width: 70%; object-fit: contain; mix-blend-mode: multiply; }
.eg-acc-body { padding: 12px 14px !important; gap: 2px !important; }
.eg-acc-body > * { margin: 0; }
.eg-acc-name { font-weight: 700; color: var(--wp--preset--color--navy); font-size: 15px; }
.eg-acc-desc { font-size: 13px; color: var(--wp--preset--color--gray); line-height: 1.4; }

/* ---------- Support ---------- */
.eg-res { padding: 28px !important; gap: 10px !important; }
.eg-res > * { margin: 0; }
.eg-res h3 { font-size: 21px; }
.eg-res p { font-size: 15px; line-height: 1.55; color: var(--wp--preset--color--gray); }
.eg-res .eg-res-link { font-size: 14px; font-weight: 600; margin-top: auto; }
.eg-contact-box { background: var(--wp--preset--color--mist); border-radius: 8px; padding: 32px !important; gap: 22px !important; }
.eg-contact-box > * { margin: 0; }
.eg-contact-k { font-size: 13px; letter-spacing: 1.5px; font-weight: 700; color: var(--wp--preset--color--gray); margin: 0 0 4px; }
.eg-contact-v { font-size: 17px; line-height: 1.6; margin: 0; }
.eg-dist { border-radius: 8px; padding: 32px !important; gap: 12px !important; }
.eg-dist > * { margin: 0; }
.eg-dist h3 { color: #fff; }
.eg-dist p { color: #C9D1DD; font-size: 16px; line-height: 1.6; }

/* Contact form (theme shortcode) */
.eg-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.eg-form .eg-field { display: flex; flex-direction: column; gap: 8px; }
.eg-form .eg-field-full { grid-column: 1 / -1; }
.eg-form label { font-size: 14px; font-weight: 600; color: var(--wp--preset--color--ink); }
.eg-form input, .eg-form select, .eg-form textarea { font: inherit; font-size: 16px; color: var(--wp--preset--color--ink); background: #fff; border: 1px solid #B9C1CD; border-radius: 4px; padding: 12px 14px; min-height: 48px; width: 100%; box-sizing: border-box; }
.eg-form textarea { min-height: 140px; resize: vertical; }
.eg-form .eg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.eg-form button { font: inherit; font-size: 15px; font-weight: 600; background: var(--wp--preset--color--red); color: #fff; border: 0; border-radius: 4px; padding: 15px 28px; cursor: pointer; }
.eg-form button:hover { background: #A33024; }
.eg-form-msg { grid-column: 1 / -1; margin: 0; padding: 14px 16px; border-radius: 4px; font-size: 15px; }
.eg-form-msg.is-ok { background: #E7F3EC; color: #1E5B37; }
.eg-form-msg.is-err { background: #FBE9E7; color: #8A2A1F; }
@media (max-width: 640px) { .eg-form { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.eg-footer { padding-top: 64px; padding-bottom: 32px; }
.eg-footer a { color: #C9D1DD; text-decoration: none; }
.eg-footer a:hover { color: #fff; }
.eg-footer .wp-block-columns { gap: 40px; }
.eg-footer p { margin: 0; font-size: 15px; line-height: 1.6; }
.eg-footer .eg-fhead { font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: #fff; font-weight: 700; margin-bottom: 6px; }
.eg-footer .eg-fcol { gap: 10px !important; }
.eg-footer .eg-logo .eg-ever { color: #fff; }
.eg-footer .eg-logo .eg-grid { color: #E0604F; }
.eg-footer-bottom { border-top: 1px solid #25385A; padding-top: 24px; margin-top: 48px; font-size: 14px; flex-wrap: wrap; gap: 12px 24px; }
.eg-footer-bottom p { font-size: 14px; }

/* ---------- Privacy policy ---------- */
.eg-pp-date { font-size: 15px; font-weight: 600; color: #F2B8AE; margin: 0; }
.eg-pp { gap: 72px; }
.eg-pp-toc { position: sticky; top: 110px; border-left: 2px solid var(--wp--preset--color--line); padding-left: 20px; gap: 2px !important; }
body.admin-bar .eg-pp-toc { top: 142px; }
.eg-pp-toc > * { margin: 0; }
.eg-pp-toc p { font-size: 15px; line-height: 1.45; padding: 5px 0; }
.eg-pp-toc a { color: var(--wp--preset--color--ink); text-decoration: none; }
.eg-pp-toc a:hover { color: var(--wp--preset--color--red); }
.eg-pp-toc .eg-pp-toc-title { font-size: 13px; letter-spacing: 2px; font-weight: 700; color: var(--wp--preset--color--gray); padding-bottom: 10px; }
.eg-pp-intro { font-size: 19px; line-height: 1.7; max-width: 760px; }
.eg-pp-section { border-top: 1px solid var(--wp--preset--color--line); padding-top: 36px; margin-top: 36px; max-width: 760px; }
.eg-pp-section > * { margin-top: 0; margin-bottom: 14px; }
.eg-pp-section h2 { font-size: 28px; line-height: 1.2; scroll-margin-top: 110px; }
.eg-pp-section h3 { font-family: var(--wp--preset--font-family--body); font-size: 17px; color: var(--wp--preset--color--ink); margin-top: 10px; }
.eg-pp-section p, .eg-pp-section li { font-size: 16px; line-height: 1.7; }
.eg-pp-section ul { padding-left: 22px; }
.eg-pp-section li + li { margin-top: 8px; }
.eg-pp-section strong { color: var(--wp--preset--color--navy); }
@media (max-width: 781px) { .eg-pp-toc { position: static; } .eg-pp { gap: 32px; } }
